Skip to contentSkip to conversation

package/sway: make systemd optional

PATCH Superseded Stefan Ott via buildroot 3 participants 5 messages Feb 2, 2024 – Feb 4, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 package/sway: make systemd optional

Sway works perfectly fine without it.

---
Changes v2 -> v3:
- Make BR2_PACKAGE_SWAY_SWAYBAR_TRAY depend on systemd and set sd-bus-provider=libsystemd if SWAY_SWAYBAR_TRAY is enabled
Changes v1 -> v2:
- Automatically enable systemd integration for builds with systemd support (suggested by Thomas Petazzoni)

---
 package/sway/Config.in | 10 ++++++----
 package/sway/sway.mk   |  8 ++++----
 2 files changed, 10 insertions(+), 8 deletions(-)
package/sway/Config.in +6 -4
index 4f6d9fb215..f11c473fa8 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_SWAY
 	bool "sway"
-	depends on BR2_PACKAGE_SYSTEMD # is required by the sd-bus provider
 	depends on !BR2_STATIC_LIBS # wlroots
 	depends on BR2_TOOLCHAIN_HAS_THREADS # pango, wlroots
 	depends on BR2_PACKAGE_HAS_LIBEGL # wlroots
@@ -42,9 +41,13 @@ if BR2_PACKAGE_SWAY_SWAYBAR
 
 config BR2_PACKAGE_SWAY_SWAYBAR_TRAY
 	bool "swaybar tray"
+	depends on BR2_PACKAGE_SYSTEMD
 	help
 	  Enable support for swaybar tray
 
+comment "swaybar tray needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
+
 endif # BR2_PACKAGE_SWAY_SWAYBAR
 
 config BR2_PACKAGE_SWAY_SWAYNAG
@@ -54,9 +57,8 @@ config BR2_PACKAGE_SWAY_SWAYNAG
 
 endif # BR2_PACKAGE_SWAY
 
-comment "sway needs systemd, udev, EGL w/ Wayland backend and OpenGL ES support"
-	depends on !BR2_PACKAGE_SYSTEMD || \
-		!BR2_PACKAGE_HAS_UDEV || \
+comment "sway needs udev, EGL w/ Wayland backend and OpenGL ES support"
+	depends on !BR2_PACKAGE_HAS_UDEV || \
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBEGL_WAYLAND || \
 		!BR2_PACKAGE_HAS_LIBGLES
package/sway/sway.mk +4 -4
index 0aad9de712..87a01002f0 100644
@@ -8,13 +8,12 @@ SWAY_VERSION = 1.8.1
 SWAY_SITE = https://github.com/swaywm/sway/releases/download/$(SWAY_VERSION)
 SWAY_LICENSE = MIT
 SWAY_LICENSE_FILES = LICENSE
-SWAY_DEPENDENCIES = systemd host-pkgconf wlroots json-c pcre cairo pango
+SWAY_DEPENDENCIES = host-pkgconf wlroots json-c pcre cairo pango
 SWAY_CONF_OPTS = \
 	-Dwerror=false \
 	-Dzsh-completions=false \
 	-Dfish-completions=false \
-	-Dman-pages=disabled \
-	-Dsd-bus-provider=libsystemd
+	-Dman-pages=disabled
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 SWAY_CONF_OPTS += -Dxwayland=enabled
@@ -54,7 +53,8 @@ SWAY_CONF_OPTS += -Dswaynag=false
 endif
 
 ifeq ($(BR2_PACKAGE_SWAY_SWAYBAR_TRAY),y)
-SWAY_CONF_OPTS += -Dtray=enabled
+SWAY_DEPENDENCIES += systemd
+SWAY_CONF_OPTS += -Dtray=enabled -Dsd-bus-provider=libsystemd
 else
 SWAY_CONF_OPTS += -Dtray=disabled
 endif
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hello Stefan,

Thanks for the new iteration!

On 2/2/24 03:02, Stefan Ott wrote:

[SNIP]

package/sway/Config.in config BR2_PACKAGE_SWAY_SWAYNAG · line 59

Quoted 11 lines
package/sway/Config.in +3 -0
+comment "swaybar tray needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
+
  endif # BR2_PACKAGE_SWAY_SWAYBAR
 
  config BR2_PACKAGE_SWAY_SWAYNAG
@@ -54,9 +57,8 @@ config BR2_PACKAGE_SWAY_SWAYNAG
 
  endif # BR2_PACKAGE_SWAY
 

I like it more if the tray feature is enabled automatically if systemd is present, without making it an option.

