From f04e0e70e8ddb82686a2f660d292e7338ed564d2 Mon Sep 17 00:00:00 2001 From: Thomas Tuegel Date: Mon, 2 May 2016 13:01:59 -0500 Subject: [PATCH 1/3] Revert "Revert "dbus: 1.8.20 -> 1.10.8"" This reverts commit 9eb107dc52409c5f438402eadf48b5dcd64da6ac. --- pkgs/development/libraries/dbus/default.nix | 7 +++--- .../dbus/ignore-missing-includedirs.patch | 23 ------------------- 2 files changed, 3 insertions(+), 27 deletions(-) delete mode 100644 pkgs/development/libraries/dbus/ignore-missing-includedirs.patch diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix index 83635d9739f..dd86ca54081 100644 --- a/pkgs/development/libraries/dbus/default.nix +++ b/pkgs/development/libraries/dbus/default.nix @@ -6,8 +6,8 @@ assert x11Support -> libX11 != null && libSM != null; let - version = "1.8.20"; - sha256 = "0fkh3d5r57a659hw9lqnw4v0bc5556vx54fsf7l9c732ci6byksw"; + version = "1.10.8"; + sha256 = "0560y3hxpgh346w6avcrcz79c8ansmn771y5xpcvvlr6m8mx5wxs"; self = stdenv.mkDerivation { name = "dbus-${version}"; @@ -17,8 +17,7 @@ self = stdenv.mkDerivation { inherit sha256; }; - patches = [ ./ignore-missing-includedirs.patch ] - ++ lib.optional stdenv.isSunOS ./implement-getgrouplist.patch; + patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch; postPatch = '' substituteInPlace tools/Makefile.in \ --replace 'install-localstatelibDATA:' 'disabled:' \ diff --git a/pkgs/development/libraries/dbus/ignore-missing-includedirs.patch b/pkgs/development/libraries/dbus/ignore-missing-includedirs.patch deleted file mode 100644 index 2781f4ae3de..00000000000 --- a/pkgs/development/libraries/dbus/ignore-missing-includedirs.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -ru -x '*~' dbus-1.2.24-orig/bus/config-parser.c dbus-1.2.24/bus/config-parser.c ---- dbus-1.2.24-orig/bus/config-parser.c 2010-03-23 20:01:27.000000000 +0100 -+++ dbus-1.2.24/bus/config-parser.c 2010-07-20 14:17:20.000000000 +0200 -@@ -2159,12 +2159,16 @@ - - retval = FALSE; - -- dir = _dbus_directory_open (dirname, error); -+ dbus_error_init (&tmp_error); -+ -+ dir = _dbus_directory_open (dirname, &tmp_error); - - if (dir == NULL) -- goto failed; -+ { -+ retval = TRUE; -+ goto failed; -+ } - -- dbus_error_init (&tmp_error); - while (_dbus_directory_get_next_file (dir, &filename, &tmp_error)) - { - DBusString full_path; From 60b34849284db4aec8f4fdab722273096e1ed002 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 6 Mar 2016 17:38:53 -0800 Subject: [PATCH 2/3] dbus: Fix for new 1.10 version (cherry picked from commit 68a4a6df3971d66aa988bba680351a30fbadbed3) --- nixos/modules/services/system/dbus.nix | 68 +++++++++----------------- nixos/modules/system/boot/systemd.nix | 2 + 2 files changed, 26 insertions(+), 44 deletions(-) diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix index 59c2e482e1a..434211aaac4 100644 --- a/nixos/modules/services/system/dbus.nix +++ b/nixos/modules/services/system/dbus.nix @@ -10,6 +10,16 @@ let homeDir = "/var/run/dbus"; + systemExtraxml = concatStrings (flip concatMap cfg.packages (d: [ + "${d}/share/dbus-1/system-services" + "${d}/etc/dbus-1/system.d" + ])); + + sessionExtraxml = concatStrings (flip concatMap cfg.packages (d: [ + "${d}/share/dbus-1/services" + "${d}/etc/dbus-1/session.d" + ])); + configDir = pkgs.stdenv.mkDerivation { name = "dbus-conf"; @@ -19,47 +29,17 @@ let buildCommand = '' mkdir -p $out - cp -v ${pkgs.dbus.daemon}/etc/dbus-1/system.conf $out/system.conf + sed '${./dbus-system-local.conf.in}' \ + -e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \ + -e 's,@extra@,${systemExtraxml},' \ + > "$out/system-local.conf" - # !!! Hm, these `sed' calls are rather error-prone... - - # Tell the daemon where the setuid wrapper around - # dbus-daemon-launch-helper lives. - sed -i $out/system.conf \ - -e 's|.*/libexec/dbus-daemon-launch-helper|${config.security.wrapperDir}/dbus-daemon-launch-helper|' - - # Add the system-services and system.d directories to the system - # bus search path. - sed -i $out/system.conf \ - -e 's||${systemServiceDirs}|' \ - -e 's|system.d|${systemIncludeDirs}|' - - cp ${pkgs.dbus.daemon}/etc/dbus-1/session.conf $out/session.conf - - # Add the services and session.d directories to the session bus - # search path. - sed -i $out/session.conf \ - -e 's||${sessionServiceDirs}&|' \ - -e 's|session.d|${sessionIncludeDirs}|' - ''; # */ + sed '${./dbus-session-local.conf.in}' \ + -e 's,@extra@,${sessionExtraxml},' \ + > "$out/session-local.conf" + ''; }; - systemServiceDirs = concatMapStrings - (d: "${d}/share/dbus-1/system-services ") - cfg.packages; - - systemIncludeDirs = concatMapStrings - (d: "${d}/etc/dbus-1/system.d ") - cfg.packages; - - sessionServiceDirs = concatMapStrings - (d: "${d}/share/dbus-1/services ") - cfg.packages; - - sessionIncludeDirs = concatMapStrings - (d: "${d}/etc/dbus-1/session.d ") - cfg.packages; - in { @@ -72,7 +52,7 @@ in enable = mkOption { type = types.bool; - default = true; + default = false; internal = true; description = '' Whether to start the D-Bus message bus daemon, which is @@ -82,7 +62,7 @@ in packages = mkOption { type = types.listOf types.path; - default = []; + default = [ ]; description = '' Packages whose D-Bus configuration files should be included in the configuration of the D-Bus system-wide message bus. @@ -129,10 +109,10 @@ in permissions = "u+rx,g+rx,o-rx"; }; - services.dbus.packages = - [ "/nix/var/nix/profiles/default" - config.system.path - ]; + services.dbus.packages = [ + pkgs.dbus + config.system.path + ]; # Don't restart dbus-daemon. Bad things tend to happen if we do. systemd.services.dbus.reloadIfChanged = true; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 3f497566ff1..e7f89294531 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -689,6 +689,8 @@ in "systemd/system-generators" = { source = generators; }; }); + services.dbus.enable = true; + system.activationScripts.systemd = stringAfter [ "groups" ] '' mkdir -m 0755 -p /var/lib/udev From 4dc716115f93d11b4d65201a33542e095e85a168 Mon Sep 17 00:00:00 2001 From: "William A. Kennington III" Date: Sun, 6 Mar 2016 17:44:56 -0800 Subject: [PATCH 3/3] Add missing files (cherry picked from commit 5917fc2f50c87bbdd6ba0be339849a030a7eba10) --- nixos/modules/services/system/dbus-session-local.conf.in | 5 +++++ nixos/modules/services/system/dbus-system-local.conf.in | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 nixos/modules/services/system/dbus-session-local.conf.in create mode 100644 nixos/modules/services/system/dbus-system-local.conf.in diff --git a/nixos/modules/services/system/dbus-session-local.conf.in b/nixos/modules/services/system/dbus-session-local.conf.in new file mode 100644 index 00000000000..5fd6f80a353 --- /dev/null +++ b/nixos/modules/services/system/dbus-session-local.conf.in @@ -0,0 +1,5 @@ + + + @extra@ + diff --git a/nixos/modules/services/system/dbus-system-local.conf.in b/nixos/modules/services/system/dbus-system-local.conf.in new file mode 100644 index 00000000000..edbb476f585 --- /dev/null +++ b/nixos/modules/services/system/dbus-system-local.conf.in @@ -0,0 +1,6 @@ + + + @servicehelper@ + @extra@ +