Skip to content

Commit 12bcb31

Browse files
authored
Merge pull request #1627 from BastianZim/add-extra-license
Add automated dependency license file generating
2 parents d1215c1 + 2f25f88 commit 12bcb31

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/maintainer/adding_pkgs.rst

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,58 @@ for the specification on expressions.
702702
MIT AND BSD-2-Clause
703703
PSF-2.0
704704
705+
.. _third_party_package_licenses:
706+
707+
Licenses of included dependencies
708+
.................................
709+
710+
For some languages (Go, rust, etc.), the current policy is to include all dependencies and their dependencies in the package.
711+
This presents a problem when packaging the license files as each dependency needs to have its license file included in the recipe.
712+
713+
For some languages, the community provides tools which can automate this process, enabling the automatic inclusion of all needed license files.
714+
715+
* **Rust**
716+
717+
`cargo-bundle-licenses <https://github.com/sstadick/cargo-bundle-licenses>`__ can be included in the build process of a package and will automatically collect and add the license files of all dependencies of a package.
718+
719+
For a detailed description, please visit the project page but a short example can be found below.
720+
721+
First, include the collection of licenses as a step of the build process.
722+
723+
.. code-block:: yaml
724+
725+
build:
726+
number: 0
727+
script:
728+
- cargo-bundle-licenses --format yaml --output THIRDPARTY.yml
729+
- build_command_goes_here
730+
731+
Then, include the tool as a build time dependency.
732+
733+
.. code-block:: yaml
734+
735+
requirements:
736+
build:
737+
- cargo-bundle-licenses
738+
739+
Finally, make sure that the generated file is included in the recipe.
740+
741+
.. code-block:: yaml
742+
743+
about:
744+
license_file:
745+
- THIRDPARTY.yml
746+
- package_license.txt
747+
748+
.. important::
749+
750+
We are not lawyers and cannot guarantee that the above advice is correct or that the tools are able to find all license files.
751+
Additionally, we are unable to accept any responsibility or liability.
752+
It is always your responsibility to double-check that all licenses are included and verify that any generated output is correct.
753+
754+
.. note::
755+
756+
The correct and automated packaging of dependency licenses is an ongoing discussion. Please feel free to add your thoughs to `this <https://github.com/conda-forge/conda-forge.github.io/issues/1052>`__ discussion.
705757

706758
Miscellaneous
707759
=============

0 commit comments

Comments
 (0)