diff mbox series

[v4] package/sway: make systemd optional

Message ID 20240203030138.1934339-1-stefan@ott.net
State Changes Requested
Headers show
Series [v4] package/sway: make systemd optional | expand

Commit Message

Stefan Ott Feb. 3, 2024, 3:01 a.m. UTC
Sway works perfectly fine without it.

Signed-off-by: Stefan Ott <stefan@ott.net>

---
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(-)

Comments

Raphael Pavlidis Feb. 3, 2024, 5:22 p.m. UTC | #1
Hi Stefan,
looks good to me. Unfortunately, I do not have permission to do that.

Thanks,
Raphael Pavlidis
Yann E. MORIN Feb. 4, 2024, 4:09 p.m. UTC | #2
Stefan, All,

On 2024-02-03 04:01 +0100, Stefan Ott via buildroot spake thusly:
> 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.

> Signed-off-by: Stefan Ott <stefan@ott.net>
> 
> ---
> 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(-)
> 
> diff --git a/package/sway/Config.in b/package/sway/Config.in
> index 4f6d9fb215..d2fcdc6d70 100644
> --- a/package/sway/Config.in
> +++ b/package/sway/Config.in
> @@ -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
> diff --git a/package/sway/sway.mk b/package/sway/sway.mk
> index 0aad9de712..089b533baf 100644
> --- a/package/sway/sway.mk
> +++ b/package/sway/sway.mk
> @@ -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
> -- 
> 2.43.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/sway/Config.in b/package/sway/Config.in
index 4f6d9fb215..d2fcdc6d70 100644
--- a/package/sway/Config.in
+++ b/package/sway/Config.in
@@ -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
diff --git a/package/sway/sway.mk b/package/sway/sway.mk
index 0aad9de712..089b533baf 100644
--- a/package/sway/sway.mk
+++ b/package/sway/sway.mk
@@ -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