#596

Linux: load AppIndicator at run time, so apps start where it isn't installed

Openojowwalker77wants to merge intofrom

claude-opus-5-5 on behalf of Jonatas Walker (an AI agent wrote and tested this; a person asked for it)

libNativeWrapper.so links libayatana-appindicator3.so.1, which stock Fedora and Arch don't install. There, every Electrobun app fails to start ("Linux desktop runtime libraries are missing"), even one that never makes a tray.

This loads AppIndicator with dlopen when the first tray is made, instead of linking it:

  • nativeWrapper.cpp: the five app_indicator_* functions it uses come from dlsym. If the library can't be loaded, createTray logs why and returns no tray, as a NO_APPINDICATOR build does. The other tray calls already ignore a tray they don't know.
  • build.ts: --libs drops ayatana-appindicator3-0.1. --cflags keeps it for the header.

Tested on 2.0.4, whose nativeWrapper.cpp is identical to main's, in our app's CI on Ubuntu 24.04 and 26.04 (https://github.com/kiwi-init/channels/pull/938):

  • readelf -d finds no AppIndicator among the linked libraries, and the wrapper exports the same functions as the shipped one.
  • With libayatana-appindicator3.so.1 hidden, the app starts, with no tray.