summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/doc/manual/release-notes/rl-1803.xml16
-rw-r--r--nixos/modules/misc/ids.nix4
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/databases/mysql.nix17
-rw-r--r--nixos/modules/services/games/ghost-one.nix105
-rw-r--r--pkgs/applications/audio/amarok/kf5.nix5
-rw-r--r--pkgs/applications/gis/grass/default.nix23
-rw-r--r--pkgs/applications/graphics/digikam/default.nix1
-rw-r--r--pkgs/applications/misc/deepin-terminal/default.nix8
-rw-r--r--pkgs/applications/misc/font-manager/default.nix7
-rw-r--r--pkgs/applications/misc/kupfer/default.nix7
-rw-r--r--pkgs/applications/misc/pdfpc/default.nix8
-rw-r--r--pkgs/applications/misc/synapse/default.nix8
-rw-r--r--pkgs/applications/misc/valauncher/default.nix10
-rw-r--r--pkgs/applications/office/kexi/default.nix4
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix2
-rw-r--r--pkgs/applications/video/kodi/default.nix2
-rw-r--r--pkgs/desktops/gnome-3/apps/gnome-characters/default.nix6
-rw-r--r--pkgs/desktops/gnome-3/core/eog/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gtksourceview/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gucharmap/default.nix11
-rw-r--r--pkgs/desktops/gnome-3/core/libpeas/default.nix6
-rw-r--r--pkgs/desktops/gnome-3/core/simple-scan/default.nix8
-rw-r--r--pkgs/desktops/gnome-3/misc/gspell/default.nix4
-rw-r--r--pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix8
-rw-r--r--pkgs/development/compilers/gerbil/default.nix6
-rw-r--r--pkgs/development/compilers/hhvm/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.7/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.8/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.9/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/4/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/5/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/default.nix10
-rw-r--r--pkgs/development/compilers/llvm/5/libc++/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/libc++abi.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/lld.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/lldb.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/llvm.nix2
-rw-r--r--pkgs/development/compilers/llvm/5/openmp.nix2
-rw-r--r--pkgs/development/compilers/neko/default.nix4
-rw-r--r--pkgs/development/compilers/urweb/default.nix6
-rw-r--r--pkgs/development/compilers/vala/default.nix24
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix2
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix2
-rw-r--r--pkgs/development/interpreters/php/default.nix7
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix17
-rw-r--r--pkgs/development/libraries/atk/default.nix4
-rw-r--r--pkgs/development/libraries/boost/1.65.nix2
-rw-r--r--pkgs/development/libraries/boost/1.66.nix14
-rw-r--r--pkgs/development/libraries/cppdb/default.nix6
-rw-r--r--pkgs/development/libraries/gdal/default.nix2
-rw-r--r--pkgs/development/libraries/gdal/gdal-1_11.nix4
-rw-r--r--pkgs/development/libraries/glibc/2.26-75to115.diff.gzbin0 -> 32865 bytes
-rw-r--r--pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch39
-rw-r--r--pkgs/development/libraries/glibc/common.nix22
-rw-r--r--pkgs/development/libraries/gtk+/2.x.nix4
-rw-r--r--pkgs/development/libraries/kdb/default.nix4
-rw-r--r--pkgs/development/libraries/libagar/default.nix5
-rw-r--r--pkgs/development/libraries/libassuan/default.nix4
-rw-r--r--pkgs/development/libraries/libdbi-drivers/default.nix18
-rw-r--r--pkgs/development/libraries/libdrm/default.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix4
-rw-r--r--pkgs/development/libraries/libnftnl/default.nix4
-rw-r--r--pkgs/development/libraries/librdf/redland.nix2
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/opendbx/default.nix6
-rw-r--r--pkgs/development/libraries/pcre/default.nix3
-rw-r--r--pkgs/development/libraries/pcre/stacksize-detection.patch16
-rw-r--r--pkgs/development/libraries/poco/default.nix5
-rw-r--r--pkgs/development/libraries/qt-3/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix2
-rw-r--r--pkgs/development/libraries/tntdb/default.nix2
-rw-r--r--pkgs/development/libraries/unixODBCDrivers/default.nix12
-rw-r--r--pkgs/development/libraries/wt/default.nix6
-rw-r--r--pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix6
-rw-r--r--pkgs/development/lisp-modules/shell.nix4
-rw-r--r--pkgs/development/ocaml-modules/mysql/default.nix11
-rw-r--r--pkgs/development/perl-modules/DBD-mysql/default.nix2
-rw-r--r--pkgs/development/pure-modules/glpk/default.nix6
-rw-r--r--pkgs/development/python-modules/jinja2/default.nix20
-rw-r--r--pkgs/development/r-modules/default.nix6
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix6
-rw-r--r--pkgs/development/tools/database/shmig/default.nix4
-rw-r--r--pkgs/development/tools/misc/d-feet/default.nix4
-rw-r--r--pkgs/development/tools/misc/sysbench/default.nix6
-rw-r--r--pkgs/development/tools/tora/default.nix4
-rw-r--r--pkgs/games/zod/default.nix6
-rw-r--r--pkgs/servers/clickhouse/default.nix9
-rw-r--r--pkgs/servers/computing/slurm/default.nix2
-rw-r--r--pkgs/servers/dns/powerdns/default.nix4
-rw-r--r--pkgs/servers/freeradius/default.nix6
-rw-r--r--pkgs/servers/games/ghost-one/default.nix55
-rw-r--r--pkgs/servers/http/lighttpd/default.nix2
-rw-r--r--pkgs/servers/mail/dovecot/default.nix4
-rw-r--r--pkgs/servers/mail/dspam/default.nix6
-rw-r--r--pkgs/servers/mail/opensmtpd/extras.nix10
-rw-r--r--pkgs/servers/mail/postfix/default.nix6
-rw-r--r--pkgs/servers/sql/mariadb/cmake-includedir.patch11
-rw-r--r--pkgs/servers/sql/mariadb/default.nix74
-rw-r--r--pkgs/servers/sql/mysql/5.5.x.nix12
-rw-r--r--pkgs/servers/sql/mysql/5.7.x.nix27
-rw-r--r--pkgs/servers/web-apps/frab/Gemfile.lock2
-rw-r--r--pkgs/servers/web-apps/frab/gemset.nix6
-rw-r--r--pkgs/servers/x11/xorg/default.nix6
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.7.list2
-rw-r--r--pkgs/stdenv/darwin/default.nix20
-rw-r--r--pkgs/tools/admin/ansible/2.1.nix9
-rw-r--r--pkgs/tools/admin/ansible/2.2.nix9
-rw-r--r--pkgs/tools/backup/bareos/default.nix8
-rw-r--r--pkgs/tools/backup/mydumper/default.nix4
-rw-r--r--pkgs/tools/misc/coreutils/default.nix4
-rw-r--r--pkgs/tools/networking/kea/default.nix4
-rw-r--r--pkgs/tools/networking/mailutils/default.nix21
-rw-r--r--pkgs/tools/networking/snabb/default.nix4
-rw-r--r--pkgs/tools/security/gnupg/22.nix4
-rw-r--r--pkgs/tools/security/thc-hydra/default.nix4
-rw-r--r--pkgs/tools/system/collectd/default.nix7
-rw-r--r--pkgs/tools/system/rsyslog/default.nix9
-rw-r--r--pkgs/tools/typesetting/tex/dblatex/default.nix4
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix14
-rw-r--r--pkgs/top-level/lua-packages.nix7
-rw-r--r--pkgs/top-level/python-packages.nix4
125 files changed, 570 insertions, 493 deletions
diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml
index 6329ec705821..fcad5bfff556 100644
--- a/nixos/doc/manual/release-notes/rl-1803.xml
+++ b/nixos/doc/manual/release-notes/rl-1803.xml
@@ -20,6 +20,22 @@ has the following highlights: </para>
 <itemizedlist>
   <listitem>
     <para>
+      MariaDB 10.2, updated from 10.1, is now the default MySQL implementation. While upgrading a few changes
+      have been made to the infrastructure involved:
+      <itemizedlist>
+        <listitem>
+          <para>
+            <literal>libmysql</literal> has been deprecated, please use <literal>mysql.connector-c</literal>
+            instead, a compatibility passthru has been added to the MySQL packages.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            The <literal>mysql57</literal> package has a new <literal>static</literal> output containing
+            the static libraries including <literal>libmysqld.a</literal>
+          </para>
+        </listitem>
+      </itemizedlist>
     </para>
   </listitem>
 </itemizedlist>
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix
index 678593a2d8b4..579a3f6393ce 100644
--- a/nixos/modules/misc/ids.nix
+++ b/nixos/modules/misc/ids.nix
@@ -65,7 +65,7 @@
       foldingathome = 37;
       sabnzbd = 38;
       #kdm = 39; # dropped in 17.03
-      ghostone = 40;
+      #ghostone = 40; # dropped in 18.03
       git = 41;
       fourstore = 42;
       fourstorehttp = 43;
@@ -348,7 +348,7 @@
       #foldingathome = 37; # unused
       #sabnzd = 38; # unused
       #kdm = 39; # unused, even before 17.03
-      ghostone = 40;
+      #ghostone = 40; # dropped in 18.03
       git = 41;
       fourstore = 42;
       fourstorehttp = 43;
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 405dc3823d52..ccc2a46456e8 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -220,7 +220,6 @@
   ./services/editors/emacs.nix
   ./services/editors/infinoted.nix
   ./services/games/factorio.nix
-  ./services/games/ghost-one.nix
   ./services/games/minecraft-server.nix
   ./services/games/minetest-server.nix
   ./services/games/terraria.nix
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index a3bf4f9ba925..36d5340a306f 100644
--- a/nixos/modules/services/databases/mysql.nix
+++ b/nixos/modules/services/databases/mysql.nix
@@ -7,14 +7,12 @@ let
   cfg = config.services.mysql;
 
   mysql = cfg.package;
-  
-  isMariaDB = 
+
+  isMariaDB =
     let
       pName = _p: (builtins.parseDrvName (_p.name)).name;
     in pName mysql == pName pkgs.mariadb;
 
-  atLeast55 = versionAtLeast mysql.mysqlVersion "5.5";
-
   pidFile = "${cfg.pidDir}/mysqld.pid";
 
   mysqldOptions =
@@ -28,13 +26,6 @@ let
     ${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
     ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
     ${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
-    ${optionalString (cfg.replication.role == "slave" && !atLeast55)
-    ''
-      master-host = ${cfg.replication.masterHost}
-      master-user = ${cfg.replication.masterUser}
-      master-password = ${cfg.replication.masterPassword}
-      master-port = ${toString cfg.replication.masterPort}
-    ''}
     ${optionalString (cfg.ensureUsers != [])
     ''
       plugin-load-add = auth_socket.so
@@ -315,7 +306,7 @@ in
                     fi
                   '') cfg.initialDatabases}
 
-                ${optionalString (cfg.replication.role == "master" && atLeast55)
+                ${optionalString (cfg.replication.role == "master")
                   ''
                     # Set up the replication master
 
@@ -326,7 +317,7 @@ in
                     ) | ${mysql}/bin/mysql -u root -N
                   ''}
 
-                ${optionalString (cfg.replication.role == "slave" && atLeast55)
+                ${optionalString (cfg.replication.role == "slave")
                   ''
                     # Set up the replication slave
 
diff --git a/nixos/modules/services/games/ghost-one.nix b/nixos/modules/services/games/ghost-one.nix
deleted file mode 100644
index 71ff6bb2f3f0..000000000000
--- a/nixos/modules/services/games/ghost-one.nix
+++ /dev/null
@@ -1,105 +0,0 @@
-{ config, lib, pkgs, ... }:
-with lib;
-let
-
-  cfg = config.services.ghostOne;
-  ghostUser = "ghostone";
-  stateDir = "/var/lib/ghost-one";
-
-in
-{
-
-  ###### interface
-
-  options = {
-    services.ghostOne = {
-
-      enable = mkOption {
-        default = false;
-        description = "Enable Ghost-One Warcraft3 game hosting server.";
-      };
-
-      language = mkOption {
-        default = "English";
-        type = types.enum [ "English" "Spanish" "Russian" "Serbian" "Turkish" ];
-        description = "The language of bot messages: English, Spanish, Russian, Serbian or Turkish.";
-      };
-
-      war3path = mkOption {
-        default = "";
-        description = ''
-          The path to your local Warcraft III directory, which must contain war3.exe, storm.dll, and game.dll.
-        '';
-      };
-
-      mappath = mkOption {
-        default = "";
-        description = ''
-          The path to the directory where you keep your map files. GHost One doesn't require
-          map files but if it has access to them it can send them to players and automatically
-          calculate most map config values. GHost One will search [bot_mappath + map_localpath]
-          for the map file (map_localpath is set in each map's config file).
-        '';
-      };
-
-      config = mkOption {
-        default = "";
-        description = "Extra configuration options.";
-      };
-
-    };
-  };
-
-  ###### implementation
-
-  config = mkIf cfg.enable {
-
-    users.extraUsers = singleton
-      { name = ghostUser;
-        uid = config.ids.uids.ghostone;
-        description = "Ghost One game server user";
-        home = stateDir;
-      };
-
-    users.extraGroups = singleton
-      { name = ghostUser;
-        gid = config.ids.gids.ghostone;
-      };
-
-    services.ghostOne.config = ''
-#      bot_log = /dev/stderr
-      bot_language = ${pkgs.ghostOne}/share/ghost-one/languages/${cfg.language}.cfg
-      bot_war3path = ${cfg.war3path}
-
-      bot_mapcfgpath = mapcfgs
-      bot_savegamepath = savegames
-      bot_mappath = ${cfg.mappath}
-      bot_replaypath = replays
-    '';
-
-    systemd.services."ghost-one" = {
-      wantedBy = [ "multi-user.target" ];
-      script = ''
-        mkdir -p ${stateDir}
-        cd ${stateDir}
-        chown ${ghostUser}:${ghostUser} .
-
-        mkdir -p mapcfgs
-        chown ${ghostUser}:${ghostUser} mapcfgs
-
-        mkdir -p replays
-        chown ${ghostUser}:${ghostUser} replays
-
-        mkdir -p savegames
-        chown ${ghostUser}:${ghostUser} savegames
-
-        ln -sf ${pkgs.writeText "ghost.cfg" cfg.config} ghost.cfg
-        ln -sf ${pkgs.ghostOne}/share/ghost-one/ip-to-country.csv
-        ${pkgs.su}/bin/su -s ${pkgs.stdenv.shell} ${ghostUser} \
-          -c "LANG=C ${pkgs.ghostOne}/bin/ghost++"
-      '';
-    };
-
-  };
-
-}
diff --git a/pkgs/applications/audio/amarok/kf5.nix b/pkgs/applications/audio/amarok/kf5.nix
index a96aa3ed65d0..a4ac2943bfbc 100644
--- a/pkgs/applications/audio/amarok/kf5.nix
+++ b/pkgs/applications/audio/amarok/kf5.nix
@@ -3,7 +3,7 @@
 , qca-qt5, qjson, qtscript, qtwebkit
 , kcmutils, kconfig, kdelibs4support, kdnssd, kinit, knewstuff, knotifyconfig, ktexteditor
 , phonon, plasma-framework, threadweaver
-, curl, ffmpeg, gdk_pixbuf, libaio, libmtp, loudmouth, lzo, lz4, mariadb, pcre, snappy, taglib, taglib_extras
+, curl, ffmpeg, gdk_pixbuf, libaio, libmtp, loudmouth, lzo, lz4, mysql57, pcre, snappy, taglib, taglib_extras
 }:
 
 let
@@ -26,7 +26,8 @@ in mkDerivation {
     qca-qt5 qjson qtscript qtwebkit
     kcmutils kconfig kdelibs4support kdnssd kinit knewstuff knotifyconfig ktexteditor
     phonon plasma-framework threadweaver
-    curl ffmpeg gdk_pixbuf libaio libmtp loudmouth lz4 lzo mariadb pcre snappy taglib taglib_extras
+    curl ffmpeg gdk_pixbuf libaio libmtp loudmouth lz4 lzo mysql57.server mysql57.server.static
+    pcre snappy taglib taglib_extras
   ];
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix
index 3382bb3e56d7..987b544c5565 100644
--- a/pkgs/applications/gis/grass/default.nix
+++ b/pkgs/applications/gis/grass/default.nix
@@ -4,15 +4,15 @@
 }:
 
 stdenv.mkDerivation {
-  name = "grass-7.0.2";
+  name = "grass-7.2.2";
   src = fetchurl {
-    url = http://grass.osgeo.org/grass70/source/grass-7.0.2.tar.gz;
-    sha256 = "02qrdgn46gxr60amxwax4b8fkkmhmjxi6qh4yfvpbii6ai6diarf";
+    url = http://grass.osgeo.org/grass72/source/grass-7.2.2.tar.gz;
+    sha256 = "0yzljbrxlqp4wbw08n1dvmm4vmwkg8glf1ff4xyh589r5ryb7gxv";
   };
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ flex bison zlib proj gdal libtiff libpng fftw sqlite cairo
-  readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.client blas ]
+  readline ffmpeg makeWrapper wxGTK30 netcdf geos postgresql mysql.connector-c blas ]
     ++ (with python2Packages; [ python dateutil wxPython30 numpy ]);
 
   configureFlags = [
@@ -22,9 +22,12 @@ stdenv.mkDerivation {
     "--with-wxwidgets"
     "--with-netcdf"
     "--with-geos"
-    "--with-postgres" "--with-postgres-libs=${postgresql.lib}/lib/"
+    "--with-postgres"
+    "--with-postgres-libs=${postgresql.lib}/lib/"
     # it complains about missing libmysqld but doesn't really seem to need it
-    "--with-mysql" "--with-mysql-includes=${stdenv.lib.getDev mysql.client}/include/mysql"
+    "--with-mysql"
+    "--with-mysql-includes=${mysql.connector-c}/include/mysql"
+    "--with-mysql-libs=${mysql.connector-c}/lib/mysql"
     "--with-blas"
   ];
 
@@ -40,17 +43,20 @@ stdenv.mkDerivation {
       scripts/r.pack/r.pack.py \
       scripts/r.tileset/r.tileset.py \
       scripts/r.unpack/r.unpack.py \
-      scripts/v.krige/v.krige.py \
       scripts/v.rast.stats/v.rast.stats.py \
       scripts/v.to.lines/v.to.lines.py \
       scripts/v.what.strds/v.what.strds.py \
       scripts/v.unpack/v.unpack.py \
       scripts/wxpyimgview/*.py \
       gui/wxpython/animation/g.gui.animation.py \
+      gui/wxpython/datacatalog/g.gui.datacatalog.py \
       gui/wxpython/rlisetup/g.gui.rlisetup.py \
       gui/wxpython/vdigit/g.gui.vdigit.py \
       temporal/t.rast.accumulate/t.rast.accumulate.py \
       temporal/t.rast.accdetect/t.rast.accdetect.py \
+      temporal/t.rast.algebra/t.rast.algebra.py \
+      temporal/t.rast3d.algebra/t.rast3d.algebra.py \
+      temporal/t.vect.algebra/t.vect.algebra.py \
       temporal/t.select/t.select.py
     for d in gui lib scripts temporal tools; do
       patchShebangs $d
@@ -58,7 +64,7 @@ stdenv.mkDerivation {
   '';
 
   postInstall = ''
-    wrapProgram $out/bin/grass70 \
+    wrapProgram $out/bin/grass72 \
     --set PYTHONPATH $PYTHONPATH \
     --set GRASS_PYTHON ${python2Packages.python}/bin/${python2Packages.python.executable} \
     --suffix LD_LIBRARY_PATH ':' '${gdal}/lib'
@@ -72,6 +78,5 @@ stdenv.mkDerivation {
     description = "GIS software suite used for geospatial data management and analysis, image processing, graphics and maps production, spatial modeling, and visualization";
     license = stdenv.lib.licenses.gpl2Plus;
     platforms = stdenv.lib.platforms.all;
-    broken = true;
   };
 }
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index c955a61d3696..9a26dcdaa6a0 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -75,7 +75,6 @@ mkDerivation rec {
     libqtav
     libusb1
     mesa
-    mysql
     opencv3
     pcre
 
diff --git a/pkgs/applications/misc/deepin-terminal/default.nix b/pkgs/applications/misc/deepin-terminal/default.nix
index e08a2827b83a..12ceb0958f0d 100644
--- a/pkgs/applications/misc/deepin-terminal/default.nix
+++ b/pkgs/applications/misc/deepin-terminal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchFromGitHub, pkgconfig, gtk3, vala, cmake, vte, libgee, wnck, zssh, gettext, librsvg, libsecret, json_glib }:
+{ stdenv, fetchurl, fetchFromGitHub, pkgconfig, gtk3, vala, cmake, vte, libgee, wnck, zssh, gettext, librsvg, libsecret, json_glib, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   name = "deepin-terminal-${version}";
@@ -25,7 +25,11 @@ stdenv.mkDerivation rec {
     substituteInPlace ssh_login.sh --replace /usr/lib/deepin-terminal/zssh "${zssh}/bin/zssh"
   '';
 
-  nativeBuildInputs = [ pkgconfig vala cmake gettext ];
+  nativeBuildInputs = [
+    pkgconfig vala cmake gettext
+    # For setup hook
+    gobjectIntrospection
+  ];
   buildInputs = [ gtk3 vte libgee wnck librsvg libsecret json_glib ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/misc/font-manager/default.nix b/pkgs/applications/misc/font-manager/default.nix
index 6d67d3a340f5..8c63c8565781 100644
--- a/pkgs/applications/misc/font-manager/default.nix
+++ b/pkgs/applications/misc/font-manager/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, makeWrapper, automake, autoconf, libtool,
+{ stdenv, fetchFromGitHub, automake, autoconf, libtool,
   pkgconfig, file, intltool, libxml2, json_glib , sqlite, itstool,
-  librsvg, vala_0_34, gnome3, wrapGAppsHook
+  librsvg, vala_0_34, gnome3, wrapGAppsHook, gobjectIntrospection
 }:
 
 stdenv.mkDerivation rec {
@@ -15,7 +15,6 @@ stdenv.mkDerivation rec {
     };
 
   nativeBuildInputs = [
-    makeWrapper
     pkgconfig
     automake autoconf libtool
     file
@@ -23,6 +22,8 @@ stdenv.mkDerivation rec {
     vala_0_34
     gnome3.yelp_tools
     wrapGAppsHook
+    # For setup hook
+    gobjectIntrospection
   ];
 
   buildInputs = [
diff --git a/pkgs/applications/misc/kupfer/default.nix b/pkgs/applications/misc/kupfer/default.nix
index f3bb825cbf74..e2290105c925 100644
--- a/pkgs/applications/misc/kupfer/default.nix
+++ b/pkgs/applications/misc/kupfer/default.nix
@@ -3,6 +3,7 @@
 , fetchurl
 , intltool
 , python3Packages
+, gobjectIntrospection
 , gtk3
 , dbus
 , libwnck3
@@ -22,7 +23,11 @@ buildPythonApplication rec {
     sha256 = "0c9xjx13r8ckfr4az116bhxsd3pk78v04c3lz6lqhraak0rp4d92";
   };
 
-  nativeBuildInputs = [ wrapGAppsHook intltool ];
+  nativeBuildInputs = [
+    wrapGAppsHook intltool
+    # For setup hook
+    gobjectIntrospection
+  ];
   buildInputs = [ hicolor_icon_theme docutils libwnck3 keybinder3 ];
   propagatedBuildInputs = [ pygobject3 gtk3 pyxdg dbus-python pycairo ];
 
diff --git a/pkgs/applications/misc/pdfpc/default.nix b/pkgs/applications/misc/pdfpc/default.nix
index 8e0fc6137210..9fc14d0cae71 100644
--- a/pkgs/applications/misc/pdfpc/default.nix
+++ b/pkgs/applications/misc/pdfpc/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, cmake, makeWrapper, pkgconfig, vala, gtk3, libgee
-, poppler, libpthreadstubs, gstreamer, gst-plugins-base, librsvg, pcre }:
+, poppler, libpthreadstubs, gstreamer, gst-plugins-base, librsvg, pcre, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   name = "${product}-${version}";
@@ -13,7 +13,11 @@ stdenv.mkDerivation rec {
     sha256 = "00qfmmk8h762p53z46g976z7j4fbxyi16w5axzsv1ymvdq95ds8c";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig vala ];
+  nativeBuildInputs = [
+    cmake pkgconfig vala
+    # For setup hook
+    gobjectIntrospection
+  ];
   buildInputs = [ gstreamer gst-plugins-base gtk3 libgee poppler
     libpthreadstubs makeWrapper librsvg pcre ];
 
diff --git a/pkgs/applications/misc/synapse/default.nix b/pkgs/applications/misc/synapse/default.nix
index 04f38968142a..13f3fa98d56d 100644
--- a/pkgs/applications/misc/synapse/default.nix
+++ b/pkgs/applications/misc/synapse/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, intltool, pkgconfig, glib, libnotify, gtk3, libgee
-, keybinder3, json_glib, zeitgeist, vala_0_34, hicolor_icon_theme
+, keybinder3, json_glib, zeitgeist, vala_0_34, hicolor_icon_theme, gobjectIntrospection
 }:
 
 let
@@ -12,7 +12,11 @@ in stdenv.mkDerivation rec {
     sha256 = "04cnsmwf9xa52dh7rpb4ia715c0ls8jg1p7llc9yf3lbg1m0bvzv";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool vala_0_34 ];
+  nativeBuildInputs = [
+    pkgconfig intltool vala_0_34
+    # For setup hook
+    gobjectIntrospection
+  ];
   buildInputs = [
     glib libnotify gtk3 libgee keybinder3 json_glib zeitgeist
     hicolor_icon_theme
diff --git a/pkgs/applications/misc/valauncher/default.nix b/pkgs/applications/misc/valauncher/default.nix
index f780e5469d02..38c4055a10bb 100644
--- a/pkgs/applications/misc/valauncher/default.nix
+++ b/pkgs/applications/misc/valauncher/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, gtk3, vala, pkgconfig, gnome3 }:
+{ stdenv, fetchFromGitHub, cmake, gtk3, vala, pkgconfig, gnome3, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   version = "1.3.1";
@@ -11,8 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "18969v870737jg1q0l3d05pb9mxsrcpdi0mnyz94rwkspszvxxqi";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake gtk3 vala gnome3.libgee ];
+  nativeBuildInputs = [
+    cmake vala pkgconfig
+    # For setup hook
+    gobjectIntrospection
+  ];
+  buildInputs = [ gtk3 gnome3.libgee ];
 
   meta = with stdenv.lib; {
       description = "A fast dmenu-like gtk3 application launcher";
diff --git a/pkgs/applications/office/kexi/default.nix b/pkgs/applications/office/kexi/default.nix
index 66aee6bd9628..8463703c0179 100644
--- a/pkgs/applications/office/kexi/default.nix
+++ b/pkgs/applications/office/kexi/default.nix
@@ -4,7 +4,7 @@
   breeze-icons, karchive, kcodecs, kcompletion, kconfig, kconfigwidgets, kcoreaddons,
   kcrash, kguiaddons, ki18n, kiconthemes, kitemviews, kio, ktexteditor, ktextwidgets,
   kwidgetsaddons, kxmlgui,
-  kdb, kproperty, kreport, lcms2, libmysql, marble, postgresql
+  kdb, kproperty, kreport, lcms2, mysql, marble, postgresql
 }:
 
 mkDerivation rec {
@@ -24,7 +24,7 @@ mkDerivation rec {
     breeze-icons karchive kcodecs kcompletion kconfig kconfigwidgets kcoreaddons
     kcrash kguiaddons ki18n kiconthemes kitemviews kio ktexteditor ktextwidgets
     kwidgetsaddons kxmlgui
-    kdb kproperty kreport lcms2 libmysql marble postgresql
+    kdb kproperty kreport lcms2 mysql.connector-c marble postgresql
   ];
 
   propagatedUserEnvPkgs = [ kproperty ];
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index 3e4c8c702869..67dcfd8dc1de 100644
--- a/pkgs/applications/science/math/glsurf/default.nix
+++ b/pkgs/applications/science/math/glsurf/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
   };
 
-  buildInputs = [ freeglut mesa mysql.lib mpfr gmp
+  buildInputs = [ freeglut mesa mysql.connector-c mpfr gmp
     libtiff libjpeg libpng giflib ]
   ++ (with ocamlPackages; [
     ocaml findlib ocaml_mysql lablgl camlimages_4_0 mlgmpidl
diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix
index 125a6d492a32..28577a429bd2 100644
--- a/pkgs/applications/video/kodi/default.nix
+++ b/pkgs/applications/video/kodi/default.nix
@@ -130,7 +130,7 @@ in stdenv.mkDerivation rec {
       libmpeg2 libsamplerate libmad
       libogg libvorbis flac libxslt systemd
       lzo libcdio libmodplug libass libbluray
-      sqlite mysql.lib avahi lame
+      sqlite mysql.connector-c avahi lame
       curl bzip2 zip unzip glxinfo xdpyinfo
       libcec libcec_platform dcadec libuuid
       libgcrypt libgpgerror libunistring
diff --git a/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix b/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix
index 15f1f58b558c..a354c4f6316e 100644
--- a/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix
+++ b/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, pkgconfig, gnome3, gtk3, wrapGAppsHook
-, intltool, gjs, gdk_pixbuf, librsvg }:
+, intltool, gobjectIntrospection, gjs, gdk_pixbuf, librsvg }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig wrapGAppsHook intltool ];
   buildInputs = [
-    gtk3 wrapGAppsHook intltool gjs gdk_pixbuf
+    gtk3 gjs gdk_pixbuf gobjectIntrospection
     librsvg gnome3.gsettings_desktop_schemas gnome3.defaultIconTheme
   ];
 
diff --git a/pkgs/desktops/gnome-3/core/eog/default.nix b/pkgs/desktops/gnome-3/core/eog/default.nix
index 49ad25a8c5e7..ae0abfd71502 100644
--- a/pkgs/desktops/gnome-3/core/eog/default.nix
+++ b/pkgs/desktops/gnome-3/core/eog/default.nix
@@ -1,10 +1,10 @@
 { fetchurl, stdenv, gettext, pkgconfig, itstool, libxml2, libjpeg, gnome3
-, shared_mime_info, wrapGAppsHook, librsvg, libexif }:
+, shared_mime_info, wrapGAppsHook, librsvg, libexif, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
-  nativeBuildInputs = [ pkgconfig gettext itstool wrapGAppsHook ];
+  nativeBuildInputs = [ pkgconfig gettext itstool wrapGAppsHook gobjectIntrospection ];
 
   buildInputs = with gnome3;
     [ libxml2 libjpeg gtk glib libpeas librsvg
diff --git a/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix b/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix
index 9eaad021d320..3dbb4e32654f 100644
--- a/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, gnome3, meson, ninja, pkgconfig, gtk3, intltool, glib
-, udev, itstool, libxml2, wrapGAppsHook, libnotify, libcanberra_gtk3 }:
+, udev, itstool, libxml2, wrapGAppsHook, libnotify, libcanberra_gtk3, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
-  nativeBuildInputs = [ meson ninja intltool itstool pkgconfig libxml2 wrapGAppsHook ];
+  nativeBuildInputs = [ meson ninja intltool itstool pkgconfig libxml2 wrapGAppsHook gobjectIntrospection ];
   buildInputs = [ glib gtk3 udev libnotify libcanberra_gtk3
                   gnome3.defaultIconTheme gnome3.gsettings_desktop_schemas ];
 
diff --git a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
index 363cf1a0c4ac..ca63cbd6cb89 100644
--- a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
+++ b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango
-, libxml2, perl, intltool, gettext, gnome3, dbus, xvfb_run, shared_mime_info }:
+, libxml2, perl, intltool, gettext, gnome3, gobjectIntrospection, dbus, xvfb_run, shared_mime_info }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig intltool gettext perl ]
+  nativeBuildInputs = [ pkgconfig intltool gettext perl gobjectIntrospection ]
     ++ stdenv.lib.optionals doCheck checkInputs;
   buildInputs = [ atk cairo glib pango libxml2 ];
   checkInputs = [ xvfb_run dbus ];
diff --git a/pkgs/desktops/gnome-3/core/gucharmap/default.nix b/pkgs/desktops/gnome-3/core/gucharmap/default.nix
index 58d9901ad012..731ff7e2688e 100644
--- a/pkgs/desktops/gnome-3/core/gucharmap/default.nix
+++ b/pkgs/desktops/gnome-3/core/gucharmap/default.nix
@@ -1,7 +1,7 @@
 { stdenv, intltool, fetchurl, pkgconfig, gtk3
 , glib, desktop_file_utils, bash, appdata-tools
 , wrapGAppsHook, gnome3, itstool, libxml2
-, callPackage, unzip }:
+, callPackage, unzip, gobjectIntrospection }:
 
 # TODO: icons and theme still does not work
 # use packaged gnome3.adwaita-icon-theme
@@ -15,11 +15,12 @@ stdenv.mkDerivation rec {
 
   preConfigure = "patchShebangs gucharmap/gen-guch-unicode-tables.pl";
 
-  nativeBuildInputs = [ pkgconfig wrapGAppsHook unzip ];
+  nativeBuildInputs = [
+    pkgconfig wrapGAppsHook unzip intltool itstool appdata-tools
+    gnome3.yelp_tools libxml2 desktop_file_utils gobjectIntrospection
+  ];
 
-  buildInputs = [ gtk3 intltool itstool glib appdata-tools
-                  gnome3.yelp_tools libxml2 desktop_file_utils
-                  gnome3.gsettings_desktop_schemas ];
+  buildInputs = [ gtk3 glib gnome3.gsettings_desktop_schemas ];
 
   unicode-data = callPackage ./unicode-data.nix {};
 
diff --git a/pkgs/desktops/gnome-3/core/libpeas/default.nix b/pkgs/desktops/gnome-3/core/libpeas/default.nix
index 8fddd8f7d5a6..998a1a02b3f9 100644
--- a/pkgs/desktops/gnome-3/core/libpeas/default.nix
+++ b/pkgs/desktops/gnome-3/core/libpeas/default.nix
@@ -8,7 +8,11 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--enable-python3" ];
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs =  [ intltool glib gtk3 gnome3.defaultIconTheme ncurses python3Packages.python python3Packages.pygobject3 gobjectIntrospection ];
+  buildInputs =  [ intltool glib gtk3 gnome3.defaultIconTheme ncurses python3Packages.python python3Packages.pygobject3 ];
+  propagatedBuildInputs = [
+    # Required by libpeas-1.0.pc
+    gobjectIntrospection
+  ];
 
   meta = with stdenv.lib; {
     description = "A GObject-based plugins engine";
diff --git a/pkgs/desktops/gnome-3/core/simple-scan/default.nix b/pkgs/desktops/gnome-3/core/simple-scan/default.nix
index 27a1e4b0be5b..a30467c1862d 100644
--- a/pkgs/desktops/gnome-3/core/simple-scan/default.nix
+++ b/pkgs/desktops/gnome-3/core/simple-scan/default.nix
@@ -1,13 +1,17 @@
 { stdenv, fetchurl, meson, ninja, pkgconfig, gettext, itstool, wrapGAppsHook
 , cairo, gdk_pixbuf, colord, glib, gtk, gusb, packagekit, libwebp
-, libxml2, sane-backends, vala, gnome3 }:
+, libxml2, sane-backends, vala, gnome3, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
   buildInputs = [ cairo gdk_pixbuf colord glib gnome3.defaultIconTheme gusb
                 gtk libwebp packagekit sane-backends vala ];
-  nativeBuildInputs = [ meson ninja gettext itstool pkgconfig wrapGAppsHook libxml2 ];
+  nativeBuildInputs = [
+    meson ninja gettext itstool pkgconfig wrapGAppsHook libxml2
+    # For setup hook
+    gobjectIntrospection
+  ];
 
   postPatch = ''
     patchShebangs data/meson_compile_gschema.py
diff --git a/pkgs/desktops/gnome-3/misc/gspell/default.nix b/pkgs/desktops/gnome-3/misc/gspell/default.nix
index e8c299685f70..2bbf219e3f3a 100644
--- a/pkgs/desktops/gnome-3/misc/gspell/default.nix
+++ b/pkgs/desktops/gnome-3/misc/gspell/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, glib, gtk3, enchant, isocodes, vala }:
+{ stdenv, fetchurl, pkgconfig, glib, gtk3, enchant, isocodes, vala, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
   propagatedBuildInputs = [ enchant ]; # required for pkgconfig
 
-  nativeBuildInputs = [ pkgconfig vala ];
+  nativeBuildInputs = [ pkgconfig vala gobjectIntrospection ];
   buildInputs = [ glib gtk3 isocodes ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix b/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix
index b7c27ec3d0a9..13a34f90fcdd 100644
--- a/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix
+++ b/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, cmake, vala_0_38, pkgconfig, glib, gtk3, granite, gnome3, libnotify, gettext, makeWrapper }:
+{ stdenv, fetchurl, perl, cmake, vala_0_38, pkgconfig, glib, gtk3, granite, gnome3, libnotify, gettext, makeWrapper, gobjectIntrospection }:
 
 stdenv.mkDerivation rec {
   majorVersion = "0.4";
@@ -20,7 +20,11 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  nativeBuildInputs = [ perl cmake vala_0_38 pkgconfig makeWrapper ];
+  nativeBuildInputs = [
+    perl cmake vala_0_38 pkgconfig makeWrapper
+    # For setup hook
+    gobjectIntrospection
+  ];
   buildInputs = with gnome3; [
     glib gtk3 granite libnotify gettext vte_290 libgee
     gsettings_desktop_schemas defaultIconTheme
diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix
index 622107c75345..23089ddda4e8 100644
--- a/pkgs/development/compilers/gerbil/default.nix
+++ b/pkgs/development/compilers/gerbil/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, fetchgit, gambit,
   coreutils, rsync, bash,
-  openssl, zlib, sqlite, libxml2, libyaml, libmysql, lmdb, leveldb }:
+  openssl, zlib, sqlite, libxml2, libyaml, mysql, lmdb, leveldb }:
 
 # TODO: distinct packages for gerbil-release and gerbil-devel
 
@@ -17,9 +17,11 @@ stdenv.mkDerivation rec {
   buildInputs = [
     gambit
     coreutils rsync bash
-    openssl zlib sqlite libxml2 libyaml libmysql lmdb leveldb
+    openssl zlib sqlite libxml2 libyaml mysql.connector-c lmdb leveldb
   ];
 
+  NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ];
+
   postPatch = ''
     echo '(define (gerbil-version-string) "v${version}")' > src/gerbil/runtime/gx-version.scm
 
diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix
index 2f84387a8888..a66b2264f073 100644
--- a/pkgs/development/compilers/hhvm/default.nix
+++ b/pkgs/development/compilers/hhvm/default.nix
@@ -2,7 +2,7 @@
 , pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php
 , expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
 , bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
-, libxslt, freetype, gdb, git, perl, mariadb, gmp, libyaml, libedit
+, libxslt, freetype, gdb, git, perl, mysql, gmp, libyaml, libedit
 , libvpx, imagemagick, fribidi, gperf, which, ocamlPackages
 }:
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ cmake pkgconfig boost libunwind mariadb.client libmemcached pcre gdb git perl
+    [ cmake pkgconfig boost libunwind mysql.connector-c libmemcached pcre gdb git perl
       libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
       oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
       libelf uwimap binutils cyrus_sasl pam glog libpng libxslt libkrb5
diff --git a/pkgs/development/compilers/llvm/3.7/default.nix b/pkgs/development/compilers/llvm/3.7/default.nix
index 35af978216c6..5cac04c044de 100644
--- a/pkgs/development/compilers/llvm/3.7/default.nix
+++ b/pkgs/development/compilers/llvm/3.7/default.nix
@@ -44,15 +44,11 @@ let
     stdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.clang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     libcxxStdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.libcxxClang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     lldb = callPackage ./lldb.nix {};
diff --git a/pkgs/development/compilers/llvm/3.8/default.nix b/pkgs/development/compilers/llvm/3.8/default.nix
index bd79db012a63..a660d4aea5fd 100644
--- a/pkgs/development/compilers/llvm/3.8/default.nix
+++ b/pkgs/development/compilers/llvm/3.8/default.nix
@@ -41,15 +41,11 @@ let
     stdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.clang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     libcxxStdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.libcxxClang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     lldb = callPackage ./lldb.nix {};
diff --git a/pkgs/development/compilers/llvm/3.9/default.nix b/pkgs/development/compilers/llvm/3.9/default.nix
index 5ce51bc9c122..c58adc3f92da 100644
--- a/pkgs/development/compilers/llvm/3.9/default.nix
+++ b/pkgs/development/compilers/llvm/3.9/default.nix
@@ -41,15 +41,11 @@ let
     stdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.clang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     libcxxStdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.libcxxClang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     lldb = callPackage ./lldb.nix {};
diff --git a/pkgs/development/compilers/llvm/4/default.nix b/pkgs/development/compilers/llvm/4/default.nix
index fa61a6c22e71..5a44cb868253 100644
--- a/pkgs/development/compilers/llvm/4/default.nix
+++ b/pkgs/development/compilers/llvm/4/default.nix
@@ -56,15 +56,11 @@ let
     stdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.clang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     libcxxStdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.libcxxClang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     lld = callPackage ./lld.nix {};
diff --git a/pkgs/development/compilers/llvm/5/clang/default.nix b/pkgs/development/compilers/llvm/5/clang/default.nix
index fa8502ebd67a..b003d2f334ac 100644
--- a/pkgs/development/compilers/llvm/5/clang/default.nix
+++ b/pkgs/development/compilers/llvm/5/clang/default.nix
@@ -9,7 +9,7 @@ let
     name = "clang-${version}";
 
     unpackPhase = ''
-      unpackFile ${fetch "cfe" "0w09s8fn3lkn6i04nj0cisgp821r815fk5b5fjn97xrd371277q1"}
+      unpackFile ${fetch "cfe" "1zyh4dggxd55lnfg73c8fybnkssqcaa6bq2h4bzimnnj1jdnqpqk"}
       mv cfe-${version}* clang
       sourceRoot=$PWD/clang
       unpackFile ${clang-tools-extra_src}
diff --git a/pkgs/development/compilers/llvm/5/default.nix b/pkgs/development/compilers/llvm/5/default.nix
index 9891f3090ac1..a7e16c08ce96 100644
--- a/pkgs/development/compilers/llvm/5/default.nix
+++ b/pkgs/development/compilers/llvm/5/default.nix
@@ -6,7 +6,7 @@
 let
   callPackage = newScope (self // { inherit stdenv cmake libxml2 python2 isl release_version version fetch; });
 
-  release_version = "5.0.0";
+  release_version = "5.0.1";
   version = release_version; # differentiating these is important for rc's
 
   fetch = name: sha256: fetchurl {
@@ -14,8 +14,8 @@ let
     inherit sha256;
   };
 
-  compiler-rt_src = fetch "compiler-rt" "1cy0y389zxn7mk8vffqvfirk9bbcbc8ziwc1nf1a8d118rk55bfm";
-  clang-tools-extra_src = fetch "clang-tools-extra" "1ikkv6k8cfgpjqlm24iqz52i5nyafzsc4dyikzzyb9n4b6wpil47";
+  compiler-rt_src = fetch "compiler-rt" "1nlmm0b3wpdwxkldqp1klzv3rpqf94q2a248xgqb7aapyhbi9paf";
+  clang-tools-extra_src = fetch "clang-tools-extra" "09fjii7w43kvxvsxxs6gig9vz95vnvx1779rqd36h8kksvws3bcs";
 
   # Add man output without introducing extra dependencies.
   overrideManOutput = drv:
@@ -56,15 +56,11 @@ let
     stdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.clang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     libcxxStdenv = stdenv.override (drv: {
       allowedRequisites = null;
       cc = self.libcxxClang;
-      # Don't include the libc++ and libc++abi from the original stdenv.
-      extraBuildInputs = stdenv.lib.optional stdenv.isDarwin darwin.CF;
     });
 
     lld = callPackage ./lld.nix {};
diff --git a/pkgs/development/compilers/llvm/5/libc++/default.nix b/pkgs/development/compilers/llvm/5/libc++/default.nix
index 036161f7b889..6f03e225ad65 100644
--- a/pkgs/development/compilers/llvm/5/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/5/libc++/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libc++-${version}";
 
-  src = fetch "libcxx" "1cf953msb0vwgjjrapw06950dnsdb2ps305czkn0vvr1k8g9irga";
+  src = fetch "libcxx" "003wwniwlikgh38cbqbcshc5gkiv3a2jkmbn6am9s46y5gfrk3zs";
 
   postUnpack = ''
     unpackFile ${libcxxabi.src}
diff --git a/pkgs/development/compilers/llvm/5/libc++abi.nix b/pkgs/development/compilers/llvm/5/libc++abi.nix
index 5a2a269345d6..166f4260291f 100644
--- a/pkgs/development/compilers/llvm/5/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/5/libc++abi.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "libc++abi-${version}";
 
-  src = fetch "libcxxabi" "04c9dfmrr8diih73x0wq99dk9xb99mg0bvsnbhx5q912xg3ihs8p";
+  src = fetch "libcxxabi" "0m78yr4arlz2b9m96xcygk15m2pbz8i10snk78i3q7pjnwn1a9as";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
diff --git a/pkgs/development/compilers/llvm/5/lld.nix b/pkgs/development/compilers/llvm/5/lld.nix
index f19a9afc8044..1d00b16cce1f 100644
--- a/pkgs/development/compilers/llvm/5/lld.nix
+++ b/pkgs/development/compilers/llvm/5/lld.nix
@@ -10,7 +10,7 @@
 stdenv.mkDerivation {
   name = "lld-${version}";
 
-  src = fetch "lld" "15rqsmfw0jlsri7hszbs8l0j7v1030cy9xvvdb245397llh7k6ir";
+  src = fetch "lld" "15fq2zvkliyiw5qi7ig2r8bshgbz4kzvs5in16mhfkw20l06rcym";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ llvm ];
diff --git a/pkgs/development/compilers/llvm/5/lldb.nix b/pkgs/development/compilers/llvm/5/lldb.nix
index fac23b290bcb..03e65dde0e4d 100644
--- a/pkgs/development/compilers/llvm/5/lldb.nix
+++ b/pkgs/development/compilers/llvm/5/lldb.nix
@@ -17,7 +17,7 @@
 stdenv.mkDerivation {
   name = "lldb-${version}";
 
-  src = fetch "lldb" "0zcbav39srf6awv9znvzr7nqdrj704i8da3wdgc8362y20rcm860";
+  src = fetch "lldb" "0sipv8k37ai44m7jcf6wsbm2q41dgk3sk9m3i6823jkmg7kckhdp";
 
   postPatch = ''
     # Fix up various paths that assume llvm and clang are installed in the same place
diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix
index 8358b6b18c35..6c7fd9eb0a38 100644
--- a/pkgs/development/compilers/llvm/5/llvm.nix
+++ b/pkgs/development/compilers/llvm/5/llvm.nix
@@ -22,7 +22,7 @@
 }:
 
 let
-  src = fetch "llvm" "1nin64vz21hyng6jr19knxipvggaqlkl2l9jpd5czbc4c2pcnpg3";
+  src = fetch "llvm" "1c07i0b61j69m578lgjkyayg419sh7sn40xb3j112nr2q2gli9sz";
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
   shortVersion = with stdenv.lib;
diff --git a/pkgs/development/compilers/llvm/5/openmp.nix b/pkgs/development/compilers/llvm/5/openmp.nix
index 9ba42eed2e2e..5a01c191b5ae 100644
--- a/pkgs/development/compilers/llvm/5/openmp.nix
+++ b/pkgs/development/compilers/llvm/5/openmp.nix
@@ -10,7 +10,7 @@
 stdenv.mkDerivation {
   name = "openmp-${version}";
 
-  src = fetch "openmp" "1igplg89bl6k6r9q88hnpcznq3g9lb79w7bix025lwp00ldhivy0";
+  src = fetch "openmp" "0lr6r87xzg87w1q9rrh04nqpyr8c929dh4qy3csjiy7rsb6kbdmd";
 
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix
index 236273bf6bec..4dce11f93b13 100644
--- a/pkgs/development/compilers/neko/default.nix
+++ b/pkgs/development/compilers/neko/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, boehmgc, zlib, sqlite, pcre, cmake, pkgconfig
-, git, apacheHttpd, apr, aprutil, mariadb, mbedtls, openssl, pkgs, gtk2, libpthreadstubs
+, git, apacheHttpd, apr, aprutil, mysql, mbedtls, openssl, pkgs, gtk2, libpthreadstubs
 }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkgconfig git ];
   buildInputs =
     [ boehmgc zlib sqlite pcre apacheHttpd apr aprutil
-      mariadb.client mbedtls openssl libpthreadstubs ]
+      mysql.connector-c mbedtls openssl libpthreadstubs ]
       ++ stdenv.lib.optional stdenv.isLinux gtk2
       ++ stdenv.lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security
                                                 pkgs.darwin.apple_sdk.frameworks.Carbon];
diff --git a/pkgs/development/compilers/urweb/default.nix b/pkgs/development/compilers/urweb/default.nix
index 74ca5dc4c4b0..f2b6016ceb70 100644
--- a/pkgs/development/compilers/urweb/default.nix
+++ b/pkgs/development/compilers/urweb/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "17qh9mcmlhbv6r52yij8l9ik7j7x6x7c09lf6pznnbdh4sf8p5wb";
   };
 
-  buildInputs = [ openssl mlton mysql.client postgresql sqlite ];
+  buildInputs = [ openssl mlton mysql.connector-c postgresql sqlite ];
 
   prePatch = ''
     sed -e 's@/usr/bin/file@${file}/bin/file@g' -i configure
@@ -21,13 +21,13 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     export PGHEADER="${postgresql}/include/libpq-fe.h";
-    export MSHEADER="${lib.getDev mysql.client}/include/mysql/mysql.h";
+    export MSHEADER="${mysql.connector-c}/include/mysql/mysql.h";
     export SQHEADER="${sqlite.dev}/include/sqlite3.h";
 
     export CC="${gcc}/bin/gcc";
     export CCARGS="-I$out/include \
                    -L${openssl.out}/lib \
-                   -L${lib.getLib mysql.client}/lib \
+                   -L${mysql.connector-c}/lib \
                    -L${postgresql.lib}/lib \
                    -L${sqlite.out}/lib";
   '';
diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix
index 40af4c312cf0..f42cdcabae3f 100644
--- a/pkgs/development/compilers/vala/default.nix
+++ b/pkgs/development/compilers/vala/default.nix
@@ -29,6 +29,12 @@ let
 
 in rec {
 
+  vala_0_23 = generic {
+    major   = "0.23";
+    minor   = "3";
+    sha256  = "101xjbc818g4849n9a80c2aai13zakj7mpnd7470xnkvz5jwqq96";
+  };
+
   vala_0_26 = generic {
     major   = "0.26";
     minor   = "2";
@@ -37,8 +43,8 @@ in rec {
 
   vala_0_28 = generic {
     major   = "0.28";
-    minor   = "0";
-    sha256  = "0zwpzhkhfk3piya14m7p2hl2vaabahprphppfm46ci91z39kp7hd";
+    minor   = "1";
+    sha256  = "0isg327w6rfqqdjja6a8pc3xcdkj7pqrkdhw48bsyxab2fkaw3hw";
   };
 
   vala_0_32 = generic {
@@ -49,14 +55,20 @@ in rec {
 
   vala_0_34 = generic {
     major   = "0.34";
-    minor   = "1";
-    sha256  = "16cjybjw100qps6jg0jdyjh8hndz8a876zmxpybnf30a8vygrk7m";
+    minor   = "13";
+    sha256  = "0ahbnhgwhhjkndmbr1d039ws0g2bb324c60fk6wgx7py5wvmgcd2";
+  };
+
+  vala_0_36 = generic {
+    major   = "0.36";
+    minor   = "8";
+    sha256  = "1nz5a8kcb22ss9idb7k1higwpvghd617xwf40fi0a9ggws614lfz";
   };
 
   vala_0_38 = generic {
     major   = "0.38";
-    minor   = "1";
-    sha256  = "112hl3lkcyakrk8c3qgw12gzn3nxjkvx7bn0jhl5f2m57d7k8d8h";
+    minor   = "4";
+    sha256  = "1sg5gaq3jhgr9vzh2ypiw475167k150wmyglymr7wwqppmikmcrc";
     extraNativeBuildInputs = [ autoconf ] ++ stdenv.lib.optionals stdenv.isDarwin [ libtool expat ];
     extraBuildInputs = [ graphviz ];
   };
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 45f7c97af9d9..9298aa84a897 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -70,7 +70,7 @@ self: super: {
 
   # Use the default version of mysql to build this package (which is actually mariadb).
   # test phase requires networking
-  mysql = dontCheck (super.mysql.override { mysql = pkgs.mysql.lib; });
+  mysql = dontCheck (super.mysql.override { mysql = pkgs.mysql.connector-c; });
 
   # check requires mysql server
   mysql-simple = dontCheck super.mysql-simple;
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index da8d5b3dd0da..96b1893206d2 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -53,7 +53,7 @@ self: super: builtins.intersectAttrs super {
 
   # Use the default version of mysql to build this package (which is actually mariadb).
   # test phase requires networking
-  mysql = dontCheck (super.mysql.override { mysql = pkgs.mysql.lib; });
+  mysql = dontCheck (super.mysql.override { mysql = pkgs.mysql.connector-c; });
 
   # CUDA needs help finding the SDK headers and libraries.
   cuda = overrideCabal super.cuda (drv: {
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index db4eb6eaee0c..3eedf19a312b 100644
--- a/pkgs/development/interpreters/php/default.nix
+++ b/pkgs/development/interpreters/php/default.nix
@@ -12,9 +12,8 @@ let
     { version, sha256 }:
 
     let php7 = lib.versionAtLeast version "7.0";
-        mysqlHeaders = mysql.lib.dev or mysql;
         mysqlndSupport = config.php.mysqlnd or false;
-        mysqlBuildInputs = lib.optional (!mysqlndSupport) mysqlHeaders;
+        mysqlBuildInputs = lib.optional (!mysqlndSupport) mysql.connector-c;
 
     in composableDerivation.composableDerivation {} (fixed: {
 
@@ -121,7 +120,7 @@ let
         };
 
         mysqli = {
-          configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysqlHeaders}/bin/mysql_config"}"];
+          configureFlags = ["--with-mysqli=${if mysqlndSupport then "mysqlnd" else "${mysql.connector-c}/bin/mysql_config"}"];
           buildInputs = mysqlBuildInputs;
         };
 
@@ -132,7 +131,7 @@ let
         };
 
         pdo_mysql = {
-          configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysqlHeaders}"];
+          configureFlags = ["--with-pdo-mysql=${if mysqlndSupport then "mysqlnd" else mysql.connector-c}"];
           buildInputs = mysqlBuildInputs;
         };
 
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix
index 5f7348ac825f..d9cff16f448f 100644
--- a/pkgs/development/interpreters/python/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/mk-python-derivation.nix
@@ -13,7 +13,10 @@
 
 { name ? "${attrs.pname}-${attrs.version}"
 
-# Dependencies for building the package
+# Build-time dependencies for the package
+, nativeBuildInputs ? []
+
+# Run-time dependencies for the package
 , buildInputs ? []
 
 # Dependencies needed for running the checkPhase.
@@ -66,13 +69,15 @@ toPythonModule (python.stdenv.mkDerivation (builtins.removeAttrs attrs [
 
   name = namePrefix + name;
 
-  buildInputs = ([ wrapPython (ensureNewerSourcesHook { year = "1980"; }) ]
-    ++ (lib.optional (lib.hasSuffix "zip" attrs.src.name or "") unzip)
+  nativeBuildInputs = [ (ensureNewerSourcesHook { year = "1980"; }) ]
+    ++ nativeBuildInputs;
+
+  buildInputs = [ wrapPython ]
+    ++ lib.optional (lib.hasSuffix "zip" (attrs.src.name or "")) unzip
     ++ lib.optionals doCheck checkInputs
-    ++ lib.optional catchConflicts setuptools # If we nog longer propagate setuptools
+    ++ lib.optional catchConflicts setuptools # If we no longer propagate setuptools
     ++ buildInputs
-    ++ pythonPath
-  );
+    ++ pythonPath;
 
   # Propagate python and setuptools. We should stop propagating setuptools.
   propagatedBuildInputs = propagatedBuildInputs ++ [ python setuptools ];
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index 61c18837782d..f7d3887cc180 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -18,13 +18,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = libintlOrEmpty;
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl gobjectIntrospection ];
 
   propagatedBuildInputs = [
     # Required by atk.pc
     glib
-    # TODO: Why propagate?
-    gobjectIntrospection
   ];
 
   doCheck = true;
diff --git a/pkgs/development/libraries/boost/1.65.nix b/pkgs/development/libraries/boost/1.65.nix
index 56b136cd99b4..427ef072ffea 100644
--- a/pkgs/development/libraries/boost/1.65.nix
+++ b/pkgs/development/libraries/boost/1.65.nix
@@ -9,6 +9,6 @@ callPackage ./generic.nix (args // rec {
     sha256 = "9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81";
   };
 
-  enableNumpy = true;
+  enableNumpy = args.enableNumpy or true;
 
 })
diff --git a/pkgs/development/libraries/boost/1.66.nix b/pkgs/development/libraries/boost/1.66.nix
new file mode 100644
index 000000000000..a89ae84db38b
--- /dev/null
+++ b/pkgs/development/libraries/boost/1.66.nix
@@ -0,0 +1,14 @@
+{ stdenv, callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.66_0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_66_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_66_0.html
+    sha256 = "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9";
+  };
+
+  enableNumpy = args.enableNumpy or true;
+
+})
diff --git a/pkgs/development/libraries/cppdb/default.nix b/pkgs/development/libraries/cppdb/default.nix
index 72fa309b721f..07c6e1490e7e 100644
--- a/pkgs/development/libraries/cppdb/default.nix
+++ b/pkgs/development/libraries/cppdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, sqlite, libmysql, postgresql, unixODBC }:
+{ stdenv, fetchurl, cmake, sqlite, mysql, postgresql, unixODBC }:
 
 stdenv.mkDerivation rec {
   name = "cppdb";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ cmake sqlite libmysql postgresql unixODBC ];
+  buildInputs = [ cmake sqlite mysql.connector-c postgresql unixODBC ];
 
   cmakeFlags = [ "--no-warn-unused-cli" ];
+  NIX_CFLAGS_COMPILE = [ "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ];
 
   meta = with stdenv.lib; {
     homepage = http://cppcms.com/sql/cppdb/;
@@ -23,4 +24,3 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.juliendehos ];
   };
 }
-
diff --git a/pkgs/development/libraries/gdal/default.nix b/pkgs/development/libraries/gdal/default.nix
index 984d3da81198..0f1637a87e94 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "--with-poppler=${poppler.dev}" # optional
     "--with-libz=${zlib.dev}"       # optional
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.lib.dev}/bin/mysql_config"
+    "--with-mysql=${mysql.connector-c or mysql}/bin/mysql_config"
     "--with-geotiff=${libgeotiff}"
     "--with-sqlite3=${sqlite.dev}"
     "--with-spatialite=${libspatialite}"
diff --git a/pkgs/development/libraries/gdal/gdal-1_11.nix b/pkgs/development/libraries/gdal/gdal-1_11.nix
index c9f0c0761019..7a80ce7fdb66 100644
--- a/pkgs/development/libraries/gdal/gdal-1_11.nix
+++ b/pkgs/development/libraries/gdal/gdal-1_11.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, unzip, libjpeg, libtiff, zlib
-, postgresql, mysql, libgeotiff, python, pythonPackages, proj, geos, openssl
+, postgresql, mysql57, libgeotiff, python, pythonPackages, proj, geos, openssl
 , libpng }:
 
 stdenv.mkDerivation rec {
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     "--with-libz=${zlib.dev}"       # optional
 
     "--with-pg=${postgresql}/bin/pg_config"
-    "--with-mysql=${mysql.lib.dev}/bin/mysql_config"
+    "--with-mysql=${mysql57.connector-c}/bin/mysql_config"
     "--with-geotiff=${libgeotiff}"
     "--with-python"               # optional
     "--with-static-proj4=${proj}" # optional
diff --git a/pkgs/development/libraries/glibc/2.26-75to115.diff.gz b/pkgs/development/libraries/glibc/2.26-75to115.diff.gz
new file mode 100644
index 000000000000..9bf1a4f7d39b
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.26-75to115.diff.gz
Binary files differdiff --git a/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch b/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
new file mode 100644
index 000000000000..ce18b874c427
--- /dev/null
+++ b/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
@@ -0,0 +1,39 @@
+diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
+index cace758c01..38fe7fe0b0 100644
+--- a/sysdeps/unix/sysv/linux/configure
++++ b/sysdeps/unix/sysv/linux/configure
+@@ -69,7 +69,7 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
+ $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <linux/version.h>
+diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
+index 13abda0a51..6abc12eaed 100644
+--- a/sysdeps/unix/sysv/linux/configure.ac
++++ b/sysdeps/unix/sysv/linux/configure.ac
+@@ -50,7 +50,7 @@ fi
+ AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+ changequote(,)dnl
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ changequote([,])dnl
+ AC_TRY_COMPILE([#include <linux/version.h>
+ #if LINUX_VERSION_CODE < $decnum
+diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
+index 823cd8224d..482caaeeec 100644
+--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
++++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
+@@ -39,7 +39,7 @@
+ 	  GLRO(dl_osversion) = version;					      \
+ 									      \
+ 	/* Now we can test with the required version.  */		      \
+-	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION)   \
++	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION && version != 0x020620)   \
+ 	  /* Not sufficent.  */						      \
+ 	  FATAL ("FATAL: kernel too old\n");				      \
+       }									      \
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 86f3be15fea6..5af914d179b8 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -20,7 +20,7 @@
 
 let
   version = "2.26";
-  patchSuffix = "-75";
+  patchSuffix = "-115";
   sha256 = "1ggnj1hzjym7sn93rbwydcqd562q73lsb7g7kd199g6j9j9hlkp5";
   cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
@@ -47,6 +47,7 @@ stdenv.mkDerivation ({
           $ git show --reverse glibc-2.25..release/2.25/master | gzip -n -9 --rsyncable - > 2.25-49.patch.gz
       */
       ./2.26-75.patch.gz
+      ./2.26-75to115.diff.gz
 
       /* Have rpcgen(1) look for cpp(1) in $PATH.  */
       ./rpcgen-path.patch
@@ -64,6 +65,25 @@ stdenv.mkDerivation ({
          "/bin:/usr/bin", which is inappropriate on NixOS machines. This
          patch extends the search path by "/run/current-system/sw/bin". */
       ./fix_path_attribute_in_getconf.patch
+
+      /* Allow running with RHEL 6 -like kernels.  The patch adds an exception
+        for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible
+        (otherwise the loader would refuse libc).
+        Note that glibc will fully work only on their heavily patched kernels
+        and we lose early mismatch detection on 2.6.32.
+
+        On major glibc updates we should check that the patched kernel supports
+        all the required features.  ATM it's verified up to glibc-2.26-115.
+        # HOWTO: check glibc sources for changes in kernel requirements
+        git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
+        # get kernel sources (update the URL)
+        mkdir tmp && cd tmp
+        curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv
+        tar xf linux-*.bz2
+        # check syscall presence, for example
+        less linux-*?/arch/x86/kernel/syscall_table_32.S
+       */
+      ./allow-kernel-2.6.32.patch
     ]
     ++ lib.optional stdenv.isx86_64 ./fix-x64-abi.patch;
 
diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix
index 45222b7d7fcc..169fd119d51f 100644
--- a/pkgs/development/libraries/gtk+/2.x.nix
+++ b/pkgs/development/libraries/gtk+/2.x.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gettext, glib, atk, pango, cairo, perl, xorg
-, gdk_pixbuf, libintlOrEmpty, xlibsWrapper
+, gdk_pixbuf, libintlOrEmpty, xlibsWrapper, gobjectIntrospection
 , xineramaSupport ? stdenv.isLinux
 , cupsSupport ? true, cups ? null
 , gdktarget ? "x11"
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
-  nativeBuildInputs = [ setupHook perl pkgconfig gettext ];
+  nativeBuildInputs = [ setupHook perl pkgconfig gettext gobjectIntrospection ];
 
   patches = [ ./2.0-immodules.cache.patch ./gtk2-theme-paths.patch ];
 
diff --git a/pkgs/development/libraries/kdb/default.nix b/pkgs/development/libraries/kdb/default.nix
index 399d5914c2de..e85190cdfcec 100644
--- a/pkgs/development/libraries/kdb/default.nix
+++ b/pkgs/development/libraries/kdb/default.nix
@@ -1,7 +1,7 @@
 {
   mkDerivation, lib, fetchurl,
   extra-cmake-modules,
-  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, libmysql
+  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, mysql
 }:
 
 mkDerivation rec {
@@ -16,7 +16,7 @@ mkDerivation rec {
 
   nativeBuildInputs = [ extra-cmake-modules ];
 
-  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql libmysql ];
+  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql mysql.connector-c ];
 
   propagatedBuildInputs = [ qtbase ];
 
diff --git a/pkgs/development/libraries/libagar/default.nix b/pkgs/development/libraries/libagar/default.nix
index 1c9e8eca0d57..ee984a53b4c9 100644
--- a/pkgs/development/libraries/libagar/default.nix
+++ b/pkgs/development/libraries/libagar/default.nix
@@ -20,15 +20,16 @@ stdenv.mkDerivation rec {
     "--with-gettext=${gettext}"
     "--with-jpeg=${libjpeg.dev}"
     "--with-gl=${mesa}"
-    "--with-mysql=yes"
+    "--with-mysql=${mysql.connector-c}"
     "--with-manpages=yes"
   ];
 
   outputs = [ "out" "devdoc" ];
 
   nativeBuildInputs = [ pkgconfig libtool gettext ];
+
   buildInputs = [
-    bsdbuild perl xlibsWrapper libXinerama SDL mesa  mysql.client mandoc
+    bsdbuild perl xlibsWrapper libXinerama SDL mesa mysql.connector-c mandoc
     freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
   ];
 
diff --git a/pkgs/development/libraries/libassuan/default.nix b/pkgs/development/libraries/libassuan/default.nix
index bad2a060cdca..94369449ff3d 100644
--- a/pkgs/development/libraries/libassuan/default.nix
+++ b/pkgs/development/libraries/libassuan/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, pth, libgpgerror }:
 
 stdenv.mkDerivation rec {
-  name = "libassuan-2.4.3";
+  name = "libassuan-2.5.1";
 
   src = fetchurl {
     url = "mirror://gnupg/libassuan/${name}.tar.bz2";
-    sha256 = "0w9bmasln4z8mn16s1is55a06w3nv8jbyal496z5jvr5vcxkm112";
+    sha256 = "0jb4nb4nrjr949gd3lw8lh4v5d6qigxaq6xwy24w5apjnhvnrya7";
   };
 
   outputs = [ "out" "dev" "info" ];
diff --git a/pkgs/development/libraries/libdbi-drivers/default.nix b/pkgs/development/libraries/libdbi-drivers/default.nix
index 77c09f3ed158..2a03efd632ff 100644
--- a/pkgs/development/libraries/libdbi-drivers/default.nix
+++ b/pkgs/development/libraries/libdbi-drivers/default.nix
@@ -1,5 +1,7 @@
 { stdenv, fetchurl, libdbi
-, libmysql ? null, sqlite ? null, postgresql ? null
+, mysql ? null
+, sqlite ? null
+, postgresql ? null
 }:
 
 with stdenv.lib;
@@ -11,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
   };
 
-  buildInputs = [ libdbi libmysql sqlite postgresql ];
+  buildInputs = [ libdbi sqlite postgresql ] ++ optional (mysql != null) mysql.connector-c;
 
   postPatch = ''
     sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
@@ -24,16 +26,18 @@ stdenv.mkDerivation rec {
     "--enable-libdbi"
     "--with-dbi-incdir=${libdbi}/include"
     "--with-dbi-libdir=${libdbi}/lib"
-  ] ++ optionals (libmysql != null) [
+  ] ++ optionals (mysql != null) [
     "--with-mysql"
-  ] ++ optionals (postgresql != null) [
-    "--with-pgsql"
-    "--with-pgsql_incdir=${postgresql}/include"
-    "--with-pgsql_libdir=${postgresql.lib}/lib"
+    "--with-mysql-incdir=${mysql.connector-c}/include/mysql"
+    "--with-mysql-libdir=${mysql.connector-c}/lib/mysql"
   ] ++ optionals (sqlite != null) [
     "--with-sqlite3"
     "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
     "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
+  ] ++ optionals (postgresql != null) [
+    "--with-pgsql"
+    "--with-pgsql_incdir=${postgresql}/include"
+    "--with-pgsql_libdir=${postgresql.lib}/lib"
   ];
 
   installFlags = [ "DESTDIR=\${out}" ];
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index 533d5d4cac81..e5e1e2e7a399 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, valgrind-light }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.88";
+  name = "libdrm-2.4.89";
 
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "b5e55dbac2124e742e639f5b8553e8b7395863bf73dab4f77e99fe2fc25572b5";
+    sha256 = "629f9782aabbb4809166de5f24d26fe0766055255038f16935602d89f136a02e";
   };
 
   outputs = [ "out" "dev" "bin" ];
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index e32ba050c38f..397000fc7d24 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -4,11 +4,11 @@ assert enableCapabilities -> stdenv.isLinux;
 
 stdenv.mkDerivation rec {
   name = "libgcrypt-${version}";
-  version = "1.8.1";
+  version = "1.8.2";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "1cvqd9jk5qshbh48yh3ixw4zyr4n5k50r3475rrh20xfn7w7aa3s";
+    sha256 = "01sca9m8hm6b5v8hmqsfdjhyz013869p1f0fxw9ln52qfnp4q1n8";
   };
 
   outputs = [ "out" "dev" "info" ];
diff --git a/pkgs/development/libraries/libnftnl/default.nix b/pkgs/development/libraries/libnftnl/default.nix
index 074c1a9dfd28..060f5ba4934c 100644
--- a/pkgs/development/libraries/libnftnl/default.nix
+++ b/pkgs/development/libraries/libnftnl/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libmnl }:
 
 stdenv.mkDerivation rec {
-  name = "libnftnl-1.0.7";
+  name = "libnftnl-1.0.8";
 
   src = fetchurl {
     url = "http://netfilter.org/projects/libnftnl/files/${name}.tar.bz2";
-    sha256 = "10irjrylcfkbp11617yr19vpfhgl54w0kw02jhj0i1abqv5nxdlv";
+    sha256 = "0f10cfiyl4c0f8k3brxfrw28x7a6qvrakaslg4jgqncwxycxggg6";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 8e6fa005635f..402af5d6f583 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 ]
-    ++ stdenv.lib.optional withMysql mysql
+    ++ stdenv.lib.optional withMysql mysql.connector-c
     ++ stdenv.lib.optional withSqlite sqlite
     ++ stdenv.lib.optional withPostgresql postgresql
     ++ stdenv.lib.optional withBdb db;
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index fca99550a3ca..4c00df4c17d8 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -66,7 +66,7 @@ let
 in
 
 let
-  version = "17.2.7";
+  version = "17.2.8";
   branch  = head (splitString "." version);
   driverLink = "/run/opengl-driver" + optionalString stdenv.isi686 "-32";
 in
@@ -81,7 +81,7 @@ stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
       "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "0s3slgjxnx482yw0knn4a6alsy2cq28rah6hnjbmf12mvyldxksh";
+    sha256 = "0pq9kmmyllgd63d936f3x1zsg7sqaswx47khbn0gvbgari2h753f";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/opendbx/default.nix b/pkgs/development/libraries/opendbx/default.nix
index 37afa3fd5070..48ec5141e34f 100644
--- a/pkgs/development/libraries/opendbx/default.nix
+++ b/pkgs/development/libraries/opendbx/default.nix
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = ''
-    export CPPFLAGS="-I${getDev mysql.client}/include/mysql"
-    export LDFLAGS="-L${getLib mysql.client}/lib/mysql -L${getLib postgresql}/lib"
+    export CPPFLAGS="-I${mysql.connector-c}/include/mysql"
+    export LDFLAGS="-L${mysql.connector-c}/lib/mysql -L${postgresql}/lib"
     configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
   '';
 
-  buildInputs = [ readline mysql.client postgresql sqlite ];
+  buildInputs = [ readline mysql.connector-c postgresql sqlite ];
 }
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index e6055151301c..b34c9ff31f2c 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -33,6 +33,9 @@ in stdenv.mkDerivation rec {
 
   buildInputs = optional (hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads;
 
+  # https://bugs.exim.org/show_bug.cgi?id=2173
+  patches = [ ./stacksize-detection.patch ];
+
   doCheck = !(with hostPlatform; isCygwin || isFreeBSD) && hostPlatform == buildPlatform;
     # XXX: test failure on Cygwin
     # we are running out of stack on both freeBSDs on Hydra
diff --git a/pkgs/development/libraries/pcre/stacksize-detection.patch b/pkgs/development/libraries/pcre/stacksize-detection.patch
new file mode 100644
index 000000000000..4bc97069b1e2
--- /dev/null
+++ b/pkgs/development/libraries/pcre/stacksize-detection.patch
@@ -0,0 +1,16 @@
+diff --git a/pcre_exec.c b/pcre_exec.c
+--- a/pcre_exec.c
++++ b/pcre_exec.c
+@@ -509,6 +509,12 @@
+                  (e.g. stopped by repeated call or recursion limit)
+ */
+ 
++#ifdef __GNUC__
++static int
++match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
++  PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
++  unsigned int rdepth) __attribute__((noinline,noclone));
++#endif
+ static int
+ match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
+   PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
diff --git a/pkgs/development/libraries/poco/default.nix b/pkgs/development/libraries/poco/default.nix
index 0f971cff64d4..407559137370 100644
--- a/pkgs/development/libraries/poco/default.nix
+++ b/pkgs/development/libraries/poco/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysql }:
+{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, mysql }:
 
 stdenv.mkDerivation rec {
   name = "poco-${version}";
@@ -12,10 +12,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ zlib pcre expat sqlite openssl unixODBC libmysql ];
+  buildInputs = [ zlib pcre expat sqlite openssl unixODBC mysql.connector-c ];
 
   cmakeFlags = [
-    "-DMYSQL_INCLUDE_DIR=${libmysql.dev}/include/mysql"
     "-DPOCO_UNBUNDLED=ON"
   ];
 
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index 6d92de001cb7..1bc4fd1085e1 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
       -I${randrproto}/include" else "-no-xrandr"}
     ${if xineramaSupport then "-xinerama -L${libXinerama.out}/lib -I${libXinerama.dev}/include" else "-no-xinerama"}
     ${if cursorSupport then "-L${libXcursor.out}/lib -I${libXcursor.dev}/include" else ""}
-    ${if mysqlSupport then "-qt-sql-mysql -L${stdenv.lib.getLib mysql.client}/lib/mysql -I${mysql.client}/include/mysql" else ""}
+    ${if mysqlSupport then "-qt-sql-mysql -L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql" else ""}
     ${if xftSupport then "-xft
       -L${libXft.out}/lib -I${libXft.dev}/include
       -L${libXft.freetype.out}/lib -I${libXft.freetype.dev}/include
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 32691faa6893..488306fc1ce2 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -160,7 +160,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ cups # Qt dlopen's libcups instead of linking to it
       postgresql sqlite libjpeg libmng libtiff icu ]
-    ++ optionals (mysql != null) [ mysql.lib ]
+    ++ optionals (mysql != null) [ mysql.connector-c ]
     ++ optionals gtkStyle [ gtk2 gdk_pixbuf ]
     ++ optionals stdenv.isDarwin [ cf-private ApplicationServices OpenGL Cocoa AGL libcxx libobjc ];
 
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 172b20bc51bb..5f65f71bbbaa 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -80,7 +80,7 @@ stdenv.mkDerivation {
     )
     ++ lib.optional developerBuild gdb
     ++ lib.optional (cups != null) cups
-    ++ lib.optional (mysql != null) mysql.lib
+    ++ lib.optional (mysql != null) mysql.connector-c
     ++ lib.optional (postgresql != null) postgresql;
 
   nativeBuildInputs =
diff --git a/pkgs/development/libraries/tntdb/default.nix b/pkgs/development/libraries/tntdb/default.nix
index d11a5c344c9d..75a494cfbded 100644
--- a/pkgs/development/libraries/tntdb/default.nix
+++ b/pkgs/development/libraries/tntdb/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0js79dbvkic30bzw1pf26m64vs2ssw2sbj55w1dc0sy69dlv4fh9";
   };
 
-  buildInputs = [ cxxtools postgresql mysql sqlite zlib openssl ];
+  buildInputs = [ cxxtools postgresql mysql.connector-c sqlite zlib openssl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix
index 233fdd902541..badcb7e661bb 100644
--- a/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -37,19 +37,12 @@
     };
 
     nativeBuildInputs = [ cmake ];
-    buildInputs = [ unixODBC mariadb.lib ];
+    buildInputs = [ unixODBC mariadb.connector-c ];
 
     cmakeFlags = [
-      "-DMARIADB_INCLUDE_DIR=${mariadb.lib}/include/mysql"
+      "-DMARIADB_INCLUDE_DIR=${mariadb.connector-c}/include/mariadb"
     ];
 
-    preConfigure = ''
-      sed -i \
-        -e 's,mariadb_config,mysql_config,g' \
-        -e 's,libmariadbclient,libmysqlclient,g' \
-        cmake/FindMariaDB.cmake
-    '';
-
     passthru = {
       fancyName = "MariaDB";
       driver = "lib/libmyodbc3-3.51.12.so";
@@ -60,7 +53,6 @@
       homepage =  https://downloads.mariadb.org/connector-odbc/;
       license = licenses.gpl2;
       platforms = platforms.linux;
-      broken = true;
     };
   };
 
diff --git a/pkgs/development/libraries/wt/default.nix b/pkgs/development/libraries/wt/default.nix
index 3adf4f1497f8..1d0bd20f66f0 100644
--- a/pkgs/development/libraries/wt/default.nix
+++ b/pkgs/development/libraries/wt/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, cmake, boost, pkgconfig, doxygen, qt48Full, libharu
-, pango, fcgi, firebird, libmysql, postgresql, graphicsmagick, glew, openssl
+, pango, fcgi, firebird, mysql, postgresql, graphicsmagick, glew, openssl
 , pcre
 }:
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
     cmake boost doxygen qt48Full libharu
-    pango fcgi firebird libmysql postgresql graphicsmagick glew
+    pango fcgi firebird mysql.connector-c postgresql graphicsmagick glew
     openssl pcre
   ];
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
     "-DWT_CPP_11_MODE=-std=c++11"
     "-DGM_PREFIX=${graphicsmagick}"
-    "-DMYSQL_PREFIX=${libmysql.dev}"
+    "-DMYSQL_PREFIX=${mysql.connector-c}"
     "--no-warn-unused-cli"
   ];
 
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
index fae5818171bd..09113bc30bb8 100644
--- a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
+++ b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
@@ -53,11 +53,11 @@ in
   cl-async-ssl = addNativeLibs [pkgs.openssl];
   cl-async-test = addNativeLibs [pkgs.openssl];
   clsql = x: {
-    propagatedBuildInputs = with pkgs; [mysql postgresql sqlite zlib];
+    propagatedBuildInputs = with pkgs; [mysql.connector-c postgresql sqlite zlib];
     overrides = y: (x.overrides y) // {
       preConfigure = ((x.overrides y).preConfigure or "") + ''
-        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.lib.getDev pkgs.mysql.client}/include/mysql"
-        export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.lib.getLib pkgs.mysql.client}/lib/mysql"
+        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.mysql.connector-c}/include/mysql"
+        export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.mysql.connector-c}/lib/mysql"
       '';
     };
   };
diff --git a/pkgs/development/lisp-modules/shell.nix b/pkgs/development/lisp-modules/shell.nix
index b29ba53159e6..d3cb7b36aeeb 100644
--- a/pkgs/development/lisp-modules/shell.nix
+++ b/pkgs/development/lisp-modules/shell.nix
@@ -5,11 +5,11 @@ self = rec {
   env = buildEnv { name = name; paths = buildInputs; };
   buildInputs = [
     gcc stdenv
-    openssl fuse libuv mariadb libfixposix libev sqlite
+    openssl fuse libuv mysql.connector-c libfixposix libev sqlite
     freetds
     lispPackages.quicklisp-to-nix lispPackages.quicklisp-to-nix-system-info
   ];
   CPATH = "${libfixposix}/include";
-  LD_LIBRARY_PATH = "${openssl.out}/lib:${fuse}/lib:${libuv}/lib:${libev}/lib:${mariadb}/lib:${postgresql.lib}/lib:${sqlite.out}/lib:${libfixposix}/lib:${freetds}/lib";
+  LD_LIBRARY_PATH = "${openssl.out}/lib:${fuse}/lib:${libuv}/lib:${libev}/lib:${mysql.connector-c}/lib:${postgresql.lib}/lib:${sqlite.out}/lib:${libfixposix}/lib:${freetds}/lib";
 };
 in stdenv.mkDerivation self
diff --git a/pkgs/development/ocaml-modules/mysql/default.nix b/pkgs/development/ocaml-modules/mysql/default.nix
index 3fa8e9d46b40..5482d7ac87cd 100644
--- a/pkgs/development/ocaml-modules/mysql/default.nix
+++ b/pkgs/development/ocaml-modules/mysql/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, mysql }:
+{ stdenv, fetchurl, fetchpatch, ocaml, findlib, mysql, openssl }:
 
 # TODO: la versione stabile da' un errore di compilazione dovuto a
 # qualche cambiamento negli header .h
@@ -26,7 +26,14 @@ stdenv.mkDerivation rec {
 
   createFindlibDestdir = true;
 
-  propagatedBuildInputs = [ mysql.client ];
+  propagatedBuildInputs = [ mysql.connector-c ];
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/ygrek/ocaml-mysql/compare/v1.2.1...d6d1b3b262ae2cf493ef56f1dd7afcf663a70a26.patch";
+      sha256 = "0018s2wcrvbsw9yaqmwq500qmikwffrgdp5xg9b8v7ixhd4gi6hn";
+    })
+  ];
 
   meta = {
     homepage = http://ocaml-mysql.forge.ocamlcore.org;
diff --git a/pkgs/development/perl-modules/DBD-mysql/default.nix b/pkgs/development/perl-modules/DBD-mysql/default.nix
index 7302516d5429..12ddcf166e25 100644
--- a/pkgs/development/perl-modules/DBD-mysql/default.nix
+++ b/pkgs/development/perl-modules/DBD-mysql/default.nix
@@ -8,7 +8,7 @@ buildPerlPackage rec {
     sha256 = "0h4h6zwzj8fwh9ljb8svnsa0a3ch4p10hp59kpdibdb4qh8xwxs7";
   };
 
-  buildInputs = [ mysql.lib ] ;
+  buildInputs = [ mysql.connector-c ] ;
   propagatedBuildInputs = [ DBI ];
 
   doCheck = false;
diff --git a/pkgs/development/pure-modules/glpk/default.nix b/pkgs/development/pure-modules/glpk/default.nix
index 4927ac445f44..e86f08b57ca9 100644
--- a/pkgs/development/pure-modules/glpk/default.nix
+++ b/pkgs/development/pure-modules/glpk/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchurl,
-  pkgconfig, pure, glpk, gmp, libtool, libmysql, libiodbc, zlib }:
+  pkgconfig, pure, glpk, gmp, libtool, mysql, libiodbc, zlib }:
 
 stdenv.mkDerivation rec {
   baseName = "glpk";
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
   };
 
   glpkWithExtras = lib.overrideDerivation glpk (attrs: {
-    propagatedBuildInputs = [ gmp libtool libmysql libiodbc ];
+    propagatedBuildInputs = [ gmp libtool mysql.connector-c libiodbc ];
 
     CPPFLAGS = "-I${gmp.dev}/include";
 
     preConfigure = ''
       substituteInPlace configure \
-        --replace /usr/include/mysql ${lib.getDev libmysql}/include/mysql
+        --replace /usr/include/mysql ${mysql.connector-c}/include/mysql
     '';
     configureFlags = [ "--enable-dl"
                        "--enable-odbc"
diff --git a/pkgs/development/python-modules/jinja2/default.nix b/pkgs/development/python-modules/jinja2/default.nix
index ca286ae06aab..cb0eb130a2f2 100644
--- a/pkgs/development/python-modules/jinja2/default.nix
+++ b/pkgs/development/python-modules/jinja2/default.nix
@@ -1,20 +1,24 @@
-{ stdenv, buildPythonPackage, fetchPypi
-, markupsafe }:
+{ stdenv, buildPythonPackage, fetchFromGitHub
+, pytest, markupsafe }:
 
 buildPythonPackage rec {
   pname = "Jinja2";
   version = "2.9.6";
   name = "${pname}-${version}";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1zzrkywhziqffrzks14kzixz7nd4yh2vc0fb04a68vfd2ai03anx";
+  src = fetchFromGitHub {
+    owner = "pallets";
+    repo = "jinja";
+    rev = version;
+    sha256 = "1xxc5vdhz214aawmllv0fi4ak6d7zac662yb7gn1xfgqfz392pg5";
   };
 
+  checkInputs = [ pytest ];
   propagatedBuildInputs = [ markupsafe ];
 
-  # No tests included
-  doCheck = false;
+  checkPhase = ''
+    pytest -v
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://jinja.pocoo.org/;
@@ -24,7 +28,7 @@ buildPythonPackage rec {
       Jinja2 is a template engine written in pure Python. It provides a
       Django inspired non-XML syntax but supports inline expressions and
       an optional sandboxed environment.
-      '';
+    '';
     platforms = platforms.all;
     maintainers = with maintainers; [ pierron garbas sjourdois ];
   };
diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix
index 76c0e5227773..a435ee65e52c 100644
--- a/pkgs/development/r-modules/default.nix
+++ b/pkgs/development/r-modules/default.nix
@@ -320,7 +320,7 @@ let
     rmatio = [ pkgs.zlib.dev ];
     Rmpfr = [ pkgs.gmp pkgs.mpfr.dev ];
     Rmpi = [ pkgs.openmpi ];
-    RMySQL = [ pkgs.zlib pkgs.mysql.lib pkgs.mariadb pkgs.openssl.dev ];
+    RMySQL = [ pkgs.zlib pkgs.mysql.connector-c pkgs.openssl.dev ];
     RNetCDF = [ pkgs.netcdf pkgs.udunits ];
     RODBCext = [ pkgs.libiodbc ];
     RODBC = [ pkgs.libiodbc ];
@@ -798,10 +798,10 @@ let
     });
 
     RMySQL = old.RMySQL.overrideDerivation (attrs: {
-      MYSQL_DIR="${pkgs.mysql.lib}";
+      MYSQL_DIR="${pkgs.mysql.connector-c}";
       preConfigure = ''
         patchShebangs configure
-        '';
+      '';
     });
 
     devEMF = old.devEMF.overrideDerivation (attrs: {
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 05415b889680..e434a863c0e2 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -109,7 +109,7 @@ in
 
   gio2 = attrs: {
     nativeBuildInputs = [ pkgconfig ];
-    buildInputs = [ gtk2 pcre ];
+    buildInputs = [ gtk2 pcre gobjectIntrospection ];
   };
 
   gitlab-markup = attrs: { meta.priority = 1; };
@@ -167,11 +167,11 @@ in
   };
 
   mysql = attrs: {
-    buildInputs = [ mysql.lib zlib openssl ];
+    buildInputs = [ mysql.connector-c zlib openssl ];
   };
 
   mysql2 = attrs: {
-    buildInputs = [ mysql.lib zlib openssl ];
+    buildInputs = [ mysql.connector-c zlib openssl ];
   };
 
   ncursesw = attrs: {
diff --git a/pkgs/development/tools/database/shmig/default.nix b/pkgs/development/tools/database/shmig/default.nix
index a397ba696977..49e90ce64c87 100644
--- a/pkgs/development/tools/database/shmig/default.nix
+++ b/pkgs/development/tools/database/shmig/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub
 , withMySQL ? false, withPSQL ? false, withSQLite ? false
-, mariadb, postgresql, sqlite, gawk, which
+, mysql, postgresql, sqlite, gawk, which
 , lib
 }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     patchShebangs .
 
     substituteInPlace shmig \
-      --replace "\`which mysql\`" "${lib.optionalString withMySQL "${mariadb}/bin/mysql"}" \
+      --replace "\`which mysql\`" "${lib.optionalString withMySQL "${mysql.client}/bin/mysql"}" \
       --replace "\`which psql\`" "${lib.optionalString withPSQL "${postgresql}/bin/psql"}" \
       --replace "\`which sqlite3\`" "${lib.optionalString withSQLite "${sqlite}/bin/sqlite3"}" \
       --replace "awk" "${gawk}/bin/awk" \
diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix
index 6006c83c0cd9..b20f63e26253 100644
--- a/pkgs/development/tools/misc/d-feet/default.nix
+++ b/pkgs/development/tools/misc/d-feet/default.nix
@@ -1,5 +1,5 @@
 { stdenv, pkgconfig, fetchurl, itstool, intltool, libxml2, glib, gtk3
-, python3Packages, wrapGAppsHook, gnome3, libwnck3 }:
+, python3Packages, wrapGAppsHook, gnome3, libwnck3, gobjectIntrospection }:
 
 let
   version = "${major}.13";
@@ -14,7 +14,7 @@ in python3Packages.buildPythonApplication rec {
   };
 
   nativeBuildInputs = [ pkgconfig itstool intltool wrapGAppsHook libxml2 ];
-  buildInputs = [ glib gtk3 gnome3.defaultIconTheme libwnck3 ];
+  buildInputs = [ glib gtk3 gnome3.defaultIconTheme libwnck3 gobjectIntrospection ];
 
   propagatedBuildInputs = with python3Packages; [ pygobject3 pep8 ];
 
diff --git a/pkgs/development/tools/misc/sysbench/default.nix b/pkgs/development/tools/misc/sysbench/default.nix
index 45a31ad66f20..612df55471ba 100644
--- a/pkgs/development/tools/misc/sysbench/default.nix
+++ b/pkgs/development/tools/misc/sysbench/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, vim, libmysql,
-  libaio }:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, vim, mysql
+, libaio }:
 
 stdenv.mkDerivation rec {
   name = "sysbench-1.0.6";
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
-  buildInputs = [ vim libmysql libaio ];
+  buildInputs = [ vim mysql.connector-c libaio ];
 
   src = fetchFromGitHub {
     owner = "akopytov";
diff --git a/pkgs/development/tools/tora/default.nix b/pkgs/development/tools/tora/default.nix
index 578e759548a1..5b46b975cf7f 100644
--- a/pkgs/development/tools/tora/default.nix
+++ b/pkgs/development/tools/tora/default.nix
@@ -17,7 +17,7 @@ in mkDerivation rec {
 
   nativeBuildInputs = [ cmake extra-cmake-modules makeWrapper ];
   buildInputs = [
-    boost doxygen graphviz loki mysql openssl postgresql qscintillaLib qtbase
+    boost doxygen graphviz loki mysql.connector-c openssl postgresql qscintillaLib qtbase
   ];
 
   preConfigure = ''
@@ -51,6 +51,8 @@ in mkDerivation rec {
     "-lssl"
   ];
 
+  NIX_CFLAGS_COMPILE = [ "-L${mysql.connector-c}/lib/mysql" "-I${mysql.connector-c}/include/mysql" ];
+
   postFixup = ''
     wrapProgram $out/bin/tora \
       --prefix PATH : ${lib.getBin graphviz}/bin
diff --git a/pkgs/games/zod/default.nix b/pkgs/games/zod/default.nix
index f795a2ea3a25..da2f256aeb71 100644
--- a/pkgs/games/zod/default.nix
+++ b/pkgs/games/zod/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, unrar, unzip, SDL, SDL_image, SDL_ttf, SDL_mixer
-, libmysql, makeWrapper }:
+, mysql, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "zod-engine-2011-03-18";
@@ -24,9 +24,9 @@ stdenv.mkDerivation rec {
     sourceRoot=`pwd`/src
   '';
 
-  buildInputs = [ unrar unzip SDL SDL_image SDL_ttf SDL_mixer libmysql makeWrapper ];
+  buildInputs = [ unrar unzip SDL SDL_image SDL_ttf SDL_mixer mysql.connector-c makeWrapper ];
 
-  NIX_LDFLAGS = "-L${stdenv.lib.getLib libmysql}/lib/mysql";
+  NIX_LDFLAGS = "-L${mysql.connector-c}/lib/mysql";
 
   installPhase = ''
     mkdir -p $out/bin $out/share/zod
diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix
index f9b7a24273ff..f4a6b47a45a4 100644
--- a/pkgs/servers/clickhouse/default.nix
+++ b/pkgs/servers/clickhouse/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchFromGitHub, cmake, libtool, boost, double-conversion, gperftools, icu, libmysql, lz4, openssl, poco, re2, rdkafka, readline, sparsehash, unixODBC, zookeeper_mt, zstd }:
+{ stdenv, fetchFromGitHub, cmake, libtool, boost, double-conversion, gperftools
+, icu, mysql, lz4, openssl, poco, re2, rdkafka, readline, sparsehash, unixODBC
+, zookeeper_mt, zstd }:
 
 stdenv.mkDerivation rec {
   name = "clickhouse-${version}";
@@ -16,7 +18,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake libtool ];
 
-  buildInputs = [ boost double-conversion gperftools icu libmysql lz4 openssl poco re2 rdkafka readline sparsehash unixODBC zookeeper_mt zstd ];
+  buildInputs = [
+    boost double-conversion gperftools icu mysql.connector-c lz4 openssl poco
+    re2 rdkafka readline sparsehash unixODBC zookeeper_mt zstd
+  ];
 
   cmakeFlags = [ "-DENABLE_TESTS=OFF" "-DUNBUNDLED=ON" "-DUSE_STATIC_LIBRARIES=OFF" ];
 
diff --git a/pkgs/servers/computing/slurm/default.nix b/pkgs/servers/computing/slurm/default.nix
index 3b695c46e777..59d627901131 100644
--- a/pkgs/servers/computing/slurm/default.nix
+++ b/pkgs/servers/computing/slurm/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig libtool ];
   buildInputs = [
-    curl python munge perl pam openssl mysql.lib ncurses gtk2 lua hwloc numactl
+    curl python munge perl pam openssl mysql.connector-c ncurses gtk2 lua hwloc numactl
   ];
 
   configureFlags =
diff --git a/pkgs/servers/dns/powerdns/default.nix b/pkgs/servers/dns/powerdns/default.nix
index d7556a39ee92..79fff80b0b8c 100644
--- a/pkgs/servers/dns/powerdns/default.nix
+++ b/pkgs/servers/dns/powerdns/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig,
   boost, libyamlcpp, libsodium, sqlite, protobuf,
-  libmysql, postgresql, lua, openldap, geoip, curl
+  mysql57, postgresql, lua, openldap, geoip, curl
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ boost libmysql postgresql lua openldap sqlite protobuf geoip libyamlcpp libsodium curl ];
+  buildInputs = [ boost mysql57.connector-c postgresql lua openldap sqlite protobuf geoip libyamlcpp libsodium curl ];
 
   # nix destroy with-modules arguments, when using configureFlags
   preConfigure = ''
