From 8e509b58cdaa017af084be9a64e7d81713223b5e Mon Sep 17 00:00:00 2001 From: Soeren Magnus Olesen <101652697+df49b9cd@users.noreply.github.com> Date: Mon, 2 Nov 2026 14:23:25 +0100 Subject: [PATCH 1/3] Flatpak packaging (T-057): GNOME 51 manifest, build script, CI bundle packaging/flatpak/dev.testpattern.app.yml builds on the GNOME 51 runtime (GTK/WebKitGTK/libva/PipeWire from the runtime) with libass, libunibreak and uchardet as modules, the static media engine via scripts/build-media.sh on git sources pinned to its tags, and pinned Rust 1.99.0 / bun 1.4.2 as build-only modules. scripts/flatpak.sh builds, installs or bundles it (.deps/flatpak/testpattern.flatpak) and 'pins' checks the manifest against build-media.sh / rust-toolchain.toml / package.json. The app is built from the working tree with --frozen-lockfile/--locked, so this is a local/CI build, not a Flathub submission. CI builds the bundle for main, tags and manual runs and attaches it to releases (Flathub gnome-51 image). Verified locally: installed app starts in a nested KWin with a fresh profile and gets the mpv render context with VA-API zero-copy. Co-authored-by: Claude --- .github/workflows/ci.yml | 30 +++ README.md | 13 +- WORKLOG.md | 48 +++- packaging/flatpak/dev.testpattern.app.desktop | 10 + .../flatpak/dev.testpattern.app.metainfo.xml | 39 ++++ packaging/flatpak/dev.testpattern.app.yml | 206 ++++++++++++++++++ scripts/flatpak.sh | 85 ++++++++ scripts/outdated.sh | 3 +- 8 files changed, 431 insertions(+), 3 deletions(-) create mode 100644 packaging/flatpak/dev.testpattern.app.desktop create mode 100644 packaging/flatpak/dev.testpattern.app.metainfo.xml create mode 100644 packaging/flatpak/dev.testpattern.app.yml create mode 100755 scripts/flatpak.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c811709..e971c42 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,3 +129,33 @@ jobs: src-tauri/target/release/bundle/deb/*.deb src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/rpm/*.rpm + + # the same triggers as the bundles, built from packaging/flatpak/ (T-057) + # in Flathub's GNOME image; the action uploads testpattern.flatpak + flatpak: + if: startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && github.ref == 'refs/heads/main') + needs: check + runs-on: ubuntu-24.04 + timeout-minutes: 90 + permissions: + contents: write + container: + image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-51 + options: --privileged + steps: + - uses: actions/checkout@v7 + + - name: Pins + run: scripts/flatpak.sh pins + + - uses: flatpak/flatpak-github-actions/flatpak-builder@v6 + with: + manifest-path: packaging/flatpak/dev.testpattern.app.yml + bundle: testpattern.flatpak + cache-key: flatpak-${{ hashFiles('packaging/flatpak/dev.testpattern.app.yml', 'scripts/build-media.sh') }} + + - name: Release + if: startsWith(github.ref, 'refs/tags/v') + uses: softprops/action-gh-release@v3 + with: + files: testpattern.flatpak diff --git a/README.md b/README.md index eb2bf91..91ef92d 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ search, for **Xtream Codes** accounts and **M3U** playlists (+ XMLTV). - **Playback:** libmpv + FFmpeg built from source and **statically linked**, rendered through OpenGL underneath the web UI — plays H.264/HEVC/AV1, AAC/AC3/EAC3/DTS, MPEG-TS/HLS/MKV regardless of the distro's codec packages -- **Ships as one executable** (~62 MB) — .deb, .rpm and AppImage +- **Ships as one executable** (~62 MB) — .deb, .rpm, AppImage and Flatpak - **Hardware decoding** through VA-API with zero-copy on Wayland; **source passwords** live in the desktop keyring (KWallet, GNOME Keyring) - **One entry per title:** the copies a provider lists of a film or show @@ -36,6 +36,17 @@ scripts/ubuntu-build.sh # portable release: deb + AppImage + rpm (glibc The portable release is built in an Ubuntu 24.04 container (podman), so it runs on Ubuntu 24.04+, Debian 13, Fedora 40+ and similar — see WORKLOG.md §3. +**Flatpak** (any distro with Flatpak; runtimes from Flathub): + +```bash +scripts/flatpak.sh # build + install for this user (≈15 min the first time) +flatpak run dev.testpattern.app +scripts/flatpak.sh bundle # single file: .deps/flatpak/testpattern.flatpak +``` + +A bundle installs anywhere with `flatpak install --user testpattern.flatpak`; +CI attaches one to every release. + If you used the rootless sysroot, run `. .deps/env.sh` before building. **GPU decoding on Fedora:** the stock Mesa drivers decode AV1 and VP9 on AMD diff --git a/WORKLOG.md b/WORKLOG.md index 9090ff6..7ef8858 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -92,6 +92,7 @@ bun run dev # Vite on :1420 (keep running) scripts/dev-run.sh # launches target/debug/testpattern bun run tauri build # release for this machine: single binary + rpm/deb scripts/ubuntu-build.sh # portable release (Ubuntu 24.04 container): deb + AppImage + rpm +scripts/flatpak.sh # Flatpak: build + install for this user (`bundle` → .flatpak file) scripts/check.sh # unit tests + clippy + tsc + vitest + notices scripts/headless.sh start && scripts/headless.sh seed && scripts/smoke.sh scripts/outdated.sh # dependency audit (see "Dependency policy") @@ -112,6 +113,24 @@ the Ubuntu build inside the container against the headless session: `TP_APP_BIN="$PWD/scripts/ubuntu-build.sh run-app" scripts/headless.sh start`, then `scripts/smoke.sh`. CI builds the same bundles for version tags. +**Flatpak** (T-057): `packaging/flatpak/dev.testpattern.app.yml` builds on +the GNOME 51 runtime (GTK 3, WebKitGTK 4.1, libva, PipeWire, … from the +runtime) plus libass/libunibreak/uchardet as shared modules. The media +engine is `scripts/build-media.sh` again, inside the SDK, on git sources +pinned to the script's tags (the module writes them as fetch stamps, so the +script never re-fetches); `scripts/flatpak.sh pins` (also a CI step) fails +when those, the Rust version (rust-toolchain.toml — Flathub's rust-stable +extension trails it, so the manifest installs the pinned rustc/cargo +itself) or the bun pin drift. The app module builds the working tree with +network access (`bun install --frozen-lockfile`, `cargo --locked`), so it is +a local/CI build, not a Flathub submission (that would need offline +`flatpak-cargo-generator`/`flatpak-node-generator` sources). Permissions: +Wayland (X11 fallback), DRI, PulseAudio/PipeWire, network, and +`org.freedesktop.secrets` for the keyring. `scripts/flatpak.sh` builds into +`.deps/flatpak/` with flatpak-builder or Flathub's `org.flatpak.Builder`. +When bumping a media tag in build-media.sh, update the manifest's `tag` and +`commit` too. + **This machine** (Ryzen 9 5950X): at 32 parallel jobs compilers crash sporadically (GCC "internal compiler error: Segmentation fault" on random FFmpeg files, a nasm GP fault in libc) while the same files compile fine @@ -239,10 +258,11 @@ Every dependency must be on its **latest stable** release. Audited | `scripts/git-hooks/pre-commit` | Refuses commits containing `.env.local` values (enable: `git config core.hooksPath scripts/git-hooks`) | | `scripts/csp-check.sh` | Fails on Content-Security-Policy violations in a bundled-assets build (T-040) | | `scripts/ubuntu-build.sh` | Portable release in an Ubuntu 24.04 container: one glibc-2.39 binary as .deb/AppImage/.rpm; `debug` + `run-app` to test it in the headless session (T-049) | +| `scripts/flatpak.sh` · `packaging/flatpak/` | Flatpak build/install/bundle (GNOME runtime) + manifest, desktop entry, AppStream metainfo; `pins` checks the manifest against build-media.sh/rust/bun (T-057) | | `scripts/appimage-fix.sh` | Drops the bundled libwayland and the forced X11 backend from Tauri's AppImage, repacks it (T-049) | | `scripts/deb-depends.sh` | Checks `bundle.linux.deb.depends` against `dpkg-shlibdeps` (run on Ubuntu 24.04) | | `packaging/ubuntu/` | `Containerfile` + `packages.txt` (Ubuntu build packages, also installed by CI) | -| `.github/workflows/ci.yml` | CI: `scripts/check.sh` on Ubuntu 24.04 for pushes/PRs; portable bundles for `v*` tags and manual runs (T-037) | +| `.github/workflows/ci.yml` | CI: `scripts/check.sh` on Ubuntu 24.04 for pushes/PRs; portable bundles + Flatpak for `v*` tags, main and manual runs (T-037, T-057) | | `scripts/notices.py` | Generates `THIRD_PARTY_NOTICES.md` (run after any dependency change; `check.sh` enforces) | | `LICENSE` · `THIRD_PARTY_NOTICES.md` · `packaging/debian/copyright` | GPLv3 text · generated third-party licenses · DEP-5 copyright for the deb | | `.gitignore` · `.gitattributes` · `.env.example` | Ignore rules (rebuildable + secrets) · LF/binary attributes · test-account template | @@ -955,6 +975,25 @@ UHF/Infuse feature, **P2** = later. a visible, audible window). Follow-ups all closed 2026-10-03: PL-97/99/100/101 — see the 2026-10-03 log entry. +- **T-057 Flatpak** — `packaging/flatpak/dev.testpattern.app.yml` + + `scripts/flatpak.sh` (see §3): GNOME 51 runtime, libass 0.17.5 / + libunibreak 8.0 / uchardet 0.0.8 as shared modules (not in the runtime), + the media engine via `build-media.sh` inside the SDK, Rust 1.99.0 and bun + 1.4.2 as build-only modules. App ID `dev.testpattern.app` (the Tauri + identifier), desktop entry + AppStream metainfo (validated). Fixed on the + way: uchardet 0.0.8's `cmake_minimum_required(2.8)` is refused by the + SDK's CMake (→ `CMAKE_POLICY_VERSION_MINIMUM=3.5`); libass defaults to a + static library under meson; flatpak-builder's debuginfo/strip pass breaks + the official Rust tarball's `libLLVM.so` ("object file has no loadable + segments") → `no-debuginfo`/`strip: false` on the toolchain modules. + Verified: the installed app (58 MB) resolves every library in the + sandbox, starts in a nested KWin with a fresh profile (database + migrated, onboarding page rendered) and gets the mpv render context with + VA-API zero-copy on `/dev/dri/renderD128`. CI builds it (Flathub's + `gnome-51` image) for main, tags and manual runs and attaches + `testpattern.flatpak` to releases. Not a Flathub submission: the app + module downloads crates and npm packages during the build. + ### 🟨 In progress ### 🟦 To do @@ -975,6 +1014,13 @@ UHF/Infuse feature, **P2** = later. ## 6. Log +- **2026-11-02** — T-057 Flatpak (user request: "installable as a + flatpak"). New `packaging/flatpak/` (manifest, desktop entry, metainfo), + `scripts/flatpak.sh` (install / bundle / pins), CI job `flatpak`, + README + §3/§4 notes; `scripts/outdated.sh` now also audits + `owner/repo/sub-action@vN` Actions. Built and launched locally (see the + card); not yet run in CI or with a provider account inside the sandbox. + - **2026-10-03** — PL-101/PL-99/PL-100/PL-97 (planned tracker). PL-101: `src/app/Layout.tsx` gained a global-space listener — Space/K/M while playback runs off-page routes to `/player` (after the existing input diff --git a/packaging/flatpak/dev.testpattern.app.desktop b/packaging/flatpak/dev.testpattern.app.desktop new file mode 100644 index 0000000..6ea1ab4 --- /dev/null +++ b/packaging/flatpak/dev.testpattern.app.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Name=testpattern +Comment=IPTV player for Xtream Codes accounts and M3U playlists +Exec=testpattern +Icon=dev.testpattern.app +Terminal=false +Categories=AudioVideo;Video;Player;TV; +Keywords=IPTV;TV;M3U;Xtream;EPG;XMLTV; +StartupWMClass=testpattern diff --git a/packaging/flatpak/dev.testpattern.app.metainfo.xml b/packaging/flatpak/dev.testpattern.app.metainfo.xml new file mode 100644 index 0000000..1a91d4e --- /dev/null +++ b/packaging/flatpak/dev.testpattern.app.metainfo.xml @@ -0,0 +1,39 @@ + + + dev.testpattern.app + testpattern + IPTV player with a TV guide, movies and series + CC0-1.0 + GPL-3.0-or-later + + the testpattern authors + + +

+ A desktop IPTV player for Xtream Codes accounts and M3U playlists with + XMLTV: Live TV with a real TV guide, Movies and Series with rich + artwork, favorites, continue watching and search. +

+
    +
  • Plays H.264, HEVC and AV1, AAC, AC3, EAC3 and DTS in MPEG-TS, HLS and MKV through an embedded mpv and FFmpeg
  • +
  • Hardware decoding through VA-API
  • +
  • One entry per title: the copies a provider lists of a film or show become versions
  • +
  • Optional TMDB metadata with your own API key
  • +
  • Source passwords are kept in the desktop keyring
  • +
+

testpattern ships no content; use sources you are entitled to.

+
+ dev.testpattern.app.desktop + https://github.com/df49b9cd/testpattern-app + + + pointing + keyboard + + + 960 + + + + +
diff --git a/packaging/flatpak/dev.testpattern.app.yml b/packaging/flatpak/dev.testpattern.app.yml new file mode 100644 index 0000000..f2fe335 --- /dev/null +++ b/packaging/flatpak/dev.testpattern.app.yml @@ -0,0 +1,206 @@ +# Flatpak build of testpattern (WORKLOG T-057) on the GNOME runtime, which +# brings GTK 3 + WebKitGTK 4.1, libva/libdrm/EGL, PipeWire/Pulse/ALSA, lcms2, +# OpenSSL and fontconfig. Built and installed with scripts/flatpak.sh. +# +# Modules, in build order: +# libunibreak, libass, uchardet shared, not in the runtime (mpv needs them) +# media-engine scripts/build-media.sh on git sources pinned +# to its tags (`scripts/flatpak.sh pins` checks +# they match); static, only linked into the app +# rust, bun build-only toolchains (removed by cleanup): +# Flathub's rust-stable extension trails the +# version pinned in rust-toolchain.toml; after +# the media engine so a bump keeps its cache +# testpattern the working tree; this module builds with +# network access for `bun install` and the +# crates, both pinned by bun.lock / Cargo.lock +id: dev.testpattern.app +runtime: org.gnome.Platform +runtime-version: "51" +sdk: org.gnome.Sdk +command: testpattern +finish-args: + - --share=ipc + - --share=network + - --socket=wayland + - --socket=fallback-x11 + - --socket=pulseaudio + # GL for the video surface + VA-API decoding (render node) + - --device=dri + # source passwords and the TMDB key (secrets.rs: Secret Service — KWallet, + # GNOME Keyring) + - --talk-name=org.freedesktop.secrets + +modules: + - name: libunibreak + config-opts: [--disable-static] + cleanup: [/include, /lib/pkgconfig, "*.la"] + license-files: [LICENCE] + sources: + - type: archive + url: https://github.com/adah1972/libunibreak/releases/download/libunibreak_8_0/libunibreak-8.0.tar.gz + sha256: 9c4fad6e517338a098373acc9f35579ae2c325e6446666fb9ac2666ba15ceba4 + + - name: libass + buildsystem: meson + config-opts: + - -Ddefault_library=shared + - -Dfontconfig=enabled + - -Dlibunibreak=enabled + - -Dtest=disabled + - -Dcompare=disabled + - -Dprofile=disabled + - -Dfuzz=disabled + - -Dcheckasm=disabled + cleanup: [/include, /lib/pkgconfig] + license-files: [COPYING] + sources: + - type: archive + url: https://github.com/libass/libass/releases/download/0.17.5/libass-0.17.5.tar.xz + sha256: 2dca25c0e0c837ddf00b52011b3f82cac1e4ddd3ad018227806b0c2288864acc + + - name: uchardet + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + # 0.0.8 asks for CMake 2.8, which current CMake no longer accepts + - -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + - -DBUILD_BINARY=OFF + - -DBUILD_STATIC=OFF + cleanup: [/include, /lib/pkgconfig, /share/man] + license-files: [COPYING] + sources: + - type: archive + url: https://www.freedesktop.org/software/uchardet/releases/uchardet-0.0.8.tar.xz + sha256: e97a60cfc00a1c147a674b097bb1422abd9fa78a2d9ce3f3fdcc2e78a34ac5f0 + + - name: media-engine + buildsystem: simple + cleanup: ["*"] + build-commands: + # the fetch stamps build-media.sh expects: without them it would try to + # re-fetch (no network here); `scripts/flatpak.sh pins` keeps the git + # sources below on the same tags as the script + - >- + eval "$(grep -E '^[A-Z0-9]+_TAG=' scripts/build-media.sh)"; + s=third_party/src; + echo $DAV1D_TAG >$s/dav1d.tag; echo $LIBXML2_TAG >$s/libxml2.tag; + echo $FFMPEG_TAG >$s/ffmpeg.tag; echo $LIBPLACEBO_TAG >$s/libplacebo.tag; + echo $LIBDISPLAYINFO_TAG >$s/libdisplay-info.tag; echo $MPV_TAG >$s/mpv.tag + - TP_MEDIA_PREFIX=/app/media TP_JOBS=$FLATPAK_BUILDER_N_JOBS scripts/build-media.sh + sources: + - type: file + path: ../../scripts/build-media.sh + dest: scripts + - type: git + url: https://code.videolan.org/videolan/dav1d.git + tag: 1.5.4 + commit: 54706fc6bc0cdecab7e9593974a4039cc038fca7 + dest: third_party/src/dav1d + - type: git + url: https://gitlab.gnome.org/GNOME/libxml2.git + tag: v2.15.4 + commit: 96498992efa48d52b0e8b83058bd88dbdaf153c1 + dest: third_party/src/libxml2 + - type: git + url: https://github.com/FFmpeg/FFmpeg.git + tag: n9.0.2 + commit: 946fcce07b6dcd0331c8cc609192aeff5e1924f8 + dest: third_party/src/ffmpeg + - type: git + url: https://code.videolan.org/videolan/libplacebo.git + tag: v7.360.1 + commit: cee9b076f2c63104ccfd497fa79c39a867293ec4 + dest: third_party/src/libplacebo + - type: git + url: https://gitlab.freedesktop.org/emersion/libdisplay-info.git + tag: 0.4.0 + commit: c67a3e9bedb05ab61c7443704a1a107e76254595 + dest: third_party/src/libdisplay-info + - type: git + url: https://github.com/mpv-player/mpv.git + tag: v0.41.0 + commit: 41f6a645068483470267271e1d09966ca3b9f413 + dest: third_party/src/mpv + + # x86_64 only, like the other release bundles + - name: rust + buildsystem: simple + cleanup: ["*"] + # flatpak-builder's debuginfo pass corrupts libLLVM (rustc then fails with + # "object file has no loadable segments") + build-options: + no-debuginfo: true + strip: false + build-commands: + - for c in rustc cargo rust-std; do $c/install.sh --prefix=/app/rust --disable-ldconfig >/dev/null; done + - /app/rust/bin/rustc --version + sources: + - type: archive + url: https://static.rust-lang.org/dist/rustc-1.99.0-x86_64-unknown-linux-gnu.tar.xz + sha256: 77171ba2a0345fdf2abc4fedda55d6de078dae7a68527c28be8c77dcc9604bd5 + dest: rustc + - type: archive + url: https://static.rust-lang.org/dist/cargo-1.99.0-x86_64-unknown-linux-gnu.tar.xz + sha256: d7674918d28093097614cd9728b6ca60db9ea3038f640f0bd1e9a4188c7568ce + dest: cargo + - type: archive + url: https://static.rust-lang.org/dist/rust-std-1.99.0-x86_64-unknown-linux-gnu.tar.xz + sha256: 3e58dff2d0b72196b5ea4e90536e174d400de88564a52694686b81e091169933 + dest: rust-std + + # the packageManager pin in package.json + - name: bun + buildsystem: simple + cleanup: ["*"] + build-options: + no-debuginfo: true + strip: false + build-commands: + - install -Dm755 bun /app/bun/bin/bun + - ln -s bun /app/bun/bin/bunx + sources: + - type: archive + url: https://github.com/oven-sh/bun/releases/download/bun-v1.4.2/bun-linux-x64.zip + sha256: 36368faef7527875d5ffa52e53cd48021741f2a83eb6208a8dd64068d422a913 + + - name: testpattern + buildsystem: simple + build-options: + append-path: /app/rust/bin:/app/bun/bin + env: + CARGO_HOME: /run/build/testpattern/.cargo-home + TP_MEDIA_PREFIX: /app/media + build-args: [--share=network] + build-commands: + - bun install --frozen-lockfile + # release build of the binary only (bundles are the other packages' job) + - bun run tauri build --no-bundle -- --locked + - install -Dm755 src-tauri/target/release/testpattern /app/bin/testpattern + - install -Dm644 packaging/flatpak/dev.testpattern.app.desktop -t /app/share/applications + - install -Dm644 packaging/flatpak/dev.testpattern.app.metainfo.xml -t /app/share/metainfo + - install -Dm644 assets/icon.svg /app/share/icons/hicolor/scalable/apps/dev.testpattern.app.svg + - for s in 32 64 128; do install -Dm644 src-tauri/icons/${s}x${s}.png /app/share/icons/hicolor/${s}x${s}/apps/dev.testpattern.app.png; done + - install -Dm644 src-tauri/icons/128x128@2x.png /app/share/icons/hicolor/256x256/apps/dev.testpattern.app.png + - install -Dm644 src-tauri/icons/icon.png /app/share/icons/hicolor/512x512/apps/dev.testpattern.app.png + - install -Dm644 LICENSE THIRD_PARTY_NOTICES.md -t /app/share/licenses/dev.testpattern.app + sources: + # the working tree minus what is rebuilt here, machine-local or secret + - type: dir + path: ../.. + skip: + - .git + - .deps + - .env + - .env.local + # flatpak-builder's own output when run from the repository root (CI) + - .flatpak-builder + - flatpak_app + - repo + - testpattern.flatpak + - node_modules + - dist + - third_party + - src-tauri/target + - src-tauri/gen + - src-tauri/media_macos/.build diff --git a/scripts/flatpak.sh b/scripts/flatpak.sh new file mode 100755 index 0000000..a19f8c3 --- /dev/null +++ b/scripts/flatpak.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# Flatpak build (WORKLOG T-057) from packaging/flatpak/dev.testpattern.app.yml: +# GNOME runtime, the media engine built inside the SDK, the working tree as the +# app's source. Uses flatpak-builder when installed, else Flathub's +# org.flatpak.Builder app; the runtimes come from Flathub (per user). +# Everything it writes lives in .deps/flatpak/. +# +# scripts/flatpak.sh [install] build + install for this user → flatpak run dev.testpattern.app +# scripts/flatpak.sh bundle build + single-file bundle → .deps/flatpak/testpattern.flatpak +# (install elsewhere: flatpak install --user testpattern.flatpak) +# scripts/flatpak.sh pins check that the manifest's media sources match build-media.sh +set -euo pipefail +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +APP=dev.testpattern.app +MANIFEST="$ROOT/packaging/flatpak/$APP.yml" +OUT="$ROOT/.deps/flatpak" + +# The git sources of the media-engine module must be the tags build-media.sh +# pins (the module writes those tags as its fetch stamps, so a mismatch would +# silently build other code than the script's). +pins() { + local bad=0 var name tag pinned + while read -r var name; do + pinned=$(sed -n "s/^$var=//p" "$ROOT/scripts/build-media.sh") + tag=$(awk -v d="dest: third_party/src/$name" ' + /- type: git/ { t = "" } /^ *tag: / { t = $2 } $0 ~ d"$" { print t }' "$MANIFEST") + if [[ "$tag" != "$pinned" ]]; then + echo "flatpak: $name is $tag in $(basename "$MANIFEST"), build-media.sh pins $pinned (update tag + commit)" >&2 + bad=1 + fi + done <<'EOF' +DAV1D_TAG dav1d +LIBXML2_TAG libxml2 +FFMPEG_TAG ffmpeg +LIBPLACEBO_TAG libplacebo +LIBDISPLAYINFO_TAG libdisplay-info +MPV_TAG mpv +EOF + local toolchain bun + toolchain="$(sed -n 's/^channel *= *"\(.*\)"/\1/p' "$ROOT/rust-toolchain.toml")" + bun=$(python3 -c "import json, sys; print(json.load(open(sys.argv[1]))['packageManager'].removeprefix('bun@'))" "$ROOT/package.json") + grep -q "/rustc-$toolchain-x86_64" "$MANIFEST" || + { echo "flatpak: the manifest's Rust is not $toolchain (rust-toolchain.toml)" >&2; bad=1; } + grep -q "/bun-v$bun/" "$MANIFEST" || + { echo "flatpak: the manifest's bun is not $bun (package.json)" >&2; bad=1; } + return $bad +} + +builder() { + if command -v flatpak-builder >/dev/null; then + flatpak-builder "$@" + else + flatpak info --user org.flatpak.Builder >/dev/null 2>&1 || + flatpak install --user -y --noninteractive flathub org.flatpak.Builder + flatpak run --user org.flatpak.Builder "$@" + fi +} + +build() { # extra flatpak-builder args… + pins + flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo + mkdir -p "$OUT" + builder --user --force-clean --ccache --install-deps-from=flathub \ + --state-dir="$OUT/state" --jobs="${TP_JOBS:-$(nproc)}" "$@" "$OUT/build" "$MANIFEST" +} + +case "${1:-install}" in + install) + build --install + echo "==> installed: flatpak run $APP" + ;; + bundle) + build --repo="$OUT/repo" + flatpak build-bundle --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo \ + "$OUT/repo" "$OUT/testpattern.flatpak" "$APP" + ls -l "$OUT/testpattern.flatpak" + ;; + pins) + pins && echo "flatpak: manifest pins match build-media.sh, rust-toolchain.toml and package.json" + ;; + *) + echo "usage: $0 [install|bundle|pins]" >&2 + exit 2 + ;; +esac diff --git a/scripts/outdated.sh b/scripts/outdated.sh index df2a493..8aeada9 100755 --- a/scripts/outdated.sh +++ b/scripts/outdated.sh @@ -96,7 +96,8 @@ actions=0 for uses in $(grep -ho 'uses: *[^ ]*@v[0-9][^ ]*' "$ROOT"/.github/workflows/*.yml | sed 's/uses: *//' | sort -u); do repo=${uses%@*} major=${uses#*@} - newest=$(git ls-remote --tags "https://github.com/$repo" 2>/dev/null | grep -v '\^{}' | sed 's#.*refs/tags/##' | + # owner/repo/sub-action@v1 → the tags live on owner/repo + newest=$(git ls-remote --tags "https://github.com/$(cut -d/ -f1-2 <<<"$repo")" 2>/dev/null | grep -v '\^{}' | sed 's#.*refs/tags/##' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1) mark=ok [[ -n "$newest" && "${newest%%.*}" != "$major" ]] && { mark=OLD; actions=1; } From 82dc80e6000b3fba6683e4eff37b0fb3138f5377 Mon Sep 17 00:00:00 2001 From: Soeren Magnus Olesen <101652697+df49b9cd@users.noreply.github.com> Date: Mon, 2 Nov 2026 18:14:01 +0100 Subject: [PATCH 2/3] Flatpak: disable WebKitGTK's DMA-BUF renderer (web process OOM) The GNOME 51 runtime's WebKitGTK ran the web process away right after launch, idle: ~100% CPU and ~5.9 GB within a minute, until the OOM killer ended it (journal: 7.5 and 9.7 GB). Measured on Intel UHD 620 / Mesa with the same library in a nested KWin. WEBKIT_DISABLE_DMABUF_RENDERER=1 keeps it flat at ~239 MB (rebuilt Flatpak, 3 min). The native build on the system WebKitGTK 2.54.2 never showed it; mpv's video surface is separate and unaffected. Co-authored-by: Claude --- WORKLOG.md | 5 +++++ packaging/flatpak/dev.testpattern.app.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/WORKLOG.md b/WORKLOG.md index 7ef8858..506f1b8 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -993,6 +993,11 @@ UHF/Infuse feature, **P2** = later. `gnome-51` image) for main, tags and manual runs and attaches `testpattern.flatpak` to releases. Not a Flathub submission: the app module downloads crates and npm packages during the build. + Fixed after first use: the runtime's WebKitGTK DMA-BUF renderer made the + web process run away (~5.9 GB within a minute of launch, idle, OOM-killed + at 7.5–9.7 GB; Intel UHD 620 / Mesa) → `WEBKIT_DISABLE_DMABUF_RENDERER=1` + in `finish-args`; the rebuilt Flatpak stays at ~239 MB. The native build + (system WebKitGTK 2.54.2) never showed it. ### 🟨 In progress diff --git a/packaging/flatpak/dev.testpattern.app.yml b/packaging/flatpak/dev.testpattern.app.yml index f2fe335..c2ffb41 100644 --- a/packaging/flatpak/dev.testpattern.app.yml +++ b/packaging/flatpak/dev.testpattern.app.yml @@ -30,6 +30,11 @@ finish-args: # source passwords and the TMDB key (secrets.rs: Secret Service — KWallet, # GNOME Keyring) - --talk-name=org.freedesktop.secrets + # The runtime's WebKitGTK DMA-BUF renderer runs away in the web process + # (~100% CPU, several GB within seconds of the UI loading, until the OOM + # killer ends it; seen on Intel UHD 620 / Mesa). The shared-memory renderer + # stays flat at ~230 MB. Video is unaffected: mpv draws to its own GLArea. + - --env=WEBKIT_DISABLE_DMABUF_RENDERER=1 modules: - name: libunibreak From 4e05b982ed29e17c02b84febcf80cdb3372de09b Mon Sep 17 00:00:00 2001 From: Soeren Magnus Olesen <101652697+df49b9cd@users.noreply.github.com> Date: Tue, 3 Nov 2026 14:13:27 +0100 Subject: [PATCH 3/3] Flatpak: fix the web-process blow-up in the UI, drop DISABLE_DMABUF WEBKIT_DISABLE_DMABUF_RENDERER=1 (82dc80e) kept memory flat but left the transparent webview black on the runtime's WebKitGTK 2.54: only repainted regions show, so hovered elements flash up and fade. It's removed. The runaway itself was bisected in a bare WebKitGTK window inside the GNOME 51 runtime (no Tauri, no mpv) serving the real UI and catalog. Two triggers, each enough on its own: - backdrop-filter on the small chips over poster artwork: the rating chip (media.tsx) and the 4K/DV quality badges (LibraryBrowser.tsx). Now plain dark backgrounds. - the .skeleton shimmer, an endless background-position animation, on a poster grid that is still loading (Movies: ~+1 GB/min). Now an opacity pulse (styles.css). Every other blur, animation and image was harmless. With runtime defaults, Home, Movies, Series, Live TV, Guide and Search each stay at ~265-290 MB for a minute (runtime WebKit, real data). The rebuilt Flatpak renders Home fully and stays at ~240 MB for 2 minutes. scripts/check.sh passes. Co-authored-by: Claude --- WORKLOG.md | 20 +++++++++++++++----- packaging/flatpak/dev.testpattern.app.yml | 9 ++++----- src/components/LibraryBrowser.tsx | 3 ++- src/components/media.tsx | 5 ++++- src/styles.css | 17 ++++++++--------- 5 files changed, 33 insertions(+), 21 deletions(-) diff --git a/WORKLOG.md b/WORKLOG.md index c8e994e..93b137f 100644 --- a/WORKLOG.md +++ b/WORKLOG.md @@ -1066,11 +1066,21 @@ UHF/Infuse feature, **P2** = later. job adds `testpattern.flatpak` to the checksummed, attested draft release with the other bundles. Not a Flathub submission: the app module downloads crates and npm packages during the build. - Fixed after first use: the runtime's WebKitGTK DMA-BUF renderer made the - web process run away (~5.9 GB within a minute of launch, idle, OOM-killed - at 7.5–9.7 GB; Intel UHD 620 / Mesa) → `WEBKIT_DISABLE_DMABUF_RENDERER=1` - in `finish-args`; the rebuilt Flatpak stays at ~239 MB. The native build - (system WebKitGTK 2.54.2) never showed it. + Fixed after first use: the web process ran away right after launch, idle + (~100% CPU, ~5.9 GB within a minute, OOM-killed at 7.5–9.7 GB; Intel UHD + 620 / Mesa). A first fix, `WEBKIT_DISABLE_DMABUF_RENDERER=1`, kept memory + flat but left the transparent webview black (2.54 then repaints only + damaged areas: hovered elements flash up and fade) and was dropped. + Bisected in a bare WebKitGTK window inside the GNOME 51 runtime (no + Tauri, no mpv) serving the real UI + data, two triggers: (1) + `backdrop-filter` on the small chips over poster artwork — rating + (`media.tsx`) and 4K/DV quality badges (`LibraryBrowser.tsx`), now plain + dark backgrounds; (2) the `.skeleton` shimmer (an endless + `background-position` animation) on a poster grid still loading + (Movies: +1 GB/min), now an opacity pulse (`styles.css`). Every other + blur, animation and image is harmless. Runtime defaults, all six main + pages ~265–290 MB flat. The native build (system WebKitGTK 2.54.2) + never showed it. ### 🟨 In progress diff --git a/packaging/flatpak/dev.testpattern.app.yml b/packaging/flatpak/dev.testpattern.app.yml index 990a9bb..a31a059 100644 --- a/packaging/flatpak/dev.testpattern.app.yml +++ b/packaging/flatpak/dev.testpattern.app.yml @@ -30,11 +30,10 @@ finish-args: # source passwords and the TMDB key (secrets.rs: Secret Service — KWallet, # GNOME Keyring) - --talk-name=org.freedesktop.secrets - # The runtime's WebKitGTK DMA-BUF renderer runs away in the web process - # (~100% CPU, several GB within seconds of the UI loading, until the OOM - # killer ends it; seen on Intel UHD 620 / Mesa). The shared-memory renderer - # stays flat at ~230 MB. Video is unaffected: mpv draws to its own GLArea. - - --env=WEBKIT_DISABLE_DMABUF_RENDERER=1 + # No WEBKIT_DISABLE_DMABUF_RENDERER: on the runtime's WebKitGTK 2.54 it + # leaves the transparent webview black (only repainted parts show). The + # runaway memory it was set for came from blurred chips over poster + # artwork, now unblurred in the UI (WORKLOG T-059). modules: - name: libunibreak diff --git a/src/components/LibraryBrowser.tsx b/src/components/LibraryBrowser.tsx index 4d8031f..deb7beb 100644 --- a/src/components/LibraryBrowser.tsx +++ b/src/components/LibraryBrowser.tsx @@ -214,8 +214,9 @@ export function QualityBadges({ quality }: { quality: string[] }) { if (!shown.length) return null; return ( <> + {/* no backdrop blur over artwork: see the rating chip in media.tsx */} {shown.map((b) => ( - + {b} ))} diff --git a/src/components/media.tsx b/src/components/media.tsx index e1574b9..dcf33b7 100644 --- a/src/components/media.tsx +++ b/src/components/media.tsx @@ -118,8 +118,11 @@ export const PosterCard = memo(function PosterCard({ {favorite && ( )} + {/* No backdrop blur on chips over artwork: dozens of small blurred + layers over images make WebKitGTK 2.54's compositor (GNOME 51 + runtime, the Flatpak) loop at 100% CPU and grow by GBs. */} {rating != null && rating > 0 && ( - + {rating.toFixed(1)} diff --git a/src/styles.css b/src/styles.css index 1948c81..c124297 100644 --- a/src/styles.css +++ b/src/styles.css @@ -114,12 +114,9 @@ textarea { transform: none; } } -@keyframes shimmer { - from { - background-position: -400px 0; - } - to { - background-position: 400px 0; +@keyframes pulse-soft { + 50% { + opacity: 0.55; } } @@ -129,10 +126,12 @@ textarea { .animate-rise-in { animation: rise-in 320ms var(--ease-soft) both; } +/* Loading placeholder: an opacity pulse, not a moving-gradient shimmer — a + grid full of animated backgrounds makes WebKitGTK 2.54's compositor (GNOME + 51 runtime, the Flatpak) grow by GBs (WORKLOG T-059). */ .skeleton { - background: linear-gradient(90deg, rgb(255 255 255 / 0.04) 0%, rgb(255 255 255 / 0.09) 50%, rgb(255 255 255 / 0.04) 100%); - background-size: 800px 100%; - animation: shimmer 1.4s linear infinite; + background: rgb(255 255 255 / 0.06); + animation: pulse-soft 1.4s ease-in-out infinite; } /* Soft top/bottom scrims over imagery */