zserge / tray

Cross-platform, super tiny C99 implementation of a system tray icon with a popup menu.
MIT License
493 stars 84 forks source link

Ubuntu 18.04 has different pkg-config name for appindicator #15

Open tekknolagi opened 4 years ago

tekknolagi commented 4 years ago

On Ubuntu, this won't compile unless I change the Makefile a little.

maple% lsb_release -irc
Distributor ID: Ubuntu
Release:    18.04
Codename:   bionic

Apparently appindicator3-0.1 is not a valid pkg config.

diff --git a/Makefile b/Makefile
index 483c0aa..d9a1da4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,8 +2,8 @@ ifeq ($(OS),Windows_NT)
        TRAY_CFLAGS := -DTRAY_WINAPI=1
        TRAY_LDFLAGS :=
 else ifeq ($(shell uname -s),Linux)
-       TRAY_CFLAGS := -DTRAY_APPINDICATOR=1 $(shell pkg-config --cflags appindicator3-0.1)
-       TRAY_LDFLAGS := $(shell pkg-config --libs appindicator3-0.1)
+       TRAY_CFLAGS := -DTRAY_APPINDICATOR=1 $(shell pkg-config --cflags appindicator-0.1)
+       TRAY_LDFLAGS := $(shell pkg-config --libs appindicator-0.1)
 else ifeq ($(shell uname -s),Darwin)
        TRAY_CFLAGS := -DTRAY_APPKIT=1
        TRAY_LDFLAGS := -framework Cocoa

I don't think I know enough to make a pull request -- just tossing this info your way.

Cheers on a very cool project!

SapuSeven commented 3 years ago

Same here on current Arch Linux.

Update:

I did some more searching and found out that appindicator-0.1 is the GTK2 version. You need to install appindicator-gtk3 to use the GTK3 version (appindicator3-0.1).

chym95 commented 1 year ago

On Ubuntu 22.04.1 I also need GTK3 :

-       TRAY_CFLAGS := -DTRAY_APPINDICATOR=1 $(shell pkg-config --cflags appindicator3-0.1)
-       TRAY_LDFLAGS := $(shell pkg-config --libs appindicator3-0.1)
+       TRAY_CFLAGS := -DTRAY_APPINDICATOR=1 $(shell pkg-config --cflags appindicator-0.1) $(shell pkg-config --cflags --libs gtk+-3.0)
+       TRAY_LDFLAGS := $(shell pkg-config --libs appindicator-0.1) $(shell pkg-config --libs gtk+-3.0)