From 6b2e9ec669c97d064743049acd189c9336aa054f Mon Sep 17 00:00:00 2001 From: Brenden Blosser Date: Fri, 3 Jul 2026 12:12:57 -0400 Subject: [PATCH] Add flatpak packaging target electron-builder already bundles @malept/flatpak-bundler, so this just adds the target + a finishArgs set matching the app's actual needs: wayland/x11 rendering, PipeWire for WebRTC screen/mic capture (on top of the base pulseaudio socket), camera device access, and the freedesktop notifications + portal bus names (native/linux-portals handles file chooser/background/global-shortcuts through the latter). Bumped runtime/base to 23.08 from electron-builder's very old 20.08 default. Building this target requires flatpak + flatpak-builder installed on the build machine (Linux-only, can't run on macOS at all), plus the org.freedesktop.Platform/Sdk and org.electronjs.Electron2.BaseApp 23.08 runtimes from Flathub. --- fluxer_desktop/electron-builder.config.cjs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/fluxer_desktop/electron-builder.config.cjs b/fluxer_desktop/electron-builder.config.cjs index 305bd3b..63bbff4 100644 --- a/fluxer_desktop/electron-builder.config.cjs +++ b/fluxer_desktop/electron-builder.config.cjs @@ -1256,11 +1256,38 @@ module.exports = { target: 'tar.gz', arch: targetArchs, }, + { + target: 'flatpak', + arch: targetArchs, + }, ], desktop: { entry: linuxDesktopEntry, }, }, + flatpak: { + runtimeVersion: '23.08', + baseVersion: '23.08', + finishArgs: [ + // Wayland/X11 rendering + '--socket=wayland', + '--socket=x11', + '--share=ipc', + // OpenGL + '--device=dri', + // Camera (native/mac-* equivalents on Linux go through /dev/video*) + '--device=all', + // Audio output + WebRTC screen/mic capture via PipeWire + '--socket=pulseaudio', + '--socket=pipewire', + '--filesystem=home', + '--share=network', + // System notifications + '--talk-name=org.freedesktop.Notifications', + // XDG portals (file chooser, background, global shortcuts -- see native/linux-portals) + '--talk-name=org.freedesktop.portal.Desktop', + ], + }, deb: { packageCategory: 'net', desktop: {