Skip to content

Compile from source

Dimitris Panokostas edited this page Oct 9, 2024 · 9 revisions

Compiling Amiberry from source

Linux

You'll need the development version of the required packages. For example, on Debian-based distros:

  sudo apt install cmake libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libflac-dev libmpg123-dev libpng-dev libmpeg2-4-dev libserialport-dev libportmidi-dev

On Distros that use RPM instead (e.g. Fedora):

  sudo dnf install cmake SDL2-devel SDL2_ttf-devel SDL2_image-devel flac-devel libmpg123-devel libpng-devel libmpeg2-devel libserialport-devel portmidi-devel

Or if you're using an Arch-based distro (e.g. Manjaro), the relevant packages are:

  sudo pacman -S base-devel cmake sdl2 sdl2_ttf sdl2_image flac mpg123 libmpeg2 libserialport portmidi

macOS

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 dylibbundler wget

Clone this repository locally

  git clone https://github.com/BlitterStudio/amiberry
  cd amiberry

Build Amiberry

Amiberry requires 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

Local installation

You can use the following command to install Amiberry locally:

  sudo cmake --install build

Or combine it with a PREFIX to install it in a specific directory (the default is /usr/local/):

  sudo cmake --install build --prefix /opt

Packaging

There are currently several packaging options configured:

  • 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.

Clone this wiki locally