diff --git a/docs/build.rst b/docs/build.rst index 63b33d2e3..fb64b448f 100644 --- a/docs/build.rst +++ b/docs/build.rst @@ -90,6 +90,7 @@ Run-time dependencies: * ``freetype`` (not needed on macOS) * ``fontconfig`` (not needed on macOS) * ``libcanberra`` (not needed on macOS) +* ``libsystemd`` (optional, not needed on non systemd systems) * ``ImageMagick`` (optional, needed to display uncommon image formats in the terminal) diff --git a/kitty/systemd.c b/kitty/systemd.c index 5d547a2ac..1c75929e0 100644 --- a/kitty/systemd.c +++ b/kitty/systemd.c @@ -5,7 +5,6 @@ * Distributed under terms of the GPL3 license. */ -#define _GNU_SOURCE #include "data-types.h" #include "cleanup.h" diff --git a/setup.py b/setup.py index 886a1733d..c04d82055 100755 --- a/setup.py +++ b/setup.py @@ -633,8 +633,9 @@ def kitty_env(args: Options) -> Env: platform_libs = [] with suppress(SystemExit, subprocess.CalledProcessError): cflags.extend(pkg_config('libsystemd', '--cflags-only-I', fatal=False)) - has_systemd = 1 - platform_libs.extend(pkg_config('libsystemd', '--libs')) + systemd_libs = pkg_config('libsystemd', '--libs') + platform_libs.extend(systemd_libs) + has_systemd = bool(systemd_libs) cppflags.append(f'-DKITTY_HAS_SYSTEMD={has_systemd}') cflags.extend(pkg_config('harfbuzz', '--cflags-only-I')) platform_libs.extend(pkg_config('harfbuzz', '--libs'))