public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-misc/i3status/, x11-misc/i3status/files/
@ 2016-01-06 14:45 Kacper Kowalik
  0 siblings, 0 replies; 3+ messages in thread
From: Kacper Kowalik @ 2016-01-06 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     b3d5558c2778adf5f80e1444ba62d7af2b80d5db
Author:     Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  6 14:41:51 2016 +0000
Commit:     Kacper Kowalik <xarthisius <AT> gentoo <DOT> org>
CommitDate: Wed Jan  6 14:41:51 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b3d5558c

x11-misc/i3status: make dependency on pulseaudio optional

Fixes bug #570786 and introduces the new USE flag
'pulseaudio'.

Reported-by: Michele Alzetta <michele <AT> alzetta.org>

 .../i3status/files/i3status-2.10-pulseaudio.patch  | 46 ++++++++++++++++++++++
 ...3status-2.10.ebuild => i3status-2.10-r1.ebuild} |  9 +++--
 2 files changed, 51 insertions(+), 4 deletions(-)

diff --git a/x11-misc/i3status/files/i3status-2.10-pulseaudio.patch b/x11-misc/i3status/files/i3status-2.10-pulseaudio.patch
new file mode 100644
index 0000000..991ce03
--- /dev/null
+++ b/x11-misc/i3status/files/i3status-2.10-pulseaudio.patch
@@ -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

diff --git a/x11-misc/i3status/i3status-2.10.ebuild b/x11-misc/i3status/i3status-2.10-r1.ebuild
similarity index 82%
rename from x11-misc/i3status/i3status-2.10.ebuild
rename to x11-misc/i3status/i3status-2.10-r1.ebuild
index 1801fdf..7405b5e 100644
--- a/x11-misc/i3status/i3status-2.10.ebuild
+++ b/x11-misc/i3status/i3status-2.10-r1.ebuild
@@ -4,7 +4,7 @@
 
 EAPI=5
 
-inherit toolchain-funcs versionator fcaps
+inherit eutils toolchain-funcs fcaps
 
 DESCRIPTION="generates a status bar for dzen2, xmobar or similar"
 HOMEPAGE="http://i3wm.org/i3status/"
@@ -13,25 +13,26 @@ SRC_URI="http://i3wm.org/${PN}/${P}.tar.bz2"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
-IUSE=""
+IUSE="pulseaudio"
 
 RDEPEND="dev-libs/confuse
 	dev-libs/libnl:3
 	>=dev-libs/yajl-2.0.2
 	media-libs/alsa-lib