diff --git a/pkgs/servers/freeradius/default.nix b/pkgs/servers/freeradius/default.nix
index db9d11219923..bf74ca81ced8 100644
--- a/pkgs/servers/freeradius/default.nix
+++ b/pkgs/servers/freeradius/default.nix
@@ -13,7 +13,7 @@
 , withMemcached ? false
 , hiredis
 , withRedis ? false
-, libmysql
+, mysql
 , withMysql ? false
 , json_c
 , withJson ? false
@@ -29,7 +29,7 @@ assert withPcap -> libpcap != null;
 assert withCap -> libcap != null;
 assert withMemcached -> libmemcached != null;
 assert withRedis -> hiredis != null;
-assert withMysql -> libmysql != null;
+assert withMysql -> mysql != null;
 assert withYubikey -> libyubikey != null;
 assert withCollectd -> collectd != null;
 
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     ++ optional withCap libcap
     ++ optional withMemcached libmemcached
     ++ optional withRedis hiredis
-    ++ optional withMysql libmysql
+    ++ optional withMysql mysql.connector-c
     ++ optional withJson json_c
     ++ optional withYubikey libyubikey
     ++ optional withCollectd collectd;
diff --git a/pkgs/servers/games/ghost-one/default.nix b/pkgs/servers/games/ghost-one/default.nix
deleted file mode 100644
index 63a716339237..000000000000
--- a/pkgs/servers/games/ghost-one/default.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ stdenv, fetchurl, unzip, gmp, zlib, bzip2, boost, mysql }:
-stdenv.mkDerivation rec {
-
-  name = "ghost-one-${version}";
-  version = "1.7.265";
-
-  src = fetchurl {
-    url = "http://www.maxdevlon.com/ghost/ghostone${version}.zip";
-    sha256 = "1sm2ca3lcdr4vjg7v94d8zhqz8cdp44rg8yinzzwkgsr0hj74fv2";
-  };
-
-  buildInputs = [ unzip gmp zlib bzip2 boost mysql.client ];
-
-  patchPhase = ''
-    substituteInPlace ghost/Makefile --replace "/usr/local/lib/mysql" \
-      "${stdenv.lib.getLib mysql.client}/lib/mysql"
-  '';
-
-  buildPhase = ''
-    cd bncsutil/src/bncsutil
-    make
-    cd ../../../StormLib/stormlib/
-    make
-    mkdir -p $out/lib
-    cd ../..
-#    cp bncsutil/src/bncsutil/libbncutil.so $out/lib
-#    cp StormLib/stormlib/libStorm.so $out/lib
-    cd ghost
-    make
-    cd ..
-  '';
-
-  installPhase = ''
-    mkdir -p $out/lib
-    cp bncsutil/src/bncsutil/libbncsutil.so $out/lib
-    cp StormLib/stormlib/libStorm.so $out/lib
-
-    mkdir -p $out/bin
-    cp ghost/ghost++ $out/bin
-
-    mkdir -p $out/share/ghost-one/languages
-    cp -r mapcfgs $out/share/ghost-one
-    cp Languages/*.cfg $out/share/ghost-one/languages
-    cp language.cfg $out/share/ghost-one/languages/English.cfg
-    cp ip-to-country.csv $out/share/ghost-one/
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = http://www.codelain.com/forum/;
-    description = "A Warcraft III: Reign of Chaos and Warcraft III: The Frozen Throne game hosting bot";
-    license = licenses.asl20;
-    maintainers = [ maintainers.phreedom ];
-    broken = true; # can't even get downloaded
-  };
-}
diff --git a/pkgs/servers/http/lighttpd/default.nix b/pkgs/servers/http/lighttpd/default.nix
index 05722f141edd..181e3bf134fb 100644
--- a/pkgs/servers/http/lighttpd/default.nix
+++ b/pkgs/servers/http/lighttpd/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ pcre libxml2 zlib attr bzip2 which file openssl ]
              ++ stdenv.lib.optional enableMagnet lua5_1
-             ++ stdenv.lib.optional enableMysql mysql.lib
+             ++ stdenv.lib.optional enableMysql mysql.connector-c
              ++ stdenv.lib.optional enableLdap openldap;
 
   configureFlags = [ "--with-openssl" ]
diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix
index ab1808c06477..e2d1f448b321 100644
--- a/pkgs/servers/mail/dovecot/default.nix
+++ b/pkgs/servers/mail/dovecot/default.nix
@@ -2,7 +2,7 @@
 , bzip2, zlib, inotify-tools, pam, libcap
 , clucene_core_2, icu, openldap
 # Auth modules
-, withMySQL ? false, libmysql
+, withMySQL ? false, mysql
 , withPgSQL ? false, postgresql
 , withSQLite ? true, sqlite
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkgconfig ];
   buildInputs = [ openssl bzip2 zlib clucene_core_2 icu openldap ]
     ++ lib.optionals (stdenv.isLinux) [ systemd pam libcap inotify-tools ]
-    ++ lib.optional withMySQL libmysql
+    ++ lib.optional withMySQL mysql.connector-c
     ++ lib.optional withPgSQL postgresql
     ++ lib.optional withSQLite sqlite;
 
diff --git a/pkgs/servers/mail/dspam/default.nix b/pkgs/servers/mail/dspam/default.nix
index 623f0a2b0e22..b63390bb2474 100644
--- a/pkgs/servers/mail/dspam/default.nix
+++ b/pkgs/servers/mail/dspam/default.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, fetchurl, makeWrapper
 , gawk, gnused, gnugrep, coreutils, which
 , perl, NetSMTP
-, withMySQL ? false, zlib, libmysql
+, withMySQL ? false, zlib, mysql57
 , withPgSQL ? false, postgresql
 , withSQLite ? false, sqlite
 , withDB ? false, db
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
   };
 
   buildInputs = [ perl ]
-                ++ lib.optionals withMySQL [ zlib libmysql ]
+                ++ lib.optionals withMySQL [ zlib mysql57.connector-c ]
                 ++ lib.optional withPgSQL postgresql
                 ++ lib.optional withSQLite sqlite
                 ++ lib.optional withDB db;
@@ -49,7 +49,7 @@ in stdenv.mkDerivation rec {
     "--enable-preferences-extension"
     "--enable-long-usernames"
     "--enable-external-lookup"
-  ] ++ lib.optional withMySQL "--with-mysql-includes=${lib.getDev libmysql}/include/mysql"
+  ] ++ lib.optional withMySQL "--with-mysql-includes=${mysql57.connector-c}/include/mysql"
     ++ lib.optional withPgSQL "--with-pgsql-libraries=${postgresql.lib}/lib";
 
   # Lots of things are hardwired to paths like sysconfdir. That's why we install with both "prefix" and "DESTDIR"
diff --git a/pkgs/servers/mail/opensmtpd/extras.nix b/pkgs/servers/mail/opensmtpd/extras.nix
index 5e5170afbc79..5e87a1fb0995 100644
--- a/pkgs/servers/mail/opensmtpd/extras.nix
+++ b/pkgs/servers/mail/opensmtpd/extras.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, openssl, libevent, libasr,
-  python2, pkgconfig, lua5, perl, mariadb, postgresql, sqlite, hiredis }:
+  python2, pkgconfig, lua5, perl, mysql, postgresql, sqlite, hiredis }:
+
 stdenv.mkDerivation rec {
   name = "opensmtpd-extras-${version}";
   version = "5.7.1";
@@ -11,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ openssl libevent
-    libasr python2 lua5 perl mariadb.client postgresql sqlite hiredis ];
+    libasr python2 lua5 perl mysql.connector-c postgresql sqlite hiredis ];
 
   configureFlags = [
     "--sysconfdir=/etc"
@@ -54,7 +55,7 @@ stdenv.mkDerivation rec {
     "--with-perl=${perl}"
     "--with-filter-perl"
 
-  ] ++ stdenv.lib.optional (mariadb != null) [
+  ] ++ stdenv.lib.optional (mysql != null) [
     "--with-table-mysql"
 
   ] ++ stdenv.lib.optional (postgresql != null) [
@@ -67,7 +68,8 @@ stdenv.mkDerivation rec {
     "--with-table-redis"
   ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional (hiredis != null) [ "-I${hiredis}/include/hiredis" ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optional (hiredis != null) "-I${hiredis}/include/hiredis" ++
+    stdenv.lib.optional (mysql != null) "-L${mysql.connector-c}/lib/mysql";
 
   meta = with stdenv.lib; {
     homepage = https://www.opensmtpd.org/;
diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix
index c92507b4167d..bf1a1e782a5a 100644
--- a/pkgs/servers/mail/postfix/default.nix
+++ b/pkgs/servers/mail/postfix/default.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, fetchurl, makeWrapper, gnused, db, openssl, cyrus_sasl, libnsl
 , coreutils, findutils, gnugrep, gawk, icu, pcre
 , withPgSQL ? false, postgresql
-, withMySQL ? false, libmysql
+, withMySQL ? false, mysql
 , withSQLite ? false, sqlite
 , withLDAP ? false, openldap
 }:
@@ -11,7 +11,7 @@ let
     "-DUSE_TLS" "-DUSE_SASL_AUTH" "-DUSE_CYRUS_SASL" "-I${cyrus_sasl.dev}/include/sasl"
     "-DHAS_DB_BYPASS_MAKEDEFS_CHECK"
    ] ++ lib.optional withPgSQL "-DHAS_PGSQL"
-     ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${lib.getDev libmysql}/include/mysql" ]
+     ++ lib.optionals withMySQL [ "-DHAS_MYSQL" "-I${mysql.connector-c}/include/mysql" "-L${mysql.connector-c}/lib/mysql" ]
      ++ lib.optional withSQLite "-DHAS_SQLITE"
      ++ lib.optional withLDAP "-DHAS_LDAP");
    auxlibs = lib.concatStringsSep " " ([
@@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ db openssl cyrus_sasl icu libnsl pcre ]
                 ++ lib.optional withPgSQL postgresql
-                ++ lib.optional withMySQL libmysql
+                ++ lib.optional withMySQL mysql.connector-c
                 ++ lib.optional withSQLite sqlite
                 ++ lib.optional withLDAP openldap;
 
diff --git a/pkgs/servers/sql/mariadb/cmake-includedir.patch b/pkgs/servers/sql/mariadb/cmake-includedir.patch
new file mode 100644
index 000000000000..0c4fe7d321e2
--- /dev/null
+++ b/pkgs/servers/sql/mariadb/cmake-includedir.patch
@@ -0,0 +1,11 @@
+--- a/include/CMakeLists.txt	2017-12-25 05:59:07.204144374 +0100
++++ b/include/CMakeLists.txt	2017-12-25 05:59:26.339552817 +0100
+@@ -94,7 +94,7 @@
+ ENDIF()
+ 
+ MACRO(INSTALL_COMPAT_HEADER file footer)
+-  INSTALL(CODE "FILE(WRITE \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDEDIR}/${file}
++  INSTALL(CODE "FILE(WRITE ${INSTALL_INCLUDEDIR}/${file}
+ \"/* Do not edit this file directly, it was auto-generated by cmake */
+ 
+ #warning This file should not be included by clients, include only <mysql.h>
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index d6731a5b7dc3..66125b353783 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -11,24 +11,18 @@ let # in mariadb # spans the whole file
 mariadb = everything // {
   inherit client; # libmysqlclient.so in .out, necessary headers in .dev and utils in .bin
   server = everything; # a full single-output build, including everything in `client` again
-  lib = client; # compat. with the old mariadb split
+  inherit connector-c; # libmysqlclient.so
 };
 
 common = rec { # attributes common to both builds
-  version = "10.1.28";
+  version = "10.2.11";
 
   src = fetchurl {
     url    = "https://downloads.mariadb.org/f/mariadb-${version}/source/mariadb-${version}.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/?serve";
-    sha256 = "1g9b0c04qhgcgw6xw29bvdjjjacr7kn82crc7apvvi10ykzwhb99";
+    sha256 = "1s53ravbrxcc8ixvkm56rwgs3cfifzngc56pidd1f1dr1n0mlmb3";
     name   = "mariadb-${version}.tar.gz";
   };
 
-  prePatch = ''
-    substituteInPlace cmake/libutils.cmake \
-      --replace /usr/bin/libtool libtool
-    sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
-  '';
-
   nativeBuildInputs = [ cmake pkgconfig ];
 
   buildInputs = [
@@ -36,6 +30,12 @@ common = rec { # attributes common to both builds
   ] ++ stdenv.lib.optionals stdenv.isLinux [ libaio systemd ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames cctools CoreServices ];
 
+  prePatch = ''
+    sed -i 's,[^"]*/var/log,/var/log,g' storage/mroonga/vendor/groonga/CMakeLists.txt
+  '';
+
+  patches = [ ./cmake-includedir.patch ];
+
   cmakeFlags = [
     "-DBUILD_CONFIG=mysql_release"
     "-DMANUFACTURER=NixOS.org"
@@ -72,7 +72,7 @@ common = rec { # attributes common to both builds
     find "''${!outputBin}/bin" -name '*test*' -delete
   '';
 
-  passthru.mysqlVersion = "5.6";
+  passthru.mysqlVersion = "5.7";
 
   meta = with stdenv.lib; {
     description = "An enhanced, drop-in replacement for MySQL";
@@ -83,7 +83,6 @@ common = rec { # attributes common to both builds
   };
 };
 
-
 client = stdenv.mkDerivation (common // {
   name = "mariadb-client-${common.version}";
 
@@ -97,21 +96,23 @@ client = stdenv.mkDerivation (common // {
 
   preConfigure = common.preConfigure + ''
     cmakeFlags="$cmakeFlags \
-      -DINSTALL_BINDIR=$bin/bin -DINSTALL_SCRIPTDIR=$bin/bin \
+      -DINSTALL_BINDIR=$bin/bin \
+      -DINSTALL_SCRIPTDIR=$bin/bin \
       -DINSTALL_SUPPORTFILESDIR=$bin/share/mysql \
-      -DINSTALL_DOCDIR=$bin/share/doc/mysql -DINSTALL_DOCREADMEDIR=$bin/share/doc/mysql \
+      -DINSTALL_DOCDIR=$bin/share/doc/mysql \
+      -DINSTALL_DOCREADMEDIR=$bin/share/doc/mysql \
       "
   '';
 
   # prevent cycle; it needs to reference $dev
   postInstall = common.postInstall + ''
     moveToOutput bin/mysql_config "$dev"
+    moveToOutput bin/mariadb_config "$dev"
   '';
 
   enableParallelBuilding = true; # the client should be OK
 });
 
-
 everything = stdenv.mkDerivation (common // {
   name = "mariadb-${common.version}";
 
@@ -120,9 +121,7 @@ everything = stdenv.mkDerivation (common // {
   buildInputs = common.buildInputs ++ [
     xz lzo lz4 bzip2 snappy
     libxml2 boost judy libevent cracklib
-  ]
-    ++ optionals (stdenv.isLinux && !stdenv.isArm) [ numactl ]
-    ;
+  ] ++ optionals (stdenv.isLinux && !stdenv.isArm) [ numactl ];
 
   cmakeFlags = common.cmakeFlags ++ [
     "-DMYSQL_DATADIR=/var/lib/mysql"
@@ -155,10 +154,45 @@ everything = stdenv.mkDerivation (common // {
   postInstall = common.postInstall + ''
     rm -r "$out"/{mysql-test,sql-bench,data} # Don't need testing data
     rm "$out"/share/man/man1/mysql-test-run.pl.1
-
-    # Don't install mysqlbug to prevent a dependency on gcc.
-    rm $out/bin/mysqlbug
+    rm "$out"/bin/rcmysql
   '';
+
+  CXXFLAGS = optionalString stdenv.isi686 "-fpermissive";
 });
 
+connector-c = stdenv.mkDerivation rec {
+  name = "mariadb-connector-c-${version}";
+  version = "2.3.4";
+
+  src = fetchurl {
+    url = "https://downloads.mariadb.org/interstitial/connector-c-${version}/mariadb-connector-c-${version}-src.tar.gz/from/http%3A//ftp.hosteurope.de/mirror/archive.mariadb.org/?serve";
+    sha256 = "1g1sq5knarxkfhpkcczr6qxmq12pid65cdkqnhnfs94av89hbswb";
+    name   = "mariadb-connector-c-${version}-src.tar.gz";
+  };
+
+  # outputs = [ "dev" "out" ]; FIXME: cmake variables don't allow that < 3.0
+  cmakeFlags = [
+    "-DWITH_EXTERNAL_ZLIB=ON"
+    "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ openssl zlib ];
+
+  enableParallelBuilding = true;
+
+  postFixup = ''
+    ln -sv mariadb_config $out/bin/mysql_config
+    ln -sv mariadb $out/lib/mysql
+    ln -sv mariadb $out/include/mysql
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Client library that can be used to connect to MySQL or MariaDB";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ globin ];
+    platforms = platforms.all;
+  };
+};
+
 in mariadb
diff --git a/pkgs/servers/sql/mysql/5.5.x.nix b/pkgs/servers/sql/mysql/5.5.x.nix
index 28e7824cd423..8f6ccd8c0d5b 100644
--- a/pkgs/servers/sql/mysql/5.5.x.nix
+++ b/pkgs/servers/sql/mysql/5.5.x.nix
@@ -3,7 +3,8 @@
 
 # Note: zlib is not required; MySQL can use an internal zlib.
 
-stdenv.mkDerivation rec {
+let
+self = stdenv.mkDerivation rec {
   name = "mysql-${version}";
   version = "5.5.58";
 
@@ -59,11 +60,16 @@ stdenv.mkDerivation rec {
     rm $out/share/man/man1/mysql-test-run.pl.1
   '';
 
-  passthru.mysqlVersion = "5.5";
+  passthru = {
+    client = self;
+    connector-c = self;
+    server = self;
+    mysqlVersion = "5.5";
+  };
 
   meta = {
     homepage = http://www.mysql.com/;
     description = "The world's most popular open source database";
     platforms = stdenv.lib.platforms.unix;
   };
-}
+}; in self
diff --git a/pkgs/servers/sql/mysql/5.7.x.nix b/pkgs/servers/sql/mysql/5.7.x.nix
index 687993e0dc57..0b2778218760 100644
--- a/pkgs/servers/sql/mysql/5.7.x.nix
+++ b/pkgs/servers/sql/mysql/5.7.x.nix
@@ -3,7 +3,8 @@
 
 # Note: zlib is not required; MySQL can use an internal zlib.
 
-stdenv.mkDerivation rec {
+let
+self = stdenv.mkDerivation rec {
   name = "mysql-${version}";
   version = "5.7.20";
 
@@ -22,15 +23,20 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  outputs = [ "out" "static" ];
+
   cmakeFlags = [
     "-DWITH_SSL=yes"
-    "-DWITH_READLINE=yes"
     "-DWITH_EMBEDDED_SERVER=yes"
+    "-DWITH_UNITTEST=no"
     "-DWITH_ZLIB=yes"
+    "-DWITH_ARCHIVE_STORAGE_ENGINE=yes"
+    "-DWITH_BLACKHOLE_STORAGE_ENGINE=yes"
+    "-DWITH_FEDERATED_STORAGE_ENGINE=yes"
+    "-DCMAKE_VERBOSE_MAKEFILE=yes"
     "-DHAVE_IPV6=yes"
     "-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock"
     "-DMYSQL_DATADIR=/var/lib/mysql"
-    "-DINSTALL_SYSCONFDIR=etc/mysql"
     "-DINSTALL_INFODIR=share/mysql/docs"
     "-DINSTALL_MANDIR=share/man"
     "-DINSTALL_PLUGINDIR=lib/mysql/plugin"
@@ -50,15 +56,22 @@ stdenv.mkDerivation rec {
   '';
   postInstall = ''
     sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
-    rm -r $out/mysql-test "$out"/lib/*.a
-    rm $out/share/man/man1/mysql-test-run.pl.1
+    install -vD $out/lib/*.a -t $static/lib
+    rm -r $out/mysql-test
+    rm $out/share/man/man1/mysql-test-run.pl.1 $out/lib/*.a
+    ln -s libmysqlclient.so $out/lib/libmysqlclient_r.so
   '';
 
-  passthru.mysqlVersion = "5.7";
+  passthru = {
+    client = self;
+    connector-c = self;
+    server = self;
+    mysqlVersion = "5.7";
+  };
 
   meta = {
     homepage = http://www.mysql.com/;
     description = "The world's most popular open source database";
     platforms = stdenv.lib.platforms.unix;
   };
-}
+}; in self
diff --git a/pkgs/servers/web-apps/frab/Gemfile.lock b/pkgs/servers/web-apps/frab/Gemfile.lock
index 530c54ebd898..06502ef59ad5 100644
--- a/pkgs/servers/web-apps/frab/Gemfile.lock
+++ b/pkgs/servers/web-apps/frab/Gemfile.lock
@@ -180,7 +180,7 @@ GEM
       pry (~> 0.10)
     pry-rails (0.3.4)
       pry (>= 0.9.10)
-    puma (3.6.0)
+    puma (3.9.1)
     rack (1.6.4)
     rack-test (0.6.3)
       rack (>= 1.0)
diff --git a/pkgs/servers/web-apps/frab/gemset.nix b/pkgs/servers/web-apps/frab/gemset.nix
index 9f881579f42d..449fbf1a5b6b 100644
--- a/pkgs/servers/web-apps/frab/gemset.nix
+++ b/pkgs/servers/web-apps/frab/gemset.nix
@@ -628,10 +628,10 @@
   puma = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1rmcny3jr1jj01f9fqijwmikj212a5iql7ghifklm77x4a8pp399";
+      sha256 = "1k13n500r7v480rcbxm7k09hip0zi7p8zvy3vajj8g9hb7gdcwnp";
       type = "gem";
     };
-    version = "3.6.0";
+    version = "3.9.1";
   };
   rack = {
     source = {
@@ -929,4 +929,4 @@
     };
     version = "0.9.5";
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index d1c7c81c101e..cc2cade8ba13 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -2588,11 +2588,11 @@ let
   }) // {inherit ;};
 
   xorgserver = (mkDerivation "xorgserver" {
-    name = "xorg-server-1.19.5";
+    name = "xorg-server-1.19.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xserver/xorg-server-1.19.5.tar.bz2;
-      sha256 = "0iql4pgsgpyqcrd3256pv227cdadvz01ych61n0d41ixp67gmzqq";
+      url = mirror://xorg/individual/xserver/xorg-server-1.19.6.tar.bz2;
+      sha256 = "15y13ihgkggmly5s07vzvpn35gzx1w0hrkbnlcvcy05h3lpm0cm7";
     };
     nativeBuildInputs = [ pkgconfig ];
     buildInputs = [ dri2proto dri3proto renderproto openssl libX11 libXau libXaw libxcb xcbutil xcbutilwm xcbutilimage xcbutilkeysyms xcbutilrenderutil libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt ];
diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list
index 4ea77fee4431..dd48748dceb3 100644
--- a/pkgs/servers/x11/xorg/tarballs-7.7.list
+++ b/pkgs/servers/x11/xorg/tarballs-7.7.list
@@ -186,7 +186,7 @@ mirror://xorg/individual/app/xlsfonts-1.0.5.tar.bz2
 mirror://xorg/individual/app/xmag-1.0.6.tar.bz2
 mirror://xorg/individual/app/xmodmap-1.0.9.tar.bz2
 mirror://xorg/individual/doc/xorg-docs-1.7.1.tar.bz2
-mirror://xorg/individual/xserver/xorg-server-1.19.5.tar.bz2
+mirror://xorg/individual/xserver/xorg-server-1.19.6.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xorg-sgml-doctools-1.11.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xpr-1.0.4.tar.bz2
 mirror://xorg/individual/app/xprop-1.2.2.tar.bz2
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index d202186c29b2..2542d2428859 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -58,6 +58,7 @@ in rec {
                           extraPreHook      ? "",
                           extraNativeBuildInputs,
                           extraBuildInputs,
+                          libcxx,
                           allowedRequisites ? null}:
     let
       buildPackages = lib.optionalAttrs (last ? stdenv) {
@@ -82,6 +83,8 @@ in rec {
         inherit shell;
         inherit (last) stdenvNoCC;
 
+        extraPackages = lib.optional (libcxx != null) libcxx;
+
         nativeTools  = false;
         nativeLibc   = false;
         inherit buildPackages coreutils gnugrep bintools;
@@ -176,6 +179,7 @@ in rec {
 
     extraNativeBuildInputs = [];
     extraBuildInputs = [];
+    libcxx = null;
   };
 
   stage1 = prevStage: let
@@ -183,7 +187,8 @@ in rec {
   in with prevStage; stageFun 1 prevStage {
     extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
     extraNativeBuildInputs = [];
-    extraBuildInputs = [ pkgs.libcxx ];
+    extraBuildInputs = [ ];
+    libcxx = pkgs.libcxx;
 
     allowedRequisites =
       [ bootstrapTools ] ++ (with pkgs; [ libcxx libcxxabi ]) ++ [ pkgs.darwin.Libsystem ];
@@ -210,7 +215,8 @@ in rec {
     '';
 
     extraNativeBuildInputs = [ pkgs.xz ];
-    extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
+    extraBuildInputs = [ pkgs.darwin.CF ];
+    libcxx = pkgs.libcxx;
 
     allowedRequisites =
       [ bootstrapTools ] ++
@@ -242,7 +248,8 @@ in rec {
     # and instead goes by $PATH, which happens to contain bootstrapTools. So it goes and
     # patches our shebangs back to point at bootstrapTools. This makes sure bash comes first.
     extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
-    extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
+    extraBuildInputs = [ pkgs.darwin.CF ];
+    libcxx = pkgs.libcxx;
 
     extraPreHook = ''
       export PATH=${pkgs.bash}/bin:$PATH
@@ -277,7 +284,9 @@ in rec {
   in with prevStage; stageFun 4 prevStage {
     shell = "${pkgs.bash}/bin/bash";
     extraNativeBuildInputs = with pkgs; [ xz pkgs.bash ];
-    extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
+    extraBuildInputs = [ pkgs.darwin.CF ];
+    libcxx = pkgs.libcxx;
+
     extraPreHook = ''
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
@@ -347,10 +356,11 @@ in rec {
       cc       = pkgs.llvmPackages.clang-unwrapped;
       bintools = pkgs.darwin.binutils;
       libc     = pkgs.darwin.Libsystem;
+      extraPackages = [ pkgs.libcxx ];
     };
 
     extraNativeBuildInputs = [];
-    extraBuildInputs = with pkgs; [ darwin.CF libcxx ];
+    extraBuildInputs = [ pkgs.darwin.CF ];
 
     extraAttrs = {
       inherit platform bootstrapTools;
diff --git a/pkgs/tools/admin/ansible/2.1.nix b/pkgs/tools/admin/ansible/2.1.nix
index d4a349c5e47d..b8b335bd6186 100644
--- a/pkgs/tools/admin/ansible/2.1.nix
+++ b/pkgs/tools/admin/ansible/2.1.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchurl
+, fetchFromGitHub
 , pythonPackages
 , windowsSupport ? false
 }:
@@ -10,9 +11,11 @@ let
   jinja = jinja2.overridePythonAttrs (old: rec {
     version = "2.8.1";
     name = "${old.pname}-${version}";
-    src = old.src.override {
-      inherit version;
-      sha256 = "35341f3a97b46327b3ef1eb624aadea87a535b8f50863036e085e7c426ac5891";
+    src = fetchFromGitHub {
+      owner = "pallets";
+      repo = "jinja";
+      rev = version;
+      sha256 = "0m6g6fx6flxb6hrkw757mbx1gxyrmj50w27m2afdsvmvz0zpdi2a";
     };
   });
 in buildPythonPackage rec {
diff --git a/pkgs/tools/admin/ansible/2.2.nix b/pkgs/tools/admin/ansible/2.2.nix
index 4ef35fa5d9eb..ccca64b86b64 100644
--- a/pkgs/tools/admin/ansible/2.2.nix
+++ b/pkgs/tools/admin/ansible/2.2.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchurl
+, fetchFromGitHub
 , pythonPackages
 , windowsSupport ? false
 }:
@@ -12,9 +13,11 @@ let
   jinja = jinja2.overridePythonAttrs (old: rec {
     version = "2.8.1";
     name = "${old.pname}-${version}";
-    src = old.src.override {
-      inherit version;
-      sha256 = "35341f3a97b46327b3ef1eb624aadea87a535b8f50863036e085e7c426ac5891";
+    src = fetchFromGitHub {
+      owner = "pallets";
+      repo = "jinja";
+      rev = version;
+      sha256 = "0m6g6fx6flxb6hrkw757mbx1gxyrmj50w27m2afdsvmvz0zpdi2a";
     };
   });
 in buildPythonPackage rec {
diff --git a/pkgs/tools/backup/bareos/default.nix b/pkgs/tools/backup/bareos/default.nix
index c32567138322..4af20f76449a 100644
--- a/pkgs/tools/backup/bareos/default.nix
+++ b/pkgs/tools/backup/bareos/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchFromGitHub, pkgconfig, nettools, gettext, libtool, flex
 , readline ? null, openssl ? null, python2 ? null, ncurses ? null, rocksdb
-, sqlite ? null, postgresql ? null, libmysql ? null, zlib ? null, lzo ? null
+, sqlite ? null, postgresql ? null, mysql ? null, zlib ? null, lzo ? null
 , jansson ? null, acl ? null, glusterfs ? null, libceph ? null, libcap ? null
 }:
 
-assert sqlite != null || postgresql != null || libmysql != null;
+assert sqlite != null || postgresql != null || mysql != null;
 
 with stdenv.lib;
 let
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
     nettools gettext readline openssl python2 flex ncurses sqlite postgresql
-    libmysql zlib lzo jansson acl glusterfs libceph libcap rocksdb
+    mysql.connector-c zlib lzo jansson acl glusterfs libceph libcap rocksdb
   ];
 
   postPatch = ''
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
     ++ optional (openssl != null) "--with-openssl=${openssl.dev}"
     ++ optional (sqlite != null) "--with-sqlite3=${sqlite.dev}"
     ++ optional (postgresql != null) "--with-postgresql=${postgresql}"
-    ++ optional (libmysql != null) "--with-mysql=${libmysql.dev}"
+    ++ optional (mysql != null) "--with-mysql=${mysql.connector-c}"
     ++ optional (zlib != null) "--with-zlib=${zlib.dev}"
     ++ optional (lzo != null) "--with-lzo=${lzo}"
     ++ optional (jansson != null) "--with-jansson=${jansson}"
diff --git a/pkgs/tools/backup/mydumper/default.nix b/pkgs/tools/backup/mydumper/default.nix
index 5b1f8f3fd5cb..da8805bc226e 100644
--- a/pkgs/tools/backup/mydumper/default.nix
+++ b/pkgs/tools/backup/mydumper/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, cmake, pkgconfig
-, glib, zlib, pcre, mariadb, libressl, }:
+, glib, zlib, pcre, mysql, libressl }:
 
 stdenv.mkDerivation rec {
   version = "0.9.3";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ glib zlib pcre mariadb.client.dev libressl ];
+  buildInputs = [ glib zlib pcre mysql.connector-c libressl ];
 
   meta = with stdenv.lib; {
     description = ''High-perfomance MySQL backup tool'';
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 9a422a96d703..589c58d0acc0 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -14,11 +14,11 @@ assert selinuxSupport -> libselinux != null && libsepol != null;
 with lib;
 
 stdenv.mkDerivation rec {
-  name = "coreutils-8.28";
+  name = "coreutils-8.29";
 
   src = fetchurl {
     url = "mirror://gnu/coreutils/${name}.tar.xz";
-    sha256 = "0r8c1bgm68kl70j1lgd0rv12iykw6143k4m9a56xip9rc2hv25qi";
+    sha256 = "0plm1zs9il6bb5mk881qvbghq4glc8ybbgakk2lfzb0w64fgml4j";
   };
 
   patches = optional hostPlatform.isCygwin ./coreutils-8.23-4.cygwin.patch;
diff --git a/pkgs/tools/networking/kea/default.nix b/pkgs/tools/networking/kea/default.nix
index 68fb72ff7d9e..f33fe7a7105c 100644
--- a/pkgs/tools/networking/kea/default.nix
+++ b/pkgs/tools/networking/kea/default.nix
@@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--localstatedir=/var"
     "--with-dhcp-pgsql=${postgresql}/bin/pg_config"
-    "--with-dhcp-mysql=${mysql.client.dev}/bin/mysql_config"
+    "--with-dhcp-mysql=${mysql.connector-c}/bin/mysql_config"
   ];
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
   buildInputs = [
-    openssl log4cplus boost python3 mysql.client
+    openssl log4cplus boost python3 mysql.connector-c
     botan2 gmp bzip2
   ];
 
diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix
index aee5302405a5..6f47b4b55766 100644
--- a/pkgs/tools/networking/mailutils/default.nix
+++ b/pkgs/tools/networking/mailutils/default.nix
@@ -1,11 +1,10 @@
-{ stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, libtool, pkgconfig
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, dejagnu, gettext, pkgconfig
 , gdbm, pam, readline, ncurses, gnutls, guile, texinfo, gnum4, sasl, fribidi, nettools
-, gss, mysql }:
+, python, gss, mysql }:
 
 let
   p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files";
-in
-stdenv.mkDerivation rec {
+in stdenv.mkDerivation rec {
   name = "${project}-${version}";
   project = "mailutils";
   version = "3.2";
@@ -16,11 +15,11 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    autoreconfHook gettext libtool pkgconfig
+    autoreconfHook gettext pkgconfig
   ] ++ stdenv.lib.optional doCheck dejagnu;
   buildInputs = [
     gdbm pam readline ncurses gnutls guile texinfo gnum4 sasl fribidi nettools
-    gss mysql.lib
+    gss mysql.connector-c python
   ];
 
   patches = [
@@ -52,14 +51,20 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = ''
-    sed -e '/AM_GNU_GETTEXT_VERSION/s/0.18/0.19/' -i configure.ac
     sed -i -e '/chown root:mail/d' \
            -e 's/chmod [24]755/chmod 0755/' \
       */Makefile{.in,.am}
+    sed -i 's:/usr/lib/mysql:${mysql.connector-c}/lib/mysql:' configure.ac
+    sed -i 's/0\.18/0.19/' configure.ac
+    sed -i -e 's:mysql/mysql.h:mysql.h:' \
+           -e 's:mysql/errmsg.h:errmsg.h:' \
+      sql/mysql.c
   '';
 
+  NIX_CFLAGS_COMPILE = "-L${mysql.connector-c}/lib/mysql -I${mysql.connector-c}/include/mysql";
+
   preCheck = ''
-    # Add missing files.
+    # Add missing test files
     cp ${builtins.toString readmsg-tests} readmsg/tests/
     for f in hdr.at nohdr.at twomsg.at weed.at; do
       mv readmsg/tests/*-$f readmsg/tests/$f
diff --git a/pkgs/tools/networking/snabb/default.nix b/pkgs/tools/networking/snabb/default.nix
index f3baddd2653c..46580c0b802c 100644
--- a/pkgs/tools/networking/snabb/default.nix
+++ b/pkgs/tools/networking/snabb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, bash, makeWrapper, git, mariadb, diffutils, which, coreutils, procps, nettools }:
+{ stdenv, lib, fetchFromGitHub, bash, makeWrapper, git, mysql, diffutils, which, coreutils, procps, nettools }:
 
 stdenv.mkDerivation rec {
   name = "snabb-${version}";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     done
 
     # We need a way to pass $PATH to the scripts
-    sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git mariadb which procps coreutils ]}' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc
+    sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git mysql.client which procps coreutils ]}' src/program/snabbnfv/neutron_sync_master/neutron_sync_master.sh.inc
     sed -i '2iexport PATH=${stdenv.lib.makeBinPath [ git coreutils diffutils nettools ]}' src/program/snabbnfv/neutron_sync_agent/neutron_sync_agent.sh.inc
   '';
 
diff --git a/pkgs/tools/security/gnupg/22.nix b/pkgs/tools/security/gnupg/22.nix
index 0519902308af..89fee90364e8 100644
--- a/pkgs/tools/security/gnupg/22.nix
+++ b/pkgs/tools/security/gnupg/22.nix
@@ -15,11 +15,11 @@ assert guiSupport -> pinentry != null;
 stdenv.mkDerivation rec {
   name = "gnupg-${version}";
 
-  version = "2.2.3";
+  version = "2.2.4";
 
   src = fetchurl {
     url = "mirror://gnupg/gnupg/${name}.tar.bz2";
-    sha256 = "1d4482c4pbi0p1k8cc0f9c4q51k56v8navrbz5samxrrs42p3lyb";
+    sha256 = "1v7j8v2ww1knknbrhw3svfrqkmf9ll58iq0dczbsdpqgg1j3w6j0";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/security/thc-hydra/default.nix b/pkgs/tools/security/thc-hydra/default.nix
index e8eb3aacd3e9..9a7a245b8134 100644
--- a/pkgs/tools/security/thc-hydra/default.nix
+++ b/pkgs/tools/security/thc-hydra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, zlib, openssl, ncurses, libidn, pcre, libssh, libmysql, postgresql
+{ stdenv, lib, fetchurl, zlib, openssl, ncurses, libidn, pcre, libssh, mysql, postgresql
 , withGUI ? false, makeWrapper, pkgconfig, gtk2 }:
 
 let
@@ -23,7 +23,7 @@ in stdenv.mkDerivation rec {
   '';
 
   nativeBuildInputs = lib.optionals withGUI [ pkgconfig makeWrapper ];
-  buildInputs = [ zlib openssl ncurses libidn pcre libssh libmysql postgresql ]
+  buildInputs = [ zlib openssl ncurses libidn pcre libssh mysql.connector-c postgresql ]
                 ++ lib.optional withGUI gtk2;
 
   postInstall = lib.optionalString withGUI ''
diff --git a/pkgs/tools/system/collectd/default.nix b/pkgs/tools/system/collectd/default.nix
index ddfd8cbbc01f..4c9ebc460819 100644
--- a/pkgs/tools/system/collectd/default.nix
+++ b/pkgs/tools/system/collectd/default.nix
@@ -20,7 +20,7 @@
 , libtool ? null
 , lm_sensors ? null
 , lvm2 ? null
-, libmysql ? null
+, mysql ? null
 , postgresql ? null
 , protobufc ? null
 , python ? null
@@ -50,9 +50,10 @@ stdenv.mkDerivation rec {
   buildInputs = [
     curl libdbi libgcrypt libmemcached
     cyrus_sasl libnotify gdk_pixbuf liboping libpcap libvirt
-    libxml2 libmysql postgresql protobufc rrdtool
+    libxml2 postgresql protobufc rrdtool
     varnish yajl jdk libtool python hiredis libmicrohttpd
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
+  ] ++ stdenv.lib.optional (mysql != null) mysql.connector-c
+  ++ stdenv.lib.optionals stdenv.isLinux [
     iptables libatasmart libcredis libmodbus libsigrok
     lm_sensors lvm2 rabbitmq-c udev net_snmp libmnl
   ] ++ stdenv.lib.optionals stdenv.isDarwin [
diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix
index e642b91c3d96..a6999942e0c6 100644
--- a/pkgs/tools/system/rsyslog/default.nix
+++ b/pkgs/tools/system/rsyslog/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, autoreconfHook, libestr, json_c, zlib, pythonPackages, fastJson
-, libkrb5 ? null, systemd ? null, jemalloc ? null, libmysql ? null, postgresql ? null
+, libkrb5 ? null, systemd ? null, jemalloc ? null, mysql ? null, postgresql ? null
 , libdbi ? null, net_snmp ? null, libuuid ? null, curl ? null, gnutls ? null
 , libgcrypt ? null, liblognorm ? null, openssl ? null, librelp ? null, libksi ? null
 , libgt ? null, liblogging ? null, libnet ? null, hadoop ? null, rdkafka ? null
@@ -22,11 +22,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig autoreconfHook ];
   buildInputs = [
-    fastJson libestr json_c zlib pythonPackages.docutils libkrb5 jemalloc libmysql
+    fastJson libestr json_c zlib pythonPackages.docutils libkrb5 jemalloc 
     postgresql libdbi net_snmp libuuid curl gnutls libgcrypt liblognorm openssl
     librelp libgt libksi liblogging libnet hadoop rdkafka libmongo-client czmq
     rabbitmq-c hiredis
-  ] ++ stdenv.lib.optional stdenv.isLinux systemd;
+  ] ++ stdenv.lib.optional (mysql != null) mysql.connector-c
+    ++ stdenv.lib.optional stdenv.isLinux systemd;
 
   hardeningDisable = [ "format" ];
 
@@ -49,7 +50,7 @@ stdenv.mkDerivation rec {
     (mkFlag false                     "valgrind")
     (mkFlag false                     "diagtools")
     (mkFlag true                      "usertools")
-    (mkFlag (libmysql != null)        "mysql")
+    (mkFlag (mysql != null)           "mysql")
     (mkFlag (postgresql != null)      "pgsql")
     (mkFlag (libdbi != null)          "libdbi")
     (mkFlag (net_snmp != null)        "snmp")
diff --git a/pkgs/tools/typesetting/tex/dblatex/default.nix b/pkgs/tools/typesetting/tex/dblatex/default.nix
index 7ffccde2c035..c4eaf4e1df46 100644
--- a/pkgs/tools/typesetting/tex/dblatex/default.nix
+++ b/pkgs/tools/typesetting/tex/dblatex/default.nix
@@ -21,11 +21,11 @@ assert enableAllFeatures ->
   ghostscript != null;
 
 stdenv.mkDerivation rec {
-  name = "dblatex-0.3.7";
+  name = "dblatex-0.3.10";
 
   src = fetchurl {
     url = "mirror://sourceforge/dblatex/${name}.tar.bz2";
-    sha256 = "0bkjgrn03dy5c7438s429wnv6z5ynxkr4pbhp2z49kynskgkzkjr";
+    sha256 = "1yicd861rqz78i2khl35j7nvc0ccv4jx4hzqrbhll17082vrdmkg";
   };
 
   buildInputs = [ python2 libxslt tex ]
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 6eb826c073f6..2c249f73d6c4 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -95,6 +95,7 @@ mapAliases (rec {
   libcap_pam = if stdenv.isLinux then libcap.pam else null; # added 2016-04-29
   libcap_progs = libcap.out; # added 2016-04-29
   libjson_rpc_cpp = libjson-rpc-cpp; # added 2017-02-28
+  libmysql = mysql.connector-c; # added # 2017-12-28, this was a misnomer refering to libmysqlclient
   libtidy = html-tidy;  # added 2014-12-21
   links = links2; # added 2016-01-31
   lttngTools = lttng-tools;  # added 2014-07-31
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ef0780d69af1..7bc88e6ae9e0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -1254,7 +1254,7 @@ with pkgs;
     libkrb5 = null;
     systemd = null;
     jemalloc = null;
-    libmysql = null;
+    mysql = null;
     postgresql = null;
     libdbi = null;
     net_snmp = null;
@@ -1508,7 +1508,6 @@ with pkgs;
   convertlit = callPackage ../tools/text/convertlit { };
 
   collectd = callPackage ../tools/system/collectd {
-    libmysql = mysql.lib;
     libsigrok = libsigrok-0-3-0; # not compatible with >= 0.4.0 yet
   };
 
@@ -6474,6 +6473,7 @@ with pkgs;
     vala_0_28
     vala_0_32
     vala_0_34
+    vala_0_36
     vala_0_38
     vala;
 
@@ -8030,7 +8030,8 @@ with pkgs;
   boost163 = callPackage ../development/libraries/boost/1.63.nix { };
   boost164 = callPackage ../development/libraries/boost/1.64.nix { };
   boost165 = callPackage ../development/libraries/boost/1.65.nix { };
-  boost16x = boost165;
+  boost166 = callPackage ../development/libraries/boost/1.66.nix { };
+  boost16x = boost166;
   boost = boost16x;
 
   boost_process = callPackage ../development/libraries/boost-process { };
@@ -9179,12 +9180,12 @@ with pkgs;
   libdbi = callPackage ../development/libraries/libdbi { };
 
   libdbiDriversBase = callPackage ../development/libraries/libdbi-drivers {
-    libmysql = null;
+    mysql = null;
     sqlite = null;
   };
 
   libdbiDrivers = libdbiDriversBase.override {
-    inherit sqlite libmysql;
+    inherit sqlite mysql;
   };
 
   libdbusmenu-glib = callPackage ../development/libraries/libdbusmenu { };
@@ -11999,7 +12000,6 @@ with pkgs;
   };
 
   mysql = mariadb;
-  libmysql = mysql.client; # `libmysql` is a slight misnomer ATM
 
   mysql_jdbc = callPackage ../servers/sql/mysql/jdbc { };
 
@@ -18086,8 +18086,6 @@ with pkgs;
 
   gemrb = callPackage ../games/gemrb { };
 
-  ghostOne = callPackage ../servers/games/ghost-one { };
-
   gl117 = callPackage ../games/gl-117 {};
 
   globulation2 = callPackage ../games/globulation {
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index c83e62fd89a5..4c05f96caf7a 100644
--- a/pkgs/top-level/lua-packages.nix
+++ b/pkgs/top-level/lua-packages.nix
@@ -8,7 +8,7 @@
 { fetchurl, fetchzip, stdenv, lua, callPackage, unzip, zziplib, pkgconfig, libtool
 , pcre, oniguruma, gnulib, tre, glibc, sqlite, openssl, expat, cairo
 , perl, gtk2, python, glib, gobjectIntrospection, libevent, zlib, autoreconfHook
-, libmysql, postgresql, cyrus_sasl
+, mysql, postgresql, cyrus_sasl
 , fetchFromGitHub, libmpack, which
 }:
 
@@ -210,7 +210,7 @@ let
     };
     sourceRoot = ".";
 
-    buildInputs = [ libmysql postgresql sqlite ];
+    buildInputs = [ mysql.connector-c postgresql sqlite ];
 
     preConfigure = ''
       substituteInPlace Makefile --replace CC=gcc CC=cc
@@ -220,7 +220,8 @@ let
     '';
 
     NIX_CFLAGS_COMPILE = [
-      "-I${libmysql.dev}/include/mysql"
+      "-I${mysql.connector-c}/include/mysql"
+      "-L${mysql.connector-c}/lib/mysql"
       "-I${postgresql}/include/server"
     ];
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 78ce69d7f2d4..6010cc84a0e5 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -11568,9 +11568,9 @@ in {
       sha256 = "0x0c2jg0bb3pp84njaqiic050qkyd7ymwhfvhipnimg58yv40441";
     };
 
-    buildInputs = with self; [ nose pkgs.openssl ];
+    buildInputs = with self; [ nose ];
 
-    propagatedBuildInputs = with self; [ pkgs.mysql.lib pkgs.zlib ];
+    propagatedBuildInputs = with self; [ pkgs.mysql.connector-c ];
 
     meta = {
       description = "MySQL database binding for Python";