Building Cahute for macOS / OS X¶
Warning
In order to install Cahute on macOS / OS X, it is recommended to use one of the methods in Installing Cahute on macOS / OS X. However, if you wish to build Cahute manually, this guide is for you.
The following building methods are available.
Note
Since you will not be using a packaged version of Cahute, the project won’t be automatically updated when updating the rest of the system, which means you will need to do it manually, especially if a security update is made.
You can subscribe to releases by creating a Gitlab.com account, and following the steps in Get notified when a release is created. You can check your notification settings at any time in Notifications.
Building Cahute natively for macOS / OS X¶
This guide will assume you hae a POSIX or compatible shell, such as
bash
or zsh
.
Downloading the Cahute source¶
In order to get the current released version of the Cahute source, you have the following options:
You can download the latest source package:
curl -o cahute-0.6.tar.gz https://ftp.cahuteproject.org/releases/cahute-0.6.tar.gz tar xvaf cahute-0.6.tar.gz
You can clone the repository and checkout the tag corresponding to the release:
git clone https://gitlab.com/cahuteproject/cahute.git cahute-0.6 (cd cahute-0.6 && git checkout -f 0.6)
The project is present in the “cahute-0.6” directory.
Warning
If you are building the project in the context of the Creating a merge request guide, these commands need to be replaced by the following:
git clone <your-repo-url>
Where the repository’s URL can be obtained through the Code
button
on the Gitlab.com interface:
Installing the dependencies¶
Cahute depends on the following build-only dependencies:
cmake >= 3.16;
Python >= 3.8;
toml module for Python, either installed through pip or as a native package such as
python-toml
orpython3-toml
;GNU Make, pkg-config, and other C compilation and linking utilities.
It also depends on the following build and runtime dependencies:
In order to install the native dependencies, it is recommended you use Homebrew:
brew install cmake pkg-config python@3.12 libusb sdl2
You must also install the Python dependencies, by going to the parent directory
to the source, and creating a virtual environment within build/venv
using
the following commands:
python3 -m venv build/venv
source build/venv/bin/activate
python -m pip install toml
Building the project¶
You can now initialize the build directory by running the following command:
cmake -B build -S cahute-0.6 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release
Warning
The build initialization command must be run in the same shell as the one where the Python venv was initialized.
If you have created a new shell, you must run the following command beforehand:
source build/venv/bin/activate
Now that the build directory has been initialized, you can build using the following command:
cmake --build build
Note
This can be run in any shell, provided you adapt the path to be absolute
or relative to the current directory (e.g. cmake --build .
if within
the build directory), and the Python venv does not need to be
activated beforehand since CMake remembers it must use it.