Recipe constructor, that’s meant to be used privately only.
To create new Recipe objects, use Context\newRecipe.
Recipe
Operations and data on single recipes.
It is useful to know that a Recipe can generate multiple packages.
Recipes are created with one default package, that will inherit most of its properties, including its name, version, and so on.
Package |
Context |
Atom |
Recipe constructor, that’s meant to be used privately only.
To create new Recipe objects, use Context\newRecipe.
Argument | Type | Description |
---|---|---|
context | Context | pkgxx Context in which to import the recipe. |
Context.newRecipe |
Name of the recipe.
Version of the software or content to be packaged.
Version of the recipe itself.
The release
attribute should always be incremented when the recipe is updated.
This attribute must have a minimum value of 1 and must be an integer.
The person who wrote the recipe.
Should have the following format: packager name <mail@example>
.
The person who updates and maintains the recipe.
Recipes imported from package.toml
files have their maintainer default to @packager
.
The format of this field is the same as that of @packager
.
packager |
Homepage of the packaged project.
Instructions to build the software.
Contains three fields: configure
, build
and install
, which must all be instances of Builder
.
Builder |
A list of Atoms describing the recipe’s build-time dependencies.
Build-dependencies are shared between all packages described by a recipe.
Atom |
Metadata to check automagically if the recipe is out of date.
Describes the name of the directory in which the main sources are stored.
This value might be used by modules to configure their build process.
Several default values can be applied during Recipe\finalize
:
"#{@name}-#{@version}"
if @version
exists,@name
otherwise.Options with which to build the package.
.options
is a field of arbitrary strings from which modules can take instructions.
See the various postBuild modules for specific entries to add to the .options
field.
Imports a recipe’s data from a package.toml file.
Argument | Type | Description |
---|---|---|
filename | string | Filename of the recipe to parse. |
Adds sources to the Recipe.
If the sources are provided as a URL, they will automatically be converted to a Source. The arrow notation (url -> filename) is supported if you want or need to name the downloaded file.
Argument | Type | Description |
---|---|---|
source | string | Source | URL or Source that describes the sources to add. |
Type | Description | |
---|---|---|
true | All clear. | |
nil, string | Source parsing error or filename collision. |
Defines a new Package in the recipe.
Argument | Type | Description |
---|---|---|
name | string | The `name` attribute of the Package to create. |
Type | Description | |
---|---|---|
Package | The newly created Package. |
Finalizes a recipe and makes it ready for use.
All missing or uninitialized attributes will be set to safe values for further operations.
Recipes must be finalized before calling @{Recipe\build} or @{Recipe\package}.
Type | Description | |
---|---|---|
nil |
Lists the filenames and packages this recipe defines.
Type | Description | |
---|---|---|
function | Iterator over the pairs of filename and Package defined by the Recipe. |
Package |
Type | Description | |
---|---|---|
string | Location of the recipe’s log file. |
Checks that a Recipe defines a Package.
Argument | Type | Description |
---|---|---|
name | string | Name of the package. |
Type | Description | |
---|---|---|
boolean | Whether the Recipe contains a Package with the given name or not. |
Type | Description | |
---|---|---|
string | The directory in which the software will be built. |
Argument | Type | Description |
---|---|---|
name |
Type | Description | |
---|---|---|
string | The “fake installation root” of the package, as used during build. |
Checks whether the recipe’s packages need updating or rebuilding.
Type | Description | |
---|---|---|
true | Recipe needs rebuild. | |
false | Everything is up to date. |
Checks whether the recipe’s dependencies and build-dependencies are installed, and tries to install them if they are not.
Type | Description | |
---|---|---|
nil |
Installs a package by name.
Argument | Type | Description |
---|---|---|
name | string | Name of the package to install. |
Downloads the recipe’s sources.
Type | Description | |
---|---|---|
boolean | Boolean indicating whether or not the downloads succeeded. |
Generates the recipe’s version from its sources.
Is useless for recipes with static versions, but is useful if a recipe is of a development version from a git repository or any similar situation.
Builds the recipe.
This method does not build the packages themselves.
The package
method does that.
Package |
Recipe\package |
Recipe\finalize |
Removes the recipe’s temporary building directories.
Type | Description | |
---|---|---|
boolean | Whether removing the files succeeded or not. |
Prints potential defects or missing data in the recipe.
It prints the defects themselves on stderr, and returns the number of defects found.
Type | Description | |
---|---|---|
number | Number of defects found in the recipe’s current configuration. |
Checks whether or not the recipe is up to date.
It may need access to recent sources to do so.
Type | Description | |
---|---|---|
true, string | Version is up to date. Also returns the version. | |
false, string | Recipe is outdated. Returns the latest version available. |
Recipe\download |
Generates a dependency tree for the recipe.
May need access to other recipes.
Recipe can be safely converted to a debug string.