public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] build: Allow systemd unit build without libsystemd
@ 2025-12-08  1:24 Achill Gilgenast
  2025-12-08  3:46 ` [BlueZ] " bluez.test.bot
  2025-12-08 11:57 ` [PATCH BlueZ] " Bastien Nocera
  0 siblings, 2 replies; 5+ messages in thread
From: Achill Gilgenast @ 2025-12-08  1:24 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Achill Gilgenast

Decouples libsystemd and systemd units from the same option and allows
installation of services without systemd.pc by manually specifying the
directories.

This is useful in Alpine Linux where we don't ship systemd, but allow
systemd services to be subpackaged for downstream distributions like
postmarketOS.
---
I'm by far no expert in autotools or bluez and how specific components
are best categorized, so please let me know your feedback.
---
 Makefile.am    |  6 +++++-
 Makefile.mesh  |  4 +++-
 Makefile.obexd |  2 +-
 Makefile.tools |  4 ++--
 configure.ac   | 21 +++++++++++++++------
 5 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index e152ae64853c..d3cdb2890d32 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf
 state_DATA =
 endif
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
 systemdsystemunit_DATA = src/bluetooth.service
+endif
 
+if SYSTEMD_USERUNITS
 systemduserunitdir = $(SYSTEMD_USERUNITDIR)
 systemduserunit_DATA =
+endif
 
+if SYSTEMD_UNITS
 dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
 dbussystembus_DATA = src/org.bluez.service
 endif
diff --git a/Makefile.mesh b/Makefile.mesh
index e4c9fa6a32e6..e9998a9cdd75 100644
--- a/Makefile.mesh
+++ b/Makefile.mesh
@@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf
 conf_DATA += mesh/mesh-main.conf
 endif
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunit_DATA += mesh/bluetooth-mesh.service
+endif
+if SYSTEMD_UNITS
 dbussystembus_DATA += mesh/org.bluez.mesh.service
 endif
 
diff --git a/Makefile.obexd b/Makefile.obexd
index 7ad74e1286b6..25aa8feb73d1 100644
--- a/Makefile.obexd
+++ b/Makefile.obexd
@@ -1,7 +1,7 @@
 # SPDX-License-Identifier: GPL-2.0
 if OBEX
 
-if SYSTEMD
+if SYSTEMD_USERUNITS
 systemduserunit_DATA += obexd/src/obex.service
 
 obexd-add-service-symlink:
diff --git a/Makefile.tools b/Makefile.tools
index 561b03d0b95b..72dffe7cd005 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger
 tools_btmon_logger_SOURCES = tools/btmon-logger.c
 tools_btmon_logger_LDADD = src/libshared-mainloop.la
 
-if SYSTEMD
+if SYSTEMD_SYSTEMUNITS
 systemdsystemunit_DATA += tools/bluetooth-logger.service
 endif
 endif
@@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c tools/missing.h
 
 tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
 tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS) $(DBUS_LIBS)
-if SYSTEMD
+if SYSTEMD_USERUNITS
 systemduserunit_DATA += tools/mpris-proxy.service
 endif
 
diff --git a/configure.ac b/configure.ac
index 16b81aca37e6..2d9352b59557 100644
--- a/configure.ac
+++ b/configure.ac
@@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],
 			AS_HELP_STRING([--with-systemdsystemunitdir=DIR],
 			[path to systemd system unit directory]),
 					[path_systemunitdir=${withval}])
-if (test "${enable_systemd}" != "no" && test -z "${path_systemunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}"); then
 	AC_MSG_CHECKING([systemd system unit dir])
-	path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
 	if (test -z "${path_systemunitdir}"); then
-		AC_MSG_ERROR([systemd system unit directory is required])
+		path_systemunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"
+		if (test -z "${path_systemunitdir}"); then
+			AC_MSG_ERROR([systemd system unit directory is required])
+		fi
 	fi
 	AC_MSG_RESULT([${path_systemunitdir}])
 fi
 AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
+AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" != "")
 
 AC_ARG_WITH([systemduserunitdir],
 			AS_HELP_STRING([--with-systemduserunitdir=DIR],
 			[path to systemd user unit directory]),
 					[path_userunitdir=${withval}])
-if (test "${enable_systemd}" != "no" && test -z "${path_userunitdir}"); then
+if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}"); then
 	AC_MSG_CHECKING([systemd user unit dir])
-	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`"
 	if (test -z "${path_userunitdir}"); then
-		AC_MSG_ERROR([systemd user unit directory is required])
+		path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir systemd`"
+		if (test -z "${path_userunitdir}"); then
+			AC_MSG_ERROR([systemd user unit directory is required])
+		fi
 	fi
 	AC_MSG_RESULT([${path_userunitdir}])
 fi
 AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
+AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
+
+AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" || test "${path_userunitdir}" != ""))
+
 
 AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
 			[do not install configuration and data files]),
-- 
2.52.0

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

* RE: [BlueZ] build: Allow systemd unit build without libsystemd
  2025-12-08  1:24 [PATCH BlueZ] build: Allow systemd unit build without libsystemd Achill Gilgenast
@ 2025-12-08  3:46 ` bluez.test.bot
  2025-12-08 11:57 ` [PATCH BlueZ] " Bastien Nocera
  1 sibling, 0 replies; 5+ messages in thread
From: bluez.test.bot @ 2025-12-08  3:46 UTC (permalink / raw)
  To: linux-bluetooth, achill

[-- Attachment #1: Type: text/plain, Size: 1262 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=1031211

---Test result---

Test Summary:
CheckPatch                    PENDING   0.29 seconds
GitLint                       PENDING   0.34 seconds
BuildEll                      PASS      20.27 seconds
BluezMake                     PASS      629.09 seconds
MakeCheck                     PASS      21.85 seconds
MakeDistcheck                 PASS      243.05 seconds
CheckValgrind                 PASS      305.13 seconds
CheckSmatch                   PASS      365.47 seconds
bluezmakeextell               PASS      185.64 seconds
IncrementalBuild              PENDING   0.36 seconds
ScanBuild                     PASS      1063.33 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series
Output:



---
Regards,
Linux Bluetooth


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

* Re: [PATCH BlueZ] build: Allow systemd unit build without libsystemd
  2025-12-08  1:24 [PATCH BlueZ] build: Allow systemd unit build without libsystemd Achill Gilgenast
  2025-12-08  3:46 ` [BlueZ] " bluez.test.bot
@ 2025-12-08 11:57 ` Bastien Nocera
  2025-12-09 14:25   ` Achill Gilgenast
  1 sibling, 1 reply; 5+ messages in thread
From: Bastien Nocera @ 2025-12-08 11:57 UTC (permalink / raw)
  To: Achill Gilgenast, linux-bluetooth

On Mon, 2025-12-08 at 02:24 +0100, Achill Gilgenast wrote:
> Decouples libsystemd and systemd units from the same option and
> allows
> installation of services without systemd.pc by manually specifying
> the
> directories.
> 
> This is useful in Alpine Linux where we don't ship systemd, but allow
> systemd services to be subpackaged for downstream distributions like
> postmarketOS.

For what it's worth, this was already implemented in the meson port:
https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8

> ---
> I'm by far no expert in autotools or bluez and how specific
> components
> are best categorized, so please let me know your feedback.
> ---
>  Makefile.am    |  6 +++++-
>  Makefile.mesh  |  4 +++-
>  Makefile.obexd |  2 +-
>  Makefile.tools |  4 ++--
>  configure.ac   | 21 +++++++++++++++------
>  5 files changed, 26 insertions(+), 11 deletions(-)
> 
> diff --git a/Makefile.am b/Makefile.am
> index e152ae64853c..d3cdb2890d32 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf
>  state_DATA =
>  endif
>  
> -if SYSTEMD
> +if SYSTEMD_SYSTEMUNITS
>  systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
>  systemdsystemunit_DATA = src/bluetooth.service
> +endif
>  
> +if SYSTEMD_USERUNITS
>  systemduserunitdir = $(SYSTEMD_USERUNITDIR)
>  systemduserunit_DATA =
> +endif
>  
> +if SYSTEMD_UNITS
>  dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
>  dbussystembus_DATA = src/org.bluez.service
>  endif
> diff --git a/Makefile.mesh b/Makefile.mesh
> index e4c9fa6a32e6..e9998a9cdd75 100644
> --- a/Makefile.mesh
> +++ b/Makefile.mesh
> @@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf
>  conf_DATA += mesh/mesh-main.conf
>  endif
>  
> -if SYSTEMD
> +if SYSTEMD_SYSTEMUNITS
>  systemdsystemunit_DATA += mesh/bluetooth-mesh.service
> +endif
> +if SYSTEMD_UNITS
>  dbussystembus_DATA += mesh/org.bluez.mesh.service
>  endif
>  
> diff --git a/Makefile.obexd b/Makefile.obexd
> index 7ad74e1286b6..25aa8feb73d1 100644
> --- a/Makefile.obexd
> +++ b/Makefile.obexd
> @@ -1,7 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0
>  if OBEX
>  
> -if SYSTEMD
> +if SYSTEMD_USERUNITS
>  systemduserunit_DATA += obexd/src/obex.service
>  
>  obexd-add-service-symlink:
> diff --git a/Makefile.tools b/Makefile.tools
> index 561b03d0b95b..72dffe7cd005 100644
> --- a/Makefile.tools
> +++ b/Makefile.tools
> @@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger
>  tools_btmon_logger_SOURCES = tools/btmon-logger.c
>  tools_btmon_logger_LDADD = src/libshared-mainloop.la
>  
> -if SYSTEMD
> +if SYSTEMD_SYSTEMUNITS
>  systemdsystemunit_DATA += tools/bluetooth-logger.service
>  endif
>  endif
> @@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c
> tools/missing.h
>  
>  tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
>  tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS)
> $(DBUS_LIBS)
> -if SYSTEMD
> +if SYSTEMD_USERUNITS
>  systemduserunit_DATA += tools/mpris-proxy.service
>  endif
>  
> diff --git a/configure.ac b/configure.ac
> index 16b81aca37e6..2d9352b59557 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],
>  			AS_HELP_STRING([--with-
> systemdsystemunitdir=DIR],
>  			[path to systemd system unit directory]),
>  					[path_systemunitdir=${withva
> l}])
> -if (test "${enable_systemd}" != "no" && test -z
> "${path_systemunitdir}"); then
> +if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}");
> then
>  	AC_MSG_CHECKING([systemd system unit dir])
> -	path_systemunitdir="`$PKG_CONFIG --
> variable=systemdsystemunitdir systemd`"
>  	if (test -z "${path_systemunitdir}"); then
> -		AC_MSG_ERROR([systemd system unit directory is
> required])
> +		path_systemunitdir="`$PKG_CONFIG --
> variable=systemdsystemunitdir systemd`"
> +		if (test -z "${path_systemunitdir}"); then
> +			AC_MSG_ERROR([systemd system unit directory
> is required])
> +		fi
>  	fi
>  	AC_MSG_RESULT([${path_systemunitdir}])
>  fi
>  AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
> +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" !=
> "")
>  
>  AC_ARG_WITH([systemduserunitdir],
>  			AS_HELP_STRING([--with-
> systemduserunitdir=DIR],
>  			[path to systemd user unit directory]),
>  					[path_userunitdir=${withval}
> ])
> -if (test "${enable_systemd}" != "no" && test -z
> "${path_userunitdir}"); then
> +if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}");
> then
>  	AC_MSG_CHECKING([systemd user unit dir])
> -	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir
> systemd`"
>  	if (test -z "${path_userunitdir}"); then
> -		AC_MSG_ERROR([systemd user unit directory is
> required])
> +		path_userunitdir="`$PKG_CONFIG --
> variable=systemduserunitdir systemd`"
> +		if (test -z "${path_userunitdir}"); then
> +			AC_MSG_ERROR([systemd user unit directory is
> required])
> +		fi
>  	fi
>  	AC_MSG_RESULT([${path_userunitdir}])
>  fi
>  AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
> +AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
> +
> +AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" ||
> test "${path_userunitdir}" != ""))
> +
>  
>  AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
>  			[do not install configuration and data
> files]),

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

* Re: [PATCH BlueZ] build: Allow systemd unit build without libsystemd
  2025-12-08 11:57 ` [PATCH BlueZ] " Bastien Nocera
@ 2025-12-09 14:25   ` Achill Gilgenast
  2026-01-12  9:50     ` Bastien Nocera
  0 siblings, 1 reply; 5+ messages in thread
From: Achill Gilgenast @ 2025-12-09 14:25 UTC (permalink / raw)
  To: Bastien Nocera, Achill Gilgenast, linux-bluetooth

On Mon Dec 8, 2025 at 12:57 PM CET, Bastien Nocera wrote:
> On Mon, 2025-12-08 at 02:24 +0100, Achill Gilgenast wrote:
>> Decouples libsystemd and systemd units from the same option and
>> allows
>> installation of services without systemd.pc by manually specifying
>> the
>> directories.
>> 
>> This is useful in Alpine Linux where we don't ship systemd, but allow
>> systemd services to be subpackaged for downstream distributions like
>> postmarketOS.
>
> For what it's worth, this was already implemented in the meson port:
> https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8

Oh cool, I had no idea that a meson port existed. Do you know when this
will hit master?

>
>> ---
>> I'm by far no expert in autotools or bluez and how specific
>> components
>> are best categorized, so please let me know your feedback.
>> ---
>>  Makefile.am    |  6 +++++-
>>  Makefile.mesh  |  4 +++-
>>  Makefile.obexd |  2 +-
>>  Makefile.tools |  4 ++--
>>  configure.ac   | 21 +++++++++++++++------
>>  5 files changed, 26 insertions(+), 11 deletions(-)
>> 
>> diff --git a/Makefile.am b/Makefile.am
>> index e152ae64853c..d3cdb2890d32 100644
>> --- a/Makefile.am
>> +++ b/Makefile.am
>> @@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf
>>  state_DATA =
>>  endif
>>  
>> -if SYSTEMD
>> +if SYSTEMD_SYSTEMUNITS
>>  systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
>>  systemdsystemunit_DATA = src/bluetooth.service
>> +endif
>>  
>> +if SYSTEMD_USERUNITS
>>  systemduserunitdir = $(SYSTEMD_USERUNITDIR)
>>  systemduserunit_DATA =
>> +endif
>>  
>> +if SYSTEMD_UNITS
>>  dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
>>  dbussystembus_DATA = src/org.bluez.service
>>  endif
>> diff --git a/Makefile.mesh b/Makefile.mesh
>> index e4c9fa6a32e6..e9998a9cdd75 100644
>> --- a/Makefile.mesh
>> +++ b/Makefile.mesh
>> @@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf
>>  conf_DATA += mesh/mesh-main.conf
>>  endif
>>  
>> -if SYSTEMD
>> +if SYSTEMD_SYSTEMUNITS
>>  systemdsystemunit_DATA += mesh/bluetooth-mesh.service
>> +endif
>> +if SYSTEMD_UNITS
>>  dbussystembus_DATA += mesh/org.bluez.mesh.service
>>  endif
>>  
>> diff --git a/Makefile.obexd b/Makefile.obexd
>> index 7ad74e1286b6..25aa8feb73d1 100644
>> --- a/Makefile.obexd
>> +++ b/Makefile.obexd
>> @@ -1,7 +1,7 @@
>>  # SPDX-License-Identifier: GPL-2.0
>>  if OBEX
>>  
>> -if SYSTEMD
>> +if SYSTEMD_USERUNITS
>>  systemduserunit_DATA += obexd/src/obex.service
>>  
>>  obexd-add-service-symlink:
>> diff --git a/Makefile.tools b/Makefile.tools
>> index 561b03d0b95b..72dffe7cd005 100644
>> --- a/Makefile.tools
>> +++ b/Makefile.tools
>> @@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger
>>  tools_btmon_logger_SOURCES = tools/btmon-logger.c
>>  tools_btmon_logger_LDADD = src/libshared-mainloop.la
>>  
>> -if SYSTEMD
>> +if SYSTEMD_SYSTEMUNITS
>>  systemdsystemunit_DATA += tools/bluetooth-logger.service
>>  endif
>>  endif
>> @@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c
>> tools/missing.h
>>  
>>  tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
>>  tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la $(GLIB_LIBS)
>> $(DBUS_LIBS)
>> -if SYSTEMD
>> +if SYSTEMD_USERUNITS
>>  systemduserunit_DATA += tools/mpris-proxy.service
>>  endif
>>  
>> diff --git a/configure.ac b/configure.ac
>> index 16b81aca37e6..2d9352b59557 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],
>>  			AS_HELP_STRING([--with-
>> systemdsystemunitdir=DIR],
>>  			[path to systemd system unit directory]),
>>  					[path_systemunitdir=${withva
>> l}])
>> -if (test "${enable_systemd}" != "no" && test -z
>> "${path_systemunitdir}"); then
>> +if (test "${enable_systemd}" != "no" -o -z "${path_systemunitdir}");
>> then
>>  	AC_MSG_CHECKING([systemd system unit dir])
>> -	path_systemunitdir="`$PKG_CONFIG --
>> variable=systemdsystemunitdir systemd`"
>>  	if (test -z "${path_systemunitdir}"); then
>> -		AC_MSG_ERROR([systemd system unit directory is
>> required])
>> +		path_systemunitdir="`$PKG_CONFIG --
>> variable=systemdsystemunitdir systemd`"
>> +		if (test -z "${path_systemunitdir}"); then
>> +			AC_MSG_ERROR([systemd system unit directory
>> is required])
>> +		fi
>>  	fi
>>  	AC_MSG_RESULT([${path_systemunitdir}])
>>  fi
>>  AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
>> +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}" !=
>> "")
>>  
>>  AC_ARG_WITH([systemduserunitdir],
>>  			AS_HELP_STRING([--with-
>> systemduserunitdir=DIR],
>>  			[path to systemd user unit directory]),
>>  					[path_userunitdir=${withval}
>> ])
>> -if (test "${enable_systemd}" != "no" && test -z
>> "${path_userunitdir}"); then
>> +if (test "${enable_systemd}" != "no" -o -z "${path_userunitdir}");
>> then
>>  	AC_MSG_CHECKING([systemd user unit dir])
>> -	path_userunitdir="`$PKG_CONFIG --variable=systemduserunitdir
>> systemd`"
>>  	if (test -z "${path_userunitdir}"); then
>> -		AC_MSG_ERROR([systemd user unit directory is
>> required])
>> +		path_userunitdir="`$PKG_CONFIG --
>> variable=systemduserunitdir systemd`"
>> +		if (test -z "${path_userunitdir}"); then
>> +			AC_MSG_ERROR([systemd user unit directory is
>> required])
>> +		fi
>>  	fi
>>  	AC_MSG_RESULT([${path_userunitdir}])
>>  fi
>>  AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
>> +AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" != "")
>> +
>> +AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" != "" ||
>> test "${path_userunitdir}" != ""))
>> +
>>  
>>  AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
>>  			[do not install configuration and data
>> files]),

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

* Re: [PATCH BlueZ] build: Allow systemd unit build without libsystemd
  2025-12-09 14:25   ` Achill Gilgenast
@ 2026-01-12  9:50     ` Bastien Nocera
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien Nocera @ 2026-01-12  9:50 UTC (permalink / raw)
  To: Achill Gilgenast, linux-bluetooth

On Tue, 2025-12-09 at 15:25 +0100, Achill Gilgenast wrote:
> On Mon Dec 8, 2025 at 12:57 PM CET, Bastien Nocera wrote:
> > On Mon, 2025-12-08 at 02:24 +0100, Achill Gilgenast wrote:
> > > Decouples libsystemd and systemd units from the same option and
> > > allows
> > > installation of services without systemd.pc by manually
> > > specifying
> > > the
> > > directories.
> > > 
> > > This is useful in Alpine Linux where we don't ship systemd, but
> > > allow
> > > systemd services to be subpackaged for downstream distributions
> > > like
> > > postmarketOS.
> > 
> > For what it's worth, this was already implemented in the meson
> > port:
> > https://github.com/hadess/bluez/commit/b8d12fa7eb9a5b7071eb130344a0816c46c87db8
> 
> Oh cool, I had no idea that a meson port existed. Do you know when
> this
> will hit master?

Hey,

Sorry I missed your original reply. It's unfortunately not my decision
whether and when the meson port lands, we just keep making it a little
bit better each day, whether it's to allow writing Rust plugins, or
speeding up the test suite.

Cheers

> 
> > 
> > > ---
> > > I'm by far no expert in autotools or bluez and how specific
> > > components
> > > are best categorized, so please let me know your feedback.
> > > ---
> > >  Makefile.am    |  6 +++++-
> > >  Makefile.mesh  |  4 +++-
> > >  Makefile.obexd |  2 +-
> > >  Makefile.tools |  4 ++--
> > >  configure.ac   | 21 +++++++++++++++------
> > >  5 files changed, 26 insertions(+), 11 deletions(-)
> > > 
> > > diff --git a/Makefile.am b/Makefile.am
> > > index e152ae64853c..d3cdb2890d32 100644
> > > --- a/Makefile.am
> > > +++ b/Makefile.am
> > > @@ -49,13 +49,17 @@ conf_DATA += profiles/network/network.conf
> > >  state_DATA =
> > >  endif
> > >  
> > > -if SYSTEMD
> > > +if SYSTEMD_SYSTEMUNITS
> > >  systemdsystemunitdir = $(SYSTEMD_SYSTEMUNITDIR)
> > >  systemdsystemunit_DATA = src/bluetooth.service
> > > +endif
> > >  
> > > +if SYSTEMD_USERUNITS
> > >  systemduserunitdir = $(SYSTEMD_USERUNITDIR)
> > >  systemduserunit_DATA =
> > > +endif
> > >  
> > > +if SYSTEMD_UNITS
> > >  dbussystembusdir = $(DBUS_SYSTEMBUSDIR)
> > >  dbussystembus_DATA = src/org.bluez.service
> > >  endif
> > > diff --git a/Makefile.mesh b/Makefile.mesh
> > > index e4c9fa6a32e6..e9998a9cdd75 100644
> > > --- a/Makefile.mesh
> > > +++ b/Makefile.mesh
> > > @@ -6,8 +6,10 @@ dbus_DATA += mesh/bluetooth-mesh.conf
> > >  conf_DATA += mesh/mesh-main.conf
> > >  endif
> > >  
> > > -if SYSTEMD
> > > +if SYSTEMD_SYSTEMUNITS
> > >  systemdsystemunit_DATA += mesh/bluetooth-mesh.service
> > > +endif
> > > +if SYSTEMD_UNITS
> > >  dbussystembus_DATA += mesh/org.bluez.mesh.service
> > >  endif
> > >  
> > > diff --git a/Makefile.obexd b/Makefile.obexd
> > > index 7ad74e1286b6..25aa8feb73d1 100644
> > > --- a/Makefile.obexd
> > > +++ b/Makefile.obexd
> > > @@ -1,7 +1,7 @@
> > >  # SPDX-License-Identifier: GPL-2.0
> > >  if OBEX
> > >  
> > > -if SYSTEMD
> > > +if SYSTEMD_USERUNITS
> > >  systemduserunit_DATA += obexd/src/obex.service
> > >  
> > >  obexd-add-service-symlink:
> > > diff --git a/Makefile.tools b/Makefile.tools
> > > index 561b03d0b95b..72dffe7cd005 100644
> > > --- a/Makefile.tools
> > > +++ b/Makefile.tools
> > > @@ -74,7 +74,7 @@ pkglibexec_PROGRAMS += tools/btmon-logger
> > >  tools_btmon_logger_SOURCES = tools/btmon-logger.c
> > >  tools_btmon_logger_LDADD = src/libshared-mainloop.la
> > >  
> > > -if SYSTEMD
> > > +if SYSTEMD_SYSTEMUNITS
> > >  systemdsystemunit_DATA += tools/bluetooth-logger.service
> > >  endif
> > >  endif
> > > @@ -340,7 +340,7 @@ tools_hex2hcd_SOURCES = tools/hex2hcd.c
> > > tools/missing.h
> > >  
> > >  tools_mpris_proxy_SOURCES = tools/mpris-proxy.c
> > >  tools_mpris_proxy_LDADD = gdbus/libgdbus-internal.la
> > > $(GLIB_LIBS)
> > > $(DBUS_LIBS)
> > > -if SYSTEMD
> > > +if SYSTEMD_USERUNITS
> > >  systemduserunit_DATA += tools/mpris-proxy.service
> > >  endif
> > >  
> > > diff --git a/configure.ac b/configure.ac
> > > index 16b81aca37e6..2d9352b59557 100644
> > > --- a/configure.ac
> > > +++ b/configure.ac
> > > @@ -352,29 +352,38 @@ AC_ARG_WITH([systemdsystemunitdir],
> > >  			AS_HELP_STRING([--with-
> > > systemdsystemunitdir=DIR],
> > >  			[path to systemd system unit
> > > directory]),
> > >  					[path_systemunitdir=${wi
> > > thva
> > > l}])
> > > -if (test "${enable_systemd}" != "no" && test -z
> > > "${path_systemunitdir}"); then
> > > +if (test "${enable_systemd}" != "no" -o -z
> > > "${path_systemunitdir}");
> > > then
> > >  	AC_MSG_CHECKING([systemd system unit dir])
> > > -	path_systemunitdir="`$PKG_CONFIG --
> > > variable=systemdsystemunitdir systemd`"
> > >  	if (test -z "${path_systemunitdir}"); then
> > > -		AC_MSG_ERROR([systemd system unit directory is
> > > required])
> > > +		path_systemunitdir="`$PKG_CONFIG --
> > > variable=systemdsystemunitdir systemd`"
> > > +		if (test -z "${path_systemunitdir}"); then
> > > +			AC_MSG_ERROR([systemd system unit
> > > directory
> > > is required])
> > > +		fi
> > >  	fi
> > >  	AC_MSG_RESULT([${path_systemunitdir}])
> > >  fi
> > >  AC_SUBST(SYSTEMD_SYSTEMUNITDIR, [${path_systemunitdir}])
> > > +AM_CONDITIONAL(SYSTEMD_SYSTEMUNITS, test "${path_systemunitdir}"
> > > !=
> > > "")
> > >  
> > >  AC_ARG_WITH([systemduserunitdir],
> > >  			AS_HELP_STRING([--with-
> > > systemduserunitdir=DIR],
> > >  			[path to systemd user unit directory]),
> > >  					[path_userunitdir=${with
> > > val}
> > > ])
> > > -if (test "${enable_systemd}" != "no" && test -z
> > > "${path_userunitdir}"); then
> > > +if (test "${enable_systemd}" != "no" -o -z
> > > "${path_userunitdir}");
> > > then
> > >  	AC_MSG_CHECKING([systemd user unit dir])
> > > -	path_userunitdir="`$PKG_CONFIG --
> > > variable=systemduserunitdir
> > > systemd`"
> > >  	if (test -z "${path_userunitdir}"); then
> > > -		AC_MSG_ERROR([systemd user unit directory is
> > > required])
> > > +		path_userunitdir="`$PKG_CONFIG --
> > > variable=systemduserunitdir systemd`"
> > > +		if (test -z "${path_userunitdir}"); then
> > > +			AC_MSG_ERROR([systemd user unit
> > > directory is
> > > required])
> > > +		fi
> > >  	fi
> > >  	AC_MSG_RESULT([${path_userunitdir}])
> > >  fi
> > >  AC_SUBST(SYSTEMD_USERUNITDIR, [${path_userunitdir}])
> > > +AM_CONDITIONAL(SYSTEMD_USERUNITS, test "${path_userunitdir}" !=
> > > "")
> > > +
> > > +AM_CONDITIONAL(SYSTEMD_UNITS, (test "${path_systemunitdir}" !=
> > > "" ||
> > > test "${path_userunitdir}" != ""))
> > > +
> > >  
> > >  AC_ARG_ENABLE(datafiles, AS_HELP_STRING([--disable-datafiles],
> > >  			[do not install configuration and data
> > > files]),

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

end of thread, other threads:[~2026-01-12  9:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-08  1:24 [PATCH BlueZ] build: Allow systemd unit build without libsystemd Achill Gilgenast
2025-12-08  3:46 ` [BlueZ] " bluez.test.bot
2025-12-08 11:57 ` [PATCH BlueZ] " Bastien Nocera
2025-12-09 14:25   ` Achill Gilgenast
2026-01-12  9:50     ` Bastien Nocera

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