-
-
Notifications
You must be signed in to change notification settings - Fork 91
Compile from source
You'll need the development version of the required packages. For example, on Debian-based distros:
sudo apt install build-essential git cmake libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libflac-dev libmpg123-dev libpng-dev libmpeg2-4-dev libserialport-dev libportmidi-dev libenet-dev
On Distros that use RPM instead (e.g. Fedora):
sudo dnf install gcc gcc-c++ git cmake SDL2-devel SDL2_ttf-devel SDL2_image-devel flac-devel libmpg123-devel libpng-devel libmpeg2-devel libserialport-devel portmidi-devel enet-devel
Or if you're using an Arch-based distro (e.g. Manjaro):
sudo pacman -S base-devel cmake sdl2 sdl2_ttf sdl2_image flac mpg123 libmpeg2 libserialport portmidi enet
Under macOS, you will need to install the required libraries using Homebrew:
brew install cmake sdl2 mpg123 sdl2_ttf sdl2_image flac libmpeg2 libserialport portmidi enet dylibbundler wget
Amiberry uses CMake to build. The following commands will create a build
directory, configure the build, and then compile the source code:
cmake -B build && cmake --build build
You can also use Ninja, if you prefer:
cmake -B build -G Ninja && cmake --build build
Note: The default install PREFIX that CMake uses, is /usr/local/
. Amiberry will use that internally, so if you want to change it, you should specify one during the configure stage.
E.g. for installing things under /opt
, you should use:
cmake -B build -G Ninja -DCMAKE_INSTALL_PREFIX=/opt && cmake --build build
Amiberry has a few different options that can be found in the main CMakeLists.txt
file. Some are disabled by default, as they are optional, others are enabled by default but can be turned off in order to build a minimal version with fewer external dependencies if the user wants.
The following options are enabled by default:
- USE_LIBSERIALPORT - Uses the libserialportfor serial port emulation
- USE_LIBENET - Use library enet for network emulation
- USE_PORTMIDI Use PortMidi for MIDI emulation
- USE_LIBMPEG2 - Use libmpeg2 for MPEG2 decoding (CD32 FMV)
The following CMake options are disabled by default. You can choose to enable them, if you want to use them (note that some require extra libraries):
- USE_GPIOD - Use libgpiod to control GPIO LEDs (Power, HDD, Floppy). Only makes sense on boards that have GPIO pins (e.g. Raspberry Pi). You will obviously need the library installed as well, to make use of this.
- USE_DBUS - Enable D-BUS to control the emulator from another application. Useful if you have another front-end that you want to use, instead of Amiberry's own GUI.
- USE_OPENGL - Use the OpenGL back-end with shader support. Currently not fully implemented! Do not enable!
By default, the build type is Release
, which creates optimized binaries without debug symbols. If you want to change that to Debug (useful if you want to use a debugger and troubleshoot something), add this to the first CMake command:
-DCMAKE_BUILD_TYPE=Debug
After the build is finished, you can use the following command to install Amiberry locally in the default PREFIX directory (/usr/local/
):
sudo cmake --install build
Or combine it with the same PREFIX you used in the configure step, to install it in a specific directory:
sudo cmake --install build --prefix /opt
After installation, you may want to update the relevant desktop, mime, and man databases accordingly, since that won't be done from CMake itself. For example (replace @CMAKE_INSTALL_PREFIX@
with your prefix):
update-desktop-database
update-mime-database "@CMAKE_INSTALL_PREFIX@/share/mime"
gtk-update-icon-cache -f -t "@CMAKE_INSTALL_PREFIX@/share/icons/hicolor"
There are currently several packaging options configured with CPack:
- TGZ (tar.gz) archive
- DragNDrop DMG image (macOS only)
- DEB package (Linux only)
- RPM package (Linux only)
By default, all the available packaging options for the platform will be built, unless you request a specific one. If you only want a specific one, use the -G <package>
parameter. For example, the following will only build the DEB
package on Linux:
cpack --config build/CPackConfig.cmake -G DEB
More documentation regarding packaging with CPack can be found here.
- First Installation
- RetroPie Installation
- Kickstart ROMs (BIOS)
- Compiling from source
- Frequently Asked Questions
- Default Options
- How to enable Integer Scaling