ci(flatpak): add flatpak builder lint (#2799)
This commit is contained in:
parent
acccacf861
commit
37b60fb2c1
18 changed files with 235 additions and 52 deletions
11
packaging/linux/flatpak/apps.json
Normal file
11
packaging/linux/flatpak/apps.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"env": {
|
||||
"PATH": "$(PATH):$(HOME)/.local/bin"
|
||||
},
|
||||
"apps": [
|
||||
{
|
||||
"name": "Desktop",
|
||||
"image-path": "desktop.png"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<component type="desktop-application">
|
||||
<id>@PROJECT_FQDN@</id>
|
||||
|
||||
<name>@CMAKE_PROJECT_NAME@</name>
|
||||
<summary>@PROJECT_BRIEF_DESCRIPTION@</summary>
|
||||
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>@PROJECT_LICENSE@</project_license>
|
||||
|
||||
<supports>
|
||||
<control>pointing</control>
|
||||
<control>keyboard</control>
|
||||
<control>touch</control>
|
||||
<control>gamepad</control>
|
||||
</supports>
|
||||
|
||||
<url type="bugtracker">https://github.com/LizardByte/Sunshine/issues</url>
|
||||
<url type="homepage">@PROJECT_HOMEPAGE_URL@</url>
|
||||
<url type="donation">https://app.lizardbyte.dev/#Donate</url>
|
||||
<url type="contact">https://app.lizardbyte.dev/support</url>
|
||||
<url type="translate">https://translate.lizardbyte.dev</url>
|
||||
<url type="contribute">https://docs.lizardbyte.dev</url>
|
||||
<url type="vcs-browser">https://github.com/LizardByte/Sunshine</url>
|
||||
|
||||
<description>
|
||||
<p>
|
||||
@PROJECT_LONG_DESCRIPTION@
|
||||
</p>
|
||||
|
||||
<p>NOTE: Allow Sunshine Virtual Input (Required)</p>
|
||||
<p>sudo chown $USER /dev/uinput && echo 'KERNEL=="uinput", SUBSYSTEM=="misc",
|
||||
OPTIONS+="static_node=uinput", TAG+="uaccess"' | sudo tee
|
||||
/etc/udev/rules.d/60-sunshine-input.rules</p>
|
||||
<p>NOTE: Sunshine uses a self-signed certificate. The web browser will report it as not secure,
|
||||
but it is safe.</p>
|
||||
<p>NOTE: KMS Grab (Optional)</p>
|
||||
<p>sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}')
|
||||
flatpak run @PROJECT_FQDN@</p>
|
||||
</description>
|
||||
|
||||
<releases>
|
||||
<release version="0.23.1" date="2024-04-21"/>
|
||||
<release version="0.23.0" date="2024-04-06"/>
|
||||
<release version="0.22.2" date="2024-03-15"/>
|
||||
<release version="0.22.1" date="2024-03-13"/>
|
||||
<release version="0.22.0" date="2024-03-04"/>
|
||||
<release version="0.21.0" date="2023-10-15"/>
|
||||
<release version="0.20.0" date="2023-05-29"/>
|
||||
<release version="0.19.1" date="2023-03-30"/>
|
||||
</releases>
|
||||
|
||||
<developer_name>LizardByte</developer_name>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://app.lizardbyte.dev/Sunshine/assets/images/AdobeStock_305732536_1920x1280.jpg</image>
|
||||
<caption>Sunshine</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.0">
|
||||
<content_attribute id="language-profanity">moderate</content_attribute>
|
||||
<content_attribute id="language-humor">mild</content_attribute>
|
||||
<content_attribute id="money-purchasing">mild</content_attribute>
|
||||
</content_rating>
|
||||
<launchable type="desktop-id">@PROJECT_FQDN@.desktop</launchable>
|
||||
</component>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
app-id: dev.lizardbyte.sunshine
|
||||
app-id: "@PROJECT_FQDN@"
|
||||
runtime: org.freedesktop.Platform
|
||||
runtime-version: "22.08"
|
||||
sdk: org.freedesktop.Sdk
|
||||
|
|
@ -17,7 +17,7 @@ finish-args:
|
|||
- --share=network # access network
|
||||
- --socket=pulseaudio # play sounds using pulseaudio
|
||||
- --socket=wayland # show windows using Wayland
|
||||
- --socket=x11 # show windows using X11
|
||||
- --socket=fallback-x11 # show windows using X11
|
||||
- --system-talk-name=org.freedesktop.Avahi # talk to avahi on the system bus
|
||||
- --talk-name=org.freedesktop.Flatpak # talk to flatpak on the session bus
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ modules:
|
|||
stable-only: true
|
||||
|
||||
- name: miniupnpc
|
||||
buildsystem: cmake
|
||||
buildsystem: cmake-ninja
|
||||
config-opts:
|
||||
- -DUPNPC_BUILD_SAMPLE=OFF
|
||||
- -DUPNPC_BUILD_SHARED=ON
|
||||
|
|
@ -258,7 +258,7 @@ modules:
|
|||
|
||||
- name: sunshine
|
||||
disabled: false
|
||||
buildsystem: cmake
|
||||
buildsystem: cmake-ninja
|
||||
no-make-install: false
|
||||
builddir: true
|
||||
build-options:
|
||||
|
|
@ -277,7 +277,6 @@ modules:
|
|||
- -DBUILD_DOCS=OFF
|
||||
- -DBUILD_WERROR=ON
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_INSTALL_PREFIX=/app
|
||||
- -DCMAKE_CUDA_COMPILER=/app/cuda/bin/nvcc
|
||||
- -DSUNSHINE_ASSETS_DIR=share/sunshine
|
||||
- -DSUNSHINE_EXECUTABLE_PATH=/app/bin/sunshine
|
||||
|
|
@ -289,20 +288,10 @@ modules:
|
|||
sources:
|
||||
- type: git
|
||||
url: "@GITHUB_CLONE_URL@"
|
||||
branch: "@GITHUB_BRANCH@"
|
||||
commit: "@GITHUB_COMMIT@"
|
||||
post-install:
|
||||
# use `sed` to update apps.json with prefixes required for flatpak
|
||||
# -r (regex)
|
||||
# -z (handle new lines) https://linuxhint.com/sed-replace-newline-with-space
|
||||
# `/gm` global and multiline
|
||||
- sed -r -z -i -e
|
||||
's/("((do)|(undo)|(cmd)|(detached))"\s*:\s*\[?\n*\s*")(.*")/\1flatpak-spawn --host \7/gm'
|
||||
/app/share/sunshine/apps.json
|
||||
- sed -i
|
||||
's%/app/bin/sunshine%flatpak run dev.lizardbyte.sunshine\nExecStop=flatpak kill dev.lizardbyte.sunshine%g'
|
||||
/app/share/sunshine/systemd/user/sunshine.service
|
||||
- install -D $FLATPAK_BUILDER_BUILDDIR/packaging/linux/flatpak/scripts/* /app/bin
|
||||
- install -D $FLATPAK_BUILDER_BUILDDIR/packaging/linux/flatpak/apps.json /app/share/sunshine/apps.json
|
||||
run-tests: true
|
||||
test-rule: "" # empty to disable
|
||||
test-commands:
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"errors": [
|
||||
"finish-args-flatpak-spawn-access"
|
||||
],
|
||||
"info": [
|
||||
"finish-args-flatpak-spawn-access: finish-args has a talk-name access for org.freedesktop.Flatpak"
|
||||
],
|
||||
"message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter"
|
||||
}
|
||||
11
packaging/linux/flatpak/flatpak-lint-baseline_repo.json
Normal file
11
packaging/linux/flatpak/flatpak-lint-baseline_repo.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"errors": [
|
||||
"appstream-external-screenshot-url",
|
||||
"finish-args-flatpak-spawn-access"
|
||||
],
|
||||
"info": [
|
||||
"appstream-external-screenshot-url: Screenshots are not mirrored to https://dl.flathub.org/media",
|
||||
"finish-args-flatpak-spawn-access: finish-args has a talk-name access for org.freedesktop.Flatpak"
|
||||
],
|
||||
"message": "Please consult the documentation at https://docs.flathub.org/docs/for-app-authors/linter"
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=@PROJECT_NAME@
|
||||
Exec=flatpak run dev.lizardbyte.sunshine
|
||||
Exec=@PROJECT_FQDN@
|
||||
Version=1.0
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Icon=sunshine
|
||||
Icon=@SUNSHINE_DESKTOP_ICON@
|
||||
Keywords=gamestream;stream;moonlight;remote play;
|
||||
Categories=AudioVideo;Network;RemoteAccess;
|
||||
Actions=RunInTerminal;KMS;
|
||||
|
|
@ -12,9 +12,9 @@ Actions=RunInTerminal;KMS;
|
|||
[Desktop Action RunInTerminal]
|
||||
Name=Run in Terminal
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/sunshine_terminal.desktop
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/@PROJECT_FQDN@_terminal.desktop
|
||||
|
||||
[Desktop Action KMS]
|
||||
Name=Run in Terminal (KMS)
|
||||
Icon=application-x-executable
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/sunshine_kms.desktop
|
||||
Exec=gio launch @CMAKE_INSTALL_FULL_DATAROOTDIR@/applications/@PROJECT_FQDN@_kms.desktop
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[Desktop Entry]
|
||||
Name=@PROJECT_NAME@ (KMS)
|
||||
Exec=sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run dev.lizardbyte.sunshine
|
||||
Exec=sudo -i PULSE_SERVER=unix:$(pactl info | awk '/Server String/{print$3}') flatpak run @PROJECT_FQDN@
|
||||
Terminal=true
|
||||
Type=Application
|
||||
NoDisplay=true
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<project_license>@PROJECT_LICENSE@</project_license>
|
||||
<name>@PROJECT_NAME@</name>
|
||||
<url type="homepage">@CMAKE_PROJECT_HOMEPAGE_URL@</url>
|
||||
<summary>@PROJECT_DESCRIPTION@</summary>
|
||||
<summary>@PROJECT_BRIEF_DESCRIPTION@</summary>
|
||||
<description>
|
||||
<p>
|
||||
@PROJECT_LONG_DESCRIPTION@
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Name=@PROJECT_NAME@
|
|||
Exec=/usr/bin/env systemctl start --u sunshine
|
||||
Version=1.0
|
||||
Comment=@PROJECT_DESCRIPTION@
|
||||
Icon=sunshine
|
||||
Icon=@SUNSHINE_DESKTOP_ICON@
|
||||
Keywords=gamestream;stream;moonlight;remote play;
|
||||
Categories=AudioVideo;Network;RemoteAccess;
|
||||
Actions=RunInTerminal;
|
||||
|
|
|
|||
|
|
@ -4,7 +4,8 @@ StartLimitIntervalSec=500
|
|||
StartLimitBurst=5
|
||||
|
||||
[Service]
|
||||
ExecStart=@SUNSHINE_EXECUTABLE_PATH@
|
||||
@SUNSHINE_SERVICE_START_COMMAND@
|
||||
@SUNSHINE_SERVICE_STOP_COMMAND@
|
||||
Restart=on-failure
|
||||
RestartSec=5s
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue