From 0ef5ddf60725b3a19775b515dbed684bfac8f6b8 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 26 Jan 2026 15:35:56 -0500 Subject: [PATCH 1/4] dbus: only set the path for `systemctl` on platforms that enable it --- pkgs/by-name/db/dbus/package.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/by-name/db/dbus/package.nix b/pkgs/by-name/db/dbus/package.nix index 4efedb9106fe..dea34453ba09 100644 --- a/pkgs/by-name/db/dbus/package.nix +++ b/pkgs/by-name/db/dbus/package.nix @@ -110,6 +110,8 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "kqueue" (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isBSD)) (lib.mesonEnable "launchd" stdenv.hostPlatform.isDarwin) "-Dselinux=disabled" + ] + ++ lib.optionals enableSystemd [ "--cross-file=${writeText "crossfile.ini" '' [binaries] systemctl = '${systemdMinimal}/bin/systemctl' From d964cb6440e0c877f565b3aa2c467e48fd1ce3a1 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 26 Jan 2026 15:35:56 -0500 Subject: [PATCH 2/4] dbus: make epoll, inotify, and systemd support conditional These will be enabled by default due `-Dauto_features=enabled` being set in Nixpkgs. However, not all of those features are available on every platform supported by D-Bus, so set them conditionally. --- pkgs/by-name/db/dbus/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/db/dbus/package.nix b/pkgs/by-name/db/dbus/package.nix index dea34453ba09..e96dfd135076 100644 --- a/pkgs/by-name/db/dbus/package.nix +++ b/pkgs/by-name/db/dbus/package.nix @@ -106,9 +106,12 @@ stdenv.mkDerivation (finalAttrs: { "-Dsystemd_user_unitdir=${placeholder "out"}/etc/systemd/user" (lib.mesonEnable "x11_autolaunch" x11Support) (lib.mesonEnable "apparmor" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "epoll" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "inotify" stdenv.hostPlatform.isLinux) (lib.mesonEnable "libaudit" stdenv.hostPlatform.isLinux) (lib.mesonEnable "kqueue" (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isBSD)) (lib.mesonEnable "launchd" stdenv.hostPlatform.isDarwin) + (lib.mesonEnable "systemd" enableSystemd) "-Dselinux=disabled" ] ++ lib.optionals enableSystemd [ From 372961a73cd77f6af37ba6af467299057b495edc Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 19 Jan 2026 19:38:26 -0500 Subject: [PATCH 3/4] dbus: fix vendored `getgrouplist` conditional Without this patch, the vendored implementation of `getgrouplist` is always used regardless of what is detected and set in `config.h`. The function signature provided conflicts with the one in the SDK on Darwin. Moving the condition to make it actually conditional fixes Darwin. --- pkgs/by-name/db/dbus/implement-getgrouplist.patch | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/db/dbus/implement-getgrouplist.patch b/pkgs/by-name/db/dbus/implement-getgrouplist.patch index e3a4a25cb720..d738334b78b3 100644 --- a/pkgs/by-name/db/dbus/implement-getgrouplist.patch +++ b/pkgs/by-name/db/dbus/implement-getgrouplist.patch @@ -95,14 +95,15 @@ Without it, only the user's primary group is used in authentication! +} --- dbus-1.6.8/dbus/dbus-sysdeps-unix.c.orig 2013-02-28 13:08:52.171215237 +0000 +++ dbus-1.6.8/dbus/dbus-sysdeps-unix.c 2013-02-28 13:13:52.224615146 +0000 -@@ -21,6 +21,10 @@ - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ +@@ -26,6 +26,11 @@ + + #include + +#ifndef HAVE_GETGROUPLIST +#include "getgrouplist.c" +#define HAVE_GETGROUPLIST +#endif - - #include - ++ + #include "dbus-internals.h" + #include "dbus-sysdeps.h" + #include "dbus-sysdeps-unix.h" From a967f2cd4264e02f078b4f28f6e312bbcb12489b Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 19 Jan 2026 19:38:26 -0500 Subject: [PATCH 4/4] dbus: fix launchd support on Darwin - Meson tries to detect that `launchctl` is present. Lie to it because it will always be present on a Darwin host platform; and - Install the launch agent plist to `$out` instead of an impure path. --- pkgs/by-name/db/dbus/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/db/dbus/package.nix b/pkgs/by-name/db/dbus/package.nix index e96dfd135076..d2370c01c1c2 100644 --- a/pkgs/by-name/db/dbus/package.nix +++ b/pkgs/by-name/db/dbus/package.nix @@ -98,6 +98,7 @@ stdenv.mkDerivation (finalAttrs: { "-Dinstall_sysconfdir=${placeholder "out"}/etc" "-Ddoxygen_docs=disabled" "-Dducktype_docs=disabled" + "-Dlaunchd_agent_dir=${placeholder "out"}/Library/LaunchAgents" "-Dqt_help=disabled" "-Drelocation=disabled" # Conflicts with multiple outputs "-Dmodular_tests=disabled" # Requires glib @@ -114,6 +115,13 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonEnable "systemd" enableSystemd) "-Dselinux=disabled" ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + # `launchctl` is only needed at runtime. Lie to `find_program` because it will always be present on a Darwin host. + "--cross-file=${writeText "darwin.ini" '' + [binaries] + launchctl = 'true' + ''}" + ] ++ lib.optionals enableSystemd [ "--cross-file=${writeText "crossfile.ini" '' [binaries]