summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/display-managers/lightdm/default.nix5
-rw-r--r--pkgs/applications/display-managers/sddm/default.nix1
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix3
-rw-r--r--pkgs/applications/video/mpv/default.nix15
-rw-r--r--pkgs/desktops/mate/mate-settings-daemon/default.nix10
-rw-r--r--pkgs/development/libraries/accountsservice/default.nix5
-rw-r--r--pkgs/development/libraries/avahi/default.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix10
-rw-r--r--pkgs/development/libraries/flatpak/default.nix1
-rw-r--r--pkgs/development/libraries/geoclue/default.nix1
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/polkit/default.nix10
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix5
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtbase-trayicons.patch175
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-1.patch139
-rw-r--r--pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-2.patch493
-rw-r--r--pkgs/development/python-modules/flaky/default.nix17
-rw-r--r--pkgs/development/tools/parsing/bison/3.x.nix4
-rw-r--r--pkgs/misc/cups/cups-pk-helper.nix10
-rw-r--r--pkgs/misc/cups/default.nix2
-rw-r--r--pkgs/os-specific/linux/bluez/default.nix14
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix6
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix2
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/default.nix2
-rw-r--r--pkgs/tools/bluetooth/blueman/default.nix10
-rw-r--r--pkgs/tools/graphics/zbar/default.nix2
-rw-r--r--pkgs/tools/misc/man-db/default.nix1
-rw-r--r--pkgs/tools/misc/rpm-ostree/default.nix8
-rw-r--r--pkgs/tools/misc/snapper/default.nix10
-rw-r--r--pkgs/tools/networking/connman/default.nix4
-rw-r--r--pkgs/tools/networking/curl/default.nix7
-rw-r--r--pkgs/tools/networking/dhcpcd/default.nix4
-rw-r--r--pkgs/tools/networking/dnsmasq/default.nix2
-rw-r--r--pkgs/tools/networking/modem-manager/default.nix6
-rw-r--r--pkgs/tools/networking/network-manager/default.nix32
-rw-r--r--pkgs/tools/networking/network-manager/fix-install-paths.patch8
-rw-r--r--pkgs/tools/networking/network-manager/fix-paths.patch28
-rw-r--r--pkgs/tools/networking/network-manager/fortisslvpn/default.nix7
-rw-r--r--pkgs/tools/networking/network-manager/iodine/default.nix7
-rw-r--r--pkgs/tools/networking/network-manager/openconnect/default.nix7
-rw-r--r--pkgs/tools/networking/network-manager/openvpn/default.nix7
-rw-r--r--pkgs/tools/networking/network-manager/vpnc/default.nix7
-rw-r--r--pkgs/tools/networking/openconnect/default.nix4
-rw-r--r--pkgs/tools/networking/openresolv/default.nix4
-rw-r--r--pkgs/tools/networking/strongswan/default.nix8
-rw-r--r--pkgs/tools/package-management/disnix/default.nix4
-rw-r--r--pkgs/tools/package-management/packagekit/default.nix4
-rw-r--r--pkgs/tools/security/fprintd/default.nix17
-rw-r--r--pkgs/tools/system/thermald/default.nix7
49 files changed, 1046 insertions, 95 deletions
diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix
index 1df67578b3a..795472bf64a 100644
--- a/pkgs/applications/display-managers/lightdm/default.nix
+++ b/pkgs/applications/display-managers/lightdm/default.nix
@@ -53,6 +53,11 @@ stdenv.mkDerivation rec {
       url = "https://src.fedoraproject.org/rpms/lightdm/raw/4cf0d2bed8d1c68970b0322ccd5dbbbb7a0b12bc/f/lightdm-1.25.1-disable_dmrc.patch";
       sha256 = "06f7iabagrsiws2l75sx2jyljknr9js7ydn151p3qfi104d1541n";
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://github.com/canonical/lightdm/commit/a99376f5f51aa147aaf81287d7ce70db76022c47.patch";
+      sha256 = "1zyx1qqajrmqcf9hbsapd39gmdanswd9l78rq7q6rdy4692il3yn";
+    })
   ];
 
   preConfigure = "NOCONFIGURE=1 ./autogen.sh";
diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix
index 526041124bc..735e83a0842 100644
--- a/pkgs/applications/display-managers/sddm/default.nix
+++ b/pkgs/applications/display-managers/sddm/default.nix
@@ -46,6 +46,7 @@ in mkDerivation {
     "-DQT_IMPORTS_DIR=${placeholder "out"}/${qtbase.qtQmlPrefix}"
     "-DCMAKE_INSTALL_SYSCONFDIR=${placeholder "out"}/etc"
     "-DSYSTEMD_SYSTEM_UNIT_DIR=${placeholder "out"}/lib/systemd/system"
+    "-DDBUS_CONFIG_DIR=${placeholder "out"}/share/dbus-1/system.d"
   ];
 
   postInstall = ''
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index 47da7f7a1d7..46bbc72fb3b 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -141,8 +141,9 @@ stdenv.mkDerivation {
       cp -a contrib $out/share/git/
       mkdir -p $out/share/emacs/site-lisp
       ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/
+      mkdir -p $out/share/bash-completion/completions
+      ln -s $out/share/git/contrib/completion/git-completion.bash $out/share/bash-completion/completions/git
       mkdir -p $out/etc/bash_completion.d
-      ln -s $out/share/git/contrib/completion/git-completion.bash $out/etc/bash_completion.d/
       ln -s $out/share/git/contrib/completion/git-prompt.sh $out/etc/bash_completion.d/
 
       # grep is a runtime dependency, need to patch so that it's found
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index bb0b92eee03..2a8a0a64274 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -1,6 +1,6 @@
 { config, stdenv, fetchurl, fetchFromGitHub, makeWrapper
-, docutils, perl, pkgconfig, python3, which, ffmpeg_4
-, freefont_ttf, freetype, libass, libpthreadstubs, mujs
+, addOpenGLRunpath, docutils, perl, pkgconfig, python3, which
+, ffmpeg_4, freefont_ttf, freetype, libass, libpthreadstubs, mujs
 , nv-codec-headers, lua, libuchardet, libiconv ? null, darwin
 
 , waylandSupport ? stdenv.isLinux
@@ -135,8 +135,7 @@ in stdenv.mkDerivation rec {
   '';
 
   nativeBuildInputs = [
-    docutils makeWrapper perl
-    pkgconfig python3 which
+    addOpenGLRunpath docutils makeWrapper perl pkgconfig python3 which
   ];
 
   buildInputs = [
@@ -214,11 +213,17 @@ in stdenv.mkDerivation rec {
       ${wrapperFlags}
   '';
 
+  # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.
+  # See the explanation in addOpenGLRunpath.
+  postFixup = optionalString stdenv.isLinux ''
+    addOpenGLRunpath $out/bin/.mpv-wrapped
+  '';
+
   meta = with stdenv.lib; {
     description = "A media player that supports many video formats (MPlayer and mplayer2 fork)";
     homepage = https://mpv.io;
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ AndersonTorres fuuzetsu fpletz globin ];
+    maintainers = with maintainers; [ AndersonTorres fuuzetsu fpletz globin ivan ];
     platforms = platforms.darwin ++ platforms.linux;
 
     longDescription = ''
diff --git a/pkgs/desktops/mate/mate-settings-daemon/default.nix b/pkgs/desktops/mate/mate-settings-daemon/default.nix
index 5ee995402ec..70092651702 100644
--- a/pkgs/desktops/mate/mate-settings-daemon/default.nix
+++ b/pkgs/desktops/mate/mate-settings-daemon/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, intltool, glib, dbus-glib, libxklavier,
   libcanberra-gtk3, libnotify, nss, polkit, gnome3, gtk3, mate,
   pulseaudioSupport ? stdenv.config.pulseaudio or true, libpulseaudio,
-  wrapGAppsHook }:
+  wrapGAppsHook, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "mate-settings-daemon";
@@ -12,6 +12,14 @@ stdenv.mkDerivation rec {
     sha256 = "0yr5v6b9hdk20j29smbw1k4fkyg82i5vlflmgly0vi5whgc74gym";
   };
 
+  patches = [
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/mate-desktop/mate-settings-daemon/pull/296.patch";
+      sha256 = "00dfn8h47zw3wr7yya82vvp19wsw51whn8jwgayn4hkjd161s9nm";
+    })
+  ];
+
   nativeBuildInputs = [
     pkgconfig
     intltool
diff --git a/pkgs/development/libraries/accountsservice/default.nix b/pkgs/development/libraries/accountsservice/default.nix
index 860ac3fde41..11ac842342b 100644
--- a/pkgs/development/libraries/accountsservice/default.nix
+++ b/pkgs/development/libraries/accountsservice/default.nix
@@ -70,6 +70,11 @@ stdenv.mkDerivation rec {
       url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/commit/0e712e935abd26499ff5995ab363e5bfd9ee7c4c.patch";
       sha256 = "1y60a5fmgfqjzprwpizilrazqn3mggdlgc5sgcpsprsp62fv78rl";
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/commit/ced73d0fcbd2a54085a660d260482fc70d79bd5c.patch";
+      sha256 = "0s7fknfgxl8hnf6givmhfg4586fjb2n64i9arh1w7xnq7x9x8d4c";
+    })
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix
index ee451818831..babfd6849a8 100644
--- a/pkgs/development/libraries/avahi/default.nix
+++ b/pkgs/development/libraries/avahi/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
-      "--disable-gtk"
+      "--disable-gtk" "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
       (stdenv.lib.enableFeature gtk3Support "gtk3")
       "--${if qt4Support then "enable" else "disable"}-qt4"
       (stdenv.lib.enableFeature withPython "python")
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 4c0ca0210cc..b3310e44ae0 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, perl, texinfo, yasm
+{ stdenv, fetchurl, pkgconfig, addOpenGLRunpath, perl, texinfo, yasm
 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
 , libssh, libtheora, libva, libdrm, libvorbis, libvpx, lzma, libpulseaudio, soxr
 , x264, x265, xvidcore, zlib, libopus, speex, nv-codec-headers, dav1d
@@ -42,7 +42,7 @@
 
 let
   inherit (stdenv) isDarwin isFreeBSD isLinux isAarch32;
-  inherit (stdenv.lib) optional optionals enableFeature;
+  inherit (stdenv.lib) optional optionals optionalString enableFeature;
 
   cmpVer = builtins.compareVersions;
   reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
@@ -157,7 +157,7 @@ stdenv.mkDerivation rec {
       "--enable-cross-compile"
   ] ++ optional stdenv.cc.isClang "--cc=clang";
 
-  nativeBuildInputs = [ perl pkgconfig texinfo yasm ];
+  nativeBuildInputs = [ addOpenGLRunpath perl pkgconfig texinfo yasm ];
 
   buildInputs = [
     bzip2 fontconfig freetype gnutls libiconv lame libass libogg libssh libtheora
@@ -186,6 +186,10 @@ stdenv.mkDerivation rec {
       substituteInPlace $pc \
         --replace "includedir=$out" "includedir=''${!outputInclude}"
     done
+  '' + optionalString stdenv.isLinux ''
+    # Set RUNPATH so that libnvcuvid in /run/opengl-driver(-32)/lib can be found.
+    # See the explanation in addOpenGLRunpath.
+    addOpenGLRunpath $out/lib/libavcodec.so*
   '';
 
   installFlags = [ "install-man" ];
diff --git a/pkgs/development/libraries/flatpak/default.nix b/pkgs/development/libraries/flatpak/default.nix
index d29be4cb930..8aa61949e40 100644
--- a/pkgs/development/libraries/flatpak/default.nix
+++ b/pkgs/development/libraries/flatpak/default.nix
@@ -61,6 +61,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-system-bubblewrap=${bubblewrap}/bin/bwrap"
     "--with-system-dbus-proxy=${xdg-dbus-proxy}/bin/xdg-dbus-proxy"
+    "--dbus_config_dir=${placeholder "out"}/share/dbus-1/system.d"
     "--localstatedir=/var"
     "--enable-installed-tests"
   ];
diff --git a/pkgs/development/libraries/geoclue/default.nix b/pkgs/development/libraries/geoclue/default.nix
index cc2037791e0..d597ed41072 100644
--- a/pkgs/development/libraries/geoclue/default.nix
+++ b/pkgs/development/libraries/geoclue/default.nix
@@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "-Dsysconfdir_install=${placeholder "out"}/etc"
     "-Ddbus-srv-user=geoclue"
+    "-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
   ] ++ optionals stdenv.isDarwin [
     "-D3g-source=false"
     "-Dcdma-source=false"
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 07f99a058d8..f9b49a46ebf 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.30.1";
+  version = "1.32.0";
   pname = "libuv";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    sha256 = "16l207g9qwckxn0vnbnwiybhw6083imdwyfd6ipfsl44b1m8jmf7";
+    sha256 = "1ifazxr5ssw2ay6j66acaxgfwq0x8130fvsyjs1wxvf2r9g4ds9w";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index b5b9f1f7fa4..0d220988b15 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, expat, pam, perl
+{ stdenv, fetchurl, pkgconfig, glib, expat, pam, perl, fetchpatch
 , intltool, spidermonkey_60 , gobject-introspection, libxslt, docbook_xsl, dbus
 , docbook_xml_dtd_412, gtk-doc, coreutils
 , useSystemd ? stdenv.isLinux, systemd
@@ -22,6 +22,14 @@ stdenv.mkDerivation rec {
     sha256 = "1c9lbpndh5zis22f154vjrhnqw65z8s85nrgl42v738yf6g0q5w8";
   };
 
+  patches = [
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/polkit/polkit/merge_requests/11.patch";
+      sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp";
+    })
+  ];
+
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     sed -i -e "s/-Wl,--as-needed//" configure.ac
   '';
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index 7b4addd9161..a2062af65f0 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -53,6 +53,7 @@ let
     qtbase = [
       ./qtbase.patch
       ./qtbase-fixguicmake.patch
+      ./qtbase-trayicons.patch # can be removed with 5.12.4 or 5.13
     ];
     qtdeclarative = [ ./qtdeclarative.patch ];
     qtscript = [ ./qtscript.patch ];
@@ -67,6 +68,10 @@ let
         ./qtwebkit-darwin-no-qos-classes.patch
       ];
     qttools = [ ./qttools.patch ];
+    qtwayland = [
+      ./qtwayland-fix-webengine-freezeups-1.patch # can be removed with 5.12.4 or 5.13
+      ./qtwayland-fix-webengine-freezeups-2.patch # can be removed with 5.12.4 or 5.13
+    ];
   };
 
   qtModule =
diff --git a/pkgs/development/libraries/qt-5/5.12/qtbase-trayicons.patch b/pkgs/development/libraries/qt-5/5.12/qtbase-trayicons.patch
new file mode 100644
index 00000000000..0376c1c96c2
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtbase-trayicons.patch
@@ -0,0 +1,175 @@
+From 4d5e59c54a805ba4e7311fe58c9adc492ca1b35a Mon Sep 17 00:00:00 2001
+From: Alexander Volkov <a.volkov@rusbitech.ru>
+Date: Mon, 4 Feb 2019 18:42:35 +0300
+Subject: [PATCH] QSystemTrayIcon/X11: Create tray icon window when system tray
+ appears
+
+... and destroy it otherwise.
+
+Fixes: QTBUG-61898
+Fixes: QTBUG-73459
+Done-with: Gatis Paeglis <gatis.paeglis@qt.io>
+Change-Id: I6bd8f397f7ccdb123f6a60d4fa466f7b0d760dfc
+---
+ src/widgets/util/qsystemtrayicon_p.h     |  4 ++
+ src/widgets/util/qsystemtrayicon_x11.cpp | 75 ++++++++++++++++++++++----------
+ 2 files changed, 57 insertions(+), 22 deletions(-)
+
+diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
+index 5bdf020a472..e31532ea193 100644
+--- a/src/widgets/util/qsystemtrayicon_p.h
++++ b/src/widgets/util/qsystemtrayicon_p.h
+@@ -69,6 +69,7 @@
+ QT_BEGIN_NAMESPACE
+ 
+ class QSystemTrayIconSys;
++class QSystemTrayWatcher;
+ class QPlatformSystemTrayIcon;
+ class QToolButton;
+ class QLabel;
+@@ -90,6 +91,8 @@ public:
+     void showMessage_sys(const QString &title, const QString &msg, const QIcon &icon,
+                          QSystemTrayIcon::MessageIcon msgIcon, int msecs);
+ 
++    void destroyIcon();
++
+     static bool isSystemTrayAvailable_sys();
+     static bool supportsMessages_sys();
+ 
+@@ -101,6 +104,7 @@ public:
+     QSystemTrayIconSys *sys;
+     QPlatformSystemTrayIcon *qpa_sys;
+     bool visible;
++    QSystemTrayWatcher *trayWatcher;
+ 
+ private:
+     void install_sys_qpa();
+diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
+index 86532456c76..70e5f3678ea 100644
+--- a/src/widgets/util/qsystemtrayicon_x11.cpp
++++ b/src/widgets/util/qsystemtrayicon_x11.cpp
+@@ -92,9 +92,6 @@ protected:
+     virtual void resizeEvent(QResizeEvent *) override;
+     virtual void moveEvent(QMoveEvent *) override;
+ 
+-private slots:
+-    void systemTrayWindowChanged(QScreen *screen);
+-
+ private:
+     QSystemTrayIcon *q;
+ };
+@@ -116,15 +113,6 @@ QSystemTrayIconSys::QSystemTrayIconSys(QSystemTrayIcon *qIn)
+     setMouseTracking(true);
+ }
+ 
+-void QSystemTrayIconSys::systemTrayWindowChanged(QScreen *)
+-{
+-    if (!locateSystemTray()) {
+-        QBalloonTip::hideBalloon();
+-        hide(); // still no luck
+-        destroy();
+-    }
+-}
+-
+ QRect QSystemTrayIconSys::globalGeometry() const
+ {
+     return QRect(mapToGlobal(QPoint(0, 0)), size());
+@@ -199,10 +187,41 @@ void QSystemTrayIconSys::resizeEvent(QResizeEvent *event)
+ }
+ ////////////////////////////////////////////////////////////////////////////
+ 
++class QSystemTrayWatcher: public QObject
++{
++    Q_OBJECT
++public:
++    QSystemTrayWatcher(QSystemTrayIcon *trayIcon)
++        : QObject(trayIcon)
++        , mTrayIcon(trayIcon)
++    {
++        // This code uses string-based syntax because we want to connect to a signal
++        // which is defined in XCB plugin - QXcbNativeInterface::systemTrayWindowChanged().
++        connect(qGuiApp->platformNativeInterface(), SIGNAL(systemTrayWindowChanged(QScreen*)),
++                this, SLOT(systemTrayWindowChanged(QScreen*)));
++    }
++
++private slots:
++    void systemTrayWindowChanged(QScreen *)
++    {
++        auto icon = static_cast<QSystemTrayIconPrivate *>(QObjectPrivate::get(mTrayIcon));
++        icon->destroyIcon();
++        if (icon->visible && locateSystemTray()) {
++            icon->sys = new QSystemTrayIconSys(mTrayIcon);
++            icon->sys->show();
++        }
++    }
++
++private:
++    QSystemTrayIcon *mTrayIcon = nullptr;
++};
++////////////////////////////////////////////////////////////////////////////
++
+ QSystemTrayIconPrivate::QSystemTrayIconPrivate()
+     : sys(0),
+       qpa_sys(QGuiApplicationPrivate::platformTheme()->createPlatformSystemTrayIcon()),
+-      visible(false)
++      visible(false),
++      trayWatcher(nullptr)
+ {
+ }
+ 
+@@ -213,16 +232,21 @@ QSystemTrayIconPrivate::~QSystemTrayIconPrivate()
+ 
+ void QSystemTrayIconPrivate::install_sys()
+ {
++    Q_Q(QSystemTrayIcon);
++
+     if (qpa_sys) {
+         install_sys_qpa();
+         return;
+     }
+-    Q_Q(QSystemTrayIcon);
+-    if (!sys && locateSystemTray()) {
+-        sys = new QSystemTrayIconSys(q);
+-        QObject::connect(QGuiApplication::platformNativeInterface(), SIGNAL(systemTrayWindowChanged(QScreen*)),
+-                         sys, SLOT(systemTrayWindowChanged(QScreen*)));
+-        sys->show();
++
++    if (!sys) {
++        if (!trayWatcher)
++            trayWatcher = new QSystemTrayWatcher(q);
++
++        if (locateSystemTray()) {
++            sys = new QSystemTrayIconSys(q);
++            sys->show();
++        }
+     }
+ }
+ 
+@@ -241,14 +265,21 @@ void QSystemTrayIconPrivate::remove_sys()
+         remove_sys_qpa();
+         return;
+     }
++
++    destroyIcon();
++}
++
++void QSystemTrayIconPrivate::destroyIcon()
++{
+     if (!sys)
+         return;
+     QBalloonTip::hideBalloon();
+-    sys->hide(); // this should do the trick, but...
+-    delete sys; // wm may resize system tray only for DestroyEvents
+-    sys = 0;
++    sys->hide();
++    delete sys;
++    sys = nullptr;
+ }
+ 
++
+ void QSystemTrayIconPrivate::updateIcon_sys()
+ {
+     if (qpa_sys) {
+-- 
+2.16.3
+
diff --git a/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-1.patch b/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-1.patch
new file mode 100644
index 00000000000..2e5a890be05
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-1.patch
@@ -0,0 +1,139 @@
+From 9aced4f9571e74cc57b853598aa4b3f38d66363d Mon Sep 17 00:00:00 2001
+From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
+Date: Thu, 1 Nov 2018 13:48:52 +0100
+Subject: [PATCH 1/2] Client: Don't be exposed if we want to create a sub or
+ shell surface
+
+Because some shells don't allow attaching buffers before configure, we need to
+not be exposed until we know that we don't want a shell surface.
+
+Change-Id: Ida7101a99f953d02cf6401e4ea8d28cfabd6e102
+Reviewed-by: Giulio Camuffo <giulio.camuffo@kdab.com>
+Reviewed-by: David Edmundson <davidedmundson@kde.org>
+---
+ src/client/qwaylanddisplay.cpp | 13 ++++++-------
+ src/client/qwaylanddisplay_p.h |  6 +++---
+ src/client/qwaylandwindow.cpp  | 18 +++++++++++++++---
+ 3 files changed, 24 insertions(+), 13 deletions(-)
+
+diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
+index a2957e0d..f2bd3160 100644
+--- a/src/client/qwaylanddisplay.cpp
++++ b/src/client/qwaylanddisplay.cpp
+@@ -88,13 +88,6 @@ struct wl_surface *QWaylandDisplay::createSurface(void *handle)
+     return surface;
+ }
+ 
+-QWaylandShellSurface *QWaylandDisplay::createShellSurface(QWaylandWindow *window)
+-{
+-    if (!mWaylandIntegration->shellIntegration())
+-        return nullptr;
+-    return mWaylandIntegration->shellIntegration()->createShellSurface(window);
+-}
+-
+ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
+ {
+     struct ::wl_region *region = mCompositor.create_region();
+@@ -108,12 +101,18 @@ struct ::wl_region *QWaylandDisplay::createRegion(const QRegion &qregion)
+ ::wl_subsurface *QWaylandDisplay::createSubSurface(QWaylandWindow *window, QWaylandWindow *parent)
+ {
+     if (!mSubCompositor) {
++        qCWarning(lcQpaWayland) << "Can't create subsurface, not supported by the compositor.";
+         return nullptr;
+     }
+ 
+     return mSubCompositor->get_subsurface(window->object(), parent->object());
+ }
+ 
++QWaylandShellIntegration *QWaylandDisplay::shellIntegration() const
++{
++    return mWaylandIntegration->shellIntegration();
++}
++
+ QWaylandClientBufferIntegration * QWaylandDisplay::clientBufferIntegration() const
+ {
+     return mWaylandIntegration->clientBufferIntegration();
+diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
+index 0dd8d7af..cc6a0a72 100644
+--- a/src/client/qwaylanddisplay_p.h
++++ b/src/client/qwaylanddisplay_p.h
+@@ -94,7 +94,7 @@ class QWaylandQtKeyExtension;
+ class QWaylandWindow;
+ class QWaylandIntegration;
+ class QWaylandHardwareIntegration;
+-class QWaylandShellSurface;
++class QWaylandShellIntegration;
+ class QWaylandCursorTheme;
+ 
+ typedef void (*RegistryListener)(void *data,
+@@ -115,13 +115,13 @@ public:
+     QWaylandScreen *screenForOutput(struct wl_output *output) const;
+ 
+     struct wl_surface *createSurface(void *handle);
+-    QWaylandShellSurface *createShellSurface(QWaylandWindow *window);
+     struct ::wl_region *createRegion(const QRegion &qregion);
+     struct ::wl_subsurface *createSubSurface(QWaylandWindow *window, QWaylandWindow *parent);
+ 
++    QWaylandShellIntegration *shellIntegration() const;
+     QWaylandClientBufferIntegration *clientBufferIntegration() const;
+-
+     QWaylandWindowManagerIntegration *windowManagerIntegration() const;
++
+ #if QT_CONFIG(cursor)
+     void setCursor(struct wl_buffer *buffer, struct wl_cursor_image *image, qreal dpr);
+     void setCursor(const QSharedPointer<QWaylandBuffer> &buffer, const QPoint &hotSpot, qreal dpr);
+diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
+index 4ac2ca51..600ea1df 100644
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -50,6 +50,7 @@
+ #include "qwaylandnativeinterface_p.h"
+ #include "qwaylanddecorationfactory_p.h"
+ #include "qwaylandshmbackingstore_p.h"
++#include "qwaylandshellintegration_p.h"
+ 
+ #if QT_CONFIG(wayland_datadevice)
+ #include "qwaylanddatadevice_p.h"
+@@ -138,8 +139,9 @@ void QWaylandWindow::initWindow()
+         }
+     } else if (shouldCreateShellSurface()) {
+         Q_ASSERT(!mShellSurface);
++        Q_ASSERT(mDisplay->shellIntegration());
+ 
+-        mShellSurface = mDisplay->createShellSurface(this);
++        mShellSurface = mDisplay->shellIntegration()->createShellSurface(this);
+         if (mShellSurface) {
+             // Set initial surface title
+             setWindowTitle(window()->title());
+@@ -211,6 +213,9 @@ void QWaylandWindow::initializeWlSurface()
+ 
+ bool QWaylandWindow::shouldCreateShellSurface() const
+ {
++    if (!mDisplay->shellIntegration())
++        return false;
++
+     if (shouldCreateSubSurface())
+         return false;
+ 
+@@ -963,9 +968,16 @@ void QWaylandWindow::unfocus()
+ 
+ bool QWaylandWindow::isExposed() const
+ {
++    if (!window()->isVisible())
++        return false;
++
+     if (mShellSurface)
+-        return window()->isVisible() && mShellSurface->isExposed();
+-    return QPlatformWindow::isExposed();
++        return mShellSurface->isExposed();
++
++    if (mSubSurfaceWindow)
++        return mSubSurfaceWindow->parent()->isExposed();
++
++    return !(shouldCreateShellSurface() || shouldCreateSubSurface());
+ }
+ 
+ bool QWaylandWindow::isActive() const
+-- 
+2.22.0
+
diff --git a/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-2.patch b/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-2.patch
new file mode 100644
index 00000000000..b1a8d6c9ae0
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.12/qtwayland-fix-webengine-freezeups-2.patch
@@ -0,0 +1,493 @@
+From d85beeb65820d6e5733f88af63b15f77d03aa6ba Mon Sep 17 00:00:00 2001
+From: Johan Klokkhammer Helsing <johan.helsing@qt.io>
+Date: Mon, 28 Jan 2019 09:48:26 +0100
+Subject: [PATCH 2/2] Client: Full implementation for frame callbacks (second
+ try)
+
+The Wayland plugin now takes full control over delivering update request and
+implement frame callbacks for both egl and shm.
+
+[ChangeLog][QPA plugin] The non-blocking version of eglSwapBuffers is now used, if
+supported. This fixed a bug where minimized windows would block the event loop.
+
+[ChangeLog][QPA plugin] Windows that don't get frame callbacks from the
+compositor within 100 ms are now set as not exposed. This should stop most
+clients from rendering unnecessary frames to minimized or hidden windows.
+
+Also, when we relied on the QPA version of requestUpdate, we would sometimes
+deliver one update request while we were waiting for a frame callback. When we
+implement the fallback timer ourselves we can make sure we only deliver the
+fallback if there are no pending frame callbacks.
+
+QtQuick and other applications often depend on blocking swapBuffers to throttle
+animations. If the context's surface format has a non-zero swapInterval, try to
+emulate a blocking swap.
+
+Fixes: QTBUG-69077
+Change-Id: I3c6964f31a16e9aff70b8ec3c5340e640a30fef2
+Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
+---
+ src/client/qwaylanddisplay.cpp                |  38 +++-
+ src/client/qwaylanddisplay_p.h                |   3 +
+ src/client/qwaylandwindow.cpp                 | 180 +++++++++++++++---
+ src/client/qwaylandwindow_p.h                 |  17 +-
+ .../client/wayland-egl/qwaylandglcontext.cpp  |  25 ++-
+ .../qwaylandxcompositeeglcontext.cpp          |   2 +-
+ .../qwaylandxcompositeglxcontext.cpp          |   2 +-
+ 7 files changed, 218 insertions(+), 49 deletions(-)
+
+diff --git a/src/client/qwaylanddisplay.cpp b/src/client/qwaylanddisplay.cpp
+index f2bd3160..82003a30 100644
+--- a/src/client/qwaylanddisplay.cpp
++++ b/src/client/qwaylanddisplay.cpp
+@@ -68,6 +68,8 @@
+ 
+ #include <QtWaylandClient/private/qwayland-text-input-unstable-v2.h>
+ 
++#include <QtCore/private/qcore_unix_p.h>
++
+ #include <QtCore/QAbstractEventDispatcher>
+ #include <QtGui/private/qguiapplication_p.h>
+ 
+@@ -190,7 +192,6 @@ void QWaylandDisplay::flushRequests()
+     wl_display_flush(mDisplay);
+ }
+ 
+-
+ void QWaylandDisplay::blockingReadEvents()
+ {
+     if (wl_display_dispatch(mDisplay) < 0) {
+@@ -204,6 +205,41 @@ void QWaylandDisplay::exitWithError()
+     ::exit(1);
+ }
+ 
++wl_event_queue *QWaylandDisplay::createEventQueue()
++{
++    return wl_display_create_queue(mDisplay);
++}
++
++void QWaylandDisplay::dispatchQueueWhile(wl_event_queue *queue, std::function<bool ()> condition, int timeout)
++{
++    if (!condition())
++        return;
++
++    QElapsedTimer timer;
++    timer.start();
++    struct pollfd pFd = qt_make_pollfd(wl_display_get_fd(mDisplay), POLLIN);
++    while (timeout == -1 || timer.elapsed() < timeout) {
++        while (wl_display_prepare_read_queue(mDisplay, queue) != 0)
++            wl_display_dispatch_queue_pending(mDisplay, queue);
++
++        wl_display_flush(mDisplay);
++
++        const int remaining = qMax(timeout - timer.elapsed(), 0ll);
++        const int pollTimeout = timeout == -1 ? -1 : remaining;
++        if (qt_poll_msecs(&pFd, 1, pollTimeout) > 0)
++            wl_display_read_events(mDisplay);
++        else
++            wl_display_cancel_read(mDisplay);
++
++        if (wl_display_dispatch_queue_pending(mDisplay, queue) < 0) {
++            checkError();
++            exitWithError();
++        }
++        if (!condition())
++            break;
++    }
++}
++
+ QWaylandScreen *QWaylandDisplay::screenForOutput(struct wl_output *output) const
+ {
+     for (int i = 0; i < mScreens.size(); ++i) {
+diff --git a/src/client/qwaylanddisplay_p.h b/src/client/qwaylanddisplay_p.h
+index cc6a0a72..fa8b4c3f 100644
+--- a/src/client/qwaylanddisplay_p.h
++++ b/src/client/qwaylanddisplay_p.h
+@@ -182,6 +182,9 @@ public:
+     void handleKeyboardFocusChanged(QWaylandInputDevice *inputDevice);
+     void handleWindowDestroyed(QWaylandWindow *window);
+ 
++    wl_event_queue *createEventQueue();
++    void dispatchQueueWhile(wl_event_queue *queue, std::function<bool()> condition, int timeout = -1);
++
+ public slots:
+     void blockingReadEvents();
+     void flushRequests();
+diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
+index 600ea1df..4d399f8f 100644
+--- a/src/client/qwaylandwindow.cpp
++++ b/src/client/qwaylandwindow.cpp
+@@ -67,6 +67,7 @@
+ #include <QtGui/private/qwindow_p.h>
+ 
+ #include <QtCore/QDebug>
++#include <QtCore/QThread>
+ 
+ #include <wayland-client.h>
+ 
+@@ -81,6 +82,7 @@ QWaylandWindow *QWaylandWindow::mMouseGrab = nullptr;
+ QWaylandWindow::QWaylandWindow(QWindow *window)
+     : QPlatformWindow(window)
+     , mDisplay(waylandScreen()->display())
++    , mFrameQueue(mDisplay->createEventQueue())
+     , mResizeAfterSwap(qEnvironmentVariableIsSet("QT_WAYLAND_RESIZE_AFTER_SWAP"))
+ {
+     static WId id = 1;
+@@ -363,6 +365,8 @@ void QWaylandWindow::sendExposeEvent(const QRect &rect)
+ {
+     if (!(mShellSurface && mShellSurface->handleExpose(rect)))
+         QWindowSystemInterface::handleExposeEvent(window(), rect);
++    else
++        qCDebug(lcQpaWayland) << "sendExposeEvent: intercepted by shell extension, not sending";
+     mLastExposeGeometry = rect;
+ }
+ 
+@@ -547,18 +551,11 @@ void QWaylandWindow::handleScreenRemoved(QScreen *qScreen)
+ void QWaylandWindow::attach(QWaylandBuffer *buffer, int x, int y)
+ {
+     Q_ASSERT(!buffer->committed());
+-    if (mFrameCallback) {
+-        wl_callback_destroy(mFrameCallback);
+-        mFrameCallback = nullptr;
+-    }
+-
+     if (buffer) {
+-        mFrameCallback = frame();
+-        wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
+-        mWaitingForFrameSync = true;
++        handleUpdate();
+         buffer->setBusy();
+ 
+-        attach(buffer->buffer(), x, y);
++        QtWayland::wl_surface::attach(buffer->buffer(), x, y);
+     } else {
+         QtWayland::wl_surface::attach(nullptr, 0, 0);
+     }
+@@ -614,32 +611,61 @@ void QWaylandWindow::commit(QWaylandBuffer *buffer, const QRegion &damage)
+ }
+ 
+ const wl_callback_listener QWaylandWindow::callbackListener = {
+-    QWaylandWindow::frameCallback
++    [](void *data, wl_callback *callback, uint32_t time) {
++        Q_UNUSED(callback);
++        Q_UNUSED(time);
++        auto *window = static_cast<QWaylandWindow*>(data);
++        if (window->thread() != QThread::currentThread())
++            QMetaObject::invokeMethod(window, [=] { window->handleFrameCallback(); }, Qt::QueuedConnection);
++        else
++            window->handleFrameCallback();
++    }
+ };
+ 
+-void QWaylandWindow::frameCallback(void *data, struct wl_callback *callback, uint32_t time)
++void QWaylandWindow::handleFrameCallback()
+ {
+-    Q_UNUSED(time);
+-    Q_UNUSED(callback);
+-    QWaylandWindow *self = static_cast<QWaylandWindow*>(data);
++    bool wasExposed = isExposed();
+ 
+-    self->mWaitingForFrameSync = false;
+-    if (self->mUpdateRequested) {
+-        self->mUpdateRequested = false;
+-        self->deliverUpdateRequest();
++    if (mFrameCallbackTimerId != -1) {
++        killTimer(mFrameCallbackTimerId);
++        mFrameCallbackTimerId = -1;
+     }
++
++    mWaitingForFrameCallback = false;
++    mFrameCallbackTimedOut = false;
++
++    if (!wasExposed && isExposed())
++        sendExposeEvent(QRect(QPoint(), geometry().size()));
++    if (wasExposed && hasPendingUpdateRequest())
++        deliverUpdateRequest();
+ }
+ 
+ QMutex QWaylandWindow::mFrameSyncMutex;
+ 
+-void QWaylandWindow::waitForFrameSync()
++bool QWaylandWindow::waitForFrameSync(int timeout)
+ {
+     QMutexLocker locker(&mFrameSyncMutex);
+-    if (!mWaitingForFrameSync)
+-        return;
+-    mDisplay->flushRequests();
+-    while (mWaitingForFrameSync)
+-        mDisplay->blockingReadEvents();
++    if (!mWaitingForFrameCallback)
++        return true;
++
++    wl_proxy_set_queue(reinterpret_cast<wl_proxy *>(mFrameCallback), mFrameQueue);
++    mDisplay->dispatchQueueWhile(mFrameQueue, [&]() { return mWaitingForFrameCallback; }, timeout);
++
++    if (mWaitingForFrameCallback) {
++        qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
++        mFrameCallbackTimedOut = true;
++        mWaitingForUpdate = false;
++        sendExposeEvent(QRect());
++    }
++
++    // Stop current frame timer if any, can't use killTimer directly, because we might be on a diffent thread
++    if (mFrameCallbackTimerId != -1) {
++        int id = mFrameCallbackTimerId;
++        mFrameCallbackTimerId = -1;
++        QMetaObject::invokeMethod(this, [=] { killTimer(id); }, Qt::QueuedConnection);
++    }
++
++    return !mWaitingForFrameCallback;
+ }
+ 
+ QMargins QWaylandWindow::frameMargins() const
+@@ -971,6 +997,9 @@ bool QWaylandWindow::isExposed() const
+     if (!window()->isVisible())
+         return false;
+ 
++    if (mFrameCallbackTimedOut)
++        return false;
++
+     if (mShellSurface)
+         return mShellSurface->isExposed();
+ 
+@@ -1046,12 +1075,107 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa
+     return m_properties.value(name, defaultValue);
+ }
+ 
++void QWaylandWindow::timerEvent(QTimerEvent *event)
++{
++    if (event->timerId() == mFallbackUpdateTimerId) {
++        killTimer(mFallbackUpdateTimerId);
++        mFallbackUpdateTimerId = -1;
++        qCDebug(lcWaylandBackingstore) << "mFallbackUpdateTimer timed out";
++
++        if (!isExposed()) {
++            qCDebug(lcWaylandBackingstore) << "Fallback update timer: Window not exposed,"
++                                           << "not delivering update request.";
++            return;
++        }
++
++        if (mWaitingForUpdate && hasPendingUpdateRequest() && !mWaitingForFrameCallback) {
++            qCWarning(lcWaylandBackingstore) << "Delivering update request through fallback timer,"
++                                             << "may not be in sync with display";
++            deliverUpdateRequest();
++        }
++    }
++
++    if (event->timerId() == mFrameCallbackTimerId) {
++        killTimer(mFrameCallbackTimerId);
++        mFrameCallbackTimerId = -1;
++        qCDebug(lcWaylandBackingstore) << "Didn't receive frame callback in time, window should now be inexposed";
++        mFrameCallbackTimedOut = true;
++        mWaitingForUpdate = false;
++        sendExposeEvent(QRect());
++    }
++}
++
+ void QWaylandWindow::requestUpdate()
+ {
+-    if (!mWaitingForFrameSync)
+-        QPlatformWindow::requestUpdate();
+-    else
+-        mUpdateRequested = true;
++    Q_ASSERT(hasPendingUpdateRequest()); // should be set by QPA
++
++    // If we have a frame callback all is good and will be taken care of there
++    if (mWaitingForFrameCallback)
++        return;
++
++    // If we've already called deliverUpdateRequest(), but haven't seen any attach+commit/swap yet
++    if (mWaitingForUpdate) {
++        // Ideally, we should just have returned here, but we're not guaranteed that the client
++        // will actually update, so start this timer to deliver another request update after a while
++        // *IF* the client doesn't update.
++        int fallbackTimeout = 100;
++        mFallbackUpdateTimerId = startTimer(fallbackTimeout);
++        return;
++    }
++
++    // Some applications (such as Qt Quick) depend on updates being delivered asynchronously,
++    // so use invokeMethod to delay the delivery a bit.
++    QMetaObject::invokeMethod(this, [this] {
++        // Things might have changed in the meantime
++        if (hasPendingUpdateRequest() && !mWaitingForUpdate && !mWaitingForFrameCallback)
++            deliverUpdateRequest();
++    }, Qt::QueuedConnection);
++}
++
++// Should be called whenever we commit a buffer (directly through wl_surface.commit or indirectly
++// with eglSwapBuffers) to know when it's time to commit the next one.
++// Can be called from the render thread (without locking anything) so make sure to not make races in this method.
++void QWaylandWindow::handleUpdate()
++{
++    // TODO: Should sync subsurfaces avoid requesting frame callbacks?
++
++    if (mFrameCallback) {
++        wl_callback_destroy(mFrameCallback);
++        mFrameCallback = nullptr;
++    }
++
++    if (mFallbackUpdateTimerId != -1) {
++        // Ideally, we would stop the fallback timer here, but since we're on another thread,
++        // it's not allowed. Instead we set mFallbackUpdateTimer to -1 here, so we'll just
++        // ignore it if it times out before it's cleaned up by the invokeMethod call.
++        int id = mFallbackUpdateTimerId;
++        mFallbackUpdateTimerId = -1;
++        QMetaObject::invokeMethod(this, [=] { killTimer(id); }, Qt::QueuedConnection);
++    }
++
++    mFrameCallback = frame();
++    wl_callback_add_listener(mFrameCallback, &QWaylandWindow::callbackListener, this);
++    mWaitingForFrameCallback = true;
++    mWaitingForUpdate = false;
++
++    // Stop current frame timer if any, can't use killTimer directly, see comment above.
++    if (mFrameCallbackTimerId != -1) {
++        int id = mFrameCallbackTimerId;
++        mFrameCallbackTimerId = -1;
++        QMetaObject::invokeMethod(this, [=] { killTimer(id); }, Qt::QueuedConnection);
++    }
++
++    // Start a timer for handling the case when the compositor stops sending frame callbacks.
++    QMetaObject::invokeMethod(this, [=] { // Again; can't do it directly
++        if (mWaitingForFrameCallback)
++            mFrameCallbackTimerId = startTimer(100);
++    }, Qt::QueuedConnection);
++}
++
++void QWaylandWindow::deliverUpdateRequest()
++{
++    mWaitingForUpdate = true;
++    QPlatformWindow::deliverUpdateRequest();
+ }
+ 
+ void QWaylandWindow::addAttachOffset(const QPoint point)
+diff --git a/src/client/qwaylandwindow_p.h b/src/client/qwaylandwindow_p.h
+index 56ebd3cc..c47123dc 100644
+--- a/src/client/qwaylandwindow_p.h
++++ b/src/client/qwaylandwindow_p.h
+@@ -120,7 +120,7 @@ public:
+     void handleExpose(const QRegion &region);
+     void commit(QWaylandBuffer *buffer, const QRegion &damage);
+ 
+-    void waitForFrameSync();
++    bool waitForFrameSync(int timeout);
+ 
+     QMargins frameMargins() const override;
+ 
+@@ -191,7 +191,10 @@ public:
+ 
+     bool startSystemMove(const QPoint &pos) override;
+ 
++    void timerEvent(QTimerEvent *event) override;
+     void requestUpdate() override;
++    void handleUpdate();
++    void deliverUpdateRequest() override;
+ 
+ public slots:
+     void applyConfigure();
+@@ -211,10 +214,17 @@ protected:
+     Qt::MouseButtons mMousePressedInContentArea = Qt::NoButton;
+ 
+     WId mWindowId;
+-    bool mWaitingForFrameSync = false;
++    bool mWaitingForFrameCallback = false;
++    bool mFrameCallbackTimedOut = false; // Whether the frame callback has timed out
++    int mFrameCallbackTimerId = -1; // Started on commit, reset on frame callback
+     struct ::wl_callback *mFrameCallback = nullptr;
++    struct ::wl_event_queue *mFrameQueue = nullptr;
+     QWaitCondition mFrameSyncWait;
+ 
++    // True when we have called deliverRequestUpdate, but the client has not yet attached a new buffer
++    bool mWaitingForUpdate = false;
++    int mFallbackUpdateTimerId = -1; // Started when waiting for app to commit
++
+     QMutex mResizeLock;
+     bool mWaitingToApplyConfigure = false;
+     bool mCanResize = true;
+@@ -253,11 +263,10 @@ private:
+     void handleMouseEventWithDecoration(QWaylandInputDevice *inputDevice, const QWaylandPointerEvent &e);
+     void handleScreenChanged();
+ 
+-    bool mUpdateRequested = false;
+     QRect mLastExposeGeometry;
+ 
+     static const wl_callback_listener callbackListener;
+-    static void frameCallback(void *data, struct wl_callback *wl_callback, uint32_t time);
++    void handleFrameCallback();
+ 
+     static QMutex mFrameSyncMutex;
+     static QWaylandWindow *mMouseGrab;
+diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+index e58403ad..30dab408 100644
+--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
++++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+@@ -315,7 +315,9 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis
+        mSupportNonBlockingSwap = false;
+     }
+     if (!mSupportNonBlockingSwap) {
+-        qWarning() << "Non-blocking swap buffers not supported. Subsurface rendering can be affected.";
++        qWarning(lcQpaWayland) << "Non-blocking swap buffers not supported."
++                               << "Subsurface rendering can be affected."
++                               << "It may also cause the event loop to freeze in some situations";
+     }
+ 
+     updateGLFormat();
+@@ -550,20 +552,15 @@ void QWaylandGLContext::swapBuffers(QPlatformSurface *surface)
+         m_blitter->blit(window);
+     }
+ 
+-
+-    QWaylandSubSurface *sub = window->subSurfaceWindow();
+-    if (sub) {
+-        QMutexLocker l(sub->syncMutex());
+-
+-        int si = (sub->isSync() && mSupportNonBlockingSwap) ? 0 : m_format.swapInterval();
+-
+-        eglSwapInterval(m_eglDisplay, si);
+-        eglSwapBuffers(m_eglDisplay, eglSurface);
+-    } else {
+-        eglSwapInterval(m_eglDisplay, m_format.swapInterval());
+-        eglSwapBuffers(m_eglDisplay, eglSurface);
++    int swapInterval = mSupportNonBlockingSwap ? 0 : m_format.swapInterval();
++    eglSwapInterval(m_eglDisplay, swapInterval);
++    if (swapInterval == 0 && m_format.swapInterval() > 0) {
++        // Emulating a blocking swap
++        glFlush(); // Flush before waiting so we can swap more quickly when the frame event arrives
++        window->waitForFrameSync(100);
+     }
+-
++    window->handleUpdate();
++    eglSwapBuffers(m_eglDisplay, eglSurface);
+ 
+     window->setCanResize(true);
+ }
+diff --git a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
+index c07ad534..a6fead95 100644
+--- a/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
++++ b/src/hardwareintegration/client/xcomposite-egl/qwaylandxcompositeeglcontext.cpp
+@@ -65,7 +65,7 @@ void QWaylandXCompositeEGLContext::swapBuffers(QPlatformSurface *surface)
+     QSize size = w->geometry().size();
+ 
+     w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height()));
+-    w->waitForFrameSync();
++    w->waitForFrameSync(100);
+ }
+ 
+ EGLSurface QWaylandXCompositeEGLContext::eglSurfaceForPlatformSurface(QPlatformSurface *surface)
+diff --git a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
+index 33ae2e03..35188741 100644
+--- a/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
++++ b/src/hardwareintegration/client/xcomposite-glx/qwaylandxcompositeglxcontext.cpp
+@@ -93,7 +93,7 @@ void QWaylandXCompositeGLXContext::swapBuffers(QPlatformSurface *surface)
+     glXSwapBuffers(m_display, w->xWindow());
+ 
+     w->commit(w->buffer(), QRegion(0, 0, size.width(), size.height()));
+-    w->waitForFrameSync();
++    w->waitForFrameSync(100);
+ }
+ 
+ QFunctionPointer QWaylandXCompositeGLXContext::getProcAddress(const char *procName)
+-- 
+2.22.0
+
diff --git a/pkgs/development/python-modules/flaky/default.nix b/pkgs/development/python-modules/flaky/default.nix
index 523e6ac53e6..c4e803245d5 100644
--- a/pkgs/development/python-modules/flaky/default.nix
+++ b/pkgs/development/python-modules/flaky/default.nix
@@ -2,22 +2,29 @@
 , buildPythonPackage
 , fetchPypi
 , mock
+, nose
 , pytest
 }:
 
 buildPythonPackage rec {
   pname = "flaky";
-  version = "3.5.3";
+  version = "3.6.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "12bd5e41f372b2190e8d754b6e5829c2f11dbc764e10b30f57e59f829c9ca1da";
+    sha256 = "8cd5455bb00c677f787da424eaf8c4a58a922d0e97126d3085db5b279a98b698";
   };
 
-  buildInputs = [ mock pytest ];
+  checkInputs = [ mock nose pytest ];
 
-  # waiting for feedback https://github.com/box/flaky/issues/97
-  doCheck = false;
+  checkPhase = ''
+    # based on tox.ini
+    pytest -k 'example and not options' --doctest-modules test/test_pytest/
+    pytest -k 'example and not options' test/test_pytest/
+    pytest -p no:flaky test/test_pytest/test_flaky_pytest_plugin.py
+    nosetests --with-flaky --force-flaky --max-runs 2 test/test_nose/test_nose_options_example.py
+    pytest --force-flaky --max-runs 2  test/test_pytest/test_pytest_options_example.py
+  '';
 
   meta = with stdenv.lib; {
     homepage = https://github.com/box/flaky;
diff --git a/pkgs/development/tools/parsing/bison/3.x.nix b/pkgs/development/tools/parsing/bison/3.x.nix
index bbcecae8f04..5382ec421b7 100644
--- a/pkgs/development/tools/parsing/bison/3.x.nix
+++ b/pkgs/development/tools/parsing/bison/3.x.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "bison";
-  version = "3.4.1";
+  version = "3.4.2";
 
   src = fetchurl {
     url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "15ah05gharrzcxs8q5pm9mli5dp5lw19nd95apzzmyqnqa4zq1vh";
+    sha256 = "1kzsb6fmmpq00l2s55hyb4dbsmz8f3a64ria6354wlbx6ypj4fgz";
   };
 
   nativeBuildInputs = [ m4 perl ] ++ stdenv.lib.optional stdenv.isSunOS help2man;
diff --git a/pkgs/misc/cups/cups-pk-helper.nix b/pkgs/misc/cups/cups-pk-helper.nix
index 5e7596032b3..6534d300e82 100644
--- a/pkgs/misc/cups/cups-pk-helper.nix
+++ b/pkgs/misc/cups/cups-pk-helper.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, pkgconfig, glib, polkit, cups }:
+{ stdenv, fetchurl, intltool, pkgconfig, glib, polkit, cups, fetchpatch }:
 
 stdenv.mkDerivation rec {
   version = "0.2.6";
@@ -12,6 +12,14 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs = [ glib polkit cups ];
 
+  patches = [
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/cups-pk-helper/cups-pk-helper/merge_requests/2.patch";
+      sha256 = "1kamhr5kn8c1y0q8xbip0fgr7maf3dyddlvab4n0iypk7rwwikl0";
+    })
+  ];
+
   meta = with stdenv.lib; {
     description = "PolicyKit helper to configure cups with fine-grained privileges";
     homepage = http://www.freedesktop.org/wiki/Software/cups-pk-helper/;
diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix
index 6e27fdb0a52..c7df3f333b6 100644
--- a/pkgs/misc/cups/default.nix
+++ b/pkgs/misc/cups/default.nix
@@ -48,6 +48,7 @@ stdenv.mkDerivation rec {
   ] ++ optionals stdenv.isLinux [
     "--enable-dbus"
     "--enable-pam"
+    "--with-dbusdir=${placeholder "out"}/share/dbus-1"
   ] ++ optional (libusb != null) "--enable-libusb"
     ++ optional (gnutls != null) "--enable-ssl"
     ++ optional (avahi != null) "--enable-avahi"
@@ -81,7 +82,6 @@ stdenv.mkDerivation rec {
       "STATEDIR=$(TMPDIR)/dummy"
       # Idem for /etc.
       "PAMDIR=$(out)/etc/pam.d"
-      "DBUSDIR=$(out)/etc/dbus-1"
       "XINETD=$(out)/etc/xinetd.d"
       "SERVERROOT=$(out)/etc/cups"
       # Idem for /usr.
diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix
index be43d23d611..cca3674bdd1 100644
--- a/pkgs/os-specific/linux/bluez/default.nix
+++ b/pkgs/os-specific/linux/bluez/default.nix
@@ -48,12 +48,12 @@ stdenv.mkDerivation rec {
     "--enable-library"
     "--enable-cups"
     "--enable-pie"
-    "--with-dbusconfdir=$(out)/etc"
-    "--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
-    "--with-dbussessionbusdir=$(out)/share/dbus-1/services"
-    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
-    "--with-systemduserunitdir=$(out)/etc/systemd/user"
-    "--with-udevdir=$(out)/lib/udev"
+    "--with-dbusconfdir=${placeholder "out"}/share"
+    "--with-dbussystembusdir=${placeholder "out"}/share/dbus-1/system-services"
+    "--with-dbussessionbusdir=${placeholder "out"}/share/dbus-1/services"
+    "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
+    "--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
+    "--with-udevdir=${placeholder "out"}/lib/udev"
     ] ++ optional enableWiimote [ "--enable-wiimote" ]
       ++ optional enableMidi    [ "--enable-midi" ]
       ++ optional enableSixaxis [ "--enable-sixaxis" ]);
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
   # Work around `make install' trying to create /var/lib/bluetooth.
   installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
 
-  makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
+  makeFlags = "rulesdir=${placeholder "out"}/lib/udev/rules.d";
 
   postInstall = ''
     mkdir -p $test/{bin,test}
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 75144799d01..f298073d11a 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -2,6 +2,7 @@
 
 { stdenv
 , fetchurl
+, fetchpatch
 , substituteAll
 , gtk-doc
 , pkgconfig
@@ -153,6 +154,11 @@ stdenv.mkDerivation rec {
       # needs a different set of modules than po/make-images
       inherit installedTestsPython;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://github.com/fwupd/fwupd/commit/41a25be6f4b371c367904284e9251cd461ad5cfe.patch";
+      sha256 = "0vv3x2pq5bpmg9c8ax5dsqcblw45n7jmzgw6p8h4asyjy57mzhaq";
+    })
   ];
 
   postPatch = ''
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 90b33e183ce..2eb8777d995 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -56,7 +56,7 @@ in stdenv.mkDerivation {
   #dontAddPrefix = true;
 
   mesonFlags = [
-    "-Ddbuspolicydir=${placeholder "out"}/etc/dbus-1/system.d"
+    "-Ddbuspolicydir=${placeholder "out"}/share/dbus-1/system.d"
     "-Ddbussessionservicedir=${placeholder "out"}/share/dbus-1/services"
     "-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
     "-Dpamconfdir=${placeholder "out"}/etc/pam.d"
diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index 69525c92ede..f54366201ff 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/etc/dbus-1/system.d $out/share/dbus-1/system-services $out/etc/systemd/system
     cp -v "dbus/"*service $out/share/dbus-1/system-services
     sed -e "s@/sbin/wpa_supplicant@$out&@" -i "$out/share/dbus-1/system-services/"*
-    cp -v dbus/dbus-wpa_supplicant.conf $out/etc/dbus-1/system.d
+    cp -v dbus/dbus-wpa_supplicant.conf $out/share/dbus-1/system.d
     cp -v "systemd/"*.service $out/etc/systemd/system
     rm $out/share/man/man8/wpa_priv.8
     install -Dm444 wpa_supplicant.conf $out/share/doc/wpa_supplicant/wpa_supplicant.conf.example
diff --git a/pkgs/tools/bluetooth/blueman/default.nix b/pkgs/tools/bluetooth/blueman/default.nix
index 8e393ac3f13..0a924bc3ab7 100644
--- a/pkgs/tools/bluetooth/blueman/default.nix
+++ b/pkgs/tools/bluetooth/blueman/default.nix
@@ -3,7 +3,7 @@
 , gnome3, librsvg, wrapGAppsHook, gobject-introspection
 , withNetworkManager ?
     config.networking.networkmanager.enable or false, networkmanager
-, withPulseAudio ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
+, withPulseAudio ? config.pulseaudio or stdenv.isLinux, libpulseaudio, fetchpatch }:
 
 let
   pythonPackages = python3Packages;
@@ -29,6 +29,14 @@ in stdenv.mkDerivation rec {
                 ++ lib.optional withPulseAudio libpulseaudio
                 ++ lib.optional withNetworkManager networkmanager;
 
+  patches = [
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/blueman-project/blueman/pull/1103.patch";
+      sha256 = "0zqdi6ya97jljwinn10n9q6bixl23ww55c0pkhskn140qnrj42wf";
+    })
+  ];
+
   postPatch = lib.optionalString withPulseAudio ''
     sed -i 's,CDLL(",CDLL("${libpulseaudio.out}/lib/,g' blueman/main/PulseAudioUtils.py
   '';
