How to contribute to the xPack WineHQ
This page is designed for developers who plan to contribute new features or fix bugs in the xPack WineHQ project and provides documentation on how to build and test the package.
The xPack Build Box
The build scripts in this project use the xPack Build Box (XBB)
tools, which require the usual native development tools
(packed as a Docker image for GNU/Linux builds), complemented with
several binary packages, installed with xpm
as development dependencies.
For those interested in understanding how things work, a good starting point would be to read the XBB page.
The XBB tools are intended for building standalone relocatable distributions, thus are quite complex and perform several post-processing steps to adjust RPATH and validate the resulting binaries.
For the traditional configure && make install
builds specific to Linux,
these scripts are probably too complicated and therefore are not recommended
for inexperienced users.
xPack build configurations
The xPack Framework supports projects with multiple build configurations.
Build configurations are sets of properties, actions and dependencies that apply to a specific build. Build configurations can inherit from other build configurations.
For simple projects, the typical use case is with two configurations, Debug and Release.
For building the binary xPack executables, there is one configuration for each platform:
linux-x64
In case you wonder where these names come
from, they are exactly the Node.js process.platform
and process.arch
for each platform.
The build configurations are defined in the package.json
file, in the
xpack
section.
{
"...":"...",
"xpack": {
"buildConfigurations": {
"...": {
},
"win32-x64": {
"inherit": [
"common-dependencies",
"common-actions",
"common-docker"
],
"devDependencies": {
"@xpack-dev-tools/gcc": "13.2.0-2.1",
"@xpack-dev-tools/mingw-w64-gcc": "13.2.0-1.1",
"@xpack-dev-tools/wine": "8.0.2-1.1"
},
"properties": {
"dockerImage": "ilegeul/ubuntu:amd64-18.04-xbb-v5.2.2"
},
"actions": {
"build": "{{properties.commandBashBuild}} --windows",
"build-development": "{{properties.commandBashBuild}} --windows --development",
"build-development-debug": "{{properties.commandBashBuild}} --windows --development --debug",
"build-development-tests-only": "{{properties.commandBashBuild}} --windows --development --tests-only"
}
}
}
}
}
To ask xpm to perform a specific action on a given build configuration,
use the --config <name>
option.
For example:
xpm install --config darwin-x64
xpm run build --config darwin-x64
xpm/xPack actions
The xpm actions are extensions of npm scripts, i.e. named sequences
of commands that are invoked via xpm run <name>
to perform specific
operations.
together in a sub-shell .
The commands are invoked in a sub-shell with an adjusted PATH,
having the xpacks/.bin
folder prepended. This ensures the locally installed tools are
preferred to the system tools.
Actions can be defined for the entire project or for a specific build configuration.
The actions are defined in the package.json
file, in the
xpack
section, at the top or inside build configurations.
For those who, for various reasons, can not use xpm, it is perfectly possible to manually adjust the PATH and to invoke the sequence of commands in order, just that it is more tedious, since multiple substitutions must be performed to compose the commands.
Visual Studio Code integration
xpm/xPack actions and build configurations are supported in Visual Studio via the xPack C/C++ Managed Build Tools extension.
With this extension installed, xpm/xPack actions can be very conveniently invoked via a single mouse click, for example:
Prerequisites
The build scripts run on GNU/Linux and macOS. The Windows binaries are compiled on GNU/Linux, using mingw-w64.
For details on installing the prerequisites, please read the Build Prerequisites page.
Get project sources
The project is hosted on GitHub:
Branches
Apart from the unused master
branch, there are three active branches:
xpack
, with the latest stable version (default)xpack-development
, with the current development versionwebsite
, with the current content of the website
All development is done in the xpack-development
branch, and contributions via
Pull Requests should be directed to this branch.
When new releases are published, the xpack-development
branch is merged
into xpack
.
Pushes to the website
branch trigger a GitHub Action to generate
and publish the project web site.
To clone the stable branch (xpack
), run the following commands in a
terminal (on Windows use the Git Bash console):
rm -rf ~/Work/xpack-dev-tools/wine-xpack.git && \
git clone https://github.com/xpack-dev-tools/wine-xpack.git \
~/Work/xpack-dev-tools/wine-xpack.git
For development purposes, clone the xpack-development
branch.
rm -rf ~/Work/xpack-dev-tools/wine-xpack.git && \
mkdir -p ~/Work/xpack-dev-tools && \
git clone \
--branch xpack-development \
https://github.com/xpack-dev-tools/wine-xpack.git \
~/Work/xpack-dev-tools/wine-xpack.git
To contribute Pull Requests, fork the project and be sure the Copy the master branch only is disabled.
Use the xpack-development
branch and be sure you contribute the
Pull Requests back to the xpack-development
branch.
::
Get the writable helper sources (optional, for development purposes)
The project has a dependency to a common helper, that is
normally installed as a read-only dependency; for development
purposes, to be able to make changes to the scripts located inside the helper,
clone the xpack-development
branch and link it to
the user global xPacks store:
rm -rf ~/Work/xpack-dev-tools/xbb-helper-xpack.git && \
mkdir -p ~/Work/xpack-dev-tools && \
git clone \
--branch xpack-development \
https://github.com/xpack-dev-tools/xbb-helper-xpack.git \
~/Work/xpack-dev-tools/xbb-helper-xpack.git && \
xpm link -C ~/Work/xpack-dev-tools/xbb-helper-xpack.git
For more details the how a writable helper can be used via
xpm link
, please see the
XBB documentation.