Skip to content

Commit afe489f

Browse files
authored
Merge pull request #2203 from BastianZim/add-go-licenses
2 parents be490d2 + 1200949 commit afe489f

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/maintainer/adding_pkgs.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,42 @@ about:
994994
- package_license.txt
995995
```
996996

997+
<a id="Go"></a>
998+
999+
##### Go
1000+
1001+
[go-licenses](https://github.com/google/go-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.
1002+
1003+
For a detailed description, please visit the project page but a short example can be found below.
1004+
1005+
First, include the collection of licenses as a step of the build process.
1006+
1007+
```yaml
1008+
build:
1009+
number: 0
1010+
script:
1011+
- go build [...]
1012+
- go-licenses save . --save_path="./license-files/"
1013+
```
1014+
1015+
Then, include the tool as a build time dependency.
1016+
1017+
```yaml
1018+
requirements:
1019+
build:
1020+
- {{ compiler('go') }}
1021+
- go-licenses
1022+
```
1023+
1024+
Finally, make sure that the generated file is included in the recipe.
1025+
1026+
```yaml
1027+
about:
1028+
license_file:
1029+
- LICENSE
1030+
- license-files/
1031+
```
1032+
9971033
:::warning[Important]
9981034

9991035
We are not lawyers and cannot guarantee that the above advice is correct or that the tools are able to find all license files.

0 commit comments

Comments
 (0)