From a967f2cd4264e02f078b4f28f6e312bbcb12489b Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 19 Jan 2026 19:38:26 -0500 Subject: [PATCH] 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]