Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

329.3. libretro-mupen64plus-next-20260912

Mupen64Plus-Next as a libretro core — Nintendo 64 emulator with the GLideN64 renderer

Version 20260912, release 2
Shelf libretro — RetroArch, its assets, databases and libretro cores
Phase 44_apps (Applications), 273 of 422 in build order
Licence GPL-2.0-or-later AND GPL-2.0-only
Homepage https://github.com/libretro/mupen64plus-libretro-nx
Build time 5.0 SBU
Installed size 4.3 MiB in 2 files
Recipe ports/core/libretro/libretro-mupen64plus-next/kpkgbuild

About

Mupen64Plus-Next is a Nintendo 64 emulator packaged as a libretro core: a shared object, mupen64plus_next_libretro.so, that retroarch loads from /usr/lib/libretro. It joins the Mupen64Plus core to the GLideN64 renderer, which draws through desktop OpenGL from mesa by way of libglvnd.

Sources

Dependencies

Depends on: nasm, pkgconf, mesa, libglvnd, zlib, libpng, minizip, xxhash.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 libretro-mupen64plus-next'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/libretro/libretro-mupen64plus-next.

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/libretro/libretro-mupen64plus-next
echo '78509e9787729aa0051915e646200ce21ab2d7e809318c9b1dfdaabcab2f067d  libretro-mupen64plus-next-20260912.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/libretro-mupen64plus-next
SRC=$SRC_ROOT/libretro-mupen64plus-next-20260912
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf libretro-mupen64plus-next-20260912.tar.gz -C "$SRC" --strip-components=1

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 _commit and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/gcc14.patch"
patch -p1 -i "$PORT_SRC/gcc15.patch"

export CFLAGS="$CFLAGS -I$(pkg-config --variable=includedir minizip)/minizip"
make platform=unix WITH_DYNAREC=x86_64 \
	SYSTEM_ZLIB=1 SYSTEM_LIBPNG=1 SYSTEM_MINIZIP=1 SYSTEM_XXHASH=1
install -Dm755 mupen64plus_next_libretro.so "$PKG/usr/lib/libretro/mupen64plus_next_libretro.so"
install -Dm644 LICENSE "$PKG/usr/share/licenses/$name/LICENSE"

The switches, and why each is set:

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/libretro-mupen64plus-next, 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 libretro-mupen64plus-next-20260912-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/libretro-mupen64plus-next, and runs the triggers its paths call for.

Contents

Installed directories: /usr/share/licenses/libretro-mupen64plus-next.

Notes

The CFLAGS line adds the minizip/ include directory by hand. The save-state code (mupen64plus-core/src/main/savestates.c) includes <unzip.h> and <zip.h> by bare name, while the minizip port’s minizip.pc gives only -I/usr/include, the directory above minizip/. The makefile appends its own flags to the exported CFLAGS, so the directory reaches every compile.

gcc14.patch carries three upstream commits, each with its own description. Of them, only the EmuThread change touches this build: the other two add defines to the branches of Makefile.common that compile the bundled minizip and zlib, which SYSTEM_MINIZIP=1 and SYSTEM_ZLIB=1 leave unused.