Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 34 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# CI (WORKLOG T-037/T-057). Every push to main and every pull request runs
# CI (WORKLOG T-037/T-057/T-059). Every push to main and every pull request runs
# scripts/check.sh on Ubuntu 24.04 (Rust unit tests + clippy, TypeScript
# typecheck + vitest, third-party notices) and on macOS 26 (the same checks
# plus the keychain round-trip test, PL-111). Version tags (v*), pushes to
# main and manual runs also build the portable release bundles — Linux
# (.deb/AppImage/.rpm, T-049) and macOS (.dmg, T-028) — as run artifacts;
# tag builds publish them on a GitHub release: version-gated, checksummed,
# draft, with release notes and Sigstore build-provenance attestations.
# (.deb/AppImage/.rpm, T-049; Flatpak, T-059) and macOS (.dmg, T-028) — as
# run artifacts; tag builds publish them on a GitHub release: version-gated,
# checksummed, draft, with release notes and Sigstore build-provenance
# attestations.
# The end-to-end smoke test stays local: it needs the IPTV account, which
# allows one stream at a time.
#
Expand Down Expand Up @@ -301,7 +302,7 @@ jobs:
# on a DRAFT release with generated + manual notes — a human publishes.
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [bundle, bundle-macos]
needs: [bundle, bundle-macos, flatpak]
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
Expand Down Expand Up @@ -334,7 +335,7 @@ jobs:
- name: Checksums
run: |
cd release
sha256sum -- *.dmg *.deb *.AppImage *.rpm > SHA256SUMS
sha256sum -- *.dmg *.deb *.AppImage *.rpm *.flatpak > SHA256SUMS
cat SHA256SUMS

- name: Prerelease?
Expand All @@ -352,6 +353,8 @@ jobs:

**Linux** (Ubuntu 24.04+, Debian 13, Fedora 40+ — glibc ≥ 2.39): the \`.deb\`, the \`.rpm\` or the AppImage. Wayland and X11 both work; VA-API hardware decoding where the GPU offers it.

**Flatpak** (any distro with Flatpak; the GNOME runtime comes from Flathub): \`flatpak install --user testpattern.flatpak\`.

**macOS 13+ (Apple Silicon)**: the \`.dmg\`. If Gatekeeper warns on first launch, right-click the app and choose Open (releases are signed and notarized when Apple credentials are configured; otherwise ad-hoc signed).

Checksums are in **SHA256SUMS** — verify with \`sha256sum -c SHA256SUMS\` (Linux) or \`shasum -a 256 -c SHA256SUMS\` (macOS). Each asset carries a build-provenance attestation, verifiable with \`gh attestation verify <asset>\`.
Expand Down Expand Up @@ -380,5 +383,30 @@ jobs:
release/*.deb
release/*.AppImage
release/*.rpm
release/*.flatpak
release/SHA256SUMS
fail_on_unmatched_files: true

# Flatpak (T-059), built from packaging/flatpak/ in Flathub's GNOME image on
# the same triggers as the other bundles; the action uploads
# testpattern.flatpak as an artifact, which the release job picks up.
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
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
artifact-name: testpattern-flatpak-x86_64
cache-key: flatpak-${{ hashFiles('packaging/flatpak/dev.testpattern.app.yml', 'scripts/build-media.sh') }}
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
64 changes: 63 additions & 1 deletion WORKLOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,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")
Expand Down Expand Up @@ -127,6 +128,24 @@ the repo secrets are set (`APPLE_CERTIFICATE` +
`APPLE_PASSWORD` + `APPLE_TEAM_ID`); without them the .dmg is ad-hoc
signed (runs after right-click → Open).

**Flatpak** (T-059): `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
Expand Down Expand Up @@ -258,10 +277,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-059) |
| `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 + macOS 26 (keychain round-trip) for pushes/PRs; Linux and macOS bundles on main pushes/tags; tag builds publish checksummed, attested draft releases (T-037, T-057) |
| `.github/workflows/ci.yml` | CI: `scripts/check.sh` on Ubuntu 24.04 + macOS 26 (keychain round-trip) for pushes/PRs; Linux, macOS and Flatpak bundles on main pushes/tags; tag builds publish checksummed, attested draft releases (T-037, T-057, T-059) |
| `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 |
Expand Down Expand Up @@ -1027,6 +1047,41 @@ UHF/Infuse feature, **P2** = later.
unlocked keychain only (locked classification stays covered by the
pure unit test) and CI bounds it with the watchdog.

- **T-059 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; the T-057 `release`
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 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

### 🟦 To do
Expand All @@ -1047,6 +1102,13 @@ UHF/Infuse feature, **P2** = later.

## 6. Log

- **2026-11-02** — T-059 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
Expand Down
10 changes: 10 additions & 0 deletions packaging/flatpak/dev.testpattern.app.desktop
Original file line number Diff line number Diff line change
@@ -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
39 changes: 39 additions & 0 deletions packaging/flatpak/dev.testpattern.app.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>dev.testpattern.app</id>
<name>testpattern</name>
<summary>IPTV player with a TV guide, movies and series</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-or-later</project_license>
<developer id="dev.testpattern">
<name>the testpattern authors</name>
</developer>
<description>
<p>
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.
</p>
<ul>
<li>Plays H.264, HEVC and AV1, AAC, AC3, EAC3 and DTS in MPEG-TS, HLS and MKV through an embedded mpv and FFmpeg</li>
<li>Hardware decoding through VA-API</li>
<li>One entry per title: the copies a provider lists of a film or show become versions</li>
<li>Optional TMDB metadata with your own API key</li>
<li>Source passwords are kept in the desktop keyring</li>
</ul>
<p>testpattern ships no content; use sources you are entitled to.</p>
</description>
<launchable type="desktop-id">dev.testpattern.app.desktop</launchable>
<url type="homepage">https://github.com/df49b9cd/testpattern-app</url>
<content_rating type="oars-1.1"/>
<supports>
<control>pointing</control>
<control>keyboard</control>
</supports>
<requires>
<display_length compare="ge">960</display_length>
</requires>
<releases>
<release version="0.1.0" date="2026-11-02"/>
</releases>
</component>
Loading
Loading