2.6. Working With Recipes

When building a recipe using the devtool build command, the typical build progresses as follows:

  1. Fetch the source

  2. Unpack the source

  3. Configure the source

  4. Compile the source

  5. Install the build output

  6. Package the installed output

For recipes in the workspace, fetching and unpacking is disabled as the source tree has already been prepared and is persistent. Each of these build steps is defined as a function (task), usually with a "do_" prefix (e.g. do_fetch, do_unpack, and so forth). These functions are typically shell scripts but can instead be written in Python.

If you look at the contents of a recipe, you will see that the recipe does not include complete instructions for building the software. Instead, common functionality is encapsulated in classes inherited with the inherit directive. This technique leaves the recipe to describe just the things that are specific to the software being built. A base class exists that is implicitly inherited by all recipes and provides the functionality that most recipes typically need.

The remainder of this section presents information useful when working with recipes.