Autobuilder Development and Packaging


Revision as of 18:38, 3 December 2009 by Pnaulls (Talk | contribs)
Jump to: navigation, search

Information on using the autobuilder is listed on the GCCSDK Development page. This page is about adding packages to it.

The specific aims of an autobuilder package are:

  • Supply information on where to get the sources
  • Perform any special build steps, especially for cross compiling
  • Generate a RiscPkg package suitable for deployment

Given minimal information, the autobuilder knows how to do almost all of these steps by itself most of the time. But some packages deviate, and explicit instructions need to be given.


Anatomy of an autobuilder package

Note: some packages follow older conventions, and do not look exactly like what is described here. These are in the process of being updated.

To start, download a copy of the Autobuilder from SVN and look in the directory cli/tar. The heart of an autobuilder package is a file called 'setvars'. tar's has:

ab_package() {
  cp $S/src/tar$AB_EXEEXT $S/COPYING $D

Normally the autobuilder will make a best guess at how to build a package, so all that's needed are to specify in those areas it gets it wrong. The main work is done by the fetch* and build* collections of scripts in the top level of the autobuilder tree. As well as setting various key variables and providing some functions, the setvars script is run just before any configuration script so you can use it to fix up anything that the automatic steps missed.

setvars variables

If no URL is given the autobuilder will try to fetch the package of the same name from Debian's 'unstable' repository. Here we don't want that, so we explicitly give a URL in AB_URL of where the sources can be found. This can be a .tar.gz, a .tar.bz2 or a .zip file. Alternatively you can specify a CVS or SVN repository. For example, browser/firefox2/setvars has:

while audio/tremor/setvars has:


setvars functions

When producing a Zip package, the ab_package shell function is called to choose which files are to be placed in the zipfile.

There are three main types of packages - the first type contains a standard RISC OS application, the second is a container for command line components, and the third contains development libraries and headers. In future, there will be another type generated along with the library one to contain a shared library.

RISC OS Application

XJig is a typical game, and its packaging looks like this:

 ab_package() {
   ab_create_app XJig Apps/Games
   ab_makerun $S/xjig$AB_EXEEXT
   cp -av $S/tina.gif $A/
   rman -f HTML $S/ > $A/\!Help,faf
   $AB_HOME/add-riscpkg -unixlib -depends Tinct

In the final package, the path Apps/Games/!XJig will be created, which is part of the RiscPkg structure. The !XJig application is copied from autobuilder/games/xjig/!Xjig by the ab_create_app command.

The ab_makerun copies the actual game binary, but also importantly, it converts it from a static ELF binary (it will complain if it is a dynamic ELF binary) to a RISC OS AIF, and will also calculate the required WimpSlot for the application. This will be substituted for 'WIMPSLOT' in the !Run file.

The rest of the commands copy required files, and then perform the final packaging steps.

Command Line Applications

For wget, which is a command line application:

 ab_package() {
   ab_create_command_app Wget Apps/Network
   ab_add_commands $S/src/*$AB_EXEEXT
   rman -f HTML $S/doc/ > $A/\!Help,faf

   cp -av $S/README $A
   cp -av $S/NEWS $S/ChangeLog $A
   $AB_HOME/add-riscpkg -unixlib

In this case, a !Wget application will be created. If !Wget already exists in the autobuilder directory, that will be copied. ab_add_commands is used in this case to add any command line commands. This will generate Alias variables in the !Boot file.

Note the variables in use in these scripts:

$S - source directory. e.g, the directory from which 'make' was run.
$D - destination, top level of packaging.  This is often not used.
$H - home, or directory containing 'setvars' for the package
$A - application directory created after call to ab_create_command_app
$AA - actual app name, in this case 'Wget'.  Normally not used by setvars.


To be added.

Patch files

Files ending .p are patches which the autobuilder will apply to the downloaded source tree. For this to work the file naming in the first two lines of the patch file must be correct - ensure you just have a relative path starting at the top level of the unpacked source tree.

Packages may depend on other packages. Normally this uses the Debian dependency information, but you may specify packages manually using a 'depends' file. This just has a list of package names - for an example see browser/firefox2/depends

Personal tools