diff --git a/Manual.md b/Manual.md index 0b6b5ab..667ab63 100644 --- a/Manual.md +++ b/Manual.md @@ -5,7 +5,8 @@ packages for XBPS, the `Void Linux` native packaging system. *Table of Contents* -* [Introduction](#Introduction) +* The XBPS source packages manual + * [Introduction](#Introduction) * [Package build phases](#buildphase) * [Package naming conventions](#namingconventions) * [Libraries](#libs) @@ -27,20 +28,20 @@ packages for XBPS, the `Void Linux` native packaging system. * [Build helper scripts](#build_helper) * [Functions](#functions) * [Build options](#build_options) - * [Runtime dependencies](#deps_runtime) * [INSTALL and REMOVE files](#install_remove_files) * [INSTALL.msg and REMOVE.msg files](#install_remove_files_msg) * [Creating system accounts/groups at runtime](#runtime_account_creation) * [Writing runit services](#writing_runit_services) * [32bit packages](#32bit_pkgs) * [Subpackages](#pkgs_sub) - * [Development packages](#pkgs_development) - * [Data packages](#pkgs_data) - * [Documentation packages](#pkgs_documentation) - * [Python packages](#pkgs_python) - * [Go packages](#pkgs_go) - * [Haskell packages](#pkgs_haskell) - * [Font packages](#pkgs_font) + * [Some package classes](#pkgs_classes) + * [Development packages](#pkgs_development) + * [Data packages](#pkgs_data) + * [Documentation packages](#pkgs_documentation) + * [Python packages](#pkgs_python) + * [Go packages](#pkgs_go) + * [Haskell packages](#pkgs_haskell) + * [Font packages](#pkgs_font) * [Renaming a package](#pkg_rename) * [Removing a package](#pkg_remove) * [XBPS Triggers](#xbps_triggers) @@ -73,10 +74,10 @@ packages for XBPS, the `Void Linux` native packaging system. * [Void specific documentation](#documentation) * [Notes](#notes) * [Contributing via git](#contributing) -* [Help](#help) + * [Help](#help) -## Introduction +### Introduction The `void-packages` repository contains all the recipes to download, compile and build binary packages for Void Linux. @@ -440,8 +441,8 @@ the generated `binary packages` have been modified. - `version` A string with the package version. Must not contain dashes or underscore and at least one digit is required. Shell's variable substitution usage is not allowed. -Neither `pkgname` or `version` should contain special characters which make it -necessary to quote them, so they shouldn't be quoted in the template. +`pkgname` and `version` are forbidden to contain special characters. Hence, they don't +need to be quoted, and by convention, they shouldn't be. #### Optional variables @@ -787,20 +788,65 @@ should be listed in `checkdepends` and will be installed as if they were part of a D-Bus session for applications that need it - `git`: some test suites run the `git` command + Lastly, a package may require certain dependencies at runtime, without which it is unusable. These dependencies, when they aren't detected automatically by -XBPS, should be listed in `depends`. This is mostly relevant for Perl and Python -modules and other programs that use `dlopen(3)` instead of dynamically linking. +XBPS, should be listed in `depends`. + +Libraries linked by ELF objects are detected automatically by `xbps-src`, hence they +must not be specified in templates via `depends`. This variable should list: + +- executables called as separate processes. +- ELF objects using dlopen(3). +- non-object code, e.g. C headers, perl/python/ruby/etc modules. +- data files. +- overriding the minimal version specified in the `common/shlibs` file. + +The runtime dependencies for ELF objects are detected by checking which SONAMEs +they require and then the SONAMEs are mapped to a binary package name with a minimal +required version. The `common/shlibs` file +sets up the ` >=` mappings. + +For example the `foo-1.0_1` package provides the `libfoo.so.1` SONAME and +software requiring this library will link to `libfoo.so.1`; the resulting binary +package will have a run-time dependency on `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 (usually set to `ignore`) can be used to skip checks in soname bumps. + +Dependencies declared via `depends` are not installed to the master directory, rather they are +only checked if they exist as binary packages, and are built automatically by `xbps-src` if +the specified version is not in the local repository. + +As a special case, `virtual` dependencies may be specified as runtime dependencies in the +`depends` template variable. Several different packages can provide common functionality by +declaring a virtual name and version in the `provides` template variable (e.g. +`provides="vpkg-0.1_1"`). Packages that rely on the common functionality without concern for the +specific provider can declare a dependency on the virtual package name with the prefix `virtual?` +(e.g., `depends="virtual?vpkg-0.1_1"`). When a package is built by `xbps-src`, providers for any +virtual packages will be confirmed to exist and will be built if necessary. A map from virtual +packages to their default providers is defined in `etc/defaults.virtual`. Individual mappings can be +overridden by local preferences in `etc/virtual`. Comments in `etc/defaults.virtual` provide more +information on this map. Finally, as a general rule, if a package is built the exact same way whether or not a particular package is present in `makedepends` or `hostmakedepends`, that package shouldn't be added as a build time dependency. -#### Repositories +### Repositories -##### Repositories defined by Branch +#### Repositories defined by Branch The global repository takes the name of the current branch, except if the name of the branch is master. Then the resulting @@ -808,17 +854,19 @@ repository will be at the global scope. The usage scenario is that the user can update multiple packages in a second branch without polluting his local repository. -##### Package defined Repositories +#### Package defined Repositories The second way to define a repository is by setting the `repository` variable in a template. This way the maintainer can define repositories for a specific package or a group of packages. This is currently used to distinguish between -closed source packages, which are put in the `nonfree` repository and other -packages which are at the root-repository. +certain classes of packages. The following repository names are valid: -* `nonfree`: Repository for closed source packages. +* `bootstrap`: Repository for xbps-src-specific packages. +* `debug`: Repository for packages containing debug symbols. In almost all cases, + these packages are generated automatically. +* `nonfree`: Repository for packages that are closed source or have nonfree licenses. ### Checking for new upstream releases @@ -859,6 +907,10 @@ in url. Defaults to `(|v|$pkgname)[-_.]*`. part that follows numeric part of version directory in url. Defaults to `(|\.x)`. +- `disabled` can be set to disable update checking for the package, +in cases where checking for updates is impossible or does not make sense. +This should be set to a string describing why it is disabled. + ### Handling patches @@ -995,13 +1047,11 @@ system. Additional arguments may be passed to the `zig build` invocation using For packages that use the Python module build method (`setup.py` or [PEP 517](https://www.python.org/dev/peps/pep-0517/)), you can choose one of the following: -- `python-module` to build *both* Python 2.x and 3.x modules +- `python2-module` to build Python 2.x modules -- `python2-module` to build Python 2.x only modules +- `python3-module` to build Python 3.x modules -- `python3-module` to build Python 3.x only modules - -- `python3-pep517` to build Python 3.x only modules that provide a PEP 517 build description without +- `python3-pep517` to build Python 3.x modules that provide a PEP 517 build description without a `setup.py` script Environment variables for a specific `build_style` can be declared in a filename @@ -1020,8 +1070,7 @@ suitable environment for working with certain sets of packages. The current list of available `build_helper` scripts is the following: -- `rust` specifies environment variables required for cross-compiling crates via cargo and -for compiling cargo -sys crates. +- `cmake-wxWidgets-gtk3` sets the `WX_CONFIG` variable which is used by FindwxWidgets.cmake - `gir` specifies dependencies for native and cross builds to deal with GObject Introspection. The following variables may be set in the template to handle @@ -1031,6 +1080,20 @@ additional paths to be searched when linking target binaries to be introspected. `qemu--static` when running the target binary. You can for example specify `GIR_EXTRA_OPTIONS="-strace"` to see a trace of what happens when running that binary. +- `meson` creates a cross file, `${XBPS_WRAPPERDIR}/meson/xbps_meson.cross`, which configures +meson for cross builds. This is particularly useful for building packages that wrap meson +invocations (e.g., `python3-pep517` packages that use a meson backend) and is added by default +for packages that use the `meson` build style. + +- `numpy` configures the environment for cross-compilation of python packages that provide +compiled extensions linking to NumPy C libraries. If the `meson` build helper is also +configured, a secondary cross file, `${XBPS_WRAPPERDIR}/meson/xbps_numpy.cross`, will be +written to inform meson where common NumPy components may be found. + +- `python3` configures the cross-build environment to use Python libraries, header files, and +interpreter configurations in the target root. The `python3` helper is added by default for +packages that use the `python3-module` or `python3-pep517` build styles. + - `qemu` sets additional variables for the `cmake` and `meson` build styles to allow executing cross-compiled binaries inside qemu. It sets `CMAKE_CROSSCOMPILING_EMULATOR` for cmake and `exe_wrapper` for meson @@ -1044,7 +1107,9 @@ This aims to fix cross-builds for when the build-style is mixed: e.g. when in a `gnu-configure` style the configure script calls `qmake` or a `Makefile` in `gnu-makefile` style, respectively. -- `cmake-wxWidgets-gtk3` sets the `WX_CONFIG` variable which is used by FindwxWidgets.cmake +- `rust` specifies environment variables required for cross-compiling crates via cargo and +for compiling cargo -sys crates. This helper is added by default for packages that use the +`cargo` build style. ### Functions @@ -1160,6 +1225,11 @@ package accordingly. Additionally, the following functions are available: Outputs `-D=true` if the option is set, or `-D=false` otherwise. +- *vopt_feature()* `vopt_feature