* [gentoo-commits] repo/gentoo:master commit in: gui-apps/waybar/files/, gui-apps/waybar/
@ 2023-04-10 5:22 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-04-10 5:22 UTC (permalink / raw
To: gentoo-commits
commit: a5064961fea762cf204de7bed03e018dbaf5acee
Author: Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Sun Apr 9 22:21:57 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Apr 10 05:21:34 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5064961
gui-apps/waybar: add several USE flags
evdev, jack, libinput, logind, mpris, pipewire, systemd, test, upower
drop net-wireless/rfkill DEPEND
Closes: https://bugs.gentoo.org/894068
Signed-off-by: Julien Roy <julien <AT> jroy.ca>
Signed-off-by: Sam James <sam <AT> gentoo.org>
gui-apps/waybar/files/systemd-0.9.17.patch | 35 ++++++++++++++++
gui-apps/waybar/metadata.xml | 7 +++-
...{waybar-9999.ebuild => waybar-0.9.17-r1.ebuild} | 48 ++++++++++++++++++----
gui-apps/waybar/waybar-9999.ebuild | 46 +++++++++++++++++----
4 files changed, 119 insertions(+), 17 deletions(-)
diff --git a/gui-apps/waybar/files/systemd-0.9.17.patch b/gui-apps/waybar/files/systemd-0.9.17.patch
new file mode 100644
index 000000000000..7d6c8dd10b38
--- /dev/null
+++ b/gui-apps/waybar/files/systemd-0.9.17.patch
@@ -0,0 +1,35 @@
+diff --git a/meson.build b/meson.build
+index ebf68d4..3c2a7fd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -122,7 +122,6 @@ endif
+ gtk_layer_shell = dependency('gtk-layer-shell-0',
+ required: get_option('gtk-layer-shell'),
+ fallback : ['gtk-layer-shell', 'gtk_layer_shell_dep'])
+-systemd = dependency('systemd', required: get_option('systemd'))
+ tz_dep = dependency('date',
+ required: false,
+ default_options : [ 'use_system_tzdb=true' ],
+@@ -136,16 +135,12 @@ conf_data.set('prefix', prefix)
+
+ add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'cpp')
+
+-if systemd.found()
+- user_units_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
+-
+- configure_file(
+- configuration: conf_data,
+- input: './resources/waybar.service.in',
+- output: '@BASENAME@',
+- install_dir: user_units_dir
+- )
+-endif
++configure_file(
++ configuration: conf_data,
++ input: './resources/waybar.service.in',
++ output: '@BASENAME@',
++ install_dir: '/usr/lib/systemd/user'
++)
+
+ src_files = files(
+ 'src/factory.cpp',
diff --git a/gui-apps/waybar/metadata.xml b/gui-apps/waybar/metadata.xml
index b481b93d48a5..78b89e6579cc 100644
--- a/gui-apps/waybar/metadata.xml
+++ b/gui-apps/waybar/metadata.xml
@@ -14,11 +14,16 @@
<name>Proxy Maintainers</name>
</maintainer>
<use>
- <flag name="experimental">Enable experimental features</flag>
+ <flag name="experimental">Enable experimental features, such as Bluetooth battery reporting</flag>
+ <flag name="evdev">Enable libevdev support for evdev related features</flag>
+ <flag name="libinput">Enable libinput support for libinput related features</flag>
+ <flag name="logind">Enable support for logind</flag>
<flag name="mpd">Enable support for the Music Player Daemon</flag>
+ <flag name="mpris">Enable support for mpris</flag>
<flag name="network">Enable libnl support for network related features</flag>
<flag name="popups">Enable popup support with gtk-layer-shell</flag>
<flag name="sndio">Enable support for volume control via sndio</flag>
+ <flag name="pipewire">Enable support for pipewire</flag>
<flag name="pulseaudio">Enable support for volume control via PulseAudio</flag>
<flag name="tray">Enable support for tray</flag>
<flag name="wifi">Enable support for wifi/rfkill</flag>
diff --git a/gui-apps/waybar/waybar-9999.ebuild b/gui-apps/waybar/waybar-0.9.17-r1.ebuild
similarity index 55%
copy from gui-apps/waybar/waybar-9999.ebuild
copy to gui-apps/waybar/waybar-0.9.17-r1.ebuild
index d3aca7df27b2..9ee87022a46b 100644
--- a/gui-apps/waybar/waybar-9999.ebuild
+++ b/gui-apps/waybar/waybar-0.9.17-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -14,18 +14,21 @@ if [[ ${PV} == 9999 ]]; then
else
SRC_URI="https://github.com/Alexays/${PN^}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
+ S="${WORKDIR}/${PN^}-${PV}"
fi
LICENSE="MIT"
SLOT="0"
-IUSE="mpd network +popups pulseaudio sndio tray +udev wifi"
+IUSE="evdev experimental jack libinput logind mpd mpris network +popups pipewire pulseaudio sndio test tray +udev upower wifi"
+
+RESTRICT="!test? ( test )"
BDEPEND="
>=app-text/scdoc-1.9.2
dev-util/gdbus-codegen
virtual/pkgconfig
"
-DEPEND="
+RDEPEND="
dev-cpp/cairomm:0
dev-cpp/glibmm:2
dev-cpp/gtkmm:3.0
@@ -33,38 +36,67 @@ DEPEND="
dev-libs/jsoncpp:=
dev-libs/libinput:=
dev-libs/libsigc++:2
- >=dev-libs/libfmt-5.3.0:=
+ >=dev-libs/libfmt-7.0.0:=
>=dev-libs/spdlog-1.8.5:=
dev-libs/date:=
dev-libs/wayland
- dev-libs/wayland-protocols
gui-libs/wlroots:=
x11-libs/gtk+:3[wayland]
x11-libs/libxkbcommon
+ evdev? ( dev-libs/libevdev:= )
+ jack? ( virtual/jack )
+ libinput? ( dev-libs/libinput:= )
+ logind? (
+ || ( sys-apps/systemd
+ sys-auth/elogind )
+ )
mpd? ( media-libs/libmpdclient )
+ mpris? ( >=media-sound/playerctl-2 )
network? ( dev-libs/libnl:3 )
popups? ( gui-libs/gtk-layer-shell )
- pulseaudio? ( media-sound/pulseaudio )
+ pipewire? ( media-video/wireplumber:0/0.4 )
+ pulseaudio? ( media-sound/pulseaudio[daemon] )
sndio? ( media-sound/sndio:= )
tray? (
dev-libs/libdbusmenu[gtk3]
dev-libs/libappindicator
)
udev? ( virtual/libudev:= )
- wifi? ( || ( sys-apps/util-linux net-wireless/rfkill ) )
+ upower? ( sys-power/upower )
+ wifi? ( sys-apps/util-linux )
"
-RDEPEND="${DEPEND}"
+DEPEND="${RDEPEND}
+ dev-libs/wayland-protocols
+ test? ( dev-cpp/catch:0 )
+"
+
+PATCHES=(
+ "${FILESDIR}/waybar-0.9.17-wireplumber.patch"
+ "${FILESDIR}/waybar-0.9.17-gcc13.patch"
+ "${FILESDIR}/systemd-0.9.17.patch"
+)
src_configure() {
local emesonargs=(
+ -Dman-pages=enabled
+ -Dsystemd=enabled
+ $(meson_feature evdev libevdev)
+ $(meson_feature jack)
+ $(meson_feature libinput)
+ $(meson_feature logind)
$(meson_feature mpd)
+ $(meson_feature mpris)
$(meson_feature network libnl)
$(meson_feature popups gtk-layer-shell)
$(meson_feature pulseaudio)
+ $(meson_feature pipewire wireplumber)
$(meson_feature sndio)
+ $(meson_feature test tests)
$(meson_feature tray dbusmenu-gtk)
$(meson_feature udev libudev)
+ $(meson_feature upower upower_glib)
$(meson_feature wifi rfkill)
+ $(meson_use experimental)
)
meson_src_configure
}
diff --git a/gui-apps/waybar/waybar-9999.ebuild b/gui-apps/waybar/waybar-9999.ebuild
index d3aca7df27b2..b08f76f5d66f 100644
--- a/gui-apps/waybar/waybar-9999.ebuild
+++ b/gui-apps/waybar/waybar-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -14,18 +14,21 @@ if [[ ${PV} == 9999 ]]; then
else
SRC_URI="https://github.com/Alexays/${PN^}/archive/${PV}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64"
+ S="${WORKDIR}/${PN^}-${PV}"
fi
LICENSE="MIT"
SLOT="0"
-IUSE="mpd network +popups pulseaudio sndio tray +udev wifi"
+IUSE="evdev experimental jack libinput logind mpd mpris network +popups pipewire pulseaudio sndio test tray +udev upower wifi"
+
+RESTRICT="!test? ( test )"
BDEPEND="
>=app-text/scdoc-1.9.2
dev-util/gdbus-codegen
virtual/pkgconfig
"
-DEPEND="
+RDEPEND="
dev-cpp/cairomm:0
dev-cpp/glibmm:2
dev-cpp/gtkmm:3.0
@@ -33,38 +36,65 @@ DEPEND="
dev-libs/jsoncpp:=
dev-libs/libinput:=
dev-libs/libsigc++:2
- >=dev-libs/libfmt-5.3.0:=
+ >=dev-libs/libfmt-7.0.0:=
>=dev-libs/spdlog-1.8.5:=
dev-libs/date:=
dev-libs/wayland
- dev-libs/wayland-protocols
gui-libs/wlroots:=
x11-libs/gtk+:3[wayland]
x11-libs/libxkbcommon
+ evdev? ( dev-libs/libevdev:= )
+ jack? ( virtual/jack )
+ libinput? ( dev-libs/libinput:= )
+ logind? (
+ || ( sys-apps/systemd
+ sys-auth/elogind )
+ )
mpd? ( media-libs/libmpdclient )
+ mpris? ( >=media-sound/playerctl-2 )
network? ( dev-libs/libnl:3 )
popups? ( gui-libs/gtk-layer-shell )
- pulseaudio? ( media-sound/pulseaudio )
+ pipewire? ( media-video/wireplumber:0/0.4 )
+ pulseaudio? ( media-sound/pulseaudio[daemon] )
sndio? ( media-sound/sndio:= )
tray? (
dev-libs/libdbusmenu[gtk3]
dev-libs/libappindicator
)
udev? ( virtual/libudev:= )
- wifi? ( || ( sys-apps/util-linux net-wireless/rfkill ) )
+ upower? ( sys-power/upower )
+ wifi? ( sys-apps/util-linux )
"
-RDEPEND="${DEPEND}"
+DEPEND="${RDEPEND}
+ dev-libs/wayland-protocols
+ test? ( dev-cpp/catch:0 )
+"
+
+PATCHES=(
+ "${FILESDIR}/systemd-0.9.17.patch"
+)
src_configure() {
local emesonargs=(
+ -Dman-pages=enabled
+ -Dsystemd=enabled
+ $(meson_feature evdev libevdev)
+ $(meson_feature jack)
+ $(meson_feature libinput)
+ $(meson_feature logind)
$(meson_feature mpd)
+ $(meson_feature mpris)
$(meson_feature network libnl)
$(meson_feature popups gtk-layer-shell)
$(meson_feature pulseaudio)
+ $(meson_feature pipewire wireplumber)
$(meson_feature sndio)
+ $(meson_feature test tests)
$(meson_feature tray dbusmenu-gtk)
$(meson_feature udev libudev)
+ $(meson_feature upower upower_glib)
$(meson_feature wifi rfkill)
+ $(meson_use experimental)
)
meson_src_configure
}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: gui-apps/waybar/files/, gui-apps/waybar/
@ 2024-11-18 13:05 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2024-11-18 13:05 UTC (permalink / raw
To: gentoo-commits
commit: b4932f1bc7846694b878fad47c2fe18c7332396c
Author: Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Mon Nov 18 12:31:40 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 18 13:04:39 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4932f1b
gui-apps/waybar: add patch for tray icons
https://github.com/Alexays/Waybar/commit/0d02f6877d88551ea2be0cd151c1e6354e208b1c
Closes: https://bugs.gentoo.org/942543
Signed-off-by: Julien Roy <julien <AT> jroy.ca>
Closes: https://github.com/gentoo/gentoo/pull/39354
Signed-off-by: Sam James <sam <AT> gentoo.org>
gui-apps/waybar/files/tray-icons-fix.patch | 99 +++++++++++++++++++++++++++
gui-apps/waybar/waybar-0.11.0-r1.ebuild | 105 +++++++++++++++++++++++++++++
2 files changed, 204 insertions(+)
diff --git a/gui-apps/waybar/files/tray-icons-fix.patch b/gui-apps/waybar/files/tray-icons-fix.patch
new file mode 100644
index 000000000000..95bf11ffca16
--- /dev/null
+++ b/gui-apps/waybar/files/tray-icons-fix.patch
@@ -0,0 +1,99 @@
+diff --git a/src/modules/sni/item.cpp b/src/modules/sni/item.cpp
+index 8afb39fb3..6c4ec8c06 100644
+--- a/src/modules/sni/item.cpp
++++ b/src/modules/sni/item.cpp
+@@ -104,11 +104,9 @@ void Item::proxyReady(Glib::RefPtr<Gio::AsyncResult>& result) {
+ this->updateImage();
+
+ } catch (const Glib::Error& err) {
+- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
+- std::string(err.what()));
++ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
+ } catch (const std::exception& err) {
+- spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path,
+- std::string(err.what()));
++ spdlog::error("Failed to create DBus Proxy for {} {}: {}", bus_name, object_path, err.what());
+ }
+ }
+
+@@ -126,15 +124,14 @@ ToolTip get_variant<ToolTip>(const Glib::VariantBase& value) {
+ result.text = get_variant<Glib::ustring>(container.get_child(2));
+ auto description = get_variant<Glib::ustring>(container.get_child(3));
+ if (!description.empty()) {
+- result.text = fmt::format("<b>{}</b>\n{}", std::string(result.text), std::string(description));
++ result.text = fmt::format("<b>{}</b>\n{}", result.text, description);
+ }
+ return result;
+ }
+
+ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
+ try {
+- spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id,
+- std::string(name), get_variant<std::string>(value));
++ spdlog::trace("Set tray item property: {}.{} = {}", id.empty() ? bus_name : id, name, value);
+
+ if (name == "Category") {
+ category = get_variant<std::string>(value);
+@@ -179,12 +176,10 @@ void Item::setProperty(const Glib::ustring& name, Glib::VariantBase& value) {
+ }
+ } catch (const Glib::Error& err) {
+ spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
+- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
+- std::string(err.what()));
++ id.empty() ? bus_name : id, name, value, err.what());
+ } catch (const std::exception& err) {
+ spdlog::warn("Failed to set tray item property: {}.{}, value = {}, err = {}",
+- id.empty() ? bus_name : id, std::string(name), get_variant<std::string>(value),
+- std::string(err.what()));
++ id.empty() ? bus_name : id, name, value, err.what());
+ }
+ }
+
+@@ -226,9 +221,9 @@ void Item::processUpdatedProperties(Glib::RefPtr<Gio::AsyncResult>& _result) {
+
+ this->updateImage();
+ } catch (const Glib::Error& err) {
+- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
++ spdlog::warn("Failed to update properties: {}", err.what());
+ } catch (const std::exception& err) {
+- spdlog::warn("Failed to update properties: {}", std::string(err.what()));
++ spdlog::warn("Failed to update properties: {}", err.what());
+ }
+ update_pending_.clear();
+ }
+@@ -250,7 +245,7 @@ static const std::map<std::string_view, std::set<std::string_view>> signal2props
+
+ void Item::onSignal(const Glib::ustring& sender_name, const Glib::ustring& signal_name,
+ const Glib::VariantContainerBase& arguments) {
+- spdlog::trace("Tray item '{}' got signal {}", id, std::string(signal_name));
++ spdlog::trace("Tray item '{}' got signal {}", id, signal_name);
+ auto changed = signal2props.find(signal_name.raw());
+ if (changed != signal2props.end()) {
+ if (update_pending_.empty()) {
+diff --git a/subprojects/fmt.wrap b/subprojects/fmt.wrap
+index 42b615963..fd508477f 100644
+--- a/subprojects/fmt.wrap
++++ b/subprojects/fmt.wrap
+@@ -1,13 +1,13 @@
+ [wrap-file]
+-directory = fmt-11.0.1
+-source_url = https://github.com/fmtlib/fmt/archive/11.0.1.tar.gz
+-source_filename = fmt-11.0.1.tar.gz
+-source_hash = 7d009f7f89ac84c0a83f79ed602463d092fbf66763766a907c97fd02b100f5e9
+-patch_filename = fmt_11.0.1-1_patch.zip
+-patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.1-1/get_patch
+-patch_hash = 0a8b93d1ee6d84a82d3872a9bfb4c3977d8a53f7f484d42d1f7ed63ed496d549
+-source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.1-1/fmt-11.0.1.tar.gz
+-wrapdb_version = 11.0.1-1
++directory = fmt-11.0.2
++source_url = https://github.com/fmtlib/fmt/archive/11.0.2.tar.gz
++source_filename = fmt-11.0.2.tar.gz
++source_hash = 6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f
++patch_filename = fmt_11.0.2-1_patch.zip
++patch_url = https://wrapdb.mesonbuild.com/v2/fmt_11.0.2-1/get_patch
++patch_hash = 90c9e3b8e8f29713d40ca949f6f93ad115d78d7fb921064112bc6179e6427c5e
++source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/fmt_11.0.2-1/fmt-11.0.2.tar.gz
++wrapdb_version = 11.0.2-1
+
+ [provide]
+ fmt = fmt_dep
diff --git a/gui-apps/waybar/waybar-0.11.0-r1.ebuild b/gui-apps/waybar/waybar-0.11.0-r1.ebuild
new file mode 100644
index 000000000000..b9e3032679d6
--- /dev/null
+++ b/gui-apps/waybar/waybar-0.11.0-r1.ebuild
@@ -0,0 +1,105 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit meson
+
+DESCRIPTION="Highly customizable Wayland bar for Sway and Wlroots based compositors"
+HOMEPAGE="https://github.com/Alexays/Waybar"
+
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/Alexays/${PN^}.git"
+else
+ SRC_URI="https://github.com/Alexays/${PN^}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm64"
+ S="${WORKDIR}/${PN^}-${PV}"
+fi
+
+LICENSE="MIT"
+SLOT="0"
+IUSE="evdev experimental jack +libinput +logind mpd mpris network pipewire pulseaudio sndio systemd test tray +udev upower wifi"
+REQUIRED_USE="
+ upower? ( logind )
+"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ >=app-text/scdoc-1.9.2
+ dev-util/gdbus-codegen
+ dev-util/wayland-scanner
+ virtual/pkgconfig
+"
+RDEPEND="
+ dev-cpp/cairomm:0
+ dev-cpp/glibmm:2
+ dev-cpp/gtkmm:3.0
+ dev-libs/glib:2
+ dev-libs/jsoncpp:=
+ dev-libs/libsigc++:2
+ >=dev-libs/libfmt-8.1.1:=
+ >=dev-libs/spdlog-1.10.0:=
+ dev-libs/date:=
+ dev-libs/wayland
+ gui-libs/gtk-layer-shell
+ media-video/pipewire:=
+ x11-libs/gtk+:3[wayland]
+ x11-libs/libxkbcommon
+ evdev? ( dev-libs/libevdev )
+ jack? ( virtual/jack )
+ libinput? ( dev-libs/libinput:= )
+ logind? (
+ || ( sys-apps/systemd
+ sys-auth/elogind )
+ )
+ mpd? ( media-libs/libmpdclient )
+ mpris? ( >=media-sound/playerctl-2 )
+ network? ( dev-libs/libnl:3 )
+ pipewire? ( media-video/wireplumber:0/0.5 )
+ pulseaudio? ( media-libs/libpulse )
+ sndio? ( media-sound/sndio:= )
+ systemd? ( sys-apps/systemd:= )
+ tray? (
+ dev-libs/libayatana-appindicator
+ dev-libs/libdbusmenu[gtk3]
+ )
+ udev? ( virtual/libudev:= )
+ upower? ( sys-power/upower:= )
+ wifi? ( sys-apps/util-linux )
+"
+DEPEND="${RDEPEND}
+ dev-libs/wayland-protocols
+ test? ( dev-cpp/catch:0 )
+"
+
+PATCHES=(
+ "${FILESDIR}"/tray-icons-fix.patch
+)
+
+src_configure() {
+ local emesonargs=(
+ -Dman-pages=enabled
+ -Dcava=disabled
+ $(meson_feature evdev libevdev)
+ $(meson_feature jack)
+ $(meson_feature libinput)
+ $(meson_feature logind)
+ $(meson_feature mpd)
+ $(meson_feature mpris)
+ $(meson_feature network libnl)
+ $(meson_feature pulseaudio)
+ $(meson_feature pipewire wireplumber)
+ $(meson_feature pipewire)
+ $(meson_feature sndio)
+ $(meson_feature systemd)
+ $(meson_feature test tests)
+ $(meson_feature tray dbusmenu-gtk)
+ $(meson_feature udev libudev)
+ $(meson_feature upower upower_glib)
+ $(meson_feature wifi rfkill)
+ $(meson_use experimental)
+ )
+ meson_src_configure
+}
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: gui-apps/waybar/files/, gui-apps/waybar/
@ 2023-02-04 22:50 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2023-02-04 22:50 UTC (permalink / raw
To: gentoo-commits
commit: 1d59818f4fd84e8e3fa08954310438e3fbca132a
Author: Julien Roy <julien <AT> jroy <DOT> ca>
AuthorDate: Sun Jan 29 00:30:39 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 4 22:49:41 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d59818f
gui-apps/waybar: add patch for wireplumber module
Signed-off-by: Julien Roy <julien <AT> jroy.ca>
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../waybar/files/waybar-0.9.17-wireplumber.patch | 345 +++++++++++++++++++++
gui-apps/waybar/waybar-0.9.17.ebuild | 4 +
2 files changed, 349 insertions(+)
diff --git a/gui-apps/waybar/files/waybar-0.9.17-wireplumber.patch b/gui-apps/waybar/files/waybar-0.9.17-wireplumber.patch
new file mode 100644
index 000000000000..bca3c259ae82
--- /dev/null
+++ b/gui-apps/waybar/files/waybar-0.9.17-wireplumber.patch
@@ -0,0 +1,345 @@
+From 4e8ccf36b54cacf5281726d23ea14312a133f977 Mon Sep 17 00:00:00 2001
+From: Sasha Moak <sasha.moak@gmail.com>
+Date: Thu, 12 Jan 2023 16:17:11 -0800
+Subject: [PATCH] fix(wireplumber): waybar crashes when default node changes
+
+In order to fix the issue, the default node name is cached rather than
+the default node id. This is due to ids being unstable. So now when the
+object manager is installed (ie ready), the default node name is
+retrieved and stored for later.
+
+Now when the mixer changed signal is emitted, the id of the changed node
+is used to get the node from the object manager. The nodes name is
+grabbed off that node and compared against the default node name, if
+they match the volume is updated. Some safeguarding has been added such
+that if the node cannot be found off the object manager, it's ignored.
+
+Additionally, the "changed" signal on the default nodes api is now
+utilized to update the default node name if it has changed. This way if
+the default node changes, the module will be updated with the correct
+volume and node.nick.
+
+This adds additional debug logging for helping diagnose wireplumber
+issues.
+
+This also adds the wireplumber man page entry to the main waybar
+supported section.
+---
+ include/modules/wireplumber.hpp | 10 +-
+ man/waybar.5.scd.in | 1 +
+ src/modules/wireplumber.cpp | 184 ++++++++++++++++++++++++++------
+ 3 files changed, 157 insertions(+), 38 deletions(-)
+
+diff --git a/include/modules/wireplumber.hpp b/include/modules/wireplumber.hpp
+index c0ee7f0be..fa988fcf3 100644
+--- a/include/modules/wireplumber.hpp
++++ b/include/modules/wireplumber.hpp
+@@ -20,15 +20,19 @@ class Wireplumber : public ALabel {
+ void loadRequiredApiModules();
+ void prepare();
+ void activatePlugins();
+- static void updateVolume(waybar::modules::Wireplumber* self);
+- static void updateNodeName(waybar::modules::Wireplumber* self);
+- static uint32_t getDefaultNodeId(waybar::modules::Wireplumber* self);
++ static void updateVolume(waybar::modules::Wireplumber* self, uint32_t id);
++ static void updateNodeName(waybar::modules::Wireplumber* self, uint32_t id);
+ static void onPluginActivated(WpObject* p, GAsyncResult* res, waybar::modules::Wireplumber* self);
+ static void onObjectManagerInstalled(waybar::modules::Wireplumber* self);
++ static void onMixerChanged(waybar::modules::Wireplumber* self, uint32_t id);
++ static void onDefaultNodesApiChanged(waybar::modules::Wireplumber* self);
+
+ WpCore* wp_core_;
+ GPtrArray* apis_;
+ WpObjectManager* om_;
++ WpPlugin* mixer_api_;
++ WpPlugin* def_nodes_api_;
++ gchar* default_node_name_;
+ uint32_t pending_plugins_;
+ bool muted_;
+ double volume_;
+diff --git a/man/waybar.5.scd.in b/man/waybar.5.scd.in
+index b1ed4c527..7566dd000 100644
+--- a/man/waybar.5.scd.in
++++ b/man/waybar.5.scd.in
+@@ -277,6 +277,7 @@ A module group is defined by specifying a module named "group/some-group-name".
+ - *waybar-sway-scratchpad(5)*
+ - *waybar-sway-window(5)*
+ - *waybar-sway-workspaces(5)*
++- *waybar-wireplumber(5)*
+ - *waybar-wlr-taskbar(5)*
+ - *waybar-wlr-workspaces(5)*
+ - *waybar-temperature(5)*
+diff --git a/src/modules/wireplumber.cpp b/src/modules/wireplumber.cpp
+index 9a12a9b5b..9652e1e2b 100644
+--- a/src/modules/wireplumber.cpp
++++ b/src/modules/wireplumber.cpp
+@@ -1,15 +1,22 @@
+ #include "modules/wireplumber.hpp"
+
++#include <spdlog/spdlog.h>
++
++bool isValidNodeId(uint32_t id) { return id > 0 && id < G_MAXUINT32; }
++
+ waybar::modules::Wireplumber::Wireplumber(const std::string& id, const Json::Value& config)
+ : ALabel(config, "wireplumber", id, "{volume}%"),
+ wp_core_(nullptr),
+ apis_(nullptr),
+ om_(nullptr),
++ mixer_api_(nullptr),
++ def_nodes_api_(nullptr),
++ default_node_name_(nullptr),
+ pending_plugins_(0),
+ muted_(false),
+ volume_(0.0),
+ node_id_(0) {
+- wp_init(WP_INIT_ALL);
++ wp_init(WP_INIT_PIPEWIRE);
+ wp_core_ = wp_core_new(NULL, NULL);
+ apis_ = g_ptr_array_new_with_free_func(g_object_unref);
+ om_ = wp_object_manager_new();
+@@ -18,10 +25,15 @@ waybar::modules::Wireplumber::Wireplumber(const std::string& id, const Json::Val
+
+ loadRequiredApiModules();
+
++ spdlog::debug("[{}]: connecting to pipewire...", this->name_);
++
+ if (!wp_core_connect(wp_core_)) {
++ spdlog::error("[{}]: Could not connect to PipeWire", this->name_);
+ throw std::runtime_error("Could not connect to PipeWire\n");
+ }
+
++ spdlog::debug("[{}]: connected!", this->name_);
++
+ g_signal_connect_swapped(om_, "installed", (GCallback)onObjectManagerInstalled, this);
+
+ activatePlugins();
+@@ -33,33 +45,26 @@ waybar::modules::Wireplumber::~Wireplumber() {
+ g_clear_pointer(&apis_, g_ptr_array_unref);
+ g_clear_object(&om_);
+ g_clear_object(&wp_core_);
++ g_clear_object(&mixer_api_);
++ g_clear_object(&def_nodes_api_);
++ g_free(&default_node_name_);
+ }
+
+-uint32_t waybar::modules::Wireplumber::getDefaultNodeId(waybar::modules::Wireplumber* self) {
+- uint32_t id;
+- g_autoptr(WpPlugin) def_nodes_api = wp_plugin_find(self->wp_core_, "default-nodes-api");
++void waybar::modules::Wireplumber::updateNodeName(waybar::modules::Wireplumber* self, uint32_t id) {
++ spdlog::debug("[{}]: updating node name with node.id {}", self->name_, id);
+
+- if (!def_nodes_api) {
+- throw std::runtime_error("Default nodes API is not loaded\n");
++ if (!isValidNodeId(id)) {
++ spdlog::warn("[{}]: '{}' is not a valid node ID. Ignoring node name update.", self->name_, id);
++ return;
+ }
+
+- g_signal_emit_by_name(def_nodes_api, "get-default-node", "Audio/Sink", &id);
+-
+- if (id <= 0 || id >= G_MAXUINT32) {
+- auto err = fmt::format("'{}' is not a valid ID (returned by default-nodes-api)\n", id);
+- throw std::runtime_error(err);
+- }
+-
+- return id;
+-}
+-
+-void waybar::modules::Wireplumber::updateNodeName(waybar::modules::Wireplumber* self) {
+- auto proxy = static_cast<WpProxy*>(
+- wp_object_manager_lookup(self->om_, WP_TYPE_GLOBAL_PROXY, WP_CONSTRAINT_TYPE_G_PROPERTY,
+- "bound-id", "=u", self->node_id_, NULL));
++ auto proxy = static_cast<WpProxy*>(wp_object_manager_lookup(
++ self->om_, WP_TYPE_GLOBAL_PROXY, WP_CONSTRAINT_TYPE_G_PROPERTY, "bound-id", "=u", id, NULL));
+
+ if (!proxy) {
+- throw std::runtime_error(fmt::format("Object '{}' not found\n", self->node_id_));
++ auto err = fmt::format("Object '{}' not found\n", id);
++ spdlog::error("[{}]: {}", self->name_, err);
++ throw std::runtime_error(err);
+ }
+
+ g_autoptr(WpProperties) properties =
+@@ -73,15 +78,24 @@ void waybar::modules::Wireplumber::updateNodeName(waybar::modules::Wireplumber*
+ auto description = wp_properties_get(properties, "node.description");
+
+ self->node_name_ = nick ? nick : description;
++ spdlog::debug("[{}]: Updating node name to: {}", self->name_, self->node_name_);
+ }
+
+-void waybar::modules::Wireplumber::updateVolume(waybar::modules::Wireplumber* self) {
++void waybar::modules::Wireplumber::updateVolume(waybar::modules::Wireplumber* self, uint32_t id) {
++ spdlog::debug("[{}]: updating volume", self->name_);
+ double vol;
+ GVariant* variant = NULL;
+- g_autoptr(WpPlugin) mixer_api = wp_plugin_find(self->wp_core_, "mixer-api");
+- g_signal_emit_by_name(mixer_api, "get-volume", self->node_id_, &variant);
++
++ if (!isValidNodeId(id)) {
++ spdlog::error("[{}]: '{}' is not a valid node ID. Ignoring volume update.", self->name_, id);
++ return;
++ }
++
++ g_signal_emit_by_name(self->mixer_api_, "get-volume", id, &variant);
++
+ if (!variant) {
+- auto err = fmt::format("Node {} does not support volume\n", self->node_id_);
++ auto err = fmt::format("Node {} does not support volume\n", id);
++ spdlog::error("[{}]: {}", self->name_, err);
+ throw std::runtime_error(err);
+ }
+
+@@ -93,22 +107,121 @@ void waybar::modules::Wireplumber::updateVolume(waybar::modules::Wireplumber* se
+ self->dp.emit();
+ }
+
++void waybar::modules::Wireplumber::onMixerChanged(waybar::modules::Wireplumber* self, uint32_t id) {
++ spdlog::debug("[{}]: (onMixerChanged) - id: {}", self->name_, id);
++
++ g_autoptr(WpNode) node = static_cast<WpNode*>(wp_object_manager_lookup(
++ self->om_, WP_TYPE_NODE, WP_CONSTRAINT_TYPE_G_PROPERTY, "bound-id", "=u", id, NULL));
++
++ if (!node) {
++ spdlog::warn("[{}]: (onMixerChanged) - Object with id {} not found", self->name_, id);
++ return;
++ }
++
++ const gchar* name = wp_pipewire_object_get_property(WP_PIPEWIRE_OBJECT(node), "node.name");
++
++ if (g_strcmp0(self->default_node_name_, name) != 0) {
++ spdlog::debug(
++ "[{}]: (onMixerChanged) - ignoring mixer update for node: id: {}, name: {} as it is not "
++ "the default node: {}",
++ self->name_, id, name, self->default_node_name_);
++ return;
++ }
++
++ spdlog::debug("[{}]: (onMixerChanged) - Need to update volume for node with id {} and name {}",
++ self->name_, id, name);
++ updateVolume(self, id);
++}
++
++void waybar::modules::Wireplumber::onDefaultNodesApiChanged(waybar::modules::Wireplumber* self) {
++ spdlog::debug("[{}]: (onDefaultNodesApiChanged)", self->name_);
++
++ uint32_t default_node_id;
++ g_signal_emit_by_name(self->def_nodes_api_, "get-default-node", "Audio/Sink", &default_node_id);
++
++ if (!isValidNodeId(default_node_id)) {
++ spdlog::warn("[{}]: '{}' is not a valid node ID. Ignoring node change.", self->name_,
++ default_node_id);
++ return;
++ }
++
++ g_autoptr(WpNode) node = static_cast<WpNode*>(
++ wp_object_manager_lookup(self->om_, WP_TYPE_NODE, WP_CONSTRAINT_TYPE_G_PROPERTY, "bound-id",
++ "=u", default_node_id, NULL));
++
++ if (!node) {
++ spdlog::warn("[{}]: (onDefaultNodesApiChanged) - Object with id {} not found", self->name_,
++ default_node_id);
++ return;
++ }
++
++ const gchar* default_node_name =
++ wp_pipewire_object_get_property(WP_PIPEWIRE_OBJECT(node), "node.name");
++
++ spdlog::debug(
++ "[{}]: (onDefaultNodesApiChanged) - got the following default node: Node(name: {}, id: {})",
++ self->name_, default_node_name, default_node_id);
++
++ if (g_strcmp0(self->default_node_name_, default_node_name) == 0) {
++ spdlog::debug(
++ "[{}]: (onDefaultNodesApiChanged) - Default node has not changed. Node(name: {}, id: {}). "
++ "Ignoring.",
++ self->name_, self->default_node_name_, default_node_id);
++ return;
++ }
++
++ spdlog::debug(
++ "[{}]: (onDefaultNodesApiChanged) - Default node changed to -> Node(name: {}, id: {})",
++ self->name_, default_node_name, default_node_id);
++
++ self->default_node_name_ = g_strdup(default_node_name);
++ updateVolume(self, default_node_id);
++ updateNodeName(self, default_node_id);
++}
++
+ void waybar::modules::Wireplumber::onObjectManagerInstalled(waybar::modules::Wireplumber* self) {
+- self->node_id_ =
+- self->config_["node-id"].isInt() ? self->config_["node-id"].asInt() : getDefaultNodeId(self);
++ spdlog::debug("[{}]: onObjectManagerInstalled", self->name_);
++
++ self->def_nodes_api_ = wp_plugin_find(self->wp_core_, "default-nodes-api");
++
++ if (!self->def_nodes_api_) {
++ spdlog::error("[{}]: default nodes api is not loaded.", self->name_);
++ throw std::runtime_error("Default nodes API is not loaded\n");
++ }
++
++ self->mixer_api_ = wp_plugin_find(self->wp_core_, "mixer-api");
++
++ if (!self->mixer_api_) {
++ spdlog::error("[{}]: mixer api is not loaded.", self->name_);
++ throw std::runtime_error("Mixer api is not loaded\n");
++ }
++
++ uint32_t default_node_id;
++ g_signal_emit_by_name(self->def_nodes_api_, "get-default-configured-node-name", "Audio/Sink",
++ &self->default_node_name_);
++ g_signal_emit_by_name(self->def_nodes_api_, "get-default-node", "Audio/Sink", &default_node_id);
++
++ if (self->default_node_name_) {
++ spdlog::debug("[{}]: (onObjectManagerInstalled) - default configured node name: {} and id: {}",
++ self->name_, self->default_node_name_, default_node_id);
++ }
+
+- g_autoptr(WpPlugin) mixer_api = wp_plugin_find(self->wp_core_, "mixer-api");
++ updateVolume(self, default_node_id);
++ updateNodeName(self, default_node_id);
+
+- updateVolume(self);
+- updateNodeName(self);
+- g_signal_connect_swapped(mixer_api, "changed", (GCallback)updateVolume, self);
++ g_signal_connect_swapped(self->mixer_api_, "changed", (GCallback)onMixerChanged, self);
++ g_signal_connect_swapped(self->def_nodes_api_, "changed", (GCallback)onDefaultNodesApiChanged,
++ self);
+ }
+
+ void waybar::modules::Wireplumber::onPluginActivated(WpObject* p, GAsyncResult* res,
+ waybar::modules::Wireplumber* self) {
++ auto plugin_name = wp_plugin_get_name(WP_PLUGIN(p));
++ spdlog::debug("[{}]: onPluginActivated: {}", self->name_, plugin_name);
+ g_autoptr(GError) error = NULL;
+
+ if (!wp_object_activate_finish(p, res, &error)) {
++ spdlog::error("[{}]: error activating plugin: {}", self->name_, error->message);
+ throw std::runtime_error(error->message);
+ }
+
+@@ -118,6 +231,7 @@ void waybar::modules::Wireplumber::onPluginActivated(WpObject* p, GAsyncResult*
+ }
+
+ void waybar::modules::Wireplumber::activatePlugins() {
++ spdlog::debug("[{}]: activating plugins", name_);
+ for (uint16_t i = 0; i < apis_->len; i++) {
+ WpPlugin* plugin = static_cast<WpPlugin*>(g_ptr_array_index(apis_, i));
+ pending_plugins_++;
+@@ -127,13 +241,13 @@ void waybar::modules::Wireplumber::activatePlugins() {
+ }
+
+ void waybar::modules::Wireplumber::prepare() {
+- wp_object_manager_add_interest(om_, WP_TYPE_NODE, NULL);
+- wp_object_manager_add_interest(om_, WP_TYPE_GLOBAL_PROXY, NULL);
+- wp_object_manager_request_object_features(om_, WP_TYPE_GLOBAL_PROXY,
+- WP_PIPEWIRE_OBJECT_FEATURES_MINIMAL);
++ spdlog::debug("[{}]: preparing object manager", name_);
++ wp_object_manager_add_interest(om_, WP_TYPE_NODE, WP_CONSTRAINT_TYPE_PW_PROPERTY, "media.class",
++ "=s", "Audio/Sink", NULL);
+ }
+
+ void waybar::modules::Wireplumber::loadRequiredApiModules() {
++ spdlog::debug("[{}]: loading required modules", name_);
+ g_autoptr(GError) error = NULL;
+
+ if (!wp_core_load_component(wp_core_, "libwireplumber-module-default-nodes-api", "module", NULL,
diff --git a/gui-apps/waybar/waybar-0.9.17.ebuild b/gui-apps/waybar/waybar-0.9.17.ebuild
index 97a130dc5f25..9d2f830e6558 100644
--- a/gui-apps/waybar/waybar-0.9.17.ebuild
+++ b/gui-apps/waybar/waybar-0.9.17.ebuild
@@ -57,6 +57,10 @@ DEPEND="
"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}/waybar-0.9.17-wireplumber.patch"
+)
+
src_configure() {
local emesonargs=(
$(meson_feature mpd)
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: gui-apps/waybar/files/, gui-apps/waybar/
@ 2022-08-29 22:08 Sam James
0 siblings, 0 replies; 4+ messages in thread
From: Sam James @ 2022-08-29 22:08 UTC (permalink / raw
To: gentoo-commits
commit: 5890ab330b1fe490a6c938fa974391993da52c8c
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 29 22:07:22 2022 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Aug 29 22:07:22 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5890ab33
gui-apps/waybar: fix build w/ libc++
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../waybar/files/waybar-0.9.13-libcxx-build.patch | 36 ++++++++++++++++++++++
gui-apps/waybar/waybar-0.9.13.ebuild | 4 +++
2 files changed, 40 insertions(+)
diff --git a/gui-apps/waybar/files/waybar-0.9.13-libcxx-build.patch b/gui-apps/waybar/files/waybar-0.9.13-libcxx-build.patch
new file mode 100644
index 000000000000..ad24e22fc437
--- /dev/null
+++ b/gui-apps/waybar/files/waybar-0.9.13-libcxx-build.patch
@@ -0,0 +1,36 @@
+https://github.com/Alexays/Waybar/commit/d25278f710a4932798c98141bcf5b482de0e9166
+
+From: Jan Beich <jbeich@FreeBSD.org>
+Date: Mon, 23 May 2022 16:23:00 +0000
+Subject: [PATCH] fix(upower): add missing include for libc++
+
+In file included from src/modules/upower/upower.cpp:1:
+include/modules/upower/upower.hpp:25:16: error: no template named 'unordered_map' in namespace 'std'
+ typedef std::unordered_map<std::string, UpDevice *> Devices;
+ ~~~~~^
+In file included from src/modules/upower/upower_tooltip.cpp:1:
+include/modules/upower/upower_tooltip.hpp:13:16: error: no template named 'unordered_map' in namespace 'std'
+ typedef std::unordered_map<std::string, UpDevice*> Devices;
+ ~~~~~^
+--- a/include/modules/upower/upower.hpp
++++ b/include/modules/upower/upower.hpp
+@@ -5,6 +5,7 @@
+ #include <iostream>
+ #include <map>
+ #include <string>
++#include <unordered_map>
+
+ #include "ALabel.hpp"
+ #include "glibconfig.h"
+--- a/include/modules/upower/upower_tooltip.hpp
++++ b/include/modules/upower/upower_tooltip.hpp
+@@ -2,6 +2,8 @@
+
+ #include <libupower-glib/upower.h>
+
++#include <unordered_map>
++
+ #include "gtkmm/box.h"
+ #include "gtkmm/label.h"
+ #include "gtkmm/window.h"
+
diff --git a/gui-apps/waybar/waybar-0.9.13.ebuild b/gui-apps/waybar/waybar-0.9.13.ebuild
index 6fbac657f700..c4886a844841 100644
--- a/gui-apps/waybar/waybar-0.9.13.ebuild
+++ b/gui-apps/waybar/waybar-0.9.13.ebuild
@@ -57,6 +57,10 @@ DEPEND="
"
RDEPEND="${DEPEND}"
+PATCHES=(
+ "${FILESDIR}"/${P}-libcxx-build.patch
+)
+
src_configure() {
local emesonargs=(
$(meson_feature mpd)
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-18 13:05 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-10 5:22 [gentoo-commits] repo/gentoo:master commit in: gui-apps/waybar/files/, gui-apps/waybar/ Sam James
-- strict thread matches above, loose matches on Subject: below --
2024-11-18 13:05 Sam James
2023-02-04 22:50 Sam James
2022-08-29 22:08 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox