From: "Achill Gilgenast" <achill@achill.org>
To: "Bastien Nocera" <hadess@hadess.net>,
"Achill Gilgenast" <achill@achill.org>,
<linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] build: Allow systemd unit build without libsystemd
Date: Tue, 09 Dec 2025 15:25:02 +0100 [thread overview]
Message-ID: <DETR6PAQCZNG.2PYMZRWQ9NPTS@achill.org> (raw)
In-Reply-To: <eb393fee5cfc383397918349d1f714c7023bd3ca.camel@hadess.net>
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]),
next prev parent reply other threads:[~2025-12-09 14:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-01-12 9:50 ` Bastien Nocera
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DETR6PAQCZNG.2PYMZRWQ9NPTS@achill.org \
--to=achill@achill.org \
--cc=hadess@hadess.net \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox