diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-14 13:12:49 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2017-07-14 13:13:33 +0000 |
commit | a6aae78d406eeda992384cfc595b0a54538e6aef (patch) | |
tree | 1114da3878262e60725fa948deaa69d0879920f5 /testing/i3status/no-pulseaudio.patch | |
parent | 6fbf13c07ae44a3a20d956b95cff7fa6596f18f4 (diff) | |
download | aports-a6aae78d406eeda992384cfc595b0a54538e6aef.tar.bz2 aports-a6aae78d406eeda992384cfc595b0a54538e6aef.tar.xz |
testing/i3status: upgrade to 2.11
Diffstat (limited to 'testing/i3status/no-pulseaudio.patch')
-rw-r--r-- | testing/i3status/no-pulseaudio.patch | 101 |
1 files changed, 31 insertions, 70 deletions
diff --git a/testing/i3status/no-pulseaudio.patch b/testing/i3status/no-pulseaudio.patch index 94baae7e53..0d88afb1d9 100644 --- a/testing/i3status/no-pulseaudio.patch +++ b/testing/i3status/no-pulseaudio.patch @@ -1,80 +1,41 @@ -diff -upr i3status-2.10.orig/Makefile i3status-2.10/Makefile ---- i3status-2.10.orig/Makefile 2016-01-07 19:53:31.912304558 +0100 -+++ i3status-2.10/Makefile 2016-01-07 19:55:02.869685848 +0100 -@@ -24,6 +24,10 @@ LIBS+=-lyajl - LIBS+=-lpulse +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 -+ifeq ($(OS),OpenBSD) -+LIBS+=-lpthread -+endif -+ - VERSION=2.10 - GIT_VERSION="2.10 (2016-01-01)" - OS:=$(shell uname) -@@ -70,10 +74,8 @@ CFLAGS += -idirafter yajl-fallback - OBJS:=$(wildcard src/*.c *.c) +@@ -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)) -lpthread --endif -+LIBS:=$(filter-out -lpulse, $(LIBS)) - - src/%.o: src/%.c include/i3status.h - $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $< -diff -upr i3status-2.10.orig/src/print_volume.c i3status-2.10/src/print_volume.c ---- i3status-2.10.orig/src/print_volume.c 2016-01-07 19:53:31.912304558 +0100 -+++ i3status-2.10/src/print_volume.c 2016-01-07 19:53:44.447718125 +0100 -@@ -60,50 +60,6 @@ void print_volume(yajl_gen json_gen, cha + 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__ -- /* Try PulseAudio first */ -- -- /* If the device name has the format "pulse[:N]" where N is the -- * index of the PulseAudio sink then force PulseAudio, optionally -- * overriding the default sink */ -- if (!strncasecmp(device, "pulse", strlen("pulse"))) { -- uint32_t sink_idx = device[5] == ':' ? (uint32_t)atoi(device + 6) -- : DEFAULT_SINK_INDEX; -- int cvolume = pulse_initialize() ? volume_pulseaudio(sink_idx) : 0; -- int ivolume = DECOMPOSE_VOLUME(cvolume); -- bool muted = DECOMPOSE_MUTED(cvolume); -- if (muted) { -- START_COLOR("color_degraded"); -- pbval = 0; -- } -- /* negative result means error, stick to 0 */ -- if (ivolume < 0) -- ivolume = 0; -- outwalk = apply_volume_format(muted ? fmt_muted : fmt, -- outwalk, -- ivolume); -- goto out; -- } else if (!strcasecmp(device, "default") && pulse_initialize()) { -- /* no device specified or "default" set */ -- int cvolume = volume_pulseaudio(DEFAULT_SINK_INDEX); -- int ivolume = DECOMPOSE_VOLUME(cvolume); -- bool muted = DECOMPOSE_MUTED(cvolume); -- if (ivolume >= 0) { -- if (muted) { -- START_COLOR("color_degraded"); -- pbval = 0; -- } -- outwalk = apply_volume_format(muted ? fmt_muted : fmt, -- outwalk, -- ivolume); -- goto out; -- } -- /* negative result means error, fail PulseAudio attempt */ -- } --/* If some other device was specified or PulseAudio is not detected, -- * proceed to ALSA / OSS */ --#endif -- - #ifdef LINUX - int err; - snd_mixer_t *m; ++#if defined(HAVE_PULSE) + /* Try PulseAudio first */ + + /* If the device name has the format "pulse[:N]" where N is the |