This matches the default behavior on Linux. If D-Bus defaults to launchd
activation, all packages or tests using `dbus-run-session` will fail due
the launch agent not being installed and available.
Some binaries have incorrect install names. They should be the absolute
path, but they have `@rpath` instead. This something that Meson should
handle automatically, but it’s not happening for these binaries.
Plausibly broken by 4db1e1cf13:
```
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/jp3n4kccjv0zbz50kw3qbrlnfb0mp43d-audit-static-x86_64-unknown-linux-musl-4.1.2-unstable-2025-09-06-lib/lib/libaudit.a(libaudit.o): in function `audit_can_control':
(.text+0x36a8): undefined reference to `capng_save_state'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x36bb): undefined reference to `capng_have_capability'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x36c7): undefined reference to `capng_restore_state'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/jp3n4kccjv0zbz50kw3qbrlnfb0mp43d-audit-static-x86_64-unknown-linux-musl-4.1.2-unstable-2025-09-06-lib/lib/libaudit.a(libaudit.o): in function `audit_can_write':
(.text+0x3838): undefined reference to `capng_save_state'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x384b): undefined reference to `capng_have_capability'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x3857): undefined reference to `capng_restore_state'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: /nix/store/jp3n4kccjv0zbz50kw3qbrlnfb0mp43d-audit-static-x86_64-unknown-linux-musl-4.1.2-unstable-2025-09-06-lib/lib/libaudit.a(libaudit.o): in function `audit_can_read':
(.text+0x3898): undefined reference to `capng_save_state'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x38ab): undefined reference to `capng_have_capability'
/nix/store/6iy5zryd4b8hmwpj9mky2by0ajardffk-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: (.text+0x38b7): undefined reference to `capng_restore_state'
collect2: error: ld returned 1 exit status
```
The dbus meson.build requires both libaudit and libcap-ng when libaudit
support is enabled:
have_libaudit = libaudit_ok and cap_ng_ok
While the audit package itself depends on libcap_ng, that dependency
doesn't make libcap_ng available in dbus's build environment. Adding it
explicitly fixes the build failure:
Library cap-ng found: NO
meson.build:556:8: ERROR: Problem encountered: libaudit support
requested but not found
- 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.
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.
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.
this creates some eval errors that will be fixed in the next commit
done with the following script:
```fish
\#!/usr/bin/env fish
set packagesjson (nix eval --impure --json --expr '
let
lib = import ./lib;
in
import pkgs/servers/x11/xorg/default.nix (lib.mapAttrs (
name: _:
if name == "lib" then
lib
else if name == "config" then
{ allowAliases = false; }
else
name
) (__functionArgs (import pkgs/servers/x11/xorg/default.nix))) { }
' | jq)
set one (grep '^ [A-Za-z0-9_-]*$' pkgs/servers/x11/xorg/default.nix | string trim | string replace -r '$' Z | sort | string sub -e -1)
set two (grep '^ [A-Za-z0-9_-]* = [A-Za-z0-9_-]*;$' pkgs/servers/x11/xorg/default.nix | cut -d= -f1 | string trim | string replace -r '$' Z | sort | string sub -e -1)
for arg in $one $two
set oname $arg
set nname (echo $packagesjson | jq -r .$oname)
if test $nname = null
echo (set_color red)warn:(set_color normal) unknown package xorg.$oname >&2
continue
end
echo $oname "->" $nname
# replace basic xorg.$name references
for file in (rg -F "xorg.$oname" --files-with-matches pkgs)
# special cases
sd -F "$oname = xorg.$oname;" "$nname = $nname;" $file
# replace
sd -F "xorg.$oname" "$nname" $file
# fixup function arguments
# prevent duplicate function args
if grep -E " ($oname|$nname),\$" $file >/dev/null
continue
end
if grep 'xorg\..' $file >/dev/null # case1: there is more so we can't just remove the function arg
if grep ' xorg,$' $file >/dev/null
sd ' xorg,$' " xorg,
$nname," $file
else if grep ' xorg ? .*,$' $file >/dev/null
sd 'xorg( ? .*),$' "xorg\$1,
$nname," $file
else
sd -F 'xorg,' "$nname,
xorg," $file
end
else # case there is no more xorg..* so we can just replace the function arg
sd 'xorg(| ? .*),.*$' "$nname," $file
end
end
end
nix fmt
```
https://gitlab.freedesktop.org/dbus/dbus/-/compare/dbus-1.14.10...dbus-1.16.2
This includes:
- Switch from Autotools to Meson
- Since Meson does not support separate `installFlags`, we would either need to use `DESTDIR`, or patch the build system. I chose the latter since we want to keep the `$out` as close to FHS as possible to avoid confusion, and moving a subset of content of `$out/etc` back to `$out/share` would be annoying.
- `libaudit` started to require `libcap-ng`.
- `xmlto` was replaced by `xsltproc`.
- Extra docs builds, disabled for now due to dependency requirements.
In the package definition:
- Use `finalAttrs`.
- Use `--replace-fail` with `substitute`.
- Make `getgrouplist` unconditional.
The propagation was introduced in 7d9607f151 without any context.
But the library is only used by dbus-daemon so it does not make sense to propagate it.