-	media-sound/pulseaudio"
+	pulseaudio? ( media-sound/pulseaudio )"
 DEPEND="${RDEPEND}
 	app-text/asciidoc
 	virtual/pkgconfig"
 
 src_prepare() {
+	epatch "$FILESDIR"/$P-pulseaudio.patch
 	sed -e "/@echo/d" -e "s:@\$(:\$(:g" -e "/setcap/d" \
 		-e '/CFLAGS+=-g/d' -i Makefile || die
 	rm -rf man/${PN}.1  # man not regenerated in tarball
 }
 
 src_compile() {
-	emake CC="$(tc-getCC)"
+	emake CC="$(tc-getCC)" PULSE=$(usex pulseaudio 1 0)
 }
 
 pkg_postinst() {


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-misc/i3status/, x11-misc/i3status/files/
@ 2020-11-26 22:30 Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2020-11-26 22:30 UTC (permalink / raw
  To: gentoo-commits

commit:     e8d694c30115e924b7b5680e1c95525ebd54cb07
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 26 22:18:47 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu Nov 26 22:18:47 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e8d694c3

x11-misc/i3status: drop old

Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 x11-misc/i3status/Manifest                         |  1 -
 .../i3status/files/i3status-2.11-pulseaudio.patch  | 42 --------------------
 x11-misc/i3status/i3status-2.12.ebuild             | 46 ----------------------
 3 files changed, 89 deletions(-)

diff --git a/x11-misc/i3status/Manifest b/x11-misc/i3status/Manifest
index 8f7a097491c..ab1c2b4c1da 100644
--- a/x11-misc/i3status/Manifest
+++ b/x11-misc/i3status/Manifest
@@ -1,2 +1 @@
-DIST i3status-2.12.tar.bz2 57162 BLAKE2B d3225581b628640bfb6084b390a135562c2ce052078cf014a63e106c83beb14b38270eee28d01898d478a9593ce542684252e420ffe37d07f392509ac9b2a749 SHA512 687a880a65cb8df46f5e9d2256b59724ba3424c502e9a0fb3ca71b070875df5f4008ee501c554bc716f2d728a5cf813a36d22d7377d42c3c46b14381d385bab3
 DIST i3status-2.13.tar.bz2 201409 BLAKE2B e087d69e2df3ae9348cb55739023b2164dfa3543551d173b138c72e574714069d8397716b95e92c4315aa538ea31b33aa73532d6d0f75bbc38d7db54e1f665bc SHA512 6dadff19e53499d169ba4f491e1f821014b4f92fc3c93d7947c85cbbbdeaba538d02bd8ab98fe266a8f80756a287fd5803ec77a8cd874d50082b5cad309875c2

diff --git a/x11-misc/i3status/files/i3status-2.11-pulseaudio.patch b/x11-misc/i3status/files/i3status-2.11-pulseaudio.patch
deleted file mode 100644
index 2447f16f933..00000000000
--- a/x11-misc/i3status/files/i3status-2.11-pulseaudio.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-diff --git a/Makefile b/Makefile
-index 3084ae7..7ea1964 100644
---- a/Makefile
-+++ b/Makefile
-@@ -58,6 +57,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/
-@@ -79,9 +82,12 @@ CFLAGS += -idirafter yajl-fallback
- OBJS:=$(sort $(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))
-+else
-+CPPFLAGS+=-DPULSE
- endif
- 
- src/%.o: src/%.c include/i3status.h
-diff --git a/src/print_volume.c b/src/print_volume.c
-index 51e84f3..9e015c0 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(__OpenBSD__) && defined(PULSE)
-     /* Try PulseAudio first */
- 
-     /* If the device name has the format "pulse[:N]" where N is the

diff --git a/x11-misc/i3status/i3status-2.12.ebuild b/x11-misc/i3status/i3status-2.12.ebuild
deleted file mode 100644
index 81f9ba7f6c6..00000000000
--- a/x11-misc/i3status/i3status-2.12.ebuild
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-inherit fcaps toolchain-funcs
-
-DESCRIPTION="generates a status bar for dzen2, xmobar or similar"
-HOMEPAGE="https://i3wm.org/i3status/"
-SRC_URI="https://i3wm.org/${PN}/${P}.tar.bz2"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="amd64 ~arm x86"
-IUSE="pulseaudio"
-
-BDEPEND="virtual/pkgconfig"
-DEPEND="
-	dev-libs/confuse:=
-	dev-libs/libnl:3
-	>=dev-libs/yajl-2.0.2
-	media-libs/alsa-lib
-	pulseaudio? ( media-sound/pulseaudio )
-"
-RDEPEND="${DEPEND}"
-
-PATCHES=( "${FILESDIR}"/${PN}-2.11-pulseaudio.patch )
-
-src_prepare() {
-	default
-	sed -e "/@echo/d" -e "s:@\$(:\$(:g" -e "/setcap/d" \
-		-e '/CFLAGS+=-g/d' -i Makefile || die
-}
-
-src_compile() {
-	emake V=1 CC="$(tc-getCC)" PULSE=$(usex pulseaudio 1 0)
-}
-
-pkg_postinst() {
-	fcaps cap_net_admin usr/bin/${PN}
-	einfo "${PN} can be used with any of the following programs:"
-	einfo "   i3bar (x11-wm/i3)"
-	einfo "   x11-misc/xmobar"
-	einfo "   x11-misc/dzen"
-	einfo "Please refer to manual: man ${PN}"
-}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-misc/i3status/, x11-misc/i3status/files/
@ 2020-12-15  0:26 Sergei Trofimovich
  0 siblings, 0 replies; 3+ messages in thread
From: Sergei Trofimovich @ 2020-12-15  0:26 UTC (permalink / raw
  To: gentoo-commits

commit:     6752335a13c702472e65431ed6971f4dd3bf8928
Author:     creich <creich <AT> linux <DOT> com>
AuthorDate: Mon Dec 14 23:52:41 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Tue Dec 15 00:26:14 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6752335a

x11-misc/i3status: make pulseaudio optional

Backports series of upstream patches to plumb through
--disable-pulseaudio.

Closes: https://github.com/gentoo/gentoo/pull/18659
Signed-off-by: creich <creich <AT> linux.com>
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 ...01-Extend-battery-handling-on-OpenBSD-351.patch |  98 +++++++++++++++++
 ...-meant-for-OpenBSD-but-snuck-in-for-FreeB.patch |  33 ++++++
 ...ly-compile-pulse.c-only-when-using-pulsea.patch |  56 ++++++++++
 ...4-battery-include-sys-sysctl.h-on-OpenBSD.patch |  26 +++++
 ...disable-pulse-on-OpenBSD-and-DragonFlyBSD.patch |  56 ++++++++++
 ...NetBSD-include-sys-socket.h-for-AF_INET-6.patch |  24 +++++
 ...udio-an-optional-dependency-follow-best-p.patch | 119 +++++++++++++++++++++
 x11-misc/i3status/i3status-2.13-r1.ebuild          |  68 ++++++++++++
 8 files changed, 480 insertions(+)

diff --git a/x11-misc/i3status/files/0001-Extend-battery-handling-on-OpenBSD-351.patch b/x11-misc/i3status/files/0001-Extend-battery-handling-on-OpenBSD-351.patch
new file mode 100644
index 00000000000..32a0358b421
--- /dev/null
+++ b/x11-misc/i3status/files/0001-Extend-battery-handling-on-OpenBSD-351.patch
@@ -0,0 +1,98 @@
+From 3a51673c05142b99f8db6a0bd9b8e4b806efeb72 Mon Sep 17 00:00:00 2001
+From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
+Date: Mon, 8 Jul 2019 17:53:25 +0200
+Subject: [PATCH 1/7] Extend battery handling on OpenBSD (#351)
+
+If acpibat watts value is not available, try current (for batteries
+that report in amps), then convert to watts.
+
+originally submitted by @jcs
+---
+ src/print_battery_info.c | 47 ++++++++++++++++++++++++++++++++++++++--
+ 1 file changed, 45 insertions(+), 2 deletions(-)
+
+diff --git a/src/print_battery_info.c b/src/print_battery_info.c
+index 1c51624..e2a790c 100644
+--- a/src/print_battery_info.c
++++ b/src/print_battery_info.c
+@@ -20,6 +20,8 @@
+ #include <dev/acpica/acpiio.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
++#include <sys/sysctl.h>
++#include <sys/sensors.h>
+ #endif
+ 
+ #if defined(__DragonFly__)
+@@ -31,6 +33,7 @@
+ #include <sys/fcntl.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
++#include <sys/sensors.h>
+ #endif
+ 
+ #if defined(__NetBSD__)
+@@ -269,11 +272,16 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
+ #elif defined(__OpenBSD__)
+     /*
+ 	 * We're using apm(4) here, which is the interface to acpi(4) on amd64/i386 and
+-	 * the generic interface on macppc/sparc64/zaurus, instead of using sysctl(3) and
+-	 * probing acpi(4) devices.
++	 * the generic interface on macppc/sparc64/zaurus.  Machines that have ACPI
++	 * battery sensors gain some extra information.
+ 	 */
+     struct apm_power_info apm_info;
++    struct sensordev sensordev;
++    struct sensor sensor;
++    size_t sdlen, slen;
+     int apm_fd;
++    int dev, mib[5] = {CTL_HW, HW_SENSORS, 0, 0, 0};
++    int volts = 0;
+ 
+     apm_fd = open("/dev/apm", O_RDONLY);
+     if (apm_fd < 0) {
+@@ -311,6 +319,41 @@ static bool slurp_battery_info(struct battery_info *batt_info, yajl_gen json_gen
+     if (batt_info->status != CS_CHARGING) {
+         batt_info->seconds_remaining = apm_info.minutes_left * 60;
+     }
++
++    /* If acpibat* are present, check sensors for data not present via APM. */
++    batt_info->present_rate = 0;
++    sdlen = sizeof(sensordev);
++    slen = sizeof(sensor);
++
++    for (dev = 0;; dev++) {
++        mib[2] = dev;
++        if (sysctl(mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
++            break;
++        }
++        /* 'path' is the node within the full path */
++        if (BEGINS_WITH(sensordev.xname, "acpibat")) {
++            /* power0 */
++            mib[3] = SENSOR_WATTS;
++            mib[4] = 0;
++            if (sysctl(mib, 5, &sensor, &slen, NULL, 0) == -1) {
++                /* try current0 */
++                mib[3] = SENSOR_AMPS;
++                if (sysctl(mib, 5, &sensor, &slen, NULL, 0) == -1)
++                    continue;
++                volts = sensor.value;
++
++                /* we also need current voltage to convert amps to watts */
++                mib[3] = SENSOR_VOLTS_DC;
++                mib[4] = 1;
++                if (sysctl(mib, 5, &sensor, &slen, NULL, 0) == -1)
++                    continue;
++
++                batt_info->present_rate += (((float)volts / 1000.0) * ((float)sensor.value / 1000.0));
++            } else {
++                batt_info->present_rate += sensor.value;
++            }
++        }
++    }
+ #elif defined(__NetBSD__)
+     /*
+      * Using envsys(4) via sysmon(4).
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0002-Fix-headers-meant-for-OpenBSD-but-snuck-in-for-FreeB.patch b/x11-misc/i3status/files/0002-Fix-headers-meant-for-OpenBSD-but-snuck-in-for-FreeB.patch
new file mode 100644
index 00000000000..be9a08e32cc
--- /dev/null
+++ b/x11-misc/i3status/files/0002-Fix-headers-meant-for-OpenBSD-but-snuck-in-for-FreeB.patch
@@ -0,0 +1,33 @@
+From 70b954b122c1dae1d21593d6a5239d38fde1fd55 Mon Sep 17 00:00:00 2001
+From: Jasper Lievisse Adriaanse <jasper@humppa.nl>
+Date: Mon, 8 Jul 2019 20:14:59 +0200
+Subject: [PATCH 2/7] Fix headers meant for OpenBSD, but snuck in for FreeBSD
+
+---
+ src/print_battery_info.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/print_battery_info.c b/src/print_battery_info.c
+index e2a790c..1768bc5 100644
+--- a/src/print_battery_info.c
++++ b/src/print_battery_info.c
+@@ -20,8 +20,6 @@
+ #include <dev/acpica/acpiio.h>
+ #include <sys/sysctl.h>
+ #include <sys/types.h>
+-#include <sys/sysctl.h>
+-#include <sys/sensors.h>
+ #endif
+ 
+ #if defined(__DragonFly__)
+@@ -33,6 +31,7 @@
+ #include <sys/fcntl.h>
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
++#include <sys/sysctl.h>
+ #include <sys/sensors.h>
+ #endif
+ 
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0003-conditionally-compile-pulse.c-only-when-using-pulsea.patch b/x11-misc/i3status/files/0003-conditionally-compile-pulse.c-only-when-using-pulsea.patch
new file mode 100644
index 00000000000..a1ac91ff8f2
--- /dev/null
+++ b/x11-misc/i3status/files/0003-conditionally-compile-pulse.c-only-when-using-pulsea.patch
@@ -0,0 +1,56 @@
+From 1999d5cf555c6f373549840d40f8565dcabad93b Mon Sep 17 00:00:00 2001
+From: Michael Stapelberg <michael@stapelberg.de>
+Date: Thu, 11 Jul 2019 15:23:08 +0200
+Subject: [PATCH 3/7] conditionally compile pulse.c only when using pulseaudio
+
+fixes #352
+---
+ Makefile.am  | 7 +++++--
+ configure.ac | 3 +++
+ 2 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index bb251f0..c2c1c0a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -68,8 +68,11 @@ i3status_SOURCES = \
+ 	src/print_volume.c \
+ 	src/print_wireless_info.c \
+ 	src/print_file_contents.c \
+-	src/process_runs.c \
+-	src/pulse.c
++	src/process_runs.c
++
++if PULSE
++i3status_SOURCES += src/pulse.c
++endif
+ 
+ dist_sysconf_DATA = \
+ 	i3status.conf
+diff --git a/configure.ac b/configure.ac
+index cf9e430..95009ac 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -80,16 +80,19 @@ AC_CANONICAL_HOST
+ PKG_CHECK_MODULES([CONFUSE], [libconfuse])
+ PKG_CHECK_MODULES([YAJL], [yajl])
+ 
++pulse=false
+ case $host_os in
+ 	linux*)
+ 	PKG_CHECK_MODULES([NLGENL], [libnl-genl-3.0])
+ 	PKG_CHECK_MODULES([ALSA], [alsa])
+ 	PKG_CHECK_MODULES([PULSE], [libpulse])
++	pulse=true
+ 	;;
+ 	netbsd*)
+ 	AC_SEARCH_LIBS([prop_string_create], [prop])
+ 	;;
+ esac
++AM_CONDITIONAL([PULSE], [test x$pulse = xtrue])
+ 
+ dnl TODO: check for libbsd for GNU/kFreeBSD
+ 
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0004-battery-include-sys-sysctl.h-on-OpenBSD.patch b/x11-misc/i3status/files/0004-battery-include-sys-sysctl.h-on-OpenBSD.patch
new file mode 100644
index 00000000000..579c74e7e09
--- /dev/null
+++ b/x11-misc/i3status/files/0004-battery-include-sys-sysctl.h-on-OpenBSD.patch
@@ -0,0 +1,26 @@
+From 02a47cd19641a04f6cf8d486cbb8882a1819c661 Mon Sep 17 00:00:00 2001
+From: Michael Stapelberg <michael@stapelberg.de>
+Date: Fri, 12 Jul 2019 14:38:43 +0200
+Subject: [PATCH 4/7] battery: include sys/sysctl.h on OpenBSD
+
+This is required so that CTL_HW and others are defined (ran into this on OpenBSD
+6.5).
+---
+ src/print_battery_info.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/print_battery_info.c b/src/print_battery_info.c
+index e2a790c..a36b05f 100644
+--- a/src/print_battery_info.c
++++ b/src/print_battery_info.c
+@@ -34,6 +34,7 @@
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+ #include <sys/sensors.h>
++#include <sys/sysctl.h>
+ #endif
+ 
+ #if defined(__NetBSD__)
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0005-configure-disable-pulse-on-OpenBSD-and-DragonFlyBSD.patch b/x11-misc/i3status/files/0005-configure-disable-pulse-on-OpenBSD-and-DragonFlyBSD.patch
new file mode 100644
index 00000000000..8ebb296f7ed
--- /dev/null
+++ b/x11-misc/i3status/files/0005-configure-disable-pulse-on-OpenBSD-and-DragonFlyBSD.patch
@@ -0,0 +1,56 @@
+From 54e798e3a6dcf5747c3e943b376ae441ee0534a4 Mon Sep 17 00:00:00 2001
+From: Michael Stapelberg <michael@stapelberg.de>
+Date: Fri, 12 Jul 2019 14:45:34 +0200
+Subject: [PATCH 5/7] configure: disable pulse on OpenBSD and DragonFlyBSD
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This matches the conditional compilation in the code and is more correct than
+distinguishing linux vs. non-linux (which breaks on Debian’s kFreeBSD and hurd
+variants).
+
+Thanks to sdk for providing an OpenBSD 6.5 environment for verification. This
+has not been tested on DragonFlyBSD.
+
+related to #352
+---
+ configure.ac | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 95009ac..a6c31d7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -80,19 +80,25 @@ AC_CANONICAL_HOST
+ PKG_CHECK_MODULES([CONFUSE], [libconfuse])
+ PKG_CHECK_MODULES([YAJL], [yajl])
+ 
+-pulse=false
++pulse=true
+ case $host_os in
+ 	linux*)
+ 	PKG_CHECK_MODULES([NLGENL], [libnl-genl-3.0])
+ 	PKG_CHECK_MODULES([ALSA], [alsa])
+-	PKG_CHECK_MODULES([PULSE], [libpulse])
+-	pulse=true
++	;;
++	openbsd*)
++	pulse=false
++	;;
++	dragonfly*)
++	pulse=false
+ 	;;
+ 	netbsd*)
+ 	AC_SEARCH_LIBS([prop_string_create], [prop])
+ 	;;
+ esac
+ AM_CONDITIONAL([PULSE], [test x$pulse = xtrue])
++AS_IF([test x"$pulse" = x"true"],
++      [PKG_CHECK_MODULES([PULSE], [libpulse])])
+ 
+ dnl TODO: check for libbsd for GNU/kFreeBSD
+ 
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0006-On-NetBSD-include-sys-socket.h-for-AF_INET-6.patch b/x11-misc/i3status/files/0006-On-NetBSD-include-sys-socket.h-for-AF_INET-6.patch
new file mode 100644
index 00000000000..171a1c39cfd
--- /dev/null
+++ b/x11-misc/i3status/files/0006-On-NetBSD-include-sys-socket.h-for-AF_INET-6.patch
@@ -0,0 +1,24 @@
+From 667e38ababb69b68ddcd3c453bd78f022198559a Mon Sep 17 00:00:00 2001
+From: Thomas Klausner <tk@giga.or.at>
+Date: Sun, 21 Jul 2019 21:17:59 +0200
+Subject: [PATCH 6/7] On NetBSD, include sys/socket.h for AF_INET{,6}.
+
+---
+ src/print_wireless_info.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
+index 8b2d210..6215704 100644
+--- a/src/print_wireless_info.c
++++ b/src/print_wireless_info.c
+@@ -61,6 +61,7 @@
+ 
+ #ifdef __NetBSD__
+ #include <sys/types.h>
++#include <sys/socket.h>
+ #include <net80211/ieee80211.h>
+ #define IW_ESSID_MAX_SIZE IEEE80211_NWID_LEN
+ #endif
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/files/0007-make-pulseaudio-an-optional-dependency-follow-best-p.patch b/x11-misc/i3status/files/0007-make-pulseaudio-an-optional-dependency-follow-best-p.patch
new file mode 100644
index 00000000000..e60a1375fec
--- /dev/null
+++ b/x11-misc/i3status/files/0007-make-pulseaudio-an-optional-dependency-follow-best-p.patch
@@ -0,0 +1,119 @@
+From 23da59920c4c911ee08498eb283b69bdef80fd65 Mon Sep 17 00:00:00 2001
+From: Michael Stapelberg <michael@stapelberg.de>
+Date: Mon, 29 Jul 2019 20:57:48 +0200
+Subject: [PATCH 7/7] make pulseaudio an optional dependency, follow best
+ practices
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+For my thoughts about optional dependencies, see
+https://michael.stapelberg.ch/posts/2019-05-23-optional-dependencies/
+
+This commit follows the best practices outlined in that article:
+
+1. The travis config was modified to verify both code paths build and link/don’t
+   link against pulseaudio.
+
+2. If pulseaudio is missing, the build fails until packagers explicitly pass a
+   --disable flag. In practice, I think the only situation when this flag should
+   be set is in source-based linux distributions where users can express
+   package-level compilation preferences (e.g. Gentoo USE flags).
+
+3. The --version output now reflects the status of the optional dependency.
+
+fixes #359
+---
+ .travis.yml        |  5 +++--
+ configure.ac       | 25 +++++++++++++++----------
+ i3status.c         |  8 +++++++-
+ src/print_volume.c |  2 +-
+ 4 files changed, 26 insertions(+), 14 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a6c31d7..11caa33 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -80,25 +80,29 @@ AC_CANONICAL_HOST
+ PKG_CHECK_MODULES([CONFUSE], [libconfuse])
+ PKG_CHECK_MODULES([YAJL], [yajl])
+ 
+-pulse=true
++AC_ARG_ENABLE(pulseaudio,
++  AS_HELP_STRING(
++    [--disable-pulseaudio],
++    [build without pulseaudio support]),
++  [ax_pulse=$enableval],
++  [ax_pulse=yes])
++AM_CONDITIONAL([PULSE], [test x$ax_pulse = xyes])
++AS_IF([test x"$ax_pulse" = x"yes"],
++      [PKG_CHECK_MODULES([PULSE], [libpulse])])
++pulse_def=0
++AS_IF([test x"$ax_pulse" = x"yes"],
++      [pulse_def=1])
++AC_DEFINE_UNQUOTED([HAS_PULSEAUDIO], [$pulse_def], [Build with pulseaudio])
++
+ case $host_os in
+ 	linux*)
+ 	PKG_CHECK_MODULES([NLGENL], [libnl-genl-3.0])
+ 	PKG_CHECK_MODULES([ALSA], [alsa])
+ 	;;
+-	openbsd*)
+-	pulse=false
+-	;;
+-	dragonfly*)
+-	pulse=false
+-	;;
+ 	netbsd*)
+ 	AC_SEARCH_LIBS([prop_string_create], [prop])
+ 	;;
+ esac
+-AM_CONDITIONAL([PULSE], [test x$pulse = xtrue])
+-AS_IF([test x"$pulse" = x"true"],
+-      [PKG_CHECK_MODULES([PULSE], [libpulse])])
+ 
+ dnl TODO: check for libbsd for GNU/kFreeBSD
+ 
+@@ -160,6 +164,7 @@ AS_HELP_STRING([is release version:], [${is_release}])
+ AS_HELP_STRING([enable debug flags:], [${ax_enable_debug}])
+ AS_HELP_STRING([code coverage:], [${CODE_COVERAGE_ENABLED}])
+ AS_HELP_STRING([enabled sanitizers:], [${ax_enabled_sanitizers}])
++AS_HELP_STRING([pulseaudio support:], [${ax_pulse}])
+ 
+ To compile, run:
+ 
+diff --git a/i3status.c b/i3status.c
+index 0898da3..1ab8400 100644
+--- a/i3status.c
++++ b/i3status.c
+@@ -565,7 +565,13 @@ int main(int argc, char *argv[]) {
+                 return 0;
+                 break;
+             case 'v':
+-                printf("i3status " VERSION " © 2008 Michael Stapelberg and contributors\n");
++                printf("i3status " VERSION " © 2008 Michael Stapelberg and contributors\n"
++#if HAS_PULSEAUDIO
++                       "Built with pulseaudio support\n"
++#else
++                       "Built without pulseaudio support\n"
++#endif
++                       );
+                 return 0;
+                 break;
+             case 0:
+diff --git a/src/print_volume.c b/src/print_volume.c
+index 91e8ce2..7364d47 100644
+--- a/src/print_volume.c
++++ b/src/print_volume.c
+@@ -86,7 +86,7 @@ void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *
+         free(instance);
+     }
+ 
+-#if !defined(__DragonFly__) && !defined(__OpenBSD__)
++#if HAS_PULSEAUDIO
+     /* Try PulseAudio first */
+ 
+     /* If the device name has the format "pulse[:N]" where N is the
+-- 
+2.26.2
+

diff --git a/x11-misc/i3status/i3status-2.13-r1.ebuild b/x11-misc/i3status/i3status-2.13-r1.ebuild
new file mode 100644
index 00000000000..9107ec983b7
--- /dev/null
+++ b/x11-misc/i3status/i3status-2.13-r1.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit fcaps autotools
+
+DESCRIPTION="generates a status bar for dzen2, xmobar or similar"
+HOMEPAGE="https://i3wm.org/i3status/"
+SRC_URI="https://i3wm.org/${PN}/${P}.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="pulseaudio"
+
+BDEPEND="virtual/pkgconfig"
+RDEPEND="
+	>=dev-libs/yajl-2.0.2
+	dev-libs/confuse:=
+	dev-libs/libnl:3
+	media-libs/alsa-lib
+	pulseaudio? ( || ( media-sound/pulseaudio media-sound/apulse[sdk] ) )
+"
+
+DEPEND="
+	${RDEPEND}
+	app-text/asciidoc
+	app-text/xmlto
+"
+
+PATCHES=(
+	"${FILESDIR}/0001-Extend-battery-handling-on-OpenBSD-351.patch"
+	"${FILESDIR}/0002-Fix-headers-meant-for-OpenBSD-but-snuck-in-for-FreeB.patch"
+	"${FILESDIR}/0003-conditionally-compile-pulse.c-only-when-using-pulsea.patch"
+	"${FILESDIR}/0004-battery-include-sys-sysctl.h-on-OpenBSD.patch"
+	"${FILESDIR}/0005-configure-disable-pulse-on-OpenBSD-and-DragonFlyBSD.patch"
+	"${FILESDIR}/0006-On-NetBSD-include-sys-socket.h-for-AF_INET-6.patch"
+	"${FILESDIR}/0007-make-pulseaudio-an-optional-dependency-follow-best-p.patch"
+)
+
+src_prepare() {
+	default
+	eautoreconf
+}
+
+src_configure() {
+	econf $(use_enable pulseaudio)
+}
+
+src_compile() {
+	pushd "${S}/${CHOST}" || die
+	default
+}
+
+src_install() {
+	pushd "${S}/${CHOST}" || die
+	default
+}
+
+pkg_postinst() {
+	fcaps cap_net_admin usr/bin/${PN}
+
+	elog "${PN} can be used with any of the following programs:"
+	elog "   i3bar (x11-wm/i3)"
+	elog "   x11-misc/xmobar"
+	elog "   x11-misc/dzen"
+	elog "Please refer to manual: man ${PN}"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-15  0:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-06 14:45 [gentoo-commits] repo/gentoo:master commit in: x11-misc/i3status/, x11-misc/i3status/files/ Kacper Kowalik
  -- strict thread matches above, loose matches on Subject: below --
2020-11-26 22:30 Sergei Trofimovich
2020-12-15  0:26 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox