328.12. ppsspp-1.20.4
PlayStation Portable emulator, OpenGL and Vulkan, drawn through SDL
| Version | 1.20.4, release 1 |
| Shelf | emulators — Standalone emulators of computers and consoles, and compatibility layers |
| Phase | 44_apps (Applications), 119 of 422 in build order |
| Licence | GPL-2.0-or-later |
| Homepage | https://www.ppsspp.org/ |
| Build time | 17.1 SBU |
| Installed size | 43.4 MiB in 154 files |
| Recipe | ports/core/emulators/ppsspp/kpkgbuild |
About
PPSSPP is a PlayStation Portable emulator. The port builds its SDL front end, PPSSPPSDL, on sdl2-compat, drawing with desktop OpenGL through libglvnd or with Vulkan presented through the Wayland WSI. Its interface is its own, drawn in the game window, so no toolkit is linked.
Sources
ppsspp-1.20.4.tar.xz(58.0 MiB)
sha2564de21db3105d9d81a465a8a7e78c68ee3c0e0bf6597d1c1d530f7555f3ad8b31
upstream: https://github.com/hrydgard/ppsspp/releases/download/v1.20.4/ppsspp-1.20.4.tar.xz
archive copy: sources-2/emulators--ppsspp-1.20.4.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, python3, sdl2-compat, sdl2-ttf, fontconfig, ffmpeg, libpng, zlib, zstd, libzip, rapidjson, miniupnpc, libglvnd, mesa, vulkan-loader, wayland, glew.
Required by: no port names it.
Patches
build.sh applies these; kpkg applies nothing by itself.
no-version-check.patch— Takes Linux out of the platforms for whichConfig::SupportsUpgradeCheck()is true. Upstream fetcheshttp://www.ppsspp.org/version.jsonon every fifth start while the default-on “check for new version” setting stays on.
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 ppsspp'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/emulators/ppsspp.
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/ppsspp
echo '4de21db3105d9d81a465a8a7e78c68ee3c0e0bf6597d1c1d530f7555f3ad8b31 ppsspp-1.20.4.tar.xz' | 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/ppsspp
SRC=$SRC_ROOT/ppsspp-1.20.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf ppsspp-1.20.4.tar.xz -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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/no-version-check.patch"
mkdir build && cd build
cmake .. -G Ninja \
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DUSING_QT_UI=OFF \
-DUSING_GLES2=OFF \
-DUSING_EGL=OFF \
-DUSING_FBDEV=OFF \
-DUSING_X11_VULKAN=OFF \
-DUSE_WAYLAND_WSI=ON \
-DUSE_VULKAN_DISPLAY_KHR=OFF \
-DUSE_FFMPEG=ON \
-DUSE_SYSTEM_FFMPEG=ON \
-DUSE_SYSTEM_LIBSDL2=ON \
-DUSE_SYSTEM_LIBPNG=ON \
-DUSE_SYSTEM_LIBZIP=ON \
-DUSE_SYSTEM_ZSTD=ON \
-DUSE_SYSTEM_RAPIDJSON=ON \
-DUSE_MINIUPNPC=ON \
-DUSE_SYSTEM_MINIUPNPC=ON \
-DUSE_SYSTEM_SNAPPY=OFF \
-DUSE_SYSTEM_LIBCHDR=OFF \
-DUSE_SYSTEM_FREETYPE=ON \
-DUSE_DISCORD=OFF \
-DUSE_CCACHE=OFF \
-DHEADLESS=OFF \
-DUNITTEST=OFF \
-DATLAS_TOOL=OFF \
-DGOLD=OFF
ninja
DESTDIR=$PKG ninja install
test ! -e "$PKG/usr/include"
cd ..
find "$PKG/usr/share/ppsspp/assets/lang" -name '*.ini' ! -name en_US.ini -delete
cat > "$PKG/usr/share/applications/PPSSPPSDL.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=PPSSPP
GenericName=PSP Emulator
Comment=Emulate the Sony PlayStation Portable
TryExec=PPSSPPSDL
Exec=PPSSPPSDL %f
Icon=ppsspp
Terminal=false
StartupWMClass=PPSSPPSDL
MimeType=application/x-compressed-iso;
Categories=Game;Emulator;
Keywords=sony;playstation;portable;psp;handheld;emulator;
DESKTOP
chmod 644 "$PKG/usr/share/applications/PPSSPPSDL.desktop"
The switches, and why each is set:
-DUSING_QT_UI=OFF— The SDL front end, not upstream’s Qt wrapper around it.-DUSING_GLES2=OFF— With-DUSING_EGL=OFFand-DUSING_FBDEV=OFF: desktop OpenGL, with the GL context made by SDL, rather than OpenGL ES on EGL or a framebuffer device as on embedded boards.-DUSING_X11_VULKAN=OFF— No Xlib surface for Vulkan; upstream’s default is on. sdl2-compat is built with-DSDL2COMPAT_X11=OFF, so there is no X11 window to hand it.-DUSE_WAYLAND_WSI=ON— Vulkan presents through its Wayland surface. Upstream’s default, named.-DUSE_VULKAN_DISPLAY_KHR=OFF— No Vulkan full-screen output straight to a display, outside any compositor.-DUSE_FFMPEG=ON— With-DUSE_SYSTEM_FFMPEG=ON: the decoding behind the PSP’s video playback (MediaEngine), through the ffmpeg port. WithoutUSE_SYSTEM_FFMPEG, upstream links the libraries under itsffmpeg/<platform>/lib, which its own scripts inffmpeg/build from an FFmpeg copy in the archive and which the release archive leaves empty.-DUSE_SYSTEM_LIBSDL2=ON— With-DUSE_SYSTEM_LIBPNG=ON,-DUSE_SYSTEM_LIBZIP=ON,-DUSE_SYSTEM_ZSTD=ON,-DUSE_SYSTEM_RAPIDJSON=ONand-DUSE_SYSTEM_FREETYPE=ON: links the tree’s SDL, libpng, libzip, zstd, RapidJSON and FreeType. All but SDL have a copy underext/that is compiled otherwise; the system SDL is upstream’s default everywhere but macOS, named.-DUSE_MINIUPNPC=ON— With-DUSE_SYSTEM_MINIUPNPC=ON: UPnP port forwarding for ad hoc network play, through the miniupnpc port; PPSSPP uses it only when the user turns it on.-DUSE_SYSTEM_SNAPPY=OFF— With-DUSE_SYSTEM_LIBCHDR=OFF: snappy and libchdr, the CHD disc image reader, are compiled from the copies inext/. libchdr is not a KDOS port.-DUSE_DISCORD=OFF— No Discord rich presence, which upstream builds by default fromext/discord-rpc.-DUSE_CCACHE=OFF— Does not wrap the compiler in ccache when one is found.-DHEADLESS=OFF— With-DUNITTEST=OFFand-DATLAS_TOOL=OFF: none of the developer targets, thePPSSPPHeadlesstest runner, the unit tests, or the tool that generates the font atlases.-DGOLD=OFF— Upstream’s default, named.GOLDbuilds the paid “PPSSPP Gold” edition, whose binary isPPSSPPGold; off, the binary isPPSSPPSDL, the name the desktop entry runs.
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/ppsspp, 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 ppsspp-1.20.4-1.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/ppsspp, and runs the triggers its paths call for.
Contents
Installed programs: PPSSPPSDL.
Installed directories: /usr/share/licenses/ppsspp, /usr/share/ppsspp.
Notes
test ! -e "$PKG/usr/include" stops the build if the install puts anything under /usr/include, so no header of a library compiled from ext/ can reach the package beside the program.
build.sh deletes every interface translation in /usr/share/ppsspp/assets/lang but en_US.ini. These .ini files are not message catalogs, so the package-wide English-only rule (see Size and language policy) does not reach them; PPSSPP falls back to en_US for every string.
Upstream’s desktop entry is replaced. Its StartupWMClass names an identifier the SDL front end never sets, where SDL’s Wayland app_id is the executable’s name, and its MimeType claims every CD image and every ZIP file; this entry claims only application/x-compressed-iso, which upstream’s assets/mime/ppsspp.xml defines.