All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/sway: make systemd optional
@ 2024-01-18  0:28 Stefan Ott via buildroot
  2024-01-18 12:58 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Ott via buildroot @ 2024-01-18  0:28 UTC (permalink / raw)
  To: buildroot; +Cc: Raphael Pavlidis, Stefan Ott

Sway works perfectly fine without it.

Signed-off-by: Stefan Ott <stefan@ott.net>
---
 package/sway/Config.in | 22 ++++++++++++++++++----
 package/sway/sway.mk   | 10 +++++++---
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/package/sway/Config.in b/package/sway/Config.in
index 4f6d9fb215..8d79d3ca6a 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
@@ -30,6 +29,22 @@ config BR2_PACKAGE_SWAY
 
 if BR2_PACKAGE_SWAY
 
+choice BR2_PACKAGE_SWAY_SD_BUS_PROVIDER
+	prompt "Provider of the sd-bus library"
+	default BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_AUTO
+
+config BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_AUTO
+	bool "auto"
+
+config BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_LIBSYSTEMD
+	bool "libsystemd"
+	depends on BR2_PACKAGE_SYSTEMD
+
+comment "The systemd backend needs systemd"
+	depends on !BR2_PACKAGE_SYSTEMD
+endchoice
+
+
 config BR2_PACKAGE_SWAY_SWAYBAR
 	bool "swaybar"
 	select BR2_PACKAGE_DEJAVU
@@ -54,9 +69,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..cce3b72d14 100644
--- a/package/sway/sway.mk
+++ b/package/sway/sway.mk
@@ -8,13 +8,17 @@ 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_SWAY_SD_BUS_PROVIDER_LIBSYSTEMD),y)
+SWAY_CONF_OPTS += -Dsd-bus-provider=libsystemd
+SWAY_DEPENDENCIES += systemd
+endif
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 SWAY_CONF_OPTS += -Dxwayland=enabled
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/sway: make systemd optional
  2024-01-18  0:28 [Buildroot] [PATCH] package/sway: make systemd optional Stefan Ott via buildroot
@ 2024-01-18 12:58 ` Thomas Petazzoni via buildroot
  2024-01-18 13:43   ` Stefan Ott via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-01-18 12:58 UTC (permalink / raw)
  To: Stefan Ott via buildroot; +Cc: Raphael Pavlidis, Stefan Ott

Hello,

On Thu, 18 Jan 2024 01:28:34 +0100
Stefan Ott via buildroot <buildroot@buildroot.org> wrote:

>  if BR2_PACKAGE_SWAY
>  
> +choice BR2_PACKAGE_SWAY_SD_BUS_PROVIDER
> +	prompt "Provider of the sd-bus library"
> +	default BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_AUTO
> +
> +config BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_AUTO
> +	bool "auto"
> +
> +config BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_LIBSYSTEMD
> +	bool "libsystemd"
> +	depends on BR2_PACKAGE_SYSTEMD
> +
> +comment "The systemd backend needs systemd"
> +	depends on !BR2_PACKAGE_SYSTEMD
> +endchoice

Thanks for your patch! I am wondering if adding an option for this is
needed. Can't we just enable systemd support when BR2_PACKAGE_SYSTEMD=y?

I think the fact that your comments is worded as "The systemd backend
needs systemd" is a good hint that this dependency is obvious, and
there's no need to have an explicit option for it.


> -	-Dsd-bus-provider=libsystemd
> +	-Dman-pages=disabled
> +
> +ifeq ($(BR2_PACKAGE_SWAY_SD_BUS_PROVIDER_LIBSYSTEMD),y)
> +SWAY_CONF_OPTS += -Dsd-bus-provider=libsystemd

Is there another sd-bus-provider option value that should be set when
systemd is not available?

> +SWAY_DEPENDENCIES += systemd
> +endif

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/sway: make systemd optional
  2024-01-18 12:58 ` Thomas Petazzoni via buildroot
@ 2024-01-18 13:43   ` Stefan Ott via buildroot
  2024-01-18 13:48     ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Ott via buildroot @ 2024-01-18 13:43 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Raphael Pavlidis, Stefan Ott via buildroot


[-- Attachment #1.1: Type: text/plain, Size: 998 bytes --]

Hi!

On Thu, Jan 18, 2024 at 01:58:20PM +0100, Thomas Petazzoni wrote:
> Thanks for your patch! I am wondering if adding an option for
> this is needed. Can't we just enable systemd support when
> BR2_PACKAGE_SYSTEMD=y?

That would indeed seem to be a more reasonable approach. The
reason I chose to turn it into an option was to make the user
aware of the fact that there is such an option at all and that
they might get additional features when using systemd.

Whether this is relevant or not, I cannot say. But if you think
it would be acceptable to do it automatically, I'll update the
patch accordingly.

> Is there another sd-bus-provider option value that should be
> set when systemd is not available?

To be quite honest, I can't tell you what benefits you get from
this in combination with systemd or any of the other options. All
I know is that in my case sway does work with the default value
(which is 'auto').


cheers
-- 
Stefan Ott
https://www.ott.net/

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH] package/sway: make systemd optional
  2024-01-18 13:43   ` Stefan Ott via buildroot
@ 2024-01-18 13:48     ` Thomas Petazzoni via buildroot
  2024-01-19  2:11       ` [Buildroot] [PATCH v2] " Stefan Ott via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-01-18 13:48 UTC (permalink / raw)
  To: Stefan Ott; +Cc: Raphael Pavlidis, Stefan Ott via buildroot

Hello Stefan,

On Thu, 18 Jan 2024 14:43:01 +0100
Stefan Ott <stefan@ott.net> wrote:

> That would indeed seem to be a more reasonable approach. The
> reason I chose to turn it into an option was to make the user
> aware of the fact that there is such an option at all and that
> they might get additional features when using systemd.
> 
> Whether this is relevant or not, I cannot say. But if you think
> it would be acceptable to do it automatically, I'll update the
> patch accordingly.

There's rarely a super clear-cut way of deciding whether an option
should be added, or the dependency be handled implicitly/automatically.
But in this particular case, it seems relatively obvious to me. In
addition, the systemd integration is mostly relevant if you use systemd
as your init system, in which case systemd will anyway already be
enabled, and therefore the systemd support in sway will be
automagically enabled.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* [Buildroot] [PATCH v2] package/sway: make systemd optional
  2024-01-18 13:48     ` Thomas Petazzoni via buildroot
