Platform Team/Guide/Sweets Packaging

Pencil.png NOTICE:  This page is a draft in active flux...
Please contribute to these contents and discuss issues on the discussion page.


Writing recipe files

See also recipe specification.

Package names

Within recipe files, Zero packages might be identified by several methods:

  • current package (instead of a direct slug value, to make the recipe file more robust, move the slug option to the [DEFAULT] section and use %(slug)s interpolation),
<current-slug>[/<sub-package>]
  • other packages from Bazaar that are accessible in the current project,
<other-package-slug>[/<sub-package>]
  • direct 0install link.
<0install-feed-url>

At the end, all links will be transfered to 0install feed urls. The final 0install url will be in the following format:

http://sweets.sugarlabs.org/<Bazaar-project>/<slug>

Versioning

The versioning scheme for Zero packages can be arbitrary, since the version recipe option supports 0install version format. But in some cases, e.g., libraries, stricter versioning could be useful. In that case, the age recipe option should be used.

The recipe option age is intended to support, mostly, API breakages of library packages. But not ABI, because tracking an ABI is not trivial within the Sugar ecosystem (due to the enormous potential code base of varying quality) and of little utility, and since packages may at any time be rebuilt from sources and multiple library versions may be installed (thanks to 0install).

Using the age option is simple, on every API breakage for the library package, increment the age value. The final package version will be:

<age-option>.<version-option>

Glob patterns

A pattern could be of two types:

  • doesn't contain / or ** substrings, will be applied only to file names
  • contains / or ** substring, will be applied to the full file path (relative to the root), thus could affect several directory levels

Only these pattern symbols are allowed:

  • * matches everything, except directory separator
  • ? matches any single character, except directory separator
  • ** matches everything, including directory separator

Pitfalls

Devel packages

It is common practice in binary-based GNU/Linux distributions to use satellite devel packages to collect various build-time files like C headers or pkg-config files. In the 0install environment, this doesn't work, because every package is stored in a separate directory hierarchy, e.g., *.so symlinks, from devel package, will point to nothing, since all *.so.* files from the library package live in a separate directory.

Keep all build-time files in the runtime package.