From d5b0bebaa13a5603dd17e604352e373136e4611e Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Tue, 13 Jan 2026 19:52:51 -0600 Subject: [PATCH] fix(flatpak): add libayatana-appindicator dependencies - Switch from Freedesktop 23.08 to GNOME 47 runtime (for WebKitGTK) - Add full ayatana stack: intltool, libdbusmenu, ayatana-ido, libayatana-indicator, libayatana-appindicator - Patch ayatana-ido to make Vala optional - Fix build commands: use --no-bundle, proper PATH handling - Add missing finish-args: network, pulseaudio, MPRIS - Remove xdg-portal feature from tauri-plugin-dialog to avoid ashpd/zbus incompatibility Fixes runtime crash: "Failed to load ayatana-appindicator3" --- .github/workflows/release-flatpak.yml | 8 +- packaging/flatpak/com.blitzkriegfc.qbz.yml | 103 +++++++++++++++++++-- src-tauri/Cargo.toml | 2 +- 3 files changed, 102 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-flatpak.yml b/.github/workflows/release-flatpak.yml index a1efde53f..65c339fd4 100644 --- a/.github/workflows/release-flatpak.yml +++ b/.github/workflows/release-flatpak.yml @@ -77,10 +77,10 @@ jobs: - name: Install runtimes run: | flatpak install -y --noninteractive flathub \ - org.freedesktop.Platform//23.08 \ - org.freedesktop.Sdk//23.08 \ - org.freedesktop.Sdk.Extension.node20//23.08 \ - org.freedesktop.Sdk.Extension.rust-stable//23.08 + org.gnome.Platform//47 \ + org.gnome.Sdk//47 \ + org.freedesktop.Sdk.Extension.node20//24.08 \ + org.freedesktop.Sdk.Extension.rust-stable//24.08 || true - name: Build Flatpak run: | diff --git a/packaging/flatpak/com.blitzkriegfc.qbz.yml b/packaging/flatpak/com.blitzkriegfc.qbz.yml index 16cec4bb5..e09ba6234 100644 --- a/packaging/flatpak/com.blitzkriegfc.qbz.yml +++ b/packaging/flatpak/com.blitzkriegfc.qbz.yml @@ -1,15 +1,17 @@ app-id: com.blitzkriegfc.qbz -runtime: org.freedesktop.Platform -runtime-version: '23.08' -sdk: org.freedesktop.Sdk +runtime: org.gnome.Platform +runtime-version: '47' +sdk: org.gnome.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.node20 - org.freedesktop.Sdk.Extension.rust-stable command: qbz finish-args: - --share=ipc + - --share=network - --socket=x11 - --socket=wayland + - --socket=pulseaudio - --device=dri - --filesystem=xdg-download - --filesystem=xdg-music @@ -19,15 +21,103 @@ finish-args: - --talk-name=org.kde.StatusNotifierWatcher - --talk-name=org.freedesktop.portal.Desktop - --talk-name=org.freedesktop.portal.FileChooser + - --talk-name=org.mpris.MediaPlayer2.* modules: + # intltool required for libdbusmenu + - name: intltool + buildsystem: autotools + cleanup: + - '*' + sources: + - type: archive + url: https://launchpad.net/intltool/trunk/0.51.0/+download/intltool-0.51.0.tar.gz + sha256: 67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd + + # Dependency for libayatana-appindicator + - name: libdbusmenu + buildsystem: autotools + build-options: + cflags: -Wno-error + env: + HAVE_VALGRIND_FALSE: '#' + HAVE_VALGRIND_TRUE: '' + config-opts: + - --with-gtk=3 + - --disable-dumper + - --disable-static + - --disable-gtk-doc + - --enable-introspection=no + - --disable-vala + cleanup: + - /include + - /lib/pkgconfig + - /lib/*.la + - /share/doc + - /share/libdbusmenu + sources: + - type: archive + url: https://launchpad.net/libdbusmenu/16.04/16.04.0/+download/libdbusmenu-16.04.0.tar.gz + sha256: b9cc4a2acd74509435892823607d966d424bd9ad5d0b00938f27240a1bfa878a + + - name: ayatana-ido + buildsystem: cmake-ninja + config-opts: + - -DENABLE_TESTS=NO + cleanup: + - /include + - /lib/pkgconfig + sources: + - type: archive + url: https://github.com/AyatanaIndicators/ayatana-ido/archive/refs/tags/0.10.4.tar.gz + sha256: bd59abd5f1314e411d0d55ce3643e91cef633271f58126be529de5fb71c5ab38 + - type: shell + commands: + - sed -i 's/find_package(Vala REQUIRED QUIET)/find_package(Vala QUIET)/' src/CMakeLists.txt + - sed -i '/install.*AyatanaIdo3-0.4.gir/d' src/CMakeLists.txt + - sed -i '/install.*AyatanaIdo3-0.4.typelib/d' src/CMakeLists.txt + + - name: libayatana-indicator + buildsystem: cmake-ninja + config-opts: + - -DENABLE_TESTS=NO + - -DENABLE_IDO=YES + - -DENABLE_LOADER=NO + cleanup: + - /include + - /lib/pkgconfig + - /share + sources: + - type: archive + url: https://github.com/AyatanaIndicators/libayatana-indicator/archive/refs/tags/0.9.4.tar.gz + sha256: a18d3c682e29afd77db24366f8475b26bda22b0e16ff569a2ec71cd6eb4eac95 + + - name: libayatana-appindicator + buildsystem: cmake-ninja + config-opts: + - -DENABLE_BINDINGS_MONO=NO + - -DENABLE_BINDINGS_VALA=NO + - -DENABLE_GTKDOC=NO + cleanup: + - /include + - /lib/pkgconfig + sources: + - type: archive + url: https://github.com/AyatanaIndicators/libayatana-appindicator/archive/refs/tags/0.5.93.tar.gz + sha256: cbefed7a918a227bf71286246e237fcd3a9c8499b3eaac4897811a869409edf0 + - name: qbz buildsystem: simple + build-options: + append-path: /usr/lib/sdk/node20/bin:/usr/lib/sdk/rust-stable/bin + build-args: + - --share=network + env: + npm_config_nodedir: /usr/lib/sdk/node20 build-commands: - - export PATH=/usr/lib/sdk/node20/bin:/usr/lib/sdk/rust-stable/bin:$PATH - npm ci - - npm run build - - npm run tauri build -- --bundles none + - export PATH="$PWD/node_modules/.bin:$PATH" && npm run build + - export PATH="$PWD/node_modules/.bin:$PATH" && npm run tauri build -- --no-bundle - install -Dm755 src-tauri/target/release/qbz-nix /app/bin/qbz - install -Dm644 packaging/flatpak/com.blitzkriegfc.qbz.desktop /app/share/applications/com.blitzkriegfc.qbz.desktop - install -Dm644 packaging/flatpak/com.blitzkriegfc.qbz.metainfo.xml /app/share/metainfo/com.blitzkriegfc.qbz.metainfo.xml @@ -40,3 +130,4 @@ modules: - node_modules - src-tauri/target - .svelte-kit + diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index df7f13bdc..6bcf3472b 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -90,7 +90,7 @@ futures-util = "0.3" # Platform-specific dependencies [target.'cfg(target_os = "linux")'.dependencies] -tauri-plugin-dialog = { version = "2.5.0", default-features = false, features = ["xdg-portal"] } +tauri-plugin-dialog = { version = "2.5.0" } [target.'cfg(target_os = "macos")'.dependencies] tauri-plugin-dialog = { version = "2.5.0" }