aports/testing/i3status/no-pulseaudio.patch
2017-07-14 13:13:33 +00:00

42 lines
1005 B
Diff

diff --git a/Makefile b/Makefile
index 3084ae7..fdf1030 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,6 @@ CPPFLAGS+=-DVERSION=\"${I3STATUS_VERSION}\"
CFLAGS+=-Iinclude
LIBS+=-lconfuse
LIBS+=-lyajl
-LIBS+=-lpulse
LIBS+=-lm
LIBS+=-lpthread
@@ -79,7 +78,14 @@ CFLAGS += -idirafter yajl-fallback
OBJS:=$(sort $(wildcard src/*.c *.c))
OBJS:=$(OBJS:.c=.o)
-ifeq ($(OS),OpenBSD)
+ifneq ($(OS),OpenBSD)
+HAVE_PULSE ?=1
+endif
+
+ifeq ($(HAVE_PULSE),1)
+LIBS+=-lpulse
+CFLAGS+=-DHAVE_PULSE
+else
OBJS:=$(filter-out src/pulse.o, $(OBJS))
LIBS:=$(filter-out -lpulse, $(LIBS))
endif
diff --git a/src/print_volume.c b/src/print_volume.c
index 51e84f3..95be558 100644
--- a/src/print_volume.c
+++ b/src/print_volume.c
@@ -61,7 +61,7 @@ void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *
free(instance);
}
-#ifndef __OpenBSD__
+#if defined(HAVE_PULSE)
/* Try PulseAudio first */
/* If the device name has the format "pulse[:N]" where N is the