@ 2024-01-19  2:11       ` Stefan Ott via buildroot
  2024-01-19 11:26         ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Ott via buildroot @ 2024-01-19  2:11 UTC (permalink / raw)
  To: buildroot; +Cc: Raphael Pavlidis, Stefan Ott

Sway works perfectly fine without it.

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

---
Changes v1 -> v2:
  - Automatically enable systemd integration for builds with systemd
    support (suggested by Thomas Petazzoni)
---
 package/sway/Config.in |  6 ++----
 package/sway/sway.mk   | 10 +++++++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/package/sway/Config.in b/package/sway/Config.in
index 4f6d9fb215..084ba830d7 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
@@ -54,9 +53,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..60492ae720 100644
--- a/package/sway/sway.mk
+++ b/package/sway/sway.mk
@@ -8,13 +8,17 @@ 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_SYSTEMD),y)
+SWAY_CONF_OPTS += -Dsd-bus-provider=libsystemd
+SWAY_DEPENDENCIES += systemd
+endif
 
 ifeq ($(BR2_PACKAGE_WLROOTS_X11),y)
 SWAY_CONF_OPTS += -Dxwayland=enabled
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/sway: make systemd optional
  2024-01-19  2:11       ` [Buildroot] [PATCH v2] " Stefan Ott via buildroot
@ 2024-01-19 11:26         ` Thomas Petazzoni via buildroot
  2024-01-20 15:08           ` Stefan Ott via buildroot
  0 siblings, 1 reply; 8+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-01-19 11:26 UTC (permalink / raw)
  To: Stefan Ott via buildroot; +Cc: Raphael Pavlidis, Stefan Ott

Hello,

Thanks for the new iteration!

On Fri, 19 Jan 2024 03:11:23 +0100
Stefan Ott via buildroot <buildroot@buildroot.org> wrote:

> +ifeq ($(BR2_PACKAGE_SYSTEMD),y)
> +SWAY_CONF_OPTS += -Dsd-bus-provider=libsystemd

Which other values of -Dsd-bus-provider are available? Would one be
suitable for an "else" clause to this "if" condition?

Thanks!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/sway: make systemd optional
  2024-01-19 11:26         ` Thomas Petazzoni via buildroot
@ 2024-01-20 15:08           ` Stefan Ott via buildroot
  2024-01-21 18:01             ` Raphael Pavlidis
  0 siblings, 1 reply; 8+ messages in thread
From: Stefan Ott via buildroot @ 2024-01-20 15:08 UTC (permalink / raw)
  To: Thomas Petazzoni; +Cc: Raphael Pavlidis, Stefan Ott via buildroot

Hi

On Fri, Jan 19, 2024 at 12:26:30PM +0100, Thomas Petazzoni wrote:
>
> Which other values of -Dsd-bus-provider are available? Would
> one be suitable for an "else" clause to this "if" condition?

The other values are "auto", "libelogind" and "basu", with "auto"
being the default.

-- 
Stefan Ott
https://www.ott.net/
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH v2] package/sway: make systemd optional
  2024-01-20 15:08           ` Stefan Ott via buildroot
@ 2024-01-21 18:01             ` Raphael Pavlidis
  0 siblings, 0 replies; 8+ messages in thread
From: Raphael Pavlidis @ 2024-01-21 18:01 UTC (permalink / raw)
  To: Stefan Ott, Thomas Petazzoni; +Cc: Stefan Ott via buildroot

Hi Stefan,

On 1/20/24 16:08, Stefan Ott wrote:

[SNIP]

> 
> The other values are "auto", "libelogind" and "basu", with "auto"
> being the default.
> 

I just checked the code. "auto" means that it will check if "libelogind" 
is present and then check for "basu". [1]  According to the code, a 
"sd-bus-provider" has to be present if "tray" is enabled [2], else it is 
not used anywhere. So, we can check if "BR2_PACKAGE_SYSTEMD" is enabled 
and enable also "tray", or disable it.

[1]: https://github.com/swaywm/sway/blob/master/meson.build#L89
[2]: https://github.com/swaywm/sway/blob/master/meson.build#L105

Thanks,
Raphael Pavlidis
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-01-21 18:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18  0:28 [Buildroot] [PATCH] package/sway: make systemd optional Stefan Ott via buildroot
2024-01-18 12:58 ` Thomas Petazzoni via buildroot
2024-01-18 13:43   ` Stefan Ott via buildroot
2024-01-18 13:48     ` Thomas Petazzoni via buildroot
2024-01-19  2:11       ` [Buildroot] [PATCH v2] " Stefan Ott via buildroot
2024-01-19 11:26         ` Thomas Petazzoni via buildroot
2024-01-20 15:08           ` Stefan Ott via buildroot
2024-01-21 18:01             ` Raphael Pavlidis

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.