diff options
| author | Adam C. Stephens <2071575+adamcstephens@users.noreply.github.com> | 2026-01-19 03:16:24 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-19 03:16:24 +0000 |
| commit | 670354badfb84fd7d6774e85ddda3da95e275625 (patch) | |
| tree | 0cac105f72cd2b886fa65a9bb9aacaf1abd82f57 | |
| parent | d3d93e2e5bf99af115139f5e321f0e83143d9556 (diff) | |
| parent | c77362f3c623133ef9ef4de889743d325772d4f0 (diff) | |
dbus: 1.14.10 → 1.16.2 (#386170)staging
| -rw-r--r-- | pkgs/by-name/db/dbus/meson-install-dirs.patch | 190 | ||||
| -rw-r--r-- | pkgs/by-name/db/dbus/package.nix | 167 | ||||
| -rw-r--r-- | pkgs/by-name/ja/jack2/package.nix | 2 |
3 files changed, 280 insertions, 79 deletions
diff --git a/pkgs/by-name/db/dbus/meson-install-dirs.patch b/pkgs/by-name/db/dbus/meson-install-dirs.patch new file mode 100644 index 000000000000..82c02c9245b4 --- /dev/null +++ b/pkgs/by-name/db/dbus/meson-install-dirs.patch @@ -0,0 +1,190 @@ +diff --git a/bus/legacy-config/meson.build b/bus/legacy-config/meson.build +index 1e635713..4be240e9 100644 +--- a/bus/legacy-config/meson.build ++++ b/bus/legacy-config/meson.build +@@ -24,7 +24,7 @@ if platform_unix + input: 'system.conf.in', + output: 'system.conf', + configuration: data_config, +- install_dir: get_option('sysconfdir') / 'dbus-1', ++ install_dir: install_sysconfdir / 'dbus-1', + ) + endif + +@@ -32,5 +32,5 @@ configure_file( + input: 'session.conf.in', + output: 'session.conf', + configuration: data_config, +- install_dir: get_option('sysconfdir') / 'dbus-1', ++ install_dir: install_sysconfdir / 'dbus-1', + ) +diff --git a/bus/meson.build b/bus/meson.build +index 058e3b25..0a5de112 100644 +--- a/bus/meson.build ++++ b/bus/meson.build +@@ -23,7 +23,7 @@ session_conf = configure_file( + input: 'session.conf.in', + output: 'session.conf', + configuration: data_config, +- install_dir: get_option('datadir') / 'dbus-1', ++ install_dir: install_datadir / 'dbus-1', + ) + + if platform_unix +@@ -31,7 +31,7 @@ if platform_unix + input: 'system.conf.in', + output: 'system.conf', + configuration: data_config, +- install_dir: get_option('datadir') / 'dbus-1', ++ install_dir: install_datadir / 'dbus-1', + ) + endif + +@@ -39,19 +39,19 @@ configure_file( + input: 'example-system-enable-stats.conf.in', + output: 'example-system-enable-stats.conf', + configuration: data_config, +- install_dir: get_option('datadir') / 'doc' / 'dbus' / 'examples', ++ install_dir: install_datadir / 'doc' / 'dbus' / 'examples', + ) + + configure_file( + input: 'example-session-disable-stats.conf.in', + output: 'example-session-disable-stats.conf', + configuration: data_config, +- install_dir: get_option('datadir') / 'doc' / 'dbus' / 'examples', ++ install_dir: install_datadir / 'doc' / 'dbus' / 'examples', + ) + + install_data( + 'example-system-hardening-without-traditional-activation.conf', +- install_dir: get_option('datadir') / 'doc' / 'dbus' / 'examples', ++ install_dir: install_datadir / 'doc' / 'dbus' / 'examples', + ) + + if use_launchd +@@ -185,15 +185,14 @@ if platform_unix and use_traditional_activation + endif + + install_emptydirs += [ +- get_option('datadir') / 'dbus-1' / 'session.d', +- get_option('datadir') / 'dbus-1' / 'services', ++ install_datadir / 'dbus-1' / 'session.d', ++ install_datadir / 'dbus-1' / 'services', + ] + + if platform_unix + install_emptydirs += [ +- runstatedir / 'dbus', +- get_option('datadir') / 'dbus-1' / 'system.d', +- get_option('datadir') / 'dbus-1' / 'system-services', ++ install_datadir / 'dbus-1' / 'system.d', ++ install_datadir / 'dbus-1' / 'system-services', + ] + endif + +diff --git a/doc/meson.build b/doc/meson.build +index adc6f17d..1f2c5dce 100644 +--- a/doc/meson.build ++++ b/doc/meson.build +@@ -142,7 +142,7 @@ configure_file( + # Install dtd files + + +-xml_dir = get_option('datadir') / 'xml' / 'dbus-1' ++xml_dir = install_datadir / 'xml' / 'dbus-1' + dtd_files = [ + 'busconfig.dtd', + 'introspect.dtd', +diff --git a/meson.build b/meson.build +index 3f4ad316..6cee2c6b 100644 +--- a/meson.build ++++ b/meson.build +@@ -918,7 +918,17 @@ dbus_enable_modular_tests = ( + ############################################################################### + # Paths and directories + +-docs_dir = get_option('datadir') / 'doc' / 'dbus' ++install_datadir = get_option('install_datadir') ++if install_datadir == '' ++ install_datadir = get_option('prefix') / get_option('datadir') ++endif ++ ++install_sysconfdir = get_option('install_sysconfdir') ++if install_sysconfdir == '' ++ install_sysconfdir = get_option('prefix') / get_option('sysconfdir') ++endif ++ ++docs_dir = install_datadir / 'doc' / 'dbus' + + # TODO: If a future Meson version gets a runstatedir option, try both. + # https://github.com/mesonbuild/meson/issues/4141 +diff --git a/meson_options.txt b/meson_options.txt +index 1bd00579..1dfb3c15 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -109,6 +109,20 @@ option( + description: 'Inotify support on Linux' + ) + ++option( ++ 'install_datadir', ++ type: 'string', ++ value: '', ++ description: 'datadir for installation, so that we can set --datadir=/etc and have dbus load files from there but still install them to $out/share' ++) ++ ++option( ++ 'install_sysconfdir', ++ type: 'string', ++ value: '', ++ description: 'sysconfdir for installation, so that we can set --sysconfdir=/etc and have dbus load files from there but still install them to $out/etc' ++) ++ + option( + 'installed_tests', + type: 'boolean', +diff --git a/test/data/meson.build b/test/data/meson.build +index ef570492..713396b7 100644 +--- a/test/data/meson.build ++++ b/test/data/meson.build +@@ -224,14 +224,14 @@ if install_tests + 'link_name': 'session.conf', + 'install_dir': test_exec_dir / 'data' / 'valid-config-files', + 'pointing_to': +- get_option('prefix') / get_option('datadir') / ++ install_datadir / + 'dbus-1' / 'session.conf', + }, + { + 'link_name': 'system.conf', + 'install_dir': test_exec_dir / 'data' / 'valid-config-files-system', + 'pointing_to': +- get_option('prefix') / get_option('datadir') / ++ install_datadir / + 'dbus-1' / 'system.conf', + }, + ] +diff --git a/test/meson.build b/test/meson.build +index a60afac6..be7bd935 100644 +--- a/test/meson.build ++++ b/test/meson.build +@@ -25,7 +25,7 @@ + install_tests = get_option('installed_tests') + + test_exec_dir = get_option('libexecdir') / 'installed-tests' / 'dbus' +-test_meta_dir = get_option('datadir') / 'installed-tests' / 'dbus' ++test_meta_dir = install_datadir / 'installed-tests' / 'dbus' + + ############################################################################### + # Test configuration needs some specific keys +diff --git a/tools/meson.build b/tools/meson.build +index 5d78d93a..7d094364 100644 +--- a/tools/meson.build ++++ b/tools/meson.build +@@ -112,5 +112,4 @@ install_data('GetAllMatchRules.py', + + # Create the empty directory to hold the machine ID + install_emptydirs += [ +- get_option('localstatedir') / 'lib' / 'dbus', + ] diff --git a/pkgs/by-name/db/dbus/package.nix b/pkgs/by-name/db/dbus/package.nix index 5e38403c93cc..fbdd1a174912 100644 --- a/pkgs/by-name/db/dbus/package.nix +++ b/pkgs/by-name/db/dbus/package.nix @@ -7,43 +7,23 @@ enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal, systemdMinimal, audit, + libcap_ng, libapparmor, dbus, docbook_xml_dtd_44, docbook-xsl-nons, - xmlto, - autoreconfHook, - autoconf-archive, + libxslt, + meson, + ninja, + python3, x11Support ? (stdenv.hostPlatform.isLinux || stdenv.hostPlatform.isDarwin), xorg, + writeText, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "dbus"; - version = "1.14.10"; - - src = fetchurl { - url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.xz"; - sha256 = "sha256-uh8h0r2dM52i1KqHgMCd8y/qh5mLc9ok9Jq53x42pQ8="; - }; - - patches = lib.optional stdenv.hostPlatform.isSunOS ./implement-getgrouplist.patch; - - postPatch = '' - substituteInPlace bus/Makefile.am \ - --replace 'install-data-hook:' 'disabled:' \ - --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':' - substituteInPlace tools/Makefile.am \ - --replace 'install-data-local:' 'disabled:' \ - --replace 'installcheck-local:' 'disabled:' - '' - # cleanup of runtime references - + '' - substituteInPlace ./dbus/dbus-sysdeps-unix.c \ - --replace 'DBUS_BINDIR "/dbus-launch"' "\"$lib/bin/dbus-launch\"" - substituteInPlace ./tools/dbus-launch.c \ - --replace 'DBUS_DAEMONDIR"/dbus-daemon"' '"/run/current-system/sw/bin/dbus-daemon"' - ''; + version = "1.16.2"; outputs = [ "out" @@ -52,79 +32,108 @@ stdenv.mkDerivation rec { "doc" "man" ]; + separateDebugInfo = true; + src = fetchurl { + url = "https://dbus.freedesktop.org/releases/dbus/dbus-${finalAttrs.version}.tar.xz"; + sha256 = "sha256-C6KhpLFq/nvOssB+nOmajCw1COXewpDbtkM4S9a+t+I="; + }; + + patches = [ + # Implement getgrouplist for platforms where it is not available (e.g. Illumos/Solaris) + ./implement-getgrouplist.patch + + # Add a Meson configuration option that will allow us to use a different + # `datadir` for installation from the one that will be compiled into dbus. + # This is necessary to allow NixOS to manage dbus service definitions, + # since the `datadir` in the package will be immutable. But we still want + # to install the files to the latter, since there is no other suitable + # place for the project to install them. + # + # We will also just remove installation of empty `${runstatedir}/dbus` + # and `${localstatedir}/lib/dbus` since these are useless in the package. + ./meson-install-dirs.patch + ]; + strictDeps = true; + nativeBuildInputs = [ - autoreconfHook - autoconf-archive + meson + ninja pkg-config docbook_xml_dtd_44 docbook-xsl-nons - xmlto + libxslt # for xsltproc + python3 ]; - propagatedBuildInputs = [ + buildInputs = [ expat + ] + ++ lib.optionals x11Support ( + with xorg; + [ + libX11 + libICE + libSM + ] + ) + ++ lib.optional enableSystemd systemdMinimal + ++ lib.optionals stdenv.hostPlatform.isLinux [ + audit + libcap_ng + libapparmor ]; - buildInputs = - lib.optionals x11Support ( - with xorg; - [ - libX11 - libICE - libSM - ] - ) - ++ lib.optional enableSystemd systemdMinimal - ++ lib.optionals stdenv.hostPlatform.isLinux [ - audit - libapparmor - ]; - # ToDo: optional selinux? - __darwinAllowLocalNetworking = true; - configureFlags = [ - "--enable-user-session" - "--enable-xml-docs" + mesonFlags = [ "--libexecdir=${placeholder "out"}/libexec" + # datadir from which dbus will load files will be managed by the NixOS module: "--datadir=/etc" + # But we still want to install stuff to the package: + "-Dinstall_datadir=${placeholder "out"}/share" "--localstatedir=/var" - "--runstatedir=/run" + "-Druntime_dir=/run" "--sysconfdir=/etc" - "--with-session-socket-dir=/tmp" - "--with-system-pid-file=/run/dbus/pid" - "--with-system-socket=/run/dbus/system_bus_socket" - "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system" - "--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user" - ] - ++ lib.optional (!x11Support) "--without-x" - ++ lib.optionals stdenv.hostPlatform.isLinux [ - "--enable-apparmor" - "--enable-libaudit" - ] - ++ lib.optionals enableSystemd [ "SYSTEMCTL=${systemdMinimal}/bin/systemctl" ]; - - NIX_CFLAGS_LINK = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-Wl,--as-needed"; - - enableParallelBuilding = true; + "-Dinstall_sysconfdir=${placeholder "out"}/etc" + "-Ddoxygen_docs=disabled" + "-Dducktype_docs=disabled" + "-Dqt_help=disabled" + "-Drelocation=disabled" # Conflicts with multiple outputs + "-Dmodular_tests=disabled" # Requires glib + "-Dsession_socket_dir=/tmp" + "-Dsystemd_system_unitdir=${placeholder "out"}/etc/systemd/system" + "-Dsystemd_user_unitdir=${placeholder "out"}/etc/systemd/user" + (lib.mesonEnable "x11_autolaunch" x11Support) + (lib.mesonEnable "apparmor" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "libaudit" stdenv.hostPlatform.isLinux) + (lib.mesonEnable "kqueue" (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isBSD)) + (lib.mesonEnable "launchd" stdenv.hostPlatform.isDarwin) + "-Dselinux=disabled" + "--cross-file=${writeText "crossfile.ini" '' + [binaries] + systemctl = '${systemdMinimal}/bin/systemctl' + ''}" + ]; doCheck = true; - makeFlags = [ - # Fix paths in XML catalog broken by mismatching build/install datadir. - "dtddir=${placeholder "out"}/share/xml/dbus-1" - ]; + postPatch = '' + patchShebangs \ + test/data/copy_data_for_tests.py \ + meson_post_install.py - installFlags = [ - "sysconfdir=${placeholder "out"}/etc" - "datadir=${placeholder "out"}/share" - ]; + # Cleanup of runtime references + substituteInPlace ./dbus/dbus-sysdeps-unix.c \ + --replace-fail 'DBUS_BINDIR "/dbus-launch"' "\"$lib/bin/dbus-launch\"" + substituteInPlace ./tools/dbus-launch.c \ + --replace-fail 'DBUS_DAEMONDIR"/dbus-daemon"' '"/run/current-system/sw/bin/dbus-daemon"' + ''; - # it's executed from $lib by absolute path postFixup = '' + # It's executed from $lib by absolute path moveToOutput bin/dbus-launch "$lib" ln -s "$lib/bin/dbus-launch" "$out/bin/" ''; @@ -136,9 +145,9 @@ stdenv.mkDerivation rec { meta = { description = "Simple interprocess messaging system"; homepage = "https://www.freedesktop.org/wiki/Software/dbus/"; - changelog = "https://gitlab.freedesktop.org/dbus/dbus/-/blob/dbus-${version}/NEWS"; + changelog = "https://gitlab.freedesktop.org/dbus/dbus/-/blob/dbus-${finalAttrs.version}/NEWS"; license = lib.licenses.gpl2Plus; # most is also under AFL-2.1 teams = [ lib.teams.freedesktop ]; platforms = lib.platforms.unix; }; -} +}) diff --git a/pkgs/by-name/ja/jack2/package.nix b/pkgs/by-name/ja/jack2/package.nix index 5ff5b4b47661..5f460514b1d7 100644 --- a/pkgs/by-name/ja/jack2/package.nix +++ b/pkgs/by-name/ja/jack2/package.nix @@ -16,6 +16,7 @@ # Optional Dependencies dbus ? null, + expat, # for dbus libffado ? null, alsa-lib ? null, @@ -66,6 +67,7 @@ stdenv.mkDerivation (finalAttrs: { optLibffado optAlsaLib ] + ++ lib.optionals (optDbus != null) [ expat ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ aften ] |
