forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11-misc/i3status: make dependency on pulseaudio optional
Fixes bug #570786 and introduces the new USE flag 'pulseaudio'. Reported-by: Michele Alzetta <[email protected]>
- Loading branch information
1 parent
c1134b0
commit b3d5558
Showing
2 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Make dependency on pulseaudio optional. | ||
|
||
It's unfortunately not upstreamable. See: | ||
|
||
https://github.com/i3/i3status/pull/43 | ||
https://bugs.gentoo.org/show_bug.cgi?id=570786 | ||
|
||
--- a/Makefile | ||
+++ b/Makefile | ||
@@ -49,6 +49,10 @@ ifeq ($(OS),NetBSD) | ||
LIBS+=-lprop | ||
endif | ||
|
||
+ifeq ($(OS),OpenBSD) | ||
+LIBS+=-lpthread | ||
+endif | ||
+ | ||
# This probably applies for any pkgsrc based system | ||
ifneq (, $(filter $(OS), NetBSD DragonFly)) | ||
CFLAGS+=-I/usr/pkg/include/ | ||
@@ -70,9 +74,12 @@ CFLAGS += -idirafter yajl-fallback | ||
OBJS:=$(wildcard src/*.c *.c) | ||
OBJS:=$(OBJS:.c=.o) | ||
|
||
-ifeq ($(OS),OpenBSD) | ||
+PULSE ?= 1 | ||
+ifeq ($(PULSE),0) | ||
OBJS:=$(filter-out src/pulse.o, $(OBJS)) | ||
-LIBS:=$(filter-out -lpulse, $(LIBS)) -lpthread | ||
+LIBS:=$(filter-out -lpulse, $(LIBS)) | ||
+else | ||
+CPPFLAGS+=-DPULSE | ||
endif | ||
|
||
src/%.o: src/%.c include/i3status.h | ||
--- a/src/print_volume.c | ||
+++ b/src/print_volume.c | ||
@@ -60,7 +60,7 @@ void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char * | ||
free(instance); | ||
} | ||
|
||
-#ifndef __OpenBSD__ | ||
+#if !defined(__OpenBSD__) && defined(PULSE) | ||
/* Try PulseAudio first */ | ||
|
||
/* If the device name has the format "pulse[:N]" where N is the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters