fix race condition causing crashes when loading audio messages on the flatpak

This commit is contained in:
Henry Hiles 2026-11-12 19:58:29 -05:00
commit 312dd71e6f
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
2 changed files with 14 additions and 16 deletions

View file

@ -30,7 +30,14 @@
appName = "Nexus"; appName = "Nexus";
developer = "QuadRadical"; developer = "QuadRadical";
appId = "nexus.federated.nexus"; appId = "nexus.federated.nexus";
package = default; # The runtime's GStreamer gets loaded instead of ours, and it can't
# load our plugins, so keep wrapGAppsHook from pointing it at them
package = default.overrideAttrs (old: {
postInstall = ''
unset GST_PLUGIN_SYSTEM_PATH_1_0
''
+ old.postInstall;
});
runtime = "org.gnome.Platform/51"; runtime = "org.gnome.Platform/51";
permissions = { permissions = {
share = [ "network" ]; share = [ "network" ];

View file

@ -40,9 +40,12 @@ flutter.buildFlutterApplication {
nativeBuildInputs = [ (callPackage ./hook_pkg_config.nix { }) ]; nativeBuildInputs = [ (callPackage ./hook_pkg_config.nix { }) ];
buildInputs = [ buildInputs = [
# audioplayers plays audio through GStreamer # audioplayers plays audio through GStreamer, and wrapGAppsHook adds
# these plugins to the wrapper's GST_PLUGIN_SYSTEM_PATH_1_0
gst_all_1.gstreamer gst_all_1.gstreamer
gst_all_1.gst-plugins-base gst_all_1.gst-plugins-base
gst_all_1.gst-plugins-good
gst_all_1.gst-libav
# nativeapi includes XInput2.h, which needs these, but xi.pc only lists them privately # nativeapi includes XInput2.h, which needs these, but xi.pc only lists them privately
libxext libxext
libxfixes libxfixes
@ -75,24 +78,12 @@ flutter.buildFlutterApplication {
install -Dm755 linux/*.desktop -t $out/share/applications install -Dm755 linux/*.desktop -t $out/share/applications
install -Dm644 linux/*.metainfo.xml -t $out/share/metainfo install -Dm644 linux/*.metainfo.xml -t $out/share/metainfo
install -Dm644 linux/*.service -t $out/share/dbus-1/services install -Dm644 linux/*.service -t $out/share/dbus-1/services
# better_player loads libmpv at runtime to play videos, and audioplayers # better_player loads libmpv at runtime to play videos
# needs GStreamer's plugins to decode audio
# gomuks uses ffmpeg and ffprobe for video thumbnails and metadata # gomuks uses ffmpeg and ffprobe for video thumbnails and metadata
wrapProgram $out/bin/nexus \ wrapProgram $out/bin/nexus \
--suffix LD_LIBRARY_PATH : $out/app/nexus/lib \ --suffix LD_LIBRARY_PATH : $out/app/nexus/lib \
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ mpv-unwrapped ]} \ --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ mpv-unwrapped ]} \
--prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]} \ --prefix PATH : ${lib.makeBinPath [ ffmpeg-headless ]}
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${
lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (
with gst_all_1;
[
gstreamer
gst-plugins-base
gst-plugins-good
gst-libav
]
)
}
''; '';
meta = { meta = {