328.11. amiberry-8.3.0
Amiga emulator from the A500 to the A4000 and CD32, with WHDLoad booting and the AROS ROMs
| Version | 8.3.0, release 2 |
| Shelf | emulators — Standalone emulators of computers and consoles, and compatibility layers |
| Phase | 44_apps (Applications), 118 of 422 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://amiberry.com/ |
| Build time | 47.7 SBU |
| Installed size | 46.6 MiB in 43 files |
| Recipe | ports/core/emulators/amiberry/kpkgbuild |
About
Amiberry is an Amiga emulator, from the A500 to the A4000 and the CD32, built on SDL 3 with an ImGui interface. It boots WHDLoad game archives directly and installs AROS’s free Kickstart replacement ROMs, so it starts an Amiga with no ROM of the user’s own. Rendering is desktop OpenGL through libglvnd.
Sources
amiberry-8.3.0.tar.gz(17.3 MiB)
sha256881628c2465fe28063b8444350e78167e7a9ed047def66b9ef3cfdabd4bdc1d6
upstream: https://github.com/BlitterStudio/amiberry/archive/refs/tags/v8.3.0.tar.gz
archive copy: sources-2/emulators--amiberry-8.3.0.tar.gznativefiledialog-extended-e092bbb4578583c6fd0edc2cd14fb9c658194a4d.tar.gz(425.2 KiB)
sha256f6a68f6e24c3b6c1eab37daf35d068f9a2508df5b46692f2a0850164fe6c17f7
upstream: https://github.com/btzy/nativefiledialog-extended/archive/e092bbb4578583c6fd0edc2cd14fb9c658194a4d.tar.gz
archive copy: sources-2/emulators--nativefiledialog-extended-e092bbb4578583c6fd0edc2cd14fb9c658194a4d.tar.gz
Dependencies
Depends on: cmake, ninja, pkgconf, sdl3, sdl3-image, flac, mpg123, libpng, zlib, zstd, tinyxml2, curl, nlohmann-json, libserialport, enet, portmidi, libmpeg2, libpcap, dbus, wayland, wayland-protocols, libglvnd, mesa.
Required by: no port names it.
Optional, off in KDOS
These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.
-DUSE_GLES=OFF, line 31: mesa-DUSE_VULKAN=OFF, line 32: vulkan-loader-DUSE_GPIOD=OFF, line 45: libgpiod (explained with the switches below)-DUSE_DBUS=OFF, line 46: dbus (explained with the switches below)
Patches
build.sh applies these; kpkg applies nothing by itself.
musl-null.patch— Insrc/custom.cpp, casts0instead ofNULLto theuaecptraddress type in two custom-chip writes. musl definesNULLin C++ asnullptr, whichstatic_castcannot turn into an integer.no-update-check.patch— Makesget_update_method()returnDISABLEDon Linux. Upstream returnsNOTIFY_ONLYunlessFLATPAK_IDis set, and at start-up queries GitHub’s release API for a newer Amiberry when the update check is enabled. The WHDLoad-database download the user starts is untouched.system-tinyxml2.patch— Dropssrc/tinyxml2.cppfrom the source list and links thetinyxml2::tinyxml2target of the tinyxml2 port instead;build.shdeletes the bundledtinyxml2.cppandtinyxml2.h, so the program cannot compile against its own copy by accident.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install amiberry'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/emulators/amiberry.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/emulators/amiberry
echo '881628c2465fe28063b8444350e78167e7a9ed047def66b9ef3cfdabd4bdc1d6 amiberry-8.3.0.tar.gz' | sha256sum -c -
echo 'f6a68f6e24c3b6c1eab37daf35d068f9a2508df5b46692f2a0850164fe6c17f7 nativefiledialog-extended-e092bbb4578583c6fd0edc2cd14fb9c658194a4d.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/amiberry
SRC=$SRC_ROOT/amiberry-8.3.0
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf amiberry-8.3.0.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf nativefiledialog-extended-e092bbb4578583c6fd0edc2cd14fb9c658194a4d.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _nfd and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
rmdir external/nativefiledialog-extended
mv "$SRC_ROOT/nativefiledialog-extended-$_nfd" external/nativefiledialog-extended
rmdir external/nativefiledialog-extended/3ps/wayland-protocols
ln -s /usr/share/wayland-protocols external/nativefiledialog-extended/3ps/wayland-protocols
patch -p1 -i "$PORT_SRC/no-update-check.patch"
patch -p1 -i "$PORT_SRC/musl-null.patch"
patch -p1 -i "$PORT_SRC/system-tinyxml2.patch"
rm src/tinyxml2.cpp src/include/tinyxml2.h
export CFLAGS="$CFLAGS -D_LARGEFILE64_SOURCE"
export CXXFLAGS="$CXXFLAGS -D_LARGEFILE64_SOURCE"
mkdir build && cd build
cmake .. -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSE_OPENGL=ON \
-DUSE_GLES=OFF \
-DUSE_VULKAN=OFF \
-DUSE_JIT=ON \
-DUSE_PCEM=ON \
-DUSE_PPC=ON \
-DUSE_QEMU_PPC=ON \
-DUSE_LIBSERIALPORT=ON \
-DUSE_LIBENET=ON \
-DUSE_PORTMIDI=ON \
-DUSE_LIBMPEG2=ON \
-DUSE_MPG123=ON \
-DUSE_UAENET_PCAP=ON \
-DUSE_UAENET_TAP=ON \
-DUSE_ZSTD=ON \
-DUSE_GPIOD=OFF \
-DUSE_DBUS=OFF \
-DUSE_IPC_SOCKET=ON \
-DWITH_LTO=OFF \
-DWITH_OPTIMIZE=OFF \
-DBUNDLE_SDL=OFF
ninja
DESTDIR=$PKG ninja install
cd ..
cat > "$PKG/usr/share/applications/Amiberry.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=Amiberry
GenericName=Amiga Emulator
Comment=Emulate the Commodore Amiga, from the A500 to the A4000 and CD32
TryExec=amiberry
Exec=amiberry %f
Icon=amiberry
Terminal=false
StartupWMClass=amiberry
MimeType=application/x-SPS-virtual-media-image;application/x-DMS-compressed-disk-image;application/x-amiga-disk-image;application/x-WHDLoad-game-archive;application/x-UAE-savestate-file;application/vnd.cloanto.rp9;
Categories=Game;Emulator;
Keywords=amiga;emulator;retro;commodore;a500;a1200;a4000;cd32;whdload;uae;
DESKTOP
chmod 644 "$PKG/usr/share/applications/Amiberry.desktop"
The switches, and why each is set:
-D_LARGEFILE64_SOURCE— Added toCFLAGSandCXXFLAGS. Amiberry’szfile.cppand the bundled CAPS image library call the*64file functions (fopen64,fseeko64,ftello64), which musl declares only under this macro.-DUSE_OPENGL=ON— With-DUSE_GLES=OFFand-DUSE_VULKAN=OFF: desktop OpenGL, through libglvnd and mesa. These are upstream’s defaults, named; upstream calls its Vulkan renderer experimental and exclusive of OpenGL.-DUSE_JIT=ON— The 68k JIT recompiler, for x86_64 and AArch64. Upstream’s default, named.-DUSE_PCEM=ON— The PCem code that emulates the x86 bridgeboards. Upstream’s default, named.-DUSE_PPC=ON— With-DUSE_QEMU_PPC=ON: support for the PowerPC accelerator boards and for the QEMU-UAE PowerPC plugin that runs their CPU. The plugin itself is not a KDOS port, so a PowerPC board is configurable but has no CPU to run.-DUSE_LIBSERIALPORT=ON— With-DUSE_LIBENET=ON,-DUSE_PORTMIDI=ON,-DUSE_LIBMPEG2=ON,-DUSE_MPG123=ON,-DUSE_UAENET_PCAP=ON,-DUSE_UAENET_TAP=ONand-DUSE_ZSTD=ON: serial port emulation through libserialport, networking through enet and through libpcap or a TAP device, MIDI through portmidi, CD32 full-motion video through libmpeg2, MP3 CD tracks through mpg123, and CHD compressed disk images through zstd. All are upstream’s defaults, named. Configure stops when libpcap or mpg123 is missing, but a missing libserialport, enet, portmidi or zstd costs only aSTATUSmessage and the feature; every one of these libraries is independs.-DUSE_GPIOD=OFF— No GPIO-driven LEDs, a feature for single-board computers. Upstream’s default, named.-DUSE_DBUS=OFF— No D-Bus remote-control interface. Upstream’s default, named;-DUSE_IPC_SOCKET=ON, its Unix-socket counterpart, stays on.-DWITH_LTO=OFF— With-DWITH_OPTIMIZE=OFF: no link-time optimisation and none of upstream’s native-CPU tuning, which would tie the binary to the processor that built it. Upstream’s defaults, named.-DBUNDLE_SDL=OFF— Links the system sdl3 and does not copy SDL’s shared libraries into the package, an option upstream offers for distributions without SDL 3. Upstream’s default, named.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/amiberry, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf amiberry-8.3.0-2.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/amiberry, and runs the triggers its paths call for.
Contents
Installed programs: amiberry.
Installed directories: /usr/lib/amiberry, /usr/share/amiberry, /usr/share/doc/amiberry, /usr/share/licenses/amiberry.
Short descriptions
amiberry |
An optimized Amiga emulator for Linux/macOS |
Notes
The native file dialogs, nativefiledialog-extended, are a git submodule that the release archive leaves empty; without them the build falls back to its own ImGui file dialog. The recipe fetches a commit of it as a second source, _nfd in kpkgbuild, and build.sh moves it into external/nativefiledialog-extended. Amiberry builds it with NFD_PORTAL forced on, so it opens the file chooser of xdg-desktop-portal over D-Bus and links no GTK. Its Wayland code is generated from the xdg-foreign protocol in another submodule, 3ps/wayland-protocols, empty in the commit archive too; build.sh replaces that directory with a symbolic link to /usr/share/wayland-protocols, which is why wayland-protocols is in depends.
The AROS Kickstart ROMs and the WHDLoad boot binaries the package installs are 68k code for the emulated machine, one of the payloads the tree does not compile (see What is built from source).
Upstream’s desktop entry is replaced by one without application/x-cue: a cue sheet is any CD image, and its default player should not be an Amiga emulator.