flathub / org.electronjs.Electron2.BaseApp

7 stars 16 forks source link

Add patch-desktop-filename script #56

Closed JakobDev closed 8 months ago

JakobDev commented 8 months ago

This PR belongs to #55

As mentioned in the other PR, showing a number and a progress bar in the window icon needs the correct desktop filename in the package.json, which is a problem for most Flatpaks. This PR solves the problem by providing a script to do that. You just need to call the script with the app.asar as parameter and it will do the Rest. I have modified the Element Flatpak as a Demo.

Manifest ```yaml app-id: im.riot.Riot base: org.electronjs.Electron2.BaseApp base-version: '23.08' runtime: org.freedesktop.Platform runtime-version: '23.08' sdk: org.freedesktop.Sdk command: element separate-locales: false finish-args: # Version required to use the document-portal v4 - --require-version=1.7.0 # Required due to being a GUI application - --socket=x11 # Required to make sure x11 performance is achived on all platforms # At least that's what the legends tell. it might be worth experimenting # with dropping this permission. - --share=ipc # Required for experimental wayland support - --socket=wayland # Required to provide Call functionality - --socket=pulseaudio - --device=all # As a chat application, networking is required - --share=network # Required for notifications in various desktop environments - --talk-name=org.kde.StatusNotifierWatcher # Required to allow screensaver/idle inhibition such as during video calls - --talk-name=org.freedesktop.ScreenSaver # Required to store access tokens (persistent logins) - --filesystem=xdg-run/keyring # Required for experimental wayland support - --filesystem=xdg-run/pipewire-0 # For correct cursor scaling under Wayland - --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons - --talk-name=com.canonical.Unity - --env=XDG_CURRENT_SESSION=KDE cleanup: - /include - /lib/pkgconfig - /lib/*.la - /lib/*.a - /share/pkgconfig - /share/aclocal - /share/gtk-doc - /share/doc - /share/info - /share/man - /man modules: - name: riot buildsystem: simple build-commands: - install element.sh /app/bin/element - install -Dm644 im.riot.Riot.desktop /app/share/applications/im.riot.Riot.desktop - install -Dm644 im.riot.Riot.metainfo.xml /app/share/metainfo/im.riot.Riot.metainfo.xml - rm element.sh im.riot.Riot.desktop im.riot.Riot.metainfo.xml - install -Dm644 resources/img/element.png /app/share/icons/hicolor/256x256/apps/${FLATPAK_ID}.png - mkdir /app/Element - cp -r * /app/Element - chmod -R a-s,go+rX,go-w "/app/Element" - patch-desktop-filename ${FLATPAK_DEST}/Element/resources/app.asar sources: - type: archive only-arches: - x86_64 url: https://packages.element.io/desktop/install/linux/glibc-x86-64/element-desktop-1.11.57.tar.gz sha256: da2654b17b5dbe58e8e939dc98bc29873df19b4799421c681c468c0e132f54db x-checker-data: type: html url: https://packages.element.io/desktop/install/linux/glibc-x86-64/index.html version-pattern: element-desktop-([\d\.-]*).tar.gz url-template: https://packages.element.io/desktop/install/linux/glibc-x86-64/element-desktop-$version.tar.gz - type: file path: element.sh - type: file path: im.riot.Riot.metainfo.xml - type: file path: im.riot.Riot.desktop ```

Result: grafik

flathubbot commented 8 months ago

Started test build 97175

flathubbot commented 8 months ago

Build 97175 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/79945/org.electronjs.Electron2.BaseApp.flatpakref
JakobDev commented 8 months ago

@bbhtt @TingPing Can you take a look at this?

flathubbot commented 8 months ago

Started test build 97545

flathubbot commented 8 months ago

Build 97545 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/80323/org.electronjs.Electron2.BaseApp.flatpakref