
* Drop Conan 1.x from docs Signed-off-by: Uilian Ries <uilianries@gmail.com> * Revert .c3i folder deletion Signed-off-by: Uilian Ries <uilianries@gmail.com> * Add info about CLA Signed-off-by: Uilian Ries <uilianries@gmail.com> * Restore community resources Signed-off-by: Uilian Ries <uilianries@gmail.com> * Fix markdown reference leftover Signed-off-by: Uilian Ries <uilianries@gmail.com> * Fix first time contribution title Signed-off-by: Uilian Ries <uilianries@gmail.com> * Fix 3 steps Signed-off-by: Uilian Ries <uilianries@gmail.com> * how to write a good recipe Signed-off-by: Uilian Ries <uilianries@gmail.com> * Linter and hooks displayed in Checks Signed-off-by: Uilian Ries <uilianries@gmail.com> * Re-add build() and package() Signed-off-by: Uilian Ries <uilianries@gmail.com> * May accept build scripts based on effort Signed-off-by: Uilian Ries <uilianries@gmail.com> * Clarify patch on source folder Signed-off-by: Uilian Ries <uilianries@gmail.com> * Rephrase adding old versions Signed-off-by: Uilian Ries <uilianries@gmail.com> * Only required patch fields should be included Signed-off-by: Uilian Ries <uilianries@gmail.com> * Remove community tools Signed-off-by: Uilian Ries <uilianries@gmail.com> * Restore supported platforms Signed-off-by: Uilian Ries <uilianries@gmail.com> * How to consume a graph of shared libraries Signed-off-by: Uilian Ries <uilianries@gmail.com> * Fix typo in build_and_package.md Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Fix typo in build_and_package.md Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Grammar fix in conanfile_attributes.md Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Grammar fix in conanfile_attributes.md Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Point correct link to version ranges Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> * Add note about waiting fresh bump version Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es> --------- Signed-off-by: Uilian Ries <uilianries@gmail.com> Co-authored-by: Abril Rincón Blanco <git@rinconblanco.es>
5.9 KiB
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 tutorial. To deepen you understanding, start with the How to write a good recipe section. You can follow the three steps (1️⃣ 2️⃣ 3️⃣) described below! 🎉
Contents
1️⃣ First time contributors
When submitting a pull request for the first time, you will be prompted to sign the CLA for your code contributions. You can view your signed CLA's by going to https://cla-assistant.io/ and signing in.
2️⃣ Creating a package
Once you've successfully built an existing recipe following developing recipes tutorial. You are set to being adding a new package.
Make sure you have:
- Forked and then cloned the conan-center-index git repository.
- Make sure you are using a recent Conan client 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/
folder to the recipes/
folder.
Rename the new folder following the project name guidelines. Read templates documentation
to find more information.
Quickly, there's a few items to look at:
- Add only the latest version in the
config.yml
andconandata.yml
- Make sure to update the
ConanFile
attributes likelicense
,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 as well as match the default value used by the upstream project.
- Package information, libraries, components should match as well. This includes exposing supported build system names.
How to write a good recipe
Take a look at existing 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 are a great place to find short answers. The documents in this folder are written to explain each folder, file, method, and attribute.
The one place you are certain to find a lot of information is https://docs.conan.io, 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!
3️⃣ Submitting a Package
To contribute a package, you can submit a Pull Request to this GitHub repository https://github.com/conan-io/conan-center-index.
The specific steps to submitting changes are:
- Build and test the new recipe in several combinations. Check developing recipes for tips.
- Commit and push to your fork repository then submit a pull request.
When the pull request is reviewed and merged, those packages are published to JFrog's ConanCenter 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 for a list of generated configurations. For a C++ library, the system is currently generating more than 30 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 for more. Before submitting a pull request, please ensure that it works locally for some configurations.
- The CI system will report the build logs in the Checks tab, in the pull-request.
- Linter and Hooks are automatically displayed in the Checks tab as well.