Matrix/ComponentMetadata
From SandboxWiki
Matrix components (source packages) consist of two parts: source code and metadata used to describe the component. Each component's metadata is stored in a dedicated Git repository and checked out under the "meta" directory at the root of the source code hierarchy.
Contents |
Info
The "info" file is a Python code snippet and can define the following variables:
- license
- Identifies the license terms of the source code.
- depends
- List of dependencies.
- conflicts
- List of conflicting packages.
- architectures
- List of architectures to support. None implies all. (See the
Board()config API function.)
Python lists are formed like this: ["foo", "bar"]
Plug
The "plug" file is a GNU Makefile which is used for plugging the component into the Matrix build process. It should set the MATRIX_BUILD_STYLE variable to one of the following values:
- MATRIX_BUILD_STYLE = autotools
- The component can be built using the "./configure && make && make install" incantation and supports standard configuration parameters (such as --prefix). If found, the autogen.sh script is automatically run before configure. The following flags (see the
SetFlag()config API function) are automatically converted to common configure options: no-docs, no-examples, no-tests, debug and quiet.
- MATRIX_BUILD_STYLE = make
- The component can be built using the "make && make install" incantation and may support the PREFIX or prefix variables.
- MATRIX_BUILD_STYLE = custom
- The plug file declares custom configure, build and install targets for manually invoking the component's build system.
Options
- MATRIX_FAKEROOT = autogen | configure | build | install | all
- Enables fakeroot for some of the build stages. The value is a whitespace-separated list of keywords. It makes most sense to use fakeroot during installation which causes any file mode and ownership changes to be saved for use later when packaging.
- MATRIX_COMPILER_EXTRA_OPTIONS
- Append more options in addition to the ones specified in board configuration. (See the
Board()config API function.)
- MATRIX_COMPILER_OPTIONS
- Override/access all options set in board configuration.
- MATRIX_GCC_OPTIONS
- Override/access board's gcc_options.
- MATRIX_GCC_MCPU
- Override/access board's gcc_mcpu.
- MATRIX_GCC_MFPU
- Override/access board's gcc_mfpu.
- MATRIX_WRAP_BUILD
- Build command invocations will be prefixed with this command.
- MATRIX_WRAP_INSTALL
- Install command invocations will be prefixed with this command. (For example MATRIX_FAKEROOT is implemented through this.)
- MATRIX_SB2_DISABLE = autogen | configure | build | install | all
- Disable Scratchbox 2 usage for some of the build stages if it's being used.
Options for autotools
The autotools build style allows you to add or override environment and arguments passed to autogen.sh and the configure script. Automatically, the build style will do the following:
- Include /usr/share/aclocal in the aclocal arguments
- Include /usr/lib/pkgconfig in pkg-config search path
- Add --prefix=/usr --sysconfdir=/etc --localstatedir=/var to configure arguments
- Add --disable-gtk-doc --disable-xml-docs --disable-doxygen-docs --disable-docbook --disable-docs to configure arguments if no-docs is defined
- Add --disable-demos --disable-examples to configure arguments if no-examples is defined
- Add --disable-tests to configure arguments if no-tests is defined
- Add --enable-debug to configure arguments if debug is defined and --disable-debug if not
The globally set flags should not be defined in the individual plugs, unless you really need to override MATRIX_CONFIGURE_ARGS. If you need to only add flags, you can do it by defining MATRIX_CONFIGURE_EXTRA_ARGS to include those. They will be automatically appended to the default and flag-based arguments. Note that by default MATRIX_AUTOGEN_ARGS will take its value from MATRIX_CONFIGURE_ARGS (it's used by the autogen.sh invocation).
Other ARGS you can set (but which are not defined automatically) are:
- MATRIX_BUILD_ARGS
- Appended to make invocation.
- MATRIX_INSTALL_ARGS
- Appended to make install invocation.
In addition to ARGS, you can define environment for each of these steps trough different ENV variables (which should be self-evident by now):
- MATRIX_AUTOGEN_ENV
- MATRIX_CONFIGURE_ENV
- MATRIX_BUILD_ENV
- MATRIX_INSTALL_ENV
Other:
- MATRIX_AUTOGEN = path
- Specifies a custom autogen script. The default is to look for meta/autogen.sh and autogen.sh (in that order).
- MATRIX_WRAP_AUTOGEN
- autogen.sh invocations will be prefixed with this command.
- MATRIX_WRAP_CONFIGURE
- configure invocations will be prefixed with this command.
Flags
The flags provided in project configuration (see the SetFlag() config API function) are exported as flagname=1 to the make environment, so you can make conditional choices in your plug with any build style. For example, Matrix's scripts/styles/autotools.mk contains this check to disable examples and demos from the build:
ifdef no-examples MATRIX_CONFIG_FLAGS += --disable-demos --disable-examples endif
