Skip to main content

Prerequisites for building xPack Binary Development Tools

The scripts utilised to build the xPack Binary Development Tools are based on the xPack Build Box (XBB) v5.1.0.

The build scripts run on GNU/Linux and macOS.

The Windows binaries are generated on x64 GNU/Linux, using mingw-w64.

The macOS builds run natively on x64 and arm64 machines, and apart from the usual Command Line Tools (provided by Apple) and xpm, the host machine has no other special requirements.

The prerequisites are:

  • npm (shipped with Node.js; installed via nvm)
  • xpm (installed via npm)
  • the Command Line Tools from Apple

Some build scripts may require Python 3. On modern systems, it should be available in the standard Apple distribution. If not, install it from Python downloads.

For development builds, the procedure can be executed on a recent macOS version (currently tested up to 14.6).

For production builds it is recommended to use a slightly older version, for example macOS 10.13 is a good compromise.

It is not mandatory to have a physical macOS 10.13 machine, a virtual machine is also perfectly fine. Both Parallels and VirtualBox were tested and found to be functional (although VirtualBox was not as stable as Parallels).

The build scripts were tested on:

  • macOS 14.6.1, running on an x64 MacMini
  • macOS 12.6.8, running on an x64 MacMini
  • macOS 10.14, running on a Intel NUC NUC8i7BEH
  • macOS 10.13, running inside a Parallels virtual machine
  • macOS 11.7.4, running on an Apple Silicon MacMini

npm/xpm

Quick instructions

If you are confident in your knowledge and prefer a shortcut, copy and paste the following script into a terminal (otherwise, perform the steps one by one).

caution

For security reasons, conscientious users should first check the content of the file before executing it.

mkdir -pv "${HOME}/Downloads/"
curl --output "${HOME}/Downloads/install-nvm-node-npm-xpm.sh" https://raw.githubusercontent.com/xpack/assets/master/scripts/install-nvm-node-npm-xpm.sh
cat "${HOME}/Downloads/install-nvm-node-npm-xpm.sh"

bash "${HOME}/Downloads/install-nvm-node-npm-xpm.sh"

exit

This script will install nvm (the Node Version Manager), node, npm and xpm.

info

To activate nvm automatically, the script adds several lines to the shell initialisation script.

info

When running on macOS this script also installs the Command Line Tools.

node/npm

npm is included with Node.js and is required to install xpm.

For full details on installing Node.js, please refer to the xPack prerequisites page.

caution

Ensure you do not install npm with administrative rights, such as via a system package manager. Instead, use nvm as instructed to avoid permission-related issues.

xpm

xpm is a portable Node.js command line application.

If you followed the Quick instructions, it is already installed.

Otherwise, to install it, follow the steps in the xpm install page.

If you are confident in your knowledge and prefer a shortcut, issue the following command:"

npm install --global xpm@latest

The Command Line Tools

The macOS compiler and other development tools are included in a separate Xcode add-on. The best place to obtain it is from the Apple Developer Downloads site, although this might require enrolling in the developer program (free of charge).

If you followed the Quick instructions, CLT should be already installed.

Otherwise, the recommended method is to install the Command Line Tools separately via the command line:

% xcode-select --install
% xcode-select -p
/Library/Developer/CommandLineTools
$ gcc --version
Apple clang version 15.0.0 (clang-1500.3.9.4)
Target: x86_64-apple-darwin23.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
info

Xcode alone includes the compiler in the Xcode.app folder, which may vary in different versions; for a stable configuration it is necessary to install the CommandLineTools package.

No macOS Docker

Due to the specifics of macOS, Docker cannot run natively; instead, it uses a GNU/Linux virtual machine running in Apple HyperKit (Apple's virtualization framework), and a file system compatibility layer.

The end result is that Docker runs slowly, consumes a lot of memory, and is not reliable, so it is not recommended to run the Linux/Windows builds on macOS.

Visual Studio Code

Although not mandatory, VS Code is a valuable addition to the development environment. With the xPack extension, some actions are just a mouse click away.