Implement the "recipe library" file
As an addition to the current build system, it is proposed to add "recipe library" files. The idea is to support recipe scripts inside of other toml
files, like a library of recipes.
To reduce the size of the recipe library file, each recipe category or build system type could have its own recipe library file.
This would allow us to support many programs without having a multitude of recipe folders for developers that are not using them. It would also improve recipe maintenance and reorganization.
Reasons to use recipe libraries
- Less prone to terminal typos
- Avoid conflicts after recipe renames (as the
recipe.toml
file is not inside the recipe folder, it can be easily removed or moved to its new name) - More quick to access in the text editor
Syntax
The fields of each recipe will follow the syntax of the recipe.toml
file, so the existing serialization definitions can be used. Each major section will include a [category-name]
, followed by recipe-name = recipe
.
e.g. a file wip.toml
would look something like:
[wip] # The category folder will be created with the specified name
exa = {
source = { git = "https://github.com/ogham/exa" },
build = { template = "cargo" }
}
opus = {
source = {
tar = "https://downloads.xiph.org/releases/opus/opus-1.4.tar.gz"
},
build = { template = "configure" }
}
...
If a recipe is named in the filesystem config, cook
would first check for a recipe folder (to build recipes using the old format). If none existed, cook
would scan a set of recipe library files to find the recipe.
New Category Organization
This is how categories would look like with a recipe library implementation:
category-build-system.toml
Example:
-
dev-cargo.toml
- Cargo-based recipes of thedev
category. -
dev-configure.toml
- GNU Autotools-based recipes of thedev
category. -
dev-custom.toml
- Recipes of thedev
category with a custom script.