# SPDX-FileCopyrightText: 2023-2026 Michael Serajnik # SPDX-License-Identifier: AGPL-3.0-or-later app-id: at.mser.SilQ runtime: org.freedesktop.Platform runtime-version: '25.08' sdk: org.freedesktop.Sdk command: sil-q finish-args: - --device=all # Sil-Q stores its savefiles, scores and data cache in `~/.sil` (see the build # step below); `--persist` keeps that directory in the application's data # directory (`~/.var/app/at.mser.SilQ/.sil`). - --persist=.sil - --share=ipc # Sil-Q only has X11 and terminal (GCU) frontends, not a Wayland one, so it # needs a plain X11 socket; `fallback-x11` would withhold X11 in a Wayland # session. - --socket=x11 modules: - name: sil-q buildsystem: simple build-commands: # Sil-Q builds with CMake. On Linux the build no longer defines # `USE_PRIVATE_SAVE_PATH` or `DEFAULT_PATH`, so by default the game reads # and writes everything relative to `./lib`. That does not work under # Flatpak, where `/app` is read-only. We set both in the source before # building: `USE_PRIVATE_SAVE_PATH` redirects the writable directories # (`save`, `scores`, `data`) into `~/.sil/Sil-Q` (created automatically # on first launch), and `DEFAULT_PATH` points the game at its read-only # data in `/app/lib/sil`. - | sed -i \ -e '1i #define USE_PRIVATE_SAVE_PATH' \ -e 's|#define DEFAULT_PATH "./lib/"|#define DEFAULT_PATH "/app/lib/sil"|' \ src/config.h # Build with the X11 and GCU frontends. The Cocoa frontend is macOS-only # and defaults to on, so it has to be disabled explicitly. The runtime's # ncurses keeps the terminfo symbols in a separate `libtinfo`, so we make # the linker pull them in via the GCU frontend's `libncurses` dependency. - | cmake -G Ninja -B build \ -DCMAKE_BUILD_TYPE=Release \ -DSUPPORT_COCOA_FRONTEND=OFF \ -DSUPPORT_X11_FRONTEND=ON \ -DSUPPORT_GCU_FRONTEND=ON \ -DCMAKE_EXE_LINKER_FLAGS=-Wl,--copy-dt-needed-entries - cmake --build build # Install the executable. - install -Dm755 build/sil /app/bin/sil-q # Install the desktop files, the icon and the AppData file. - install -Dm644 ${FLATPAK_ID}.desktop -t /app/share/applications - install -Dm644 ${FLATPAK_ID}.GCU.desktop -t /app/share/applications - install -Dm644 ${FLATPAK_ID}.png -t /app/share/icons/hicolor/256x256/apps - install -Dm644 ${FLATPAK_ID}.metainfo.xml -t /app/share/metainfo # Copy the read-only game data to the location `DEFAULT_PATH` points at. - | lib_path="/app/lib/sil" ; \ mkdir -p "$lib_path" ; \ cp -r lib/. "$lib_path" ; \ chmod -R 755 "$lib_path" sources: - type: git url: https://github.com/sil-quirk/sil-q.git tag: v1.5.1-beta1 commit: 4e417a7322a9cf037ee672c11f330eda7fd2c1b9 - type: file path: at.mser.SilQ.desktop - type: file path: at.mser.SilQ.GCU.desktop - type: file path: at.mser.SilQ.png - type: file path: at.mser.SilQ.metainfo.xml