diff --git a/.github/workflows/appimage-build.yml b/.github/workflows/appimage-build.yml index 36e49518..ded95a3b 100644 --- a/.github/workflows/appimage-build.yml +++ b/.github/workflows/appimage-build.yml @@ -47,7 +47,8 @@ jobs: -Dtext-frontend=true \ -Dwith-perl=perl \ -Dwith-python=python3 \ - -Dauto_features=enabled + -Dauto_features=enabled \ + -Dappindicator=enabled - name: Build run: | diff --git a/meson_options.txt b/meson_options.txt index faa9f665..0bdf5051 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -22,6 +22,9 @@ option('dbus', type: 'feature', value: 'auto', option('libcanberra', type: 'feature', value: 'auto', description: 'Support for sound alerts, Unix only' ) +option('appindicator', type: 'feature', value: 'auto', + description: 'Use Ayatana/AppIndicator-based tray backend when GTK3 is enabled' +) # Install options option('dbus-service-use-appid', type: 'boolean', value: false, diff --git a/src/fe-gtk/meson.build b/src/fe-gtk/meson.build index b66dfd73..65993c4e 100644 --- a/src/fe-gtk/meson.build +++ b/src/fe-gtk/meson.build @@ -40,15 +40,21 @@ if get_option('gtk3') zoitechat_gtk_cflags += '-DHAVE_GTK3' if host_machine.system() != 'windows' - appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false) - if appindicator_dep.found() - zoitechat_gtk_deps += appindicator_dep - zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR' - else - appindicator_dep = dependency('appindicator3-0.1', required: false) + appindicator_opt = get_option('appindicator') + + if appindicator_opt.allowed() + appindicator_dep = dependency('ayatana-appindicator3-0.1', required: false) if appindicator_dep.found() zoitechat_gtk_deps += appindicator_dep - zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR' + zoitechat_gtk_cflags += '-DHAVE_AYATANA_APPINDICATOR' + else + appindicator_dep = dependency('appindicator3-0.1', required: false) + if appindicator_dep.found() + zoitechat_gtk_deps += appindicator_dep + zoitechat_gtk_cflags += '-DHAVE_APPINDICATOR' + elif appindicator_opt.enabled() + error('appindicator=enabled, but neither ayatana-appindicator3-0.1 nor appindicator3-0.1 was found') + endif endif endif endif