Thanks,
Raphael Pavlidis

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#2 lore raw

PATCH v4 1/1 package/sway: make systemd optional

Sway works perfectly fine without it.

---
Changes v3 -> v4:
- Automatically enable tray support if systemd is enabled (suggested by Raphael Pavlidis)
Changes v2 -> v3:
- Make BR2_PACKAGE_SWAY_SWAYBAR_TRAY depend on systemd and set sd-bus-provider=libsystemd if SWAY_SWAYBAR_TRAY is enabled
Changes v1 -> v2:
- Automatically enable systemd integration for builds with systemd support (suggested by Thomas Petazzoni)

---
 package/sway/Config.in | 15 ++-------------
 package/sway/sway.mk   | 10 +++++-----
 2 files changed, 7 insertions(+), 18 deletions(-)
package/sway/Config.in +2 -13
index 4f6d9fb215..d2fcdc6d70 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_SWAY
 	bool "sway"
-	depends on BR2_PACKAGE_SYSTEMD # is required by the sd-bus provider
 	depends on !BR2_STATIC_LIBS # wlroots
 	depends on BR2_TOOLCHAIN_HAS_THREADS # pango, wlroots
 	depends on BR2_PACKAGE_HAS_LIBEGL # wlroots
@@ -38,15 +37,6 @@ config BR2_PACKAGE_SWAY_SWAYBAR
 	help
 	  Enable support for swaybar
 
-if BR2_PACKAGE_SWAY_SWAYBAR
-
-config BR2_PACKAGE_SWAY_SWAYBAR_TRAY
-	bool "swaybar tray"
-	help
-	  Enable support for swaybar tray
-
-endif # BR2_PACKAGE_SWAY_SWAYBAR
-
 config BR2_PACKAGE_SWAY_SWAYNAG
 	bool "swaynag"
 	help
@@ -54,9 +44,8 @@ config BR2_PACKAGE_SWAY_SWAYNAG
 
 endif # BR2_PACKAGE_SWAY
 
-comment "sway needs systemd, udev, EGL w/ Wayland backend and OpenGL ES support"
-	depends on !BR2_PACKAGE_SYSTEMD || \
-		!BR2_PACKAGE_HAS_UDEV || \
+comment "sway needs udev, EGL w/ Wayland backend and OpenGL ES support"
+	depends on !BR2_PACKAGE_HAS_UDEV || \
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBEGL_WAYLAND || \
 		!BR2_PACKAGE_HAS_LIBGLES
package/sway/sway.mk +5 -5
index 0aad9de712..089b533baf 100644
@@ -8,13 +8,12 @@ SWAY_VERSION = 1.8.1
 SWAY_SITE = https://github.com/swaywm/sway/releases/download/$(SWAY_VERSION)
 SWAY_LICENSE = MIT
 SWAY_LICENSE_FILES = LICENSE
-SWAY_DEPENDENCIES = systemd host-pkgconf wlroots json-c pcre cairo pango
+SWAY_DEPENDENCIES = host-pkgconf wlroots json-c pcre cairo pango
 SWAY_CONF_OPTS = \
 	-Dwerror=false \
 	-Dzsh-completions=false \
 	-Dfish-completions=false \
-	-Dman-pages=disabled \
-	-Dsd-bus-provider=libsystemd
+	-Dman-pages=disabled
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 SWAY_CONF_OPTS += -Dxwayland=enabled
@@ -53,8 +52,9 @@ else
 SWAY_CONF_OPTS += -Dswaynag=false
 endif
 
-ifeq ($(BR2_PACKAGE_SWAY_SWAYBAR_TRAY),y)
-SWAY_CONF_OPTS += -Dtray=enabled
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SWAY_DEPENDENCIES += systemd
+SWAY_CONF_OPTS += -Dtray=enabled -Dsd-bus-provider=libsystemd
 else
 SWAY_CONF_OPTS += -Dtray=disabled
 endif
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
In reply to Stefan Ott via buildroot

Stefan, All,

On 2024-02-03 04:01 +0100, Stefan Ott via buildroot spake thusly:

Quoted 1 line

Sway works perfectly fine without it.

Thanks for this new iteration. However, there are a few issues with it yet.

First, your commit log is way too short to explain the changes:
- why is it OK to drop the swaybar option altogether?
- why is there no value set for -Dsd-bus-provider when systemd is not enabled?

You provided answers to the second, and you did the first because it was suggested, but the explanations really belong to the commit log. Indeed, when we look at the git tree in the future, we need to have that information available right there, rather than buried and lost in a few threads in the mailing list.

Also, even though it may make sense to always enable the waybar with systemd, this is semantically a separate change, and should be done in a separate commit (possibly coming before the one making systemd optional). If that were not possible, then this should be dully motivated in the commit log.

So, could you please rework this change, so that:

- the first patch makes building waybar non-optional once systemd is enabled; note in the commit log that there is no need for legacy handling (I'll let you dig why! ;-))

- the second patch removes the systemd dependency on sway oitself, and explains why the non-systemd case has no otpion set for -Dsd-bus-provider

Thanks!

Regards,
Yann E. MORIN.

Quoted 95 lines

---
Changes v3 -> v4:
- Automatically enable tray support if systemd is enabled (suggested by Raphael Pavlidis)
Changes v2 -> v3:
- Make BR2_PACKAGE_SWAY_SWAYBAR_TRAY depend on systemd and set sd-bus-provider=libsystemd if SWAY_SWAYBAR_TRAY is enabled
Changes v1 -> v2:
- Automatically enable systemd integration for builds with systemd support (suggested by Thomas Petazzoni)

---
 package/sway/Config.in | 15 ++-------------
 package/sway/sway.mk   | 10 +++++-----
 2 files changed, 7 insertions(+), 18 deletions(-)
package/sway/Config.in +2 -13
index 4f6d9fb215..d2fcdc6d70 100644
@@ -1,6 +1,5 @@
 config BR2_PACKAGE_SWAY
 	bool "sway"
-	depends on BR2_PACKAGE_SYSTEMD # is required by the sd-bus provider
 	depends on !BR2_STATIC_LIBS # wlroots
 	depends on BR2_TOOLCHAIN_HAS_THREADS # pango, wlroots
 	depends on BR2_PACKAGE_HAS_LIBEGL # wlroots
@@ -38,15 +37,6 @@ config BR2_PACKAGE_SWAY_SWAYBAR
 	help
 	  Enable support for swaybar
 
-if BR2_PACKAGE_SWAY_SWAYBAR
-
-config BR2_PACKAGE_SWAY_SWAYBAR_TRAY
-	bool "swaybar tray"
-	help
-	  Enable support for swaybar tray
-
-endif # BR2_PACKAGE_SWAY_SWAYBAR
-
 config BR2_PACKAGE_SWAY_SWAYNAG
 	bool "swaynag"
 	help
@@ -54,9 +44,8 @@ config BR2_PACKAGE_SWAY_SWAYNAG
 
 endif # BR2_PACKAGE_SWAY
 
-comment "sway needs systemd, udev, EGL w/ Wayland backend and OpenGL ES support"
-	depends on !BR2_PACKAGE_SYSTEMD || \
-		!BR2_PACKAGE_HAS_UDEV || \
+comment "sway needs udev, EGL w/ Wayland backend and OpenGL ES support"
+	depends on !BR2_PACKAGE_HAS_UDEV || \
 		!BR2_PACKAGE_HAS_LIBEGL || \
 		!BR2_PACKAGE_HAS_LIBEGL_WAYLAND || \
 		!BR2_PACKAGE_HAS_LIBGLES
package/sway/sway.mk +5 -5
index 0aad9de712..089b533baf 100644
@@ -8,13 +8,12 @@ SWAY_VERSION = 1.8.1
 SWAY_SITE = https://github.com/swaywm/sway/releases/download/$(SWAY_VERSION)
 SWAY_LICENSE = MIT
 SWAY_LICENSE_FILES = LICENSE
-SWAY_DEPENDENCIES = systemd host-pkgconf wlroots json-c pcre cairo pango
+SWAY_DEPENDENCIES = host-pkgconf wlroots json-c pcre cairo pango
 SWAY_CONF_OPTS = \
 	-Dwerror=false \
 	-Dzsh-completions=false \
 	-Dfish-completions=false \
-	-Dman-pages=disabled \
-	-Dsd-bus-provider=libsystemd
+	-Dman-pages=disabled
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 SWAY_CONF_OPTS += -Dxwayland=enabled
@@ -53,8 +52,9 @@ else
 SWAY_CONF_OPTS += -Dswaynag=false
 endif
 
-ifeq ($(BR2_PACKAGE_SWAY_SWAYBAR_TRAY),y)
-SWAY_CONF_OPTS += -Dtray=enabled
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+SWAY_DEPENDENCIES += systemd
+SWAY_CONF_OPTS += -Dtray=enabled -Dsd-bus-provider=libsystemd
 else
 SWAY_CONF_OPTS += -Dtray=disabled
 endif
Signature · 6 lines
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot