mirror of
https://github.com/Andre-Bzk/twitch4steamdeck.git
synced 2026-11-15 09:33:09 +01:00
The Flatpak only copied a hand-picked subset of Node runtime dependencies. Once logging was introduced in the main and preload processes, the app could fail before opening a window because electron-log was missing from the packaged runtime. Including it keeps the Flatpak runtime consistent with the codebase and removes an early startup failure path on Steam Deck.
150 lines
8.6 KiB
YAML
150 lines
8.6 KiB
YAML
app-id: tv.twitch4steamdeck.App
|
||
runtime: org.freedesktop.Platform
|
||
runtime-version: '24.08'
|
||
sdk: org.freedesktop.Sdk
|
||
# Stellt Chrome-Runtime-Bibliotheken (GTK, GLib, etc.) + zypak-wrapper bereit.
|
||
# Provides Chrome runtime libraries (GTK, GLib, etc.) + zypak-wrapper.
|
||
# Das Electron-Binary selbst kommt aus node_modules/electron/dist/electron (npm install in WSL2).
|
||
# The Electron binary itself comes from node_modules/electron/dist/electron (npm install in WSL2).
|
||
base: org.electronjs.Electron2.BaseApp
|
||
base-version: '24.08'
|
||
command: twitch4steamdeck
|
||
|
||
# ffmpeg-full: Stellt den vollen FFmpeg-Codec-Stack bereit (h264, h264_vaapi, etc.).
|
||
# ffmpeg-full: Provides the full FFmpeg codec stack (h264, h264_vaapi, etc.).
|
||
# Das freedesktop SDK 24.08 liefert nur ein reduziertes FFmpeg ohne patentbehaftete Codecs —
|
||
# The freedesktop SDK 24.08 only ships a reduced FFmpeg without patent-encumbered codecs.
|
||
# Electron/Chromium braucht h264 für hls.js (MediaSource Extensions).
|
||
# Electron/Chromium needs h264 for hls.js (MediaSource Extensions).
|
||
add-extensions:
|
||
org.freedesktop.Platform.ffmpeg-full:
|
||
directory: lib/ffmpeg
|
||
version: '24.08'
|
||
add-ld-path: .
|
||
no-autodownload: false
|
||
autodelete: false
|
||
|
||
finish-args:
|
||
- --share=network # Twitch Helix-API + Streamlink (HLS)
|
||
- --share=ipc # X11 shared memory (Wayland-Fallback)
|
||
- --socket=wayland
|
||
- --socket=fallback-x11
|
||
- --socket=pulseaudio # Audio
|
||
- --device=all # GPU + /dev/input/* (Gamepad API braucht Input-Devices)
|
||
- --talk-name=org.freedesktop.Notifications
|
||
# Electron userData liegt automatisch in ~/.var/app/tv.twitch4steamdeck.App/config/
|
||
# Electron userData is automatically stored in ~/.var/app/tv.twitch4steamdeck.App/config/
|
||
# Kein extra --filesystem nötig.
|
||
# No extra --filesystem permission is required.
|
||
|
||
# Build-Voraussetzung (WSL2, VOR flatpak-builder):
|
||
# Build prerequisite (WSL2, BEFORE flatpak-builder):
|
||
# cd /mnt/c/Projekte/twitch4steamdeck
|
||
# npm install # installiert Electron 33 für Linux + alle Deps
|
||
# npm install # installs Electron 33 for Linux + all dependencies
|
||
# npx @electron/rebuild # rebuildet better-sqlite3 für Linux x64
|
||
# npx @electron/rebuild # rebuilds better-sqlite3 for Linux x64
|
||
# npm run build # kompiliert TS → out/
|
||
# npm run build # compiles TS -> out/
|
||
# Das Projektverzeichnis (inkl. out/ und node_modules/) wird als type:dir Source
|
||
# The project directory (including out/ and node_modules/) is copied into the manifest build step
|
||
# in den Manifest-Build-Schritt kopiert.
|
||
# as a type:dir source.
|
||
|
||
modules:
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# 1) streamlink (Python) — liefert HLS-URLs aus Twitch-Streams
|
||
# 1) streamlink (Python) — provides HLS URLs from Twitch streams
|
||
# Wird von build-flatpak.sh via flatpak-pip-generator generiert:
|
||
# Generated by build-flatpak.sh via flatpak-pip-generator:
|
||
# python3 -m flatpak_pip_generator streamlink==6.11.0 \
|
||
# --output flatpak/python3-streamlink
|
||
# Das erzeugt flatpak/python3-streamlink.json mit allen Deps + sha256-Hashes.
|
||
# This generates flatpak/python3-streamlink.json with all dependencies + sha256 hashes.
|
||
# flatpak-builder lädt alle Sources offline herunter und installiert sie sauber.
|
||
# flatpak-builder downloads all sources offline and installs them cleanly.
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
- !include python3-streamlink.json
|
||
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# 1b) Mountpoint fuer ffmpeg-full Extension (muss vor App-Modul existieren)
|
||
# 1b) Mountpoint for the ffmpeg-full extension (must exist before the app module)
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
- name: ffmpeg-full-mountpoint
|
||
buildsystem: simple
|
||
build-commands:
|
||
- mkdir -p /app/lib/ffmpeg
|
||
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# 2) Haupt-App
|
||
# 2) Main app
|
||
# Voraussetzung: npm install + @electron/rebuild + npm run build wurden
|
||
# Prerequisite: npm install + @electron/rebuild + npm run build were run
|
||
# AUSSERHALB (in WSL2) ausgeführt. Dieses Modul kopiert nur die Artefakte.
|
||
# OUTSIDE the Flatpak build (in WSL2). This module only copies the artifacts.
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
- name: twitch4steamdeck
|
||
buildsystem: simple
|
||
build-commands:
|
||
# App-Artefakte installieren
|
||
# Install app artifacts
|
||
- mkdir -p /app/lib/twitch4steamdeck
|
||
- cp -r out /app/lib/twitch4steamdeck/out
|
||
# node_modules wird für better-sqlite3 (native .node-Datei) zur Laufzeit benötigt.
|
||
# node_modules is needed at runtime for better-sqlite3 (native .node file).
|
||
# Nur die notwendigen Teile kopieren, um die Paketgröße zu begrenzen.
|
||
# Copy only the required parts to keep package size down.
|
||
- mkdir -p /app/lib/twitch4steamdeck/node_modules
|
||
- cp -r node_modules/better-sqlite3 /app/lib/twitch4steamdeck/node_modules/
|
||
- cp -r node_modules/bindings /app/lib/twitch4steamdeck/node_modules/
|
||
- cp -r node_modules/electron-log /app/lib/twitch4steamdeck/node_modules/
|
||
- cp -r node_modules/file-uri-to-path /app/lib/twitch4steamdeck/node_modules/
|
||
# Electron-Binary (Linux, via npm install in WSL2)
|
||
# Electron binary (Linux, via npm install in WSL2)
|
||
- cp -r node_modules/electron /app/lib/twitch4steamdeck/node_modules/
|
||
# package.json für node require-Resolution
|
||
# package.json for Node require resolution
|
||
- cp package.json /app/lib/twitch4steamdeck/
|
||
# Launcher-Skript
|
||
# Launcher script
|
||
- install -Dm755 flatpak/twitch4steamdeck.sh /app/bin/twitch4steamdeck
|
||
# Icon (512×512 PNG, aus SVG konvertiert oder direkt abgelegt)
|
||
# Icon (512x512 PNG, converted from SVG or provided directly)
|
||
- |
|
||
if [ -f resources/icons/icon.png ]; then
|
||
install -Dm644 resources/icons/icon.png \
|
||
/app/share/icons/hicolor/512x512/apps/tv.twitch4steamdeck.App.png
|
||
elif [ -f resources/icons/icon.svg ]; then
|
||
rsvg-convert -w 512 -h 512 resources/icons/icon.svg \
|
||
-o /tmp/icon.png
|
||
install -Dm644 /tmp/icon.png \
|
||
/app/share/icons/hicolor/512x512/apps/tv.twitch4steamdeck.App.png
|
||
fi
|
||
# .desktop-Eintrag
|
||
# .desktop entry
|
||
- install -Dm644 flatpak/tv.twitch4steamdeck.App.desktop \
|
||
/app/share/applications/tv.twitch4steamdeck.App.desktop
|
||
# WSL/Windows-Checkouts können 0777 an viele Dateien vererben; OSTree lehnt das ab.
|
||
# WSL/Windows checkouts can inherit 0777 on many files; OSTree rejects that.
|
||
- find /app -type d -exec chmod 755 {} +
|
||
- find /app -type f -exec chmod 644 {} +
|
||
- find /app/bin -type f -exec chmod 755 {} +
|
||
- find /app/lib -type f -name '*.so*' -exec chmod 755 {} +
|
||
- |
|
||
if [ -d /app/libexec ]; then
|
||
find /app/libexec -type f -exec chmod 755 {} +
|
||
fi
|
||
- |
|
||
if [ -f /app/lib/twitch4steamdeck/node_modules/electron/dist/electron ]; then
|
||
chmod 755 /app/lib/twitch4steamdeck/node_modules/electron/dist/electron
|
||
fi
|
||
- |
|
||
if [ -f /app/lib/twitch4steamdeck/node_modules/electron/dist/chrome-sandbox ]; then
|
||
chmod 755 /app/lib/twitch4steamdeck/node_modules/electron/dist/chrome-sandbox
|
||
fi
|
||
sources:
|
||
# Gesamtes Projektverzeichnis (inkl. aus/ + node_modules/ aus WSL2-Prebuild)
|
||
# Full project directory (including out/ + node_modules/ from the WSL2 prebuild)
|
||
- type: dir
|
||
path: ..
|