[Scummvm-git-logs] scummvm master -> f01ff7e337f5c0eec8ddaf1eae5e98506f47969f

lotharsm noreply at scummvm.org
Tue Mar 24 16:48:07 UTC 2026


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
f01ff7e337 DISTS: RPI: Initial import of AppImage scripts


Commit: f01ff7e337f5c0eec8ddaf1eae5e98506f47969f
    https://github.com/scummvm/scummvm/commit/f01ff7e337f5c0eec8ddaf1eae5e98506f47969f
Author: Lothar Serra Mari (mail at serra.me)
Date: 2026-03-24T17:47:01+01:00

Commit Message:
DISTS: RPI: Initial import of AppImage scripts

Warning: These scripts are for reference only and not meant
for production use on a modern Raspberry Pi system.

It will very likely brick your system.

Changed paths:
  A dists/raspberrypi/README.md
  A dists/raspberrypi/appimage-build.sh
  A dists/raspberrypi/scummvm.wrapper


diff --git a/dists/raspberrypi/README.md b/dists/raspberrypi/README.md
new file mode 100644
index 00000000000..9e547820b55
--- /dev/null
+++ b/dists/raspberrypi/README.md
@@ -0,0 +1,19 @@
+# ScummVM AppImage build scripts for Raspberry Pi
+
+This is the initial import of felsqualle's Raspberry Pi build scripts written in 2023.
+They act as a template for future development of an AppImage container and possibly
+other formats for this platform, like other forms of static builds or maybe even
+self-containing SD card images.
+
+## Warning
+The scripts in their current state are *highly* experimental. They are targeting
+the Raspberry Pi 4/400, using an old version of Debian/Raspberry Pi OS.
+
+Running these scripts without modification on a modern installation of Raspberry Pi OS
+will *very likely* destroy your system. There's no containerization, no chroot, nothing.
+The build script runs directly on your host system without any isolation.
+
+*Do not use it if you don't know exactly what you are doing*
+
+This set of scripts will also act as a template for felsqualle's future
+development on the Raspberry Pi, so stay tuned.
diff --git a/dists/raspberrypi/appimage-build.sh b/dists/raspberrypi/appimage-build.sh
new file mode 100644
index 00000000000..e807f5188fd
--- /dev/null
+++ b/dists/raspberrypi/appimage-build.sh
@@ -0,0 +1,190 @@
+#!/bin/bash
+
+export VERSION="2.2.0"
+export SCRIPT_DIRECTORY=$(pwd)
+
+# This script needs to be run with superuser privileges, e.g. via sudo.
+# It automatically prepares a build environment for a ScummVM AppImage bundle
+# and builds the image afterwards.
+#
+# Intended for building a ScummVM AppImage for the
+# Raspberry Pi 3+ and higher, up to the Raspberry Pi 400
+# and running on top of the Raspberry Pi OS (32 bit version/armhf)
+# 
+# WARNING: This script will modify your host system!
+#          I recommend to use a separate SD card for building those images,
+#          unless you don't mind having some additional packages installed on your system. 
+
+#
+# Begin.
+#
+
+# Download required ScummVM build dependencies:
+apt install g++ \
+            build-essential \
+            git \
+            liba52-dev \
+            libjpeg62-turbo-dev \
+            libmpeg2-4-dev \
+            libogg-dev \
+            libvorbis-dev \
+            libgtk-3-dev \
+            libflac-dev \
+            libmad0-dev \
+            libpng-dev \
+            libtheora-dev \
+            libfaad-dev \
+            libfluidsynth-dev \
+            libfreetype6-dev \
+            zlib1g-dev \
+            libfribidi-dev \
+            libglew-dev \
+            libsdl2-dev \
+            libsdl2-net-dev \
+            libcurl4-openssl-dev \
+            libspeechd-dev -y
+
+# Download required AppImage and linuxdeploy build dependencies
+apt install cmake \
+            autopoint \
+            automake \
+            libtool \
+            libfuse-dev \
+            libglib2.0-dev \
+            libcairo2-dev \
+            libssl-dev \
+            cimg-dev \
+            patchelf \
+            squashfs-tools -y
+
+# Build AppImage toolchain if necessary
+if ! which appimagetool; then
+    git clone https://github.com/AppImage/AppImageKit /tmp/AppImageKit/
+    cd /tmp/AppImageKit/
+    git submodule update --init --recursive
+    cmake . -DUSE_CCACHE=OFF
+    make -j$(nproc)
+    make install
+    cp -a /tmp/AppImageKit/src/appimagetool /usr/local/bin/
+    cp -a /tmp/AppImageKit/src/AppRun /usr/local/bin/
+    cp -a /tmp/AppImageKit/src/digest /usr/local/bin/
+    cp -a /tmp/AppImageKit/src/runtime /usr/local/bin/
+    cp -a /tmp/AppImageKit/src/validate /usr/local/bin/
+    cp -a /tmp/AppImageKit/src/embed-magic-bytes-in-file.sh /usr/local/bin/
+    cd ..
+    rm -rf /tmp/AppImageKit/
+fi
+
+# Build linuxdeploy if necessary
+if ! which linuxdeploy; then
+    git clone https://github.com/linuxdeploy/linuxdeploy /tmp/linuxdeploy/
+    cd /tmp/linuxdeploy
+    git submodule update --init --recursive
+    cmake . -DUSE_CCACHE=OFF
+    make -j$(nproc)
+    make install
+    cp -a /tmp/linuxdeploy/bin/* /usr/local/bin/
+    cd ..
+    rm -rf /tmp/linuxdeploy
+fi
+
+# Build linuxdeploy-plugin-appimage if necessary
+if ! which linuxdeploy-plugin-appimage; then
+    git clone https://github.com/linuxdeploy/linuxdeploy-plugin-appimage /tmp/linuxdeploy-plugin-appimage
+    cd /tmp/linuxdeploy-plugin-appimage
+    git submodule update --init --recursive
+    cmake . -DUSE_CCACHE=OFF
+    make -j$(nproc)
+    make install
+    cd ..
+    rm -rf /tmp/linuxdeploy-plugin-appimage
+fi
+
+# Create new temporary directory, clean if necessary
+mkdir -p    /tmp/scummvm-appimage-builds/
+rm -rf      /tmp/scummvm-appimage-builds/*
+
+# Build zenity, so we can bundle it with the AppImage
+git clone https://gitlab.gnome.org/GNOME/zenity /tmp/zenity
+cd /tmp/zenity
+./autogen.sh
+# Patch broken zenity configure script
+sed -i s'/AX_CHECK_ENABLE_DEBUG(yes,GNOME_ENABLE_DEBUG)/#AX_CHECK_ENABLE_DEBUG(yes,GNOME_ENABLE_DEBUG)/g' configure
+./configure
+make -j$(nproc)
+strip --strip-all /tmp/zenity/src/zenity
+
+# Fetch ScummVM sources
+git clone https://github.com/scummvm/scummvm /tmp/scummvm-appimage-builds/scummvm-src
+git -C /tmp/scummvm-appimage-builds/scummvm-src checkout tags/v${VERSION}
+
+# Build ScummVM
+cd /tmp/scummvm-appimage-builds/scummvm-src
+CXXFLAGS="$CXXFLAGS -fuse-ld=gold -flto=$(nproc) -ffunction-sections -fdata-sections" \
+LDFLAGS="$LDFLAGS   -fuse-ld=gold -flto=$(nproc) -Wl,--gc-sections" \
+./configure \
+    --prefix=../scummvm-build \
+    --datadir=../scummvm-build/share/scummvm \
+    \
+    --disable-debug \
+    --enable-release
+
+CXXFLAGS="$CXXFLAGS -fuse-ld=gold -flto=$(nproc) -ffunction-sections -fdata-sections" \
+LDFLAGS="$LDFLAGS   -fuse-ld=gold -flto=$(nproc) -Wl,--gc-sections" \
+make -j$(nproc)
+strip --strip-all scummvm
+make install
+cd ../../
+
+# Create ScummVM desktop file
+cat << EOF >> /tmp/scummvm-appimage-builds/scummvm-build/scummvm.desktop
+[Desktop Entry]
+Name=ScummVM
+Comment=Interpreter for numerous adventure games and RPGs
+Comment[pl]=Interpreter graficznych gier przygodowych
+Comment[sv]=Tolk för flera äventyrsspel
+Comment[he]=פרשן למספר משחקי הרפתקאות
+Comment[de]=Interpreter für zahlreiche Abenteuerspiele und RPGs
+Comment[es]=Intérprete para varias aventuras gráficas
+Comment[ca]=Intèrpret per diverses aventures gràfiques
+Exec=scummvm.wrapper
+Icon=scummvm
+Terminal=false
+Type=Application
+Categories=Game;AdventureGame;
+StartupNotify=false
+EOF
+
+# Remove duplicate binary
+rm -rf /tmp/scummvm-appimage-builds/scummvm-build/usr/bin/scummvm
+
+# Add zenity and scummmvm.wrapper script for AppImage desktop integration
+cp /tmp/zenity/src/zenity /tmp/scummvm-appimage-builds/scummvm-build/bin/zenity
+cp /tmp/zenity/src/zenity.ui /tmp/scummvm-appimage-builds/scummvm-build/bin/zenity.ui
+cp $SCRIPT_DIRECTORY/scummvm.wrapper /tmp/scummvm-appimage-builds/scummvm-build/bin/scummvm.wrapper
+chmod +x /tmp/scummvm-appimage-builds/scummvm-build/bin/scummvm.wrapper
+
+# Copy ScummVM icon from source
+mkdir -p /tmp/scummvm-appimage-builds/scummvm-build/usr/share/icons/hicolor/128x128/apps/
+wget https://github.com/scummvm/scummvm-media/raw/master/scummvm_icon_128.png -O /tmp/scummvm-appimage-builds/scummvm-build/usr/share/icons/hicolor/128x128/apps/scummvm.png
+
+# Build the AppImage
+linuxdeploy   --appdir=/tmp/scummvm-appimage-builds/scummvm-build/ \
+              --executable=/tmp/scummvm-appimage-builds/scummvm-build/bin/scummvm \
+              --custom-apprun=/tmp/scummvm-appimage-builds/scummvm-build/bin/scummvm.wrapper \
+              -d /tmp/scummvm-appimage-builds/scummvm-build/scummvm.desktop \
+              -i /tmp/scummvm-appimage-builds/scummvm-build/usr/share/icons/hicolor/128x128/apps/scummvm.png \
+              -o appimage
+
+mv /tmp/ScummVM-$VERSION*.AppImage $SCRIPT_DIRECTORY/
+
+# Cleanup
+cd /tmp/scummvm-appimage-builds/scummvm-src/
+make uninstall
+cd ..
+
+rm -rf /tmp/zenity
+rm -rf /tmp/scummvm-appimage-builds
+
+# Done
+echo "Done!"
\ No newline at end of file
diff --git a/dists/raspberrypi/scummvm.wrapper b/dists/raspberrypi/scummvm.wrapper
new file mode 100644
index 00000000000..dadd734abfc
--- /dev/null
+++ b/dists/raspberrypi/scummvm.wrapper
@@ -0,0 +1,291 @@
+#!/bin/bash
+#
+# SOURCE: https://github.com/aferrero2707/gimp-appimage/blob/master/appimage-helper-scripts/app.wrapper
+#
+# The purpose of this script is to provide lightweight desktop integration
+# into the host system without special help from the host system.
+# If you want to use it, then place this in usr/bin/$APPNAME.wrapper
+# and set it as the Exec= line of the .desktop file in the AppImage.
+#
+# For example, to install the appropriate icons for Scribus,
+# put them into the AppDir at the following locations:
+#
+# ./usr/share/icons/default/128x128/apps/scribus.png
+# ./usr/share/icons/default/128x128/mimetypes/application-vnd.scribus.png
+#
+# Note that the filename application-vnd.scribus.png is derived from
+# and must be match MimeType=application/vnd.scribus; in scribus.desktop
+# (with "/" characters replaced by "-").
+#
+# Then, change Exec=scribus to Exec=scribus.wrapper and place the script
+# below in usr/bin/scribus.wrapper and make it executable.
+# When you run AppRun, then AppRun runs the wrapper script below
+# which in turn will run the main application.
+#
+# TODO:
+# Handle multiple versions of the same AppImage?
+# Handle removed AppImages? Currently we are just setting TryExec=
+# See http://specifications.freedesktop.org/thumbnail-spec/thumbnail-spec-latest.html#DELETE
+# Possibly move this to the C runtime that is part of every AppImage?
+
+# Exit on errors
+set -e
+
+# Be verbose if $DEBUG=1 is set
+if [ ! -z "$DEBUG" ] ; then
+  env
+  set -x
+fi
+
+THIS="$0"
+args=("$@") # http://stackoverflow.com/questions/3190818/
+NUMBER_OF_ARGS="$#"
+
+# Please do not change $VENDORPREFIX as it will allow for desktop files
+# belonging to AppImages to be recognized by future AppImageKit components
+# such as desktop integration daemons
+VENDORPREFIX=appimagekit
+
+log () {
+  echo "$@" 1>&2
+}
+
+find-up () {
+  path="$(dirname "$(readlink -f "${THIS}")")"
+  while [[ "$path" != "" && ! -e "$path/$1" ]]; do
+    path=${path%/*}
+  done
+  echo -n "$path" # Needs to return something
+}
+
+if [ -z $APPDIR ] ; then
+  # Find the AppDir. It is the directory that contains AppRun.
+  # This assumes that this script resides inside the AppDir or a subdirectory.
+  # If this script is run inside an AppImage, then the AppImage runtime
+  # likely has already set $APPDIR
+  APPDIR=$(find-up "AppRun")
+fi
+export PATH="$PATH:$APPDIR/bin/:$APPDIR/share/:$APPDIR/share/scummvm/:$APPDIR/share/zenity/"
+FILENAME="$(readlink -f "${THIS}")"
+DIRNAME=$(dirname $FILENAME)
+
+DESKTOPFILE=$(find "$APPDIR" -maxdepth 1 -name "*.desktop" | head -n 1)
+DESKTOPFILE_NAME=$(basename "${DESKTOPFILE}")
+
+APP_FULL=$(sed -n -e 's/^Name=//p' "${DESKTOPFILE}" | head -n 1)
+APP=$(echo "$APP_FULL" | tr -c -d '[:alnum:]')
+if [ -z "$APP" ] || [ -z "$APP_FULL" ] ; then
+  APP=$(echo "$DESKTOPFILE_NAME" | sed -e 's/.desktop//g')
+  APP_FULL="$APP"
+fi
+
+RETURN="yes"
+
+BIN=$(echo "$FILENAME" | sed -e 's|.wrapper|.bin|g')
+if [[ ! -f "$BIN" ]] ; then
+  log "$BIN not found"
+  exit 0
+fi
+
+trap atexit EXIT
+
+# Note that the following handles 0, 1 or more arguments (file paths)
+# which can include blanks but uses a bashism; can the same be achieved
+# in POSIX-shell? (FIXME)
+# http://stackoverflow.com/questions/3190818
+atexit()
+{
+  if [ -z "$SKIP" ] ; then
+    # Export library paths and environment
+    HERE="$(dirname "$(readlink -f "${0}")")"
+    export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
+    export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/arm-linux-gnueabihf/:"${HERE}"/usr/lib/aarch64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/arm-linux-gnueabihf/:"${HERE}"/lib/aarch64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
+    export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
+    export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
+
+    if [ $NUMBER_OF_ARGS -eq 0 ] ; then
+      # This is pretty ugly - I need to think about a better way
+      # regarding extending the PATH variable, so we don't have
+      # to enter ./share/scummvm/ first if we want the bundled resources
+      # to be available...
+      cd $APPDIR/share/scummvm/
+      EXEC=$APPDIR/bin/scummvm
+      exec "${EXEC}"
+    else
+      cd $APPDIR/share/scummvm/
+      EXEC=$APPDIR/bin/scummvm
+      exec "${EXEC}" "${args[@]}"
+    fi
+  fi
+}
+
+error()
+{
+  $APPDIR/bin/zenity --error --text "${1}" --no-wrap 2>/dev/null
+  exit 1
+}
+
+yesno()
+{
+  TITLE=$1
+  TEXT=$2
+  # This is ugly again - see comment above.
+  cd $APPDIR/bin/
+  ./zenity --question --title="$TITLE" --text="$TEXT" --no-wrap && RETURN="yes" || RETURN="no"
+}
+
+check_prevent()
+{
+  FILE=$1
+  if [ -e "$FILE" ] ; then
+  	echo "File \"$FILE\" is exiting - skipping desktop integration"
+    exit 0
+  fi
+}
+
+check_dep()
+{
+  if [ -z "$(command -v $1)" ]; then
+    log "$1 is missing. Skipping ${THIS}."
+    exit 
+  fi
+}
+
+# Determine where the desktop file should be installed
+if [[ $EUID -ne 0 ]]; then
+   DESTINATION_DIR_DESKTOP="$HOME/.local/share/applications"
+   STAMP_DIR="$HOME/.local/share/$VENDORPREFIX"
+   SYSTEM_WIDE=""
+else
+   # TODO: Check $XDG_DATA_DIRS
+   DESTINATION_DIR_DESKTOP="/usr/local/share/applications"
+   STAMP_DIR="/etc/$VENDORPREFIX"
+   SYSTEM_WIDE="--mode system" # for xdg-mime and xdg-icon-resource
+fi
+
+# Remove desktop integration for this AppImage
+if [ "x$1" = "x--remove-appimage-desktop-integration" ] ; then
+  SKIP="yes"
+  rm -f "$STAMP_DIR/${APP}_no_desktopintegration" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME"
+  check_dep xdg-desktop-menu
+  xdg-desktop-menu forceupdate
+  exit 0
+fi
+
+# Exit immediately if one of these files is present
+# (e.g., because the desktop environment wants to handle desktop integration itself)
+check_prevent "$HOME/.local/share/$VENDORPREFIX/no_desktopintegration"
+check_prevent "/usr/share/$VENDORPREFIX/no_desktopintegration"
+check_prevent "/etc/$VENDORPREFIX/no_desktopintegration"
+
+# Exit immediately if appimaged is running
+pidof appimaged >/dev/null 2>&1 && exit 0
+
+#echo "DESKTOPINTEGRATION: $DESKTOPINTEGRATION"
+# Exit immediately if $DESKTOPINTEGRATION is not empty
+if [ ! -z "$DESKTOPINTEGRATION" ] ; then
+  exit 0
+fi
+
+# Check whether dependencies are present in base system (we do not bundle these)
+# http://cgit.freedesktop.org/xdg/desktop-file-utils/
+check_dep desktop-file-validate
+check_dep update-desktop-database
+check_dep desktop-file-install
+check_dep xdg-icon-resource
+check_dep xdg-mime
+check_dep xdg-desktop-menu
+
+# Exit immediately if one of these files is present (disabled per app)
+check_prevent "$HOME/.local/share/$VENDORPREFIX/${APP}_no_desktopintegration"
+check_prevent "/usr/share/$VENDORPREFIX/${APP}_no_desktopintegration"
+check_prevent "/etc/$VENDORPREFIX/${APP}_no_desktopintegration"
+
+if [ ! -f "$DESKTOPFILE" ] ; then
+  log "Desktop file is missing. Please run ${THIS} from within an AppImage."
+  exit 0
+fi
+
+if [ -z "$APPIMAGE" ] ; then
+  APPIMAGE="$APPDIR/AppRun"
+  # Not running from within an AppImage; hence using the AppRun for Exec=
+fi
+
+ICONFILE="$APPDIR/.DirIcon"
+
+# $XDG_DATA_DIRS contains the default paths /usr/local/share:/usr/share
+# desktop file has to be installed in an applications subdirectory
+# of one of the $XDG_DATA_DIRS components
+if [ -z "$XDG_DATA_DIRS" ] ; then
+  log "\$XDG_DATA_DIRS is missing. Please run ${THIS} from within an AppImage."
+  exit 0
+fi
+
+# Check if the desktop file is already there
+# and if so, whether it points to the same AppImage
+if [ -e "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" ] ; then
+  # echo "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME already there"
+  EXEC=$(grep "^Exec=" "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" | head -n 1 | cut -d " " -f 1)
+  # echo $EXEC
+  if [ "Exec=\"$APPIMAGE\"" == "$EXEC" ] ; then
+    exit 0
+  fi
+fi
+
+# We ask the user only if we have found no reason to skip until here
+if [ -z "$SKIP" ] ; then
+  yesno "Install" "Would you like to integrate $APP with your system?\n\nThis will add it to your applications menu and install icons.\nIf you don't do this you can still launch the application by double-clicking on the AppImage."
+fi
+
+if [ "$RETURN" = "no" ] ; then
+  yesno "Disable question?" "Should this question be permanently disabled for $APP?\n"
+  if [ "$RETURN" = "yes" ] ; then
+    mkdir -p "$STAMP_DIR"
+    touch "$STAMP_DIR/${APP}_no_desktopintegration"
+  fi
+  exit 0
+fi
+
+ZENITY_PID=$!
+# If the user has agreed, rewrite and install the desktop file, and the MIME information
+if [ -z "$SKIP" ] ; then
+  # desktop-file-install is supposed to install .desktop files to the user's
+  # applications directory when run as a non-root user,
+  # and to /usr/share/applications if run as root
+  # but that does not really work for me...
+  #
+  # For Exec we must use quotes
+  # For TryExec quotes is not supported, so, space must be replaced to \s
+  # https://askubuntu.com/questions/175404/how-to-add-space-to-exec-path-in-a-thumbnailer-descrption/175567
+  RESOURCE_NAME=$(echo "$VENDORPREFIX-$DESKTOPFILE_NAME" | sed -e 's/\.desktop//g')
+  desktop-file-install --rebuild-mime-info-cache \
+    --vendor=$VENDORPREFIX --set-key=Exec --set-value="\"${APPIMAGE}\" %U" \
+    --set-key=X-AppImage-Comment --set-value="Generated by ${THIS}" \
+    --set-key=TryExec --set-value=${APPIMAGE// /\\s} "$DESKTOPFILE" \
+    --set-key=Icon --set-value=appimagekit-scummvm \
+    --dir "$DESTINATION_DIR_DESKTOP"
+  chmod a+x "$DESTINATION_DIR_DESKTOP/"*
+  
+  # delete "Actions" entry and add an "Uninstall" action
+  sed -i -e '/^Actions=/d' "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME"
+  cat >> "$DESTINATION_DIR_DESKTOP/$VENDORPREFIX-$DESKTOPFILE_NAME" << EOF
+
+Actions=Uninstall;
+
+[Uninstall]
+Name=Remove desktop integration for $APP_FULL
+Exec="$APPIMAGE" --remove-appimage-desktop-integration
+
+EOF
+
+  # Install the icon files for the application; TODO: scalable
+  ICONS=$(find "${APPDIR}/usr/share/icons/" -iwholename "*/apps/${APP}.png" 2>/dev/null || true)
+  for ICON in $ICONS ; do
+    ICON_SIZE=$(echo "${ICON}" | rev | cut -d "/" -f 3 | rev | cut -d "x" -f 1)
+    xdg-icon-resource install --context apps --size ${ICON_SIZE} "${ICON}" "${RESOURCE_NAME}"
+  done
+
+  xdg-desktop-menu forceupdate
+  gtk-update-icon-cache # for MIME
+fi
+kill -9 $ZENITY_PID




More information about the Scummvm-git-logs mailing list