Accept SPDX compliant license specifications? #5561
Replies: 1 comment 3 replies
-
I don't recall the precise historical reasons for (1) but it's unlikely to change unless you can argue strongly for it. I think the original idea was it was avoided the need to do string parsing (since we would be converting it to an array internally anyway) and made more sense in a language like Ruby where arrays can be used directly. There was no conversion functions at all originally. For (2) there is a conversion here: https://github.com/Homebrew/brew/blob/277c4259fb5326fa13dc8d132b986be21c333b97/Library/Homebrew/utils/spdx.rb#L127-L159. It's private API but the logic shouldn't change should you wish to port it. It's fairly new in comparison. Licenses in formulae have been around since 2020 but this code was only added in 2023 for the specific scenario of parsing the formulae.brew.sh API which did use original SPDX syntax (as that API was originally only intended for outside users). Perhaps something we'll tidy up down the line if we make separate external and internal formulae.brew.sh API. |
Beta Was this translation helpful? Give feedback.
-
Output of
brew config
Output of
brew doctor
Description of issue
I am a Rust developer, setting up a workflow using cargo-dist to automatically commit formulae to my personal homebrew tap.
cargo-dist
just copies the standard SPDX license string specified in theCargo.toml
file (e.g.MIT OR Apache-2.0
) and uses it for the license in the formula; however this fails thebrew test-bot --only-tap-syntax
/brew audit
test, as Homebrew has its own special syntax for licenses (as mentioned here).Couple of questions:
cargo-dist
with some sort of conversion layer?Thank you!
Beta Was this translation helpful? Give feedback.
All reactions