aboutsummaryrefslogtreecommitdiffstats
path: root/testing/i3status/no-pulseaudio.patch
blob: 0d88afb1d9ef39d9bdb67585f29b0aef5fe5cfc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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