feat: auto detect license files from prefix directory as well
This adds auto-detection from the $PREFIX as well.
@mfansler do you think this is acceptable? It would fix the Rust case. I would have to think a bit longer to find a good solution for ${{ PREFIX }}/foobar case because the way we render the recipe, these variables are not available.
@wolfv thanks for the heads up. Yes, this would suffice. 👍
So, our translation will be, for example:
v0
about:
# other stuff
license_file:
- {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
- LICENSE
v1
about:
# other stuff
license_file:
- lib/R/share/licenses/MIT
- LICENSE
I.e., simply remove {{ environ["PREFIX"] }}/ from any about.license_file entries.
Yes, with this PR that would be the case, indeed.
I've had some extra thoughts on this. I think it might be better to compute the directories first (without creating them) so that we can already resolve ${{ PREFIX }}, ${{ SRC_DIR }}and${{ RECIPE_DIR }}` when rendering, so that users can be really explicit about where the license is supposed to come from.
For this I would also modify the folder that we create (currently it looks like package-name_1234513425134) where the number is the timestamp. The number is not easy to understand anyways (hard to know which is the latest build), so if we have e.g. a running index it might be better regardless.