diff --git a/pkgs/tools/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix
index e2b9f534ae5..8f82380e241 100644
--- a/pkgs/tools/graphics/zbar/default.nix
+++ b/pkgs/tools/graphics/zbar/default.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--without-python"
   ] ++ (if enableDbus then [
-    "--with-dbusconfdir=${placeholder "out"}/etc"
+    "--with-dbusconfdir=${placeholder "out"}/share"
   ] else [
     "--without-dbus"
   ]) ++ (if enableVideo then [
diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix
index df1a2daddb9..a8fb7eea97c 100644
--- a/pkgs/tools/misc/man-db/default.nix
+++ b/pkgs/tools/misc/man-db/default.nix
@@ -38,6 +38,7 @@ stdenv.mkDerivation rec {
     "--with-config-file=${placeholder "out"}/etc/man_db.conf"
     "--with-systemdtmpfilesdir=${placeholder "out"}/lib/tmpfiles.d"
     "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
+    "--with-pager=less"
   ] ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin [
     "ac_cv_func__set_invalid_parameter_handler=no"
     "ac_cv_func_posix_fadvise=no"
diff --git a/pkgs/tools/misc/rpm-ostree/default.nix b/pkgs/tools/misc/rpm-ostree/default.nix
index 409e65dff77..09f2150cdce 100644
--- a/pkgs/tools/misc/rpm-ostree/default.nix
+++ b/pkgs/tools/misc/rpm-ostree/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, ostree, rpm, which, autoconf, automake, libtool, pkgconfig, cargo, rustc,
   gobject-introspection, gtk-doc, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_43, gperf, cmake,
   libcap, glib, systemd, json-glib, libarchive, libsolv, librepo, polkit,
-  bubblewrap, pcre, check, python, json_c, libmodulemd_1, utillinux, sqlite, cppunit }:
+  bubblewrap, pcre, check, python, json_c, libmodulemd_1, utillinux, sqlite, cppunit, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "rpm-ostree";
@@ -17,6 +17,12 @@ stdenv.mkDerivation rec {
     # https://github.com/NixOS/nixpkgs/pull/50953#issuecomment-449777169
     # https://github.com/NixOS/nixpkgs/pull/50953#issuecomment-452177080
     ./fix-introspection-build.patch
+
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://github.com/coreos/rpm-ostree/commit/60053d0d3d2279d120ae7007c6048e499d2c4d14.patch";
+      sha256 = "0ig21zip09iy2da7ksg87jykaj3q8jyzh8r7yrpzyql85qxiwm0m";
+    })
   ];
 
   outputs = [ "out" "dev" "man" "devdoc" ];
diff --git a/pkgs/tools/misc/snapper/default.nix b/pkgs/tools/misc/snapper/default.nix
index 5eba12285de..6c9cbc56846 100644
--- a/pkgs/tools/misc/snapper/default.nix
+++ b/pkgs/tools/misc/snapper/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub
 , autoreconfHook, pkgconfig, docbook_xsl, libxslt, docbook_xml_dtd_45
 , acl, attr, boost, btrfs-progs, dbus, diffutils, e2fsprogs, libxml2
-, lvm2, pam, python, utillinux }:
+, lvm2, pam, python, utillinux, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "snapper";
@@ -23,6 +23,14 @@ stdenv.mkDerivation rec {
     lvm2 pam python utillinux
   ];
 
+  patches = [
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://github.com/openSUSE/snapper/commit/c51708aea22d9436da287cba84424557ad03644b.patch";
+      sha256 = "106pf7pv8z3q37c8ckmgwxs1phf2fy7l53a9g5xq5kk2rjj1cx34";
+    })
+  ];
+
   postPatch = ''
     # Hard-coded root paths, hard-coded root paths everywhere...
     for file in {client,data,pam,scripts}/Makefile.am; do
diff --git a/pkgs/tools/networking/connman/default.nix b/pkgs/tools/networking/connman/default.nix
index 56b0347e17f..e58b8362f95 100644
--- a/pkgs/tools/networking/connman/default.nix
+++ b/pkgs/tools/networking/connman/default.nix
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--sysconfdir=\${out}/etc"
     "--localstatedir=/var"
-    "--with-dbusconfdir=\${out}/etc"
-    "--with-dbusdatadir=\${out}/usr/share"
+    "--with-dbusconfdir=${placeholder "out"}/share"
+    "--with-dbusdatadir=${placeholder "out"}/share"
     "--disable-maintainer-mode"
     "--enable-openconnect=builtin"
     "--with-openconnect=${openconnect}/sbin/openconnect"
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 652bcdba874..817f3ccf19b 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -24,14 +24,14 @@ assert brotliSupport -> brotli != null;
 assert gssSupport -> libkrb5 != null;
 
 stdenv.mkDerivation rec {
-  name = "curl-7.65.3";
+  name = "curl-7.66.0";
 
   src = fetchurl {
     urls = [
       "https://curl.haxx.se/download/${name}.tar.bz2"
       "https://github.com/curl/curl/releases/download/${lib.replaceStrings ["."] ["_"] name}/${name}.tar.bz2"
     ];
-    sha256 = "02g5zj4rq5sr15jzjqk70xk4k92i2pdmpq00xb4pnba8ps1mx18a";
+    sha256 = "0hd1wwplw357hn876s4n2gk7dpmd1gfw5d2c3yi21i1m09726636";
   };
 
   outputs = [ "bin" "dev" "out" "man" "devdoc" ];
@@ -94,6 +94,9 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     moveToOutput bin/curl-config "$dev"
+
+    # Install completions
+    make -C scripts install
   '' + stdenv.lib.optionalString scpSupport ''
     sed '/^dependency_libs/s|${libssh2.dev}|${libssh2.out}|' -i "$out"/lib/*.la
   '' + stdenv.lib.optionalString gnutlsSupport ''
diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix
index dfc56d440e6..0827f2eac7b 100644
--- a/pkgs/tools/networking/dhcpcd/default.nix
+++ b/pkgs/tools/networking/dhcpcd/default.nix
@@ -4,11 +4,11 @@ stdenv.mkDerivation rec {
   # when updating this to >=7, check, see previous reverts:
   # nix-build -A nixos.tests.networking.scripted.macvlan.x86_64-linux nixos/release-combined.nix
   pname = "dhcpcd";
-  version = "8.0.3";
+  version = "8.0.6";
 
   src = fetchurl {
     url = "mirror://roy/${pname}/${pname}-${version}.tar.xz";
-    sha256 = "07cg0sp8sk9b6ch2ajmvkbn6z08bgyx8xbd004s5mkasrlgrfx4n";
+    sha256 = "0kxxpb79j564m6bjvjb9gsn0yzs13c0arfgsycm51gw3xnch3db6";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/networking/dnsmasq/default.nix b/pkgs/tools/networking/dnsmasq/default.nix
index bcc1f39e8fd..c009affe1ff 100644
--- a/pkgs/tools/networking/dnsmasq/default.nix
+++ b/pkgs/tools/networking/dnsmasq/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist \
       --replace "/usr/local/sbin" "$out/bin"
   '' + optionalString stdenv.isLinux ''
-    install -Dm644 dbus/dnsmasq.conf $out/etc/dbus-1/system.d/dnsmasq.conf
+    install -Dm644 dbus/dnsmasq.conf $out/share/dbus-1/system.d/dnsmasq.conf
     install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time
     install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release
     install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6
diff --git a/pkgs/tools/networking/modem-manager/default.nix b/pkgs/tools/networking/modem-manager/default.nix
index fedc8d4b71d..d921e841c5b 100644
--- a/pkgs/tools/networking/modem-manager/default.nix
+++ b/pkgs/tools/networking/modem-manager/default.nix
@@ -3,12 +3,12 @@
 
 stdenv.mkDerivation rec {
   pname = "modem-manager";
-  version = "1.10.0";
+  version = "1.10.4";
 
   package = "ModemManager";
   src = fetchurl {
     url = "https://www.freedesktop.org/software/${package}/${package}-${version}.tar.xz";
-    sha256 = "1qkfnxqvaraz1npahqvm5xc73mbxxic8msnsjmlwkni5c2ckj3zx";
+    sha256 = "0w6wdj9dh7zwhzl68775h1ni6zcgvss524dp17kph50zpas6nmgs";
   };
 
   nativeBuildInputs = [ vala gobject-introspection gettext pkgconfig ];
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-polkit"
     "--with-udev-base-dir=${placeholder "out"}/lib/udev"
-    "--with-dbus-sys-dir=${placeholder "out"}/etc/dbus-1/system.d"
+    "--with-dbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
     "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "--sysconfdir=/etc"
     "--localstatedir=/var"
diff --git a/pkgs/tools/networking/network-manager/default.nix b/pkgs/tools/networking/network-manager/default.nix
index 490ebd0fa6b..ffa56363ad6 100644
--- a/pkgs/tools/networking/network-manager/default.nix
+++ b/pkgs/tools/networking/network-manager/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, substituteAll, intltool, pkgconfig, dbus, dbus-glib
+{ stdenv, fetchurl, substituteAll, intltool, pkgconfig, fetchpatch, dbus
 , gnome3, systemd, libuuid, polkit, gnutls, ppp, dhcp, iptables, python3, vala
 , libgcrypt, dnsmasq, bluez5, readline, libselinux, audit
 , gobject-introspection, modemmanager, openresolv, libndp, newt, libsoup
@@ -10,11 +10,11 @@ let
   pythonForDocs = python3.withPackages (pkgs: with pkgs; [ pygobject3 ]);
 in stdenv.mkDerivation rec {
   pname = "network-manager";
-  version = "1.18.2";
+  version = "1.20.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/NetworkManager/${stdenv.lib.versions.majorMinor version}/NetworkManager-${version}.tar.xz";
-    sha256 = "1hx5dx5dgdqh3p8fq7q1pxy2bx2iymc74lj60ycrf7ydfjlprnad";
+    sha256 = "115cgz448vypc7c592lqqjd7lp2kzdczhjk4ran6qls65hzkfkji";
   };
 
   outputs = [ "out" "dev" "devdoc" "man" "doc" ];
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
     # to enable link-local connections
     "-Dudev_dir=${placeholder "out"}/lib/udev"
     "-Dresolvconf=${openresolv}/bin/resolvconf"
-    "-Ddbus_conf_dir=${placeholder "out"}/etc/dbus-1/system.d"
+    "-Ddbus_conf_dir=${placeholder "out"}/share/dbus-1/system.d"
     "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     "-Dkernel_firmware_dir=/run/current-system/firmware"
     "--sysconfdir=/etc"
@@ -43,8 +43,6 @@ in stdenv.mkDerivation rec {
     "-Dmodem_manager=true"
     "-Dnmtui=true"
     "-Ddocs=true"
-    # TODO: legacy library, will be *removed* in next release!
-    "-Dlibnm_glib=true"
     "-Dtests=no"
     "-Dqt=false"
     # Allow using iwd when configured to do so
@@ -53,6 +51,15 @@ in stdenv.mkDerivation rec {
   ];
 
   patches = [
+    # 1.20.2 added a decorators.sh script but they forgot to distribute it (breaking the build)
+    # as it was to fix things with gtk-doc 1.32 we can safely revert it.
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/NetworkManager/NetworkManager/commit/2d941dc95a1d94d023ac8f98df2f344dbb1d223e.patch";
+      sha256 = "1mvbajddwd6diwk6dgjg5p65i6852gx6b9p3949rs63d2i6yzg21";
+      excludes = [ "tools/decorators.sh" ];
+      revert = true;
+    })
+
     (substituteAll {
       src = ./fix-paths.patch;
       inherit iputils kmod openconnect ethtool gnused dbus;
@@ -69,19 +76,17 @@ in stdenv.mkDerivation rec {
     bluez5 dnsmasq gobject-introspection modemmanager readline newt libsoup jansson
   ];
 
-  propagatedBuildInputs = [ dbus-glib gnutls libgcrypt ];
+  propagatedBuildInputs = [ gnutls libgcrypt ];
 
   nativeBuildInputs = [
     meson ninja intltool pkgconfig
-    vala gobject-introspection
-    dbus-glib # for dbus-binding-tool
+    vala gobject-introspection dbus
     # Docs
     gtk-doc libxslt docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_42 docbook_xml_dtd_43 pythonForDocs
   ];
 
   doCheck = false; # requires /sys, the net
 
-
   postPatch = ''
     patchShebangs ./tools
     patchShebangs libnm/generate-setting-docs.py
@@ -96,13 +101,6 @@ in stdenv.mkDerivation rec {
     ln -s $PWD/libnm/libnm.so.0 ${placeholder "out"}/lib/libnm.so.0
   '';
 
-  postInstall = ''
-    # Add the legacy service name from before #51382 to prevent NetworkManager
-    # from not starting back up:
-    # TODO: remove this once 19.10 is released
-    ln -s $out/etc/systemd/system/NetworkManager.service $out/etc/systemd/system/network-manager.service
-  '';
-
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
diff --git a/pkgs/tools/networking/network-manager/fix-install-paths.patch b/pkgs/tools/networking/network-manager/fix-install-paths.patch
index 068b9c8266b..5798c1edfb6 100644
--- a/pkgs/tools/networking/network-manager/fix-install-paths.patch
+++ b/pkgs/tools/networking/network-manager/fix-install-paths.patch
@@ -1,6 +1,8 @@
+diff --git a/meson.build b/meson.build
+index 4105a9c80..3d912557f 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -925,9 +925,9 @@
+@@ -884,9 +884,9 @@ meson.add_install_script(
    join_paths('tools', 'meson-post-install.sh'),
    nm_datadir,
    nm_bindir,
@@ -12,9 +14,11 @@
    enable_docs ? 'install_docs' : '',
    nm_mandir,
  )
+diff --git a/src/settings/plugins/ifcfg-rh/meson.build b/src/settings/plugins/ifcfg-rh/meson.build
+index 58acdcfcb..e3a16d597 100644
 --- a/src/settings/plugins/ifcfg-rh/meson.build
 +++ b/src/settings/plugins/ifcfg-rh/meson.build
-@@ -70,7 +70,7 @@
+@@ -69,7 +69,7 @@ install_data(
  )
  
  meson.add_install_script('sh', '-c',
diff --git a/pkgs/tools/networking/network-manager/fix-paths.patch b/pkgs/tools/networking/network-manager/fix-paths.patch
index 938fcbdc771..015c540c0ed 100644
--- a/pkgs/tools/networking/network-manager/fix-paths.patch
+++ b/pkgs/tools/networking/network-manager/fix-paths.patch
@@ -1,6 +1,8 @@
+diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c
+index 204b7c286..8bdb734c2 100644
 --- a/clients/common/nm-vpn-helpers.c
 +++ b/clients/common/nm-vpn-helpers.c
-@@ -214,10 +214,7 @@
+@@ -215,10 +215,7 @@ nm_vpn_openconnect_authenticate_helper (const char *host,
  		NULL,
  	};
  
@@ -10,21 +12,25 @@
 -		return FALSE;
 +	path = "@openconnect@/bin/openconnect";
  
- 	argv[0] = (char *) path;
- 	argv[1] = "--authenticate";
+ 	if (!g_spawn_sync (NULL,
+ 	                   (char **) NM_MAKE_STRV (path, "--authenticate", host),
+diff --git a/data/84-nm-drivers.rules b/data/84-nm-drivers.rules
+index e398cb9f2..31c56596a 100644
 --- a/data/84-nm-drivers.rules
 +++ b/data/84-nm-drivers.rules
-@@ -7,6 +7,6 @@
+@@ -7,6 +7,6 @@ ACTION!="add|change", GOTO="nm_drivers_end"
  # Determine ID_NET_DRIVER if there's no ID_NET_DRIVER or DRIVERS (old udev?)
  ENV{ID_NET_DRIVER}=="?*", GOTO="nm_drivers_end"
  DRIVERS=="?*", GOTO="nm_drivers_end"
--PROGRAM="/bin/sh -c 'ethtool -i $1 | sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
-+PROGRAM="@shell@ -c '@ethtool@/bin/ethtool -i $1 | @gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", RESULT=="?*", ENV{ID_NET_DRIVER}="%c"
+-PROGRAM="/bin/sh -c '/usr/sbin/ethtool -i $$1 |/usr/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c"
++PROGRAM="@shell@ -c '@ethtool@/bin/ethtool -i $$1 |@gnused@/bin/sed -n s/^driver:\ //p' -- $env{INTERFACE}", ENV{ID_NET_DRIVER}="%c"
  
  LABEL="nm_drivers_end"
+diff --git a/data/NetworkManager.service.in b/data/NetworkManager.service.in
+index 2f442bf23..c3e797bf4 100644
 --- a/data/NetworkManager.service.in
 +++ b/data/NetworkManager.service.in
-@@ -8,7 +8,7 @@
+@@ -8,7 +8,7 @@ Before=network.target @DISTRO_NETWORK_SERVICE@
  [Service]
  Type=dbus
  BusName=org.freedesktop.NetworkManager
@@ -33,9 +39,11 @@
  #ExecReload=/bin/kill -HUP $MAINPID
  ExecStart=@sbindir@/NetworkManager --no-daemon
  Restart=on-failure
+diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
+index 823cf48a5..cda16e48d 100644
 --- a/src/devices/nm-device.c
 +++ b/src/devices/nm-device.c
-@@ -12451,14 +12451,14 @@ nm_device_start_ip_check (NMDevice *self)
+@@ -12822,14 +12822,14 @@ nm_device_start_ip_check (NMDevice *self)
  			gw = nm_ip4_config_best_default_route_get (priv->ip_config_4);
  			if (gw) {
  				nm_utils_inet4_ntop (NMP_OBJECT_CAST_IP4_ROUTE (gw)->gateway, buf);
@@ -53,10 +61,10 @@
  			}
  		}
 diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
-index 6f55e62a7..93721e7fb 100644
+index d896d4d33..4cacb5cb6 100644
 --- a/src/nm-core-utils.c
 +++ b/src/nm-core-utils.c
-@@ -442,7 +442,7 @@ nm_utils_modprobe (GError **error, gboolean suppress_error_logging, const char *
+@@ -446,7 +446,7 @@ nm_utils_modprobe (GError **error, gboolean suppress_error_logging, const char *
  
  	/* construct the argument list */
  	argv = g_ptr_array_sized_new (4);
diff --git a/pkgs/tools/networking/network-manager/fortisslvpn/default.nix b/pkgs/tools/networking/network-manager/fortisslvpn/default.nix
index 7773548576b..dbf175d20c9 100644
--- a/pkgs/tools/networking/network-manager/fortisslvpn/default.nix
+++ b/pkgs/tools/networking/network-manager/fortisslvpn/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, substituteAll, openfortivpn, intltool, pkgconfig, file, gtk3,
-networkmanager, ppp, libsecret, withGnome ? true, gnome3 }:
+networkmanager, ppp, libsecret, withGnome ? true, gnome3, fetchpatch }:
 
 let
   pname = "NetworkManager-fortisslvpn";
@@ -17,6 +17,11 @@ in stdenv.mkDerivation {
       src = ./fix-paths.patch;
       inherit openfortivpn;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/NetworkManager-fortisslvpn/merge_requests/11.patch";
+      sha256 = "0l7l2r1njh62lh2pf497ibf99sgkvjsj58xr76qx3jxgq9zfw6n9";
+    })
   ];
 
   buildInputs = [ openfortivpn networkmanager ppp ]
diff --git a/pkgs/tools/networking/network-manager/iodine/default.nix b/pkgs/tools/networking/network-manager/iodine/default.nix
index 27e091b6b60..85bb29b3641 100644
--- a/pkgs/tools/networking/network-manager/iodine/default.nix
+++ b/pkgs/tools/networking/network-manager/iodine/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, substituteAll, iodine, intltool, pkgconfig, networkmanager, libsecret, gtk3
-, withGnome ? true, gnome3 }:
+, withGnome ? true, gnome3, fetchpatch }:
 
 let
   pname = "NetworkManager-iodine";
@@ -17,6 +17,11 @@ in stdenv.mkDerivation {
       src = ./fix-paths.patch;
       inherit iodine;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/network-manager-iodine/merge_requests/2.patch";
+      sha256 = "108pkf0mddj32s46k7jkmpwcaq2ylci4dqpp7wck3zm9q2jffff2";
+    })
   ];
 
   buildInputs = [ iodine networkmanager ]
diff --git a/pkgs/tools/networking/network-manager/openconnect/default.nix b/pkgs/tools/networking/network-manager/openconnect/default.nix
index 4236c9e1818..7db0e59beab 100644
--- a/pkgs/tools/networking/network-manager/openconnect/default.nix
+++ b/pkgs/tools/networking/network-manager/openconnect/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, substituteAll, openconnect, intltool, pkgconfig, autoreconfHook, networkmanager, gcr, libsecret, file
-, gtk3, withGnome ? true, gnome3, kmod }:
+, gtk3, withGnome ? true, gnome3, kmod, fetchpatch }:
 
 let
   pname   = "NetworkManager-openconnect";
@@ -17,6 +17,11 @@ in stdenv.mkDerivation {
       src = ./fix-paths.patch;
       inherit kmod openconnect;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/NetworkManager-openconnect/merge_requests/9.patch";
+      sha256 = "0yd2dmq6gq6y4czr7dqdgaiqvw2vyv2gikznpfdxyfn2v1pcrk9m";
+    })
   ];
 
   buildInputs = [ openconnect networkmanager ]
diff --git a/pkgs/tools/networking/network-manager/openvpn/default.nix b/pkgs/tools/networking/network-manager/openvpn/default.nix
index 04ec49f7b9b..bedc7875fb7 100644
--- a/pkgs/tools/networking/network-manager/openvpn/default.nix
+++ b/pkgs/tools/networking/network-manager/openvpn/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, substituteAll, openvpn, intltool, libxml2, pkgconfig, file, networkmanager, libsecret
-, gtk3, withGnome ? true, gnome3, kmod }:
+, gtk3, withGnome ? true, gnome3, kmod, fetchpatch }:
 
 let
   pname = "NetworkManager-openvpn";
@@ -17,6 +17,11 @@ in stdenv.mkDerivation {
       src = ./fix-paths.patch;
       inherit kmod openvpn;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/NetworkManager-openvpn/merge_requests/13.patch";
+      sha256 = "06cvqi28v72dd53fw8ix95mqj885xhwi8qcs2q7hvm5bvnhwn704";
+    })
   ];
 
   buildInputs = [ openvpn networkmanager ]
diff --git a/pkgs/tools/networking/network-manager/vpnc/default.nix b/pkgs/tools/networking/network-manager/vpnc/default.nix
index 1aa4cd5658b..af5b19eb5db 100644
--- a/pkgs/tools/networking/network-manager/vpnc/default.nix
+++ b/pkgs/tools/networking/network-manager/vpnc/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, substituteAll, vpnc, intltool, pkgconfig, networkmanager, libsecret
-, gtk3, withGnome ? true, gnome3, kmod, file }:
+, gtk3, withGnome ? true, gnome3, kmod, file, fetchpatch }:
 let
   pname = "NetworkManager-vpnc";
   version = "1.2.6";
@@ -16,6 +16,11 @@ in stdenv.mkDerivation {
       src = ./fix-paths.patch;
       inherit vpnc kmod;
     })
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/merge_requests/5.patch";
+      sha256 = "0z0x5vqmrsap3ynamhya7gh6c6k5grhj2vqpy76alnv9xns8dzi6";
+    })
   ];
 
   buildInputs = [ vpnc networkmanager ]
diff --git a/pkgs/tools/networking/openconnect/default.nix b/pkgs/tools/networking/openconnect/default.nix
index 7e614629484..7244653e493 100644
--- a/pkgs/tools/networking/openconnect/default.nix
+++ b/pkgs/tools/networking/openconnect/default.nix
@@ -4,13 +4,13 @@ assert (openssl != null) == (gnutls == null);
 
 stdenv.mkDerivation rec {
   pname = "openconnect";
-  version = "8.04";
+  version = "8.05";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.infradead.org/pub/openconnect/${pname}-${version}.tar.gz"
     ];
-    sha256 = "07zqcl2ykdc4mgix9sbv4jgpg7cybifxfgrycvf99ckq7xp9r5wq";
+    sha256 = "14i9q727c2zc9xhzp1a9hz3gzb5lwgsslbhircm84dnbs192jp1k";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/tools/networking/openresolv/default.nix b/pkgs/tools/networking/openresolv/default.nix
index 73cb98060a0..190c903d9c1 100644
--- a/pkgs/tools/networking/openresolv/default.nix
+++ b/pkgs/tools/networking/openresolv/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "openresolv";
-  version = "3.9.1";
+  version = "3.9.2";
 
   src = fetchurl {
     url = "mirror://roy/openresolv/${pname}-${version}.tar.xz";
-    sha256 = "1wlzi88837rf4ygswmzpbcmgkbbjhn5n322n9q6ir6x367hygf1q";
+    sha256 = "0wyk9sl1xgvxjvj1v3nlgs79nykdr0b76k5zp3v6cm9fd10y5mql";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/tools/networking/strongswan/default.nix b/pkgs/tools/networking/strongswan/default.nix
index 869e568d369..a2db62c884e 100644
--- a/pkgs/tools/networking/strongswan/default.nix
+++ b/pkgs/tools/networking/strongswan/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ stdenv, fetchurl, fetchpatch
 , pkgconfig, autoreconfHook
 , gmp, python, iptables, ldns, unbound, openssl, pcsclite
 , openresolv
@@ -38,6 +38,12 @@ stdenv.mkDerivation rec {
     ./ext_auth-path.patch
     ./firewall_defaults.patch
     ./updown-path.patch
+
+    # Don't use etc/dbus-1/system.d
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/strongswan/strongswan/pull/150.patch";
+      sha256 = "1irfxb99blb8v3hs0kmlhzkkwbmds1p0gq319z8lmacz36cgyj2c";
+    })
   ];
 
   postPatch = optionalString stdenv.isLinux ''
diff --git a/pkgs/tools/package-management/disnix/default.nix b/pkgs/tools/package-management/disnix/default.nix
index 50e071be29c..c9223c9af15 100644
--- a/pkgs/tools/package-management/disnix/default.nix
+++ b/pkgs/tools/package-management/disnix/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation {
     sha256 = "1kc4520zjc1z72mknylfvrsyda9rbmm5c9mw8w13zhdwg3zbna06";
   };
 
+  configureFlags = [
+    " --with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
+  ];
+
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ glib libxml2 libxslt getopt nixUnstable libintl libiconv dysnomia ];
 
diff --git a/pkgs/tools/package-management/packagekit/default.nix b/pkgs/tools/package-management/packagekit/default.nix
index a82f4400891..a3c3c0d40a9 100644
--- a/pkgs/tools/package-management/packagekit/default.nix
+++ b/pkgs/tools/package-management/packagekit/default.nix
@@ -39,8 +39,8 @@ stdenv.mkDerivation rec {
     "--disable-offline-update"
     "--localstatedir=/var"
     "--sysconfdir=/etc"
-    "--with-dbus-sys=$(out)/etc/dbus-1/system.d"
-    "--with-systemdsystemunitdir=$(out)/lib/systemd/system/"
+    "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
+    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system/"
   ]
   ++ lib.optional enableNixBackend "--enable-nix"
   ++ lib.optional (!enableBashCompletion) "--disable-bash-completion"
diff --git a/pkgs/tools/security/fprintd/default.nix b/pkgs/tools/security/fprintd/default.nix
index 84727f55b93..4f36dc30eed 100644
--- a/pkgs/tools/security/fprintd/default.nix
+++ b/pkgs/tools/security/fprintd/default.nix
@@ -1,6 +1,6 @@
 { thinkpad ? false
 , stdenv, fetchurl, pkgconfig, intltool, libfprint-thinkpad ? null
-, libfprint ? null, glib, dbus-glib, polkit, nss, pam, systemd }:
+, libfprint ? null, glib, dbus-glib, polkit, nss, pam, systemd, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "fprintd" + stdenv.lib.optionalString thinkpad "-thinkpad";
@@ -11,16 +11,23 @@ stdenv.mkDerivation rec {
     sha256 = "124s0g9syvglgsmqnavp2a8c0zcq8cyaph8p8iyvbla11vfizs9l";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/libfprint/fprintd/merge_requests/16.patch";
+      sha256 = "1y39zsmxjll9hip8464qwhq5qg06c13pnafyafgxdph75lvhdll7";
+    })
+  ];
+
   buildInputs = [ glib dbus-glib polkit nss pam systemd ]
     ++ stdenv.lib.optional thinkpad libfprint-thinkpad
     ++ stdenv.lib.optional (!thinkpad) libfprint;
 
   nativeBuildInputs = [ pkgconfig intltool ];
 
-  configureFlags = [ 
-    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" 
-    "--localstatedir=/var" 
-    "--sysconfdir=${placeholder "out"}/etc" 
+  configureFlags = [
+    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
+    "--localstatedir=/var"
+    "--sysconfdir=${placeholder "out"}/etc"
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/system/thermald/default.nix b/pkgs/tools/system/thermald/default.nix
index 3429419052f..8caff1170bc 100644
--- a/pkgs/tools/system/thermald/default.nix
+++ b/pkgs/tools/system/thermald/default.nix
@@ -23,9 +23,10 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-    "--sysconfdir=$(out)/etc" "--localstatedir=/var"
-    "--with-dbus-sys-dir=$(out)/etc/dbus-1/system.d"
-    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--sysconfdir=${placeholder "out"}/etc"
+    "--localstatedir=/var"
+    "--with-dbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
+    "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
     ];
 
   meta = with stdenv.lib; {