2013-12-31 06:42:58 +00:00
|
|
|
// vim: set syntax=asciidoc:
|
|
|
|
|
2013-11-22 11:46:24 +00:00
|
|
|
The XBPS source packages manual
|
|
|
|
===============================
|
|
|
|
Juan RP <xtraeme@gmail.com>
|
|
|
|
:Author Initials: JRP
|
|
|
|
:toc:
|
|
|
|
:icons:
|
|
|
|
:numbered:
|
|
|
|
:website: http://www.voidlinux.eu
|
|
|
|
|
|
|
|
This article contains an exhaustive manual of how to create new source
|
2013-12-31 06:42:58 +00:00
|
|
|
packages for XBPS, the `Void Linux` native packaging system.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
The `xbps-packages` repository contains all `source` packages that are the
|
|
|
|
recipes to download, compile and build binary packages for `Void`.
|
|
|
|
Those `source` package files are called `templates`.
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
The `template files` are `GNU bash` shell scripts that must define some required/optional
|
2013-11-22 11:46:24 +00:00
|
|
|
`variables` and `functions` that are processed by `xbps-src` (the package builder)
|
|
|
|
to generate the resulting binary packages.
|
|
|
|
|
|
|
|
A simple `template` example is as follows:
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
--------------------------------------------------------------------------
|
|
|
|
# Template file for 'foo'
|
|
|
|
|
|
|
|
pkgname="foo"
|
|
|
|
version="1.0"
|
2014-01-01 16:37:56 +00:00
|
|
|
revision=1
|
|
|
|
build_style=gnu-configure
|
2013-11-22 16:51:38 +00:00
|
|
|
short_desc="A short description max 72 chars"
|
|
|
|
maintainer="name <email>"
|
|
|
|
license="GPL-3"
|
|
|
|
homepage="http://www.foo.org"
|
|
|
|
distfiles="http://www.foo.org/foo-${version}.tar.gz"
|
|
|
|
checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
|
|
|
|
|
|
|
|
---------------------------------------------------------------------------
|
2013-11-22 11:46:24 +00:00
|
|
|
|
|
|
|
|
2014-01-01 16:37:56 +00:00
|
|
|
The template file contains definitions to download, build and install the
|
|
|
|
package files to a `fake destdir`, and after this a binary package can be
|
|
|
|
generated with the definitions specified on it.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
|
|
|
Don't worry if anything is not clear as it should be. The reserved `variables`
|
|
|
|
and `functions` will be explained later. This `template` file should be created
|
|
|
|
in a directory matching `$pkgname`, i.e: `xbps-packages/srcpkgs/foo/template`.
|
|
|
|
If everything went fine after running `xbps-src build-pkg` a binary package
|
2014-02-07 03:34:23 +00:00
|
|
|
called `foo-1.0_1.<arch>.xbps` will be generated in the local repository:
|
|
|
|
`<masterdir>/host/binpkgs`.
|
|
|
|
|
|
|
|
Subpackages
|
|
|
|
-----------
|
|
|
|
|
|
|
|
In the example shown above just a binary package is generated, but with some
|
|
|
|
simple tweaks multiple binary packages can be generated from a single
|
|
|
|
template/build, this is called `subpackages`.
|
|
|
|
|
|
|
|
To create additional `subpackages` the `template` must define a new function
|
|
|
|
with this naming: `<subpkgname>_package()`, i.e:
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------
|
|
|
|
# Template file for 'foo'
|
|
|
|
|
|
|
|
pkgname="foo"
|
|
|
|
version="1.0"
|
|
|
|
revision=1
|
|
|
|
build_style=gnu-configure
|
|
|
|
short_desc="A short description max 72 chars"
|
|
|
|
maintainer="name <email>"
|
|
|
|
license="GPL-3"
|
|
|
|
homepage="http://www.foo.org"
|
|
|
|
distfiles="http://www.foo.org/foo-${version}.tar.gz"
|
|
|
|
checksum="fea0a94d4b605894f3e2d5572e3f96e4413bcad3a085aae7367c2cf07908b2ff"
|
|
|
|
|
|
|
|
# foo-devel is a subpkg
|
|
|
|
foo-devel_package() {
|
|
|
|
short_desc+=" - development files"
|
|
|
|
depends="${sourcepkg}>=${version}_${revision}"
|
|
|
|
pkg_install() {
|
|
|
|
vmove usr/include
|
|
|
|
vmove usr/lib/pkgconfig
|
|
|
|
}
|
|
|
|
}
|
|
|
|
---------------------------------------------------------------------------
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
All subpackages need an additional symlink to the `main` pkg, i.e:
|
2013-12-15 10:22:00 +00:00
|
|
|
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
/srcpkgs
|
2014-02-07 03:34:23 +00:00
|
|
|
|- foo <- directory (main pkg)
|
2013-12-15 10:22:00 +00:00
|
|
|
| |- template
|
|
|
|
|- foo-devel <- symlink to `foo`
|
|
|
|
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
Otherwise dependencies requiring those packages won't find its `template`
|
|
|
|
file.
|
|
|
|
|
2013-11-22 11:46:24 +00:00
|
|
|
Package build phases
|
|
|
|
--------------------
|
|
|
|
Building a package consist of the following phases:
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*fetch*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase downloads required sources for a `source package`, as defined by
|
|
|
|
the `distfiles` variable or `do_fetch()` function.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*extract*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase extracts the `distfiles` files into `$wrksrc` or executes the `do_extract()`
|
|
|
|
function, which is the directory to be used to compile the `source package`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*configure*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase executes the `configuration` of a `source package`, i.e `GNU configure scripts`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*build*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase compiles/prepares the `source files` via `make` or any other compatible method.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*install-destdir*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase installs the `package files` into a `fake destdir`, via `make install` or
|
|
|
|
any other compatible method.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*build-pkg*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This phase builds the `binary packages` with files stored in the `package destdir`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
|
|
|
`xbps-src` supports running just the specified phase, and if it ran
|
|
|
|
successfully, the phase will be skipped later (unless its work directory
|
|
|
|
`${wrksrc}` is removed with `xbps-src clean`).
|
|
|
|
|
2013-11-24 06:47:22 +00:00
|
|
|
Global functions
|
|
|
|
----------------
|
|
|
|
The following functions are defined by `xbps-src` and can be used on any template:
|
|
|
|
|
|
|
|
*vinstall()*::
|
|
|
|
`vinstall <file> <mode> <targetdir> [<name>]`
|
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
Installs `file` with the specified `mode` into `targetdir` into the pkg `$DESTDIR`
|
2013-12-31 06:42:58 +00:00
|
|
|
The optional 4th argument can be used to change the `file name`.
|
2013-11-24 06:47:22 +00:00
|
|
|
|
|
|
|
*vcopy()*::
|
|
|
|
`vcopy <pattern> <targetdir>`
|
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
Copies resursively all files in `pattern` to `targetdir` into the pkg `$DESTDIR`
|
2013-11-24 06:47:22 +00:00
|
|
|
|
|
|
|
*vmove()*::
|
|
|
|
`vmove <pattern>`
|
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
Moves `pattern` to the specified directory in the pkg `$DESTDIR`
|
2013-11-24 06:47:22 +00:00
|
|
|
|
|
|
|
*vmkdir()*::
|
|
|
|
`vmkdir <directory> [<mode>]`
|
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
Creates a directory in the pkg `$DESTDIR`.
|
|
|
|
The 2nd optional argument sets the mode of the directory.
|
2013-11-24 06:47:22 +00:00
|
|
|
|
2014-02-07 03:34:23 +00:00
|
|
|
NOTE: shell wildcards must be properly quoted, i.e `vmove "usr/lib/*.a"`.
|
2013-11-24 06:47:22 +00:00
|
|
|
|
2013-11-22 11:46:24 +00:00
|
|
|
Global variables
|
|
|
|
----------------
|
|
|
|
The following variables are defined by `xbps-src` and can be used on any template:
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*makejobs*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Set to `-jX` if `XBPS_MAKEJOBS` is defined, to allow parallel jobs with `GNU make`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*sourcepkg*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Set to the to main package name, can be used to match the main package
|
|
|
|
rather than additional binary package names.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*CHROOT_READY*::
|
2013-12-31 06:42:58 +00:00
|
|
|
True if the target chroot (masterdir) is ready for chroot builds.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*CROSS_BUILD*::
|
2013-12-31 06:42:58 +00:00
|
|
|
True if `xbps-src` is cross compiling a package.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*DESTDIR*::
|
2014-02-07 03:49:03 +00:00
|
|
|
Full path to the fake destdir used by the source pkg, set to
|
2013-12-31 06:42:58 +00:00
|
|
|
`${XBPS_MASTERDIR}/destdir/${sourcepkg}-${version}`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2014-02-07 03:49:03 +00:00
|
|
|
*FILESDIR*::
|
|
|
|
Full path to the `files` package directory, i.e `srcpkgs/foo/files`.
|
|
|
|
The `files` directory can be used to store additional files to be installed
|
|
|
|
as part of the source package.
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*PKGDESTDIR*::
|
2014-02-07 03:49:03 +00:00
|
|
|
Full path to the fake destdir used by the `pkg_install()` function in
|
|
|
|
`subpackages`, set to `${XBPS_MASTERDIR}/destdir/${pkgname}-${version}`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*XBPS_MACHINE*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The machine architecture as returned by `uname -m`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*XBPS_SRCDISTDIR*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Full path to where the `source distfiles` are stored, i.e `$XBPS_HOSTDIR/sources`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*XBPS_SRCPKGDIR*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Full path to the `srcpkgs` directory.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*XBPS_TARGET_MACHINE*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The target machine architecture when cross compiling a package.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2014-01-01 16:37:56 +00:00
|
|
|
*XBPS_FETCH_CMD*::
|
|
|
|
The utility to fetch files from `ftp`, `http` of `https` servers.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2014-02-07 03:49:03 +00:00
|
|
|
Available variables
|
|
|
|
-------------------
|
2013-11-22 16:51:38 +00:00
|
|
|
Mandatory variables
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
2014-02-07 03:49:03 +00:00
|
|
|
The list of mandatory variables for a template:
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*homepage*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string pointing to the `upstream` homepage.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*license*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string matching any license file available in `/usr/share/licenses`.
|
|
|
|
Multiple licenses should be separated by commas, i.e `GPL-3, LGPL-2.1`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*maintainer*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string in the form of `name <user@domain>`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*pkgname*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string with the package name, matching `srcpkgs/<pkgname>`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*revision*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A number that must be set to 1 when the `source package` is created, or
|
|
|
|
updated to a new `upstream version`. This should only be increased when
|
|
|
|
the generated `binary packages` have been modified.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*short_desc*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string with a brief description for this package. Max 72 chars.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*version*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A string with the package version. Must not contain dashes and at least
|
|
|
|
one digit is required.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
Optional variables
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
*hostmakedepends*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The list of `host` dependencies required to build the package. Dependencies
|
|
|
|
can be specified with the following version comparators: `<`, `>`, `<=`, `>=`
|
|
|
|
or `foo-1.0_1` to match an exact version. If version comparator is not
|
|
|
|
defined (just a package name), the version comparator is automatically set to `>=0`.
|
|
|
|
Example `hostmakedepends="foo blah<1.0"`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*makedepends*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The list of `target` dependencies required to build the package. Dependencies
|
|
|
|
can be specified with the following version comparators: `<`, `>`, `<=`, `>=`
|
|
|
|
or `foo-1.0_1` to match an exact version. If version comparator is not
|
|
|
|
defined (just a package name), the version comparator is automatically set to `>=0`.
|
|
|
|
Example `makedepends="foo blah>=1.0"`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*bootstrap*::
|
2013-12-31 06:42:58 +00:00
|
|
|
If enabled the source package is considered to be part of the `bootstrap`
|
|
|
|
process and required to be able to build packages in the chroot. Only a
|
|
|
|
small number of packages must set this property.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*distfiles*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The full URL to the `upstream` source distribution files. Multiple files
|
|
|
|
can be separated by blanks. The files must end in `.tar.lzma`, `.tar.xz`,
|
|
|
|
`.txz`, `.tar.bz2`, `.tbz`, `.tar.gz`, `.tgz`, `.gz`, `.bz2`, `.tar` or
|
|
|
|
`.zip`. Example `distfiles="http://foo.org/foo-1.0.tar.gz"`
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*checksum*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The `sha256` digests matching `${distfiles}`. Multiple files can be
|
|
|
|
separated by blanks. Please note that the order must be the same than
|
|
|
|
was used in `${distfiles}`. Example `checksum="kkas00xjkjas"`
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*long_desc*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A long description of the main package. Max 80 chars per line and must
|
|
|
|
not contain the following characters: `&`, `<`, `>`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*wrksrc*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The directory name where the package sources are extracted, by default
|
|
|
|
set to `${pkgname}-${version}`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*build_wrksrc*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A directory relative to `${wrksrc}` that will be used when building the package.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*create_wrksrc*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Enable it to create the `${wrksrc}` directory. Required if a package
|
|
|
|
contains multiple `distfiles`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*only_for_archs*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This expects a separated list of architectures where the package can be
|
|
|
|
built matching `uname -m` output. Example `only_for_archs="x86_64 armv6l"`
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*build_style*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This specifies the `build method` for a package. Read below to know more
|
|
|
|
about the available package `build methods`. If `build_style` is not set,
|
|
|
|
the package must define at least a `do_install()` function, and optionally
|
|
|
|
more build phases as such `do_configure()`, `do_build()`, etc.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*create_srcdir*::
|
2013-12-31 06:42:58 +00:00
|
|
|
This creates a directory in `${XBPS_SRCDISTDIR}` as such `${pkgname}-${version}`
|
|
|
|
to store the package sources at the `extract` phase. Required in packages that
|
|
|
|
use unversioned ${distfiles}`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*configure_script*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The name of the `configure` script to execute at the `configure` phase if
|
|
|
|
`${build_style}` is set to `configure` or `gnu-configure` build methods.
|
|
|
|
By default set to `./configure`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*configure_args*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The arguments to be passed in to the `configure` script if `${build_style}`
|
|
|
|
is set to `configure` or `gnu-configure` build methods. By default, prefix
|
|
|
|
must be set to `/usr`. In `gnu-configure` packages, some options are already
|
|
|
|
set by default: `--prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info --mandir=/usr/share/man --localstatedir=/var`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*make_cmd*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The executable to run at the `build` phase if `${build_style}` is set to
|
|
|
|
`configure`, `gnu-configure` or `gnu-makefile` build methods.
|
|
|
|
By default set to `make`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*make_build_args*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The arguments to be passed in to `${make_cmd}` at the build phase if
|
|
|
|
`${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile`
|
|
|
|
build methods. Unset by default.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*make_install_args*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The arguments to be passed in to `${make_cmd}` at the `install-destdir`
|
|
|
|
phase if `${build_style}` is set to `configure`, `gnu-configure` or
|
|
|
|
`gnu_makefile` build methods. By default set to
|
|
|
|
`PREFIX=/usr DESTDIR=${DESTDIR}`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*make_build_target*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The target to be passed in to `${make_cmd}` at the build phase if
|
|
|
|
`${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile`
|
|
|
|
build methods. Unset by default (`all` target).
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*make_install_target*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The target to be passed in to `${make_cmd}` at the `install-destdir` phase
|
|
|
|
if `${build_style}` is set to `configure`, `gnu-configure` or `gnu_makefile`
|
|
|
|
build methods. By default set to `install`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*patch_args*::
|
2013-12-31 06:42:58 +00:00
|
|
|
The arguments to be passed in to the `patch(1)` command when applying
|
|
|
|
patches to the package sources after `do_extract()`. Patches are stored in
|
|
|
|
`srcpkgs/<pkgname>/patches` and must be in `-p0` format. By default set to `-Np0`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*disable_parallel_build*::
|
2013-12-31 06:42:58 +00:00
|
|
|
If set the package won't be built in parallel and `XBPS_MAKEJOBS` has no effect.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*keep_libtool_archives*::
|
2013-12-31 06:42:58 +00:00
|
|
|
If enabled the `GNU Libtool` archives won't be removed. By default those
|
|
|
|
files are always removed automatically.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*skip_extraction*::
|
2013-12-31 06:42:58 +00:00
|
|
|
A list of filenames that should not be extracted in the `extract` phase.
|
|
|
|
This must match the basename of any url defined in `${distfiles}`.
|
|
|
|
Example `skip_extraction="foo-${version}.tar.gz"`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*force_debug_pkgs*::
|
2013-12-31 06:42:58 +00:00
|
|
|
If enabled binary packages with debugging symbols will be generated
|
|
|
|
even if `XBPS_DEBUG_PKGS` is disabled in `xbps-src.conf` or in the
|
|
|
|
`command line arguments`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2014-01-01 16:37:56 +00:00
|
|
|
*conf_files*::
|
|
|
|
A list of configuration files the binary package owns; this expects full
|
|
|
|
paths, and multiple entries can be separated by blanks, i.e:
|
|
|
|
`conf_files="/etc/foo.conf /etc/foo2.conf"`.
|
|
|
|
|
|
|
|
*noarch*::
|
|
|
|
If set, the binary package is not architecture specific and can be shared
|
|
|
|
by all supported architectures.
|
|
|
|
|
|
|
|
*nonfree*::
|
|
|
|
If set, the binary package will be put into the *non free* repository.
|
|
|
|
|
|
|
|
*nostrip*::
|
|
|
|
If set, the ELF binaries with debugging symbols won't be stripped. By
|
|
|
|
default all binaries are stripped.
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
build style scripts
|
|
|
|
~~~~~~~~~~~~~~~~~~~
|
2013-11-22 11:46:24 +00:00
|
|
|
The `build_style` variable specifies the build method to build and install a
|
|
|
|
package. It expects the name of any available script in the
|
|
|
|
`/usr/share/xbps-src/build_style` directory. Please note that required packages
|
|
|
|
to execute a `build_style` script must be defined via `hostmakedepends`.
|
|
|
|
|
|
|
|
The current list of available `build_style` scripts is the following:
|
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*cmake*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the CMake build system, configuration arguments
|
|
|
|
can be passed in via `configure_args`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*configure*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use non-GNU configure scripts, at least `--prefix=/usr`
|
|
|
|
should be passed in via `configure_args`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*gnu-configure*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use GNU configure scripts, additional configuration
|
|
|
|
arguments can be passed in via `configure_args`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*gnu-makefile*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use GNU make, build arguments can be passed in via
|
|
|
|
`make_build_args` and install arguments via `make_install_args`. The build
|
|
|
|
target can be overriden via `make_build_target` and the install target
|
|
|
|
via `make_install_target`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*meta*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For `meta-packages`, i.e packages that only install local files or simply
|
|
|
|
depend on additional packages. This build style does not install
|
|
|
|
dependencies to the root directory, and only checks if a binary package is
|
|
|
|
available in repositories.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*perl-ModuleBuild*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the Perl
|
|
|
|
http://search.cpan.org/~leont/Module-Build-0.4202/lib/Module/Build.pm[Module::Build] method.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*perl*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the Perl
|
|
|
|
http://perldoc.perl.org/ExtUtils/MakeMaker.html[ExtUtils::MakeMaker] build method.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*python-module*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the Python module build method (setup.py).
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*waf3*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the Python3 `waf` build method with python3.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*waf*::
|
2013-12-31 06:42:58 +00:00
|
|
|
For packages that use the Python `waf` method with python2.
|
|
|
|
|
|
|
|
NOTE: if `build_style` is not set, the template must (at least) define a
|
|
|
|
`do_install()` function and optionally more phases via `do_xxx()` functions.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
Functions
|
|
|
|
~~~~~~~~~
|
2013-11-22 13:31:49 +00:00
|
|
|
The following functions can be defined to change the behavior of how the
|
|
|
|
package is downloaded, compiled and installed.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*do_fetch()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
if defined and `distfiles` is not set, use it to fetch the required sources.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*do_extract()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
if defined and `distfiles` is not set, use it to extract the required sources.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*post_extract()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `do_extract()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*pre_configure()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `post_extract()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*do_configure()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute to configure the package; `${configure_args}` should
|
|
|
|
still be passed in if it's a GNU configure script.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*post_configure()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `do_configure()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*pre_build()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `post_configure()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*do_build()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute to build the package.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*post_build()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `do_build()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*pre_install()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `post_build()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*do_install()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute to install the packages files into the `fake destdir`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
*post_install()*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Actions to execute after `do_install()`.
|
2013-11-22 11:46:24 +00:00
|
|
|
|
2013-11-22 16:51:38 +00:00
|
|
|
NOTE: A function defined in a template has preference over the same function
|
2013-11-22 11:46:24 +00:00
|
|
|
defined by a `build_style` script.
|
2013-12-15 10:16:09 +00:00
|
|
|
|
2013-12-28 11:12:04 +00:00
|
|
|
Build options
|
2013-12-31 06:42:58 +00:00
|
|
|
-------------
|
2013-12-28 11:12:04 +00:00
|
|
|
Some packages might be built with different build options to enable/disable
|
|
|
|
additional features; `xbps-src` allows you to do this with some simple tweaks
|
|
|
|
to the `template` file.
|
|
|
|
|
|
|
|
The following variables may be set to allow package build options:
|
|
|
|
|
|
|
|
*build_options*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Sets the build options supported by the source package.
|
2013-12-28 11:12:04 +00:00
|
|
|
|
|
|
|
*build_options_default*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Sets the default build options to be used by the source package.
|
2013-12-28 11:12:04 +00:00
|
|
|
|
|
|
|
*desc_option_<option>*::
|
2013-12-31 06:42:58 +00:00
|
|
|
Sets the description for the build option `option`. This must match the
|
|
|
|
keyword set in *build_options*.
|
2013-12-28 11:12:04 +00:00
|
|
|
|
|
|
|
After defining those required variables, you can check for the
|
|
|
|
`build_option_<option>` variable to know if it has been set and adapt the source
|
|
|
|
package accordingly.
|
|
|
|
|
|
|
|
The following example shows how to change a source package that uses GNU
|
|
|
|
configure to enable a new build option to support PNG images:
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------
|
|
|
|
# Template file for 'foo'
|
|
|
|
pkgname=foo
|
|
|
|
version=1.0
|
|
|
|
revision=1
|
|
|
|
build_style=gnu-configure
|
|
|
|
...
|
|
|
|
|
|
|
|
# Package build options
|
|
|
|
build_options="png"
|
|
|
|
desc_option_png="Enable support for PNG images"
|
|
|
|
|
2013-12-28 11:21:09 +00:00
|
|
|
# To build the package by default with the `png` option:
|
|
|
|
#
|
|
|
|
# build_options_default="png"
|
|
|
|
|
2013-12-28 11:12:04 +00:00
|
|
|
if [ "$build_option_png" ]; then
|
|
|
|
configure_args+=" --with-png"
|
|
|
|
makedepends+=" libpng-devel"
|
|
|
|
else
|
|
|
|
configure_args+=" --without-png"
|
|
|
|
fi
|
|
|
|
...
|
|
|
|
|
|
|
|
-----------------------------------------------------------------------
|
|
|
|
|
2013-12-28 11:21:09 +00:00
|
|
|
The supported build options for a source package can be shown with xbps-src:
|
|
|
|
|
|
|
|
---------------------------
|
|
|
|
$ xbps-src show-options foo
|
|
|
|
---------------------------
|
|
|
|
|
|
|
|
Build options can be enabled with the `-o` flag of xbps-src:
|
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
$ xbps-src -o option,option1 foo
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
Build options can be disabled by prefixing them with `~`:
|
|
|
|
|
|
|
|
----------------------------------
|
|
|
|
$ xbps-src -o ~option,~option1 foo
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
Both ways can be used together to enable and/or disable multiple options
|
|
|
|
at the same time with xbps-src:
|
|
|
|
|
|
|
|
------------------------------------------
|
|
|
|
$ xbps-src -o option,~option1,~option2 foo
|
|
|
|
------------------------------------------
|
2013-12-28 11:12:04 +00:00
|
|
|
|
2013-12-28 11:26:09 +00:00
|
|
|
The build options can also be shown for binary packages via `xbps-query(8)`:
|
|
|
|
|
|
|
|
--------------------------------------------
|
|
|
|
$ xbps-query -R --property=build-options foo
|
|
|
|
--------------------------------------------
|
|
|
|
|
2013-12-31 06:42:58 +00:00
|
|
|
Run-time dependencies
|
|
|
|
---------------------
|
|
|
|
Dependencies for ELF executables or shared libraries are detected
|
|
|
|
automatically by `xbps-src`, hence run-time dependencies must not be specified
|
2014-02-07 03:49:03 +00:00
|
|
|
in templates with the following exceptions:
|
2013-12-31 06:42:58 +00:00
|
|
|
|
|
|
|
- ELF binaries using dlopen(3).
|
|
|
|
- non ELF objects, i.e perl/python/ruby/etc modules.
|
|
|
|
- Overriding the minimal version specified in the `shlibs` file.
|
|
|
|
|
|
|
|
The run-time dependencies for ELF binaries are detected by checking which SONAMEs
|
|
|
|
use and then the SONAMEs are mapped to a binary package name with a minimal
|
|
|
|
required version. The `shlibs` file in the `xbps-packages/common` directory
|
|
|
|
sets up the `SONAME pkgname>=version` mappings.
|
2013-12-15 10:16:09 +00:00
|
|
|
|
2013-12-31 06:42:58 +00:00
|
|
|
For example the `foo-1.0_1` package provides the `libfoo.so.1` SONAME and
|
|
|
|
software requiring this library will link to `libfoo`; the resulting binary
|
|
|
|
package will have a run-time dependency to `foo>=1.0_1` package as specified in
|
|
|
|
`common/shlibs`:
|
|
|
|
|
|
|
|
-----------------------
|
|
|
|
# common/shlibs
|
|
|
|
...
|
|
|
|
libfoo.so.1 foo-1.0_1
|
|
|
|
...
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
- The first field specifies the SONAME.
|
|
|
|
- The second field specified the package name and minimal version required.
|
|
|
|
- A third optional field specifies the architecture (rarely used).
|
|
|
|
|
|
|
|
Contributing via git
|
|
|
|
--------------------
|
2013-12-15 10:16:09 +00:00
|
|
|
You can fork the `xbps-packages` git repository on github and then set up
|
|
|
|
a remote to pull in new changes:
|
|
|
|
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
$ git remote add upstream git://github.com/voidlinux/xbps-packages.git
|
|
|
|
----------------------------------------------------------------------
|
|
|
|
|
|
|
|
To pull in new changes from `upstream`:
|
|
|
|
|
|
|
|
--------------------------
|
|
|
|
$ git pull upstream master
|
|
|
|
--------------------------
|
2013-12-15 10:29:29 +00:00
|
|
|
|
|
|
|
Once you've made changes to your `forked` repository you can submit
|
|
|
|
a github pull request; see
|
|
|
|
https://help.github.com/articles/fork-a-repo[github's help]
|
|
|
|
for more information.
|
2013-12-15 10:53:41 +00:00
|
|
|
|
|
|
|
For commit messages please use the following rules:
|
|
|
|
|
2013-12-31 06:42:58 +00:00
|
|
|
- If you've imported a new package use `"New package: <pkgver>"`.
|
|
|
|
- If you've updated a package use `"<pkgname>: updated to <version>"`.
|
|
|
|
- If you've removed a package use `"<pkgname>: removed ..."`.
|
|
|
|
- If you've modified a package use `"<pkgname>: ..."`.
|
2013-12-15 10:53:41 +00:00
|
|
|
|
2013-12-31 06:42:58 +00:00
|
|
|
Help
|
|
|
|
----
|
|
|
|
If after reading this `manual` you still need some kind of help, please join
|
|
|
|
us at `#xbps` via IRC at `irc.freenode.net`.
|