about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/cross-compilation.xml41
-rw-r--r--doc/stdenv.xml357
-rw-r--r--lib/generators.nix2
-rw-r--r--lib/maintainers.nix1
-rwxr-xr-xmaintainers/scripts/copy-tarballs.pl3
-rw-r--r--nixos/doc/manual/release-notes/rl-1803.xml36
-rw-r--r--nixos/lib/test-driver/Machine.pm28
-rw-r--r--nixos/modules/misc/ids.nix12
-rw-r--r--nixos/modules/module-list.nix3
-rw-r--r--nixos/modules/services/databases/memcached.nix57
-rw-r--r--nixos/modules/services/databases/mysql.nix17
-rw-r--r--nixos/modules/services/databases/redis.nix1
-rw-r--r--nixos/modules/services/games/ghost-one.nix105
-rw-r--r--nixos/modules/services/mail/dkimproxy-out.nix118
-rw-r--r--nixos/modules/services/networking/nat.nix26
-rw-r--r--nixos/modules/services/x11/window-managers/awesome.nix11
-rw-r--r--nixos/modules/virtualisation/hyperv-guest.nix37
-rw-r--r--pkgs/applications/altcoins/zcash/default.nix13
-rw-r--r--pkgs/applications/altcoins/zcash/libsnark/ate-pairing.nix29
-rw-r--r--pkgs/applications/altcoins/zcash/libsnark/default.nix45
-rw-r--r--pkgs/applications/altcoins/zcash/libsnark/mie.nix27
-rw-r--r--pkgs/applications/altcoins/zcash/libsnark/xbyak.nix28
-rw-r--r--pkgs/applications/audio/amarok/kf5.nix5
-rw-r--r--pkgs/applications/editors/emacs-modes/elpa-generated.nix18
-rw-r--r--pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/melpa-generated.nix925
-rw-r--r--pkgs/applications/editors/emacs-modes/melpa-stable-generated.nix209
-rw-r--r--pkgs/applications/editors/emacs-modes/org-generated.nix12
-rw-r--r--pkgs/applications/gis/grass/default.nix23
-rw-r--r--pkgs/applications/gis/saga/default.nix6
-rw-r--r--pkgs/applications/graphics/digikam/default.nix1
-rw-r--r--pkgs/applications/kde/kmime.nix4
-rw-r--r--pkgs/applications/kde/libkcddb.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-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/haxor-news/default.nix24
-rw-r--r--pkgs/applications/misc/kupfer/default.nix7
-rw-r--r--pkgs/applications/misc/lxterminal/default.nix8
-rw-r--r--pkgs/applications/misc/pdfpc/default.nix8
-rw-r--r--pkgs/applications/misc/synapse/default.nix8
-rw-r--r--pkgs/applications/misc/toot/default.nix12
-rw-r--r--pkgs/applications/misc/valauncher/default.nix10
-rw-r--r--pkgs/applications/misc/xkbmon/default.nix25
-rw-r--r--pkgs/applications/networking/browsers/lynx/default.nix6
-rw-r--r--pkgs/applications/networking/feedreaders/rssguard/default.nix25
-rw-r--r--pkgs/applications/networking/instant-messengers/jackline/default.nix8
-rw-r--r--pkgs/applications/networking/p2p/deluge/default.nix4
-rw-r--r--pkgs/applications/networking/p2p/qbittorrent/default.nix4
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix4
-rw-r--r--pkgs/applications/office/kexi/default.nix4
-rw-r--r--pkgs/applications/office/skrooge/default.nix7
-rw-r--r--pkgs/applications/office/watson/default.nix27
-rw-r--r--pkgs/applications/science/logic/coq/8.4.nix2
-rw-r--r--pkgs/applications/science/logic/coq/default.nix2
-rw-r--r--pkgs/applications/science/logic/z3/default.nix6
-rw-r--r--pkgs/applications/science/math/R/setup-hook.sh6
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix2
-rw-r--r--pkgs/applications/video/gnome-mplayer/default.nix33
-rw-r--r--pkgs/applications/video/gnome-mplayer/fix-paths.patch87
-rw-r--r--pkgs/applications/video/kodi/default.nix2
-rw-r--r--pkgs/applications/video/mplayer/default.nix3
-rw-r--r--pkgs/applications/virtualization/docker/default.nix35
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix4
-rw-r--r--pkgs/build-support/bintools-wrapper/default.nix16
-rw-r--r--pkgs/build-support/bintools-wrapper/ld-wrapper.sh5
-rw-r--r--pkgs/build-support/bintools-wrapper/setup-hook.sh45
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix3
-rw-r--r--pkgs/build-support/cc-wrapper/setup-hook.sh55
-rw-r--r--pkgs/build-support/emacs/setup-hook.sh6
-rw-r--r--pkgs/build-support/emacs/wrapper.nix36
-rw-r--r--pkgs/build-support/gcc-wrapper-old/setup-hook.sh4
-rw-r--r--pkgs/build-support/setup-hooks/find-xml-catalogs.sh2
-rw-r--r--pkgs/build-support/setup-hooks/set-java-classpath.sh2
-rw-r--r--pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh2
-rw-r--r--pkgs/build-support/setup-hooks/strip.sh37
-rw-r--r--pkgs/build-support/setup-hooks/wrap-gapps-hook.sh2
-rw-r--r--pkgs/data/icons/hicolor-icon-theme/setup-hook.sh3
-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/gconf/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/core/grilo/setup-hook.sh2
-rw-r--r--pkgs/desktops/gnome-3/core/gtksourceview/default.nix12
-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/gnustep/make/setup-hook.sh2
-rw-r--r--pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix8
-rw-r--r--pkgs/desktops/plasma-5/fetch.sh2
-rw-r--r--pkgs/desktops/plasma-5/srcs.nix352
-rw-r--r--pkgs/development/compilers/chicken/setup-hook.sh2
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix68
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix54
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix68
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix72
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix71
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix71
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix71
-rw-r--r--pkgs/development/compilers/gerbil/default.nix6
-rw-r--r--pkgs/development/compilers/ghc/6.10.2-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/6.10.4.nix7
-rw-r--r--pkgs/development/compilers/ghc/6.12.3.nix7
-rw-r--r--pkgs/development/compilers/ghc/7.0.4-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/7.0.4.nix7
-rw-r--r--pkgs/development/compilers/ghc/7.10.3-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/7.10.3.nix32
-rw-r--r--pkgs/development/compilers/ghc/7.2.2.nix12
-rw-r--r--pkgs/development/compilers/ghc/7.4.2-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/7.4.2.nix12
-rw-r--r--pkgs/development/compilers/ghc/7.6.3.nix12
-rw-r--r--pkgs/development/compilers/ghc/7.8.4-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/7.8.4.nix12
-rw-r--r--pkgs/development/compilers/ghc/8.0.2.nix39
-rw-r--r--pkgs/development/compilers/ghc/8.2.1-binary.nix5
-rw-r--r--pkgs/development/compilers/ghc/8.2.2.nix88
-rw-r--r--pkgs/development/compilers/ghc/head.nix83
-rw-r--r--pkgs/development/compilers/go/setup-hook.sh2
-rw-r--r--pkgs/development/compilers/haxe/setup-hook.sh2
-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/sbcl/default.nix2
-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.nix7
-rw-r--r--pkgs/development/haskell-modules/configuration-hackage2nix.yaml1
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix2
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix44
-rw-r--r--pkgs/development/haskell-modules/hackage-packages.nix32
-rw-r--r--pkgs/development/haskell-modules/hie-packages.nix5
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix27
-rw-r--r--pkgs/development/haskell-modules/with-packages-wrapper.nix11
-rw-r--r--pkgs/development/idris-modules/build-idris-package.nix3
-rw-r--r--pkgs/development/idris-modules/with-packages.nix2
-rw-r--r--pkgs/development/interpreters/elixir/setup-hook.sh2
-rw-r--r--pkgs/development/interpreters/erlang/setup-hook.sh2
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-2.0.sh2
-rw-r--r--pkgs/development/interpreters/guile/setup-hook-2.2.sh2
-rw-r--r--pkgs/development/interpreters/guile/setup-hook.sh2
-rw-r--r--pkgs/development/interpreters/jruby/default.nix2
-rw-r--r--pkgs/development/interpreters/perl/setup-hook.sh2
-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/interpreters/python/setup-hook.sh5
-rw-r--r--pkgs/development/interpreters/ruby/default.nix2
-rw-r--r--pkgs/development/libraries/SDL/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/SDL2/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/atk/default.nix4
-rw-r--r--pkgs/development/libraries/boost/1.59.nix58
-rw-r--r--pkgs/development/libraries/boost/1.65.nix2
-rw-r--r--pkgs/development/libraries/boost/1.66.nix12
-rw-r--r--pkgs/development/libraries/boost/generic.nix150
-rw-r--r--pkgs/development/libraries/cppdb/default.nix6
-rw-r--r--pkgs/development/libraries/gdal/default.nix6
-rw-r--r--pkgs/development/libraries/gdal/gdal-1_11.nix4
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/glib/setup-hook.sh2
-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.nix24
-rw-r--r--pkgs/development/libraries/gmp/6.x.nix4
-rw-r--r--pkgs/development/libraries/gmtk/default.nix32
-rw-r--r--pkgs/development/libraries/gmtk/fix-paths.patch20
-rw-r--r--pkgs/development/libraries/gobject-introspection/setup-hook.sh12
-rw-r--r--pkgs/development/libraries/grantlee/5/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/gstreamer/core/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh2
-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/kde-frameworks/extra-cmake-modules/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/kde-frameworks/kdoctools/default.nix14
-rw-r--r--pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh2
-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/libelf/default.nix24
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix4
-rw-r--r--pkgs/development/libraries/libnftnl/default.nix4
-rw-r--r--pkgs/development/libraries/libopcodes/default.nix3
-rw-r--r--pkgs/development/libraries/librdf/redland.nix2
-rw-r--r--pkgs/development/libraries/librep/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/1.0.nix13
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix4
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/ncurses/default.nix7
-rw-r--r--pkgs/development/libraries/nss/ckpem.patch11
-rw-r--r--pkgs/development/libraries/nss/default.nix19
-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/hooks/qtbase-setup-hook.sh6
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix2
-rw-r--r--pkgs/development/libraries/rep-gtk/setup-hook.sh2
-rw-r--r--pkgs/development/libraries/slib/setup-hook.sh2
-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/libraries/x265/default.nix4
-rw-r--r--pkgs/development/libraries/xapian/default.nix2
-rw-r--r--pkgs/development/libraries/xapian/tools/omega/default.nix2
-rw-r--r--pkgs/development/lisp-modules/clwrapper/setup-hook.sh2
-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/eliom/setup-hook.sh2
-rw-r--r--pkgs/development/ocaml-modules/mysql/default.nix11
-rw-r--r--pkgs/development/ocaml-modules/notty/default.nix32
-rw-r--r--pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh2
-rw-r--r--pkgs/development/perl-modules/DBD-mysql/default.nix2
-rw-r--r--pkgs/development/pharo/vm/build-vm.nix10
-rw-r--r--pkgs/development/pure-modules/glpk/default.nix6
-rw-r--r--pkgs/development/python-modules/APScheduler/default.nix4
-rw-r--r--pkgs/development/python-modules/Mako/default.nix32
-rw-r--r--pkgs/development/python-modules/MechanicalSoup/default.nix10
-rw-r--r--pkgs/development/python-modules/Nikola/default.nix4
-rw-r--r--pkgs/development/python-modules/Theano/default.nix4
-rw-r--r--pkgs/development/python-modules/absl-py/default.nix4
-rw-r--r--pkgs/development/python-modules/aenum/default.nix4
-rw-r--r--pkgs/development/python-modules/aiohttp/default.nix4
-rw-r--r--pkgs/development/python-modules/arrow/default.nix15
-rw-r--r--pkgs/development/python-modules/asgiref/default.nix4
-rw-r--r--pkgs/development/python-modules/asn1crypto/default.nix4
-rw-r--r--pkgs/development/python-modules/astor/default.nix4
-rw-r--r--pkgs/development/python-modules/astroid/default.nix4
-rw-r--r--pkgs/development/python-modules/astropy/default.nix4
-rw-r--r--pkgs/development/python-modules/attrs/default.nix10
-rw-r--r--pkgs/development/python-modules/aws-xray-sdk/default.nix29
-rw-r--r--pkgs/development/python-modules/backports_abc/default.nix25
-rw-r--r--pkgs/development/python-modules/backports_functools_lru_cache/default.nix24
-rw-r--r--pkgs/development/python-modules/backports_lzma/default.nix32
-rw-r--r--pkgs/development/python-modules/biopython/default.nix32
-rw-r--r--pkgs/development/python-modules/blaze/default.nix12
-rw-r--r--pkgs/development/python-modules/bokeh/default.nix4
-rw-r--r--pkgs/development/python-modules/bootstrapped-pip/default.nix4
-rw-r--r--pkgs/development/python-modules/boto3/default.nix50
-rw-r--r--pkgs/development/python-modules/botocore/default.nix4
-rw-r--r--pkgs/development/python-modules/brotlipy/default.nix36
-rw-r--r--pkgs/development/python-modules/cached-property/default.nix25
-rw-r--r--pkgs/development/python-modules/credstash/default.nix4
-rw-r--r--pkgs/development/python-modules/csscompressor/default.nix4
-rw-r--r--pkgs/development/python-modules/cx_freeze/default.nix4
-rw-r--r--pkgs/development/python-modules/cytoolz/default.nix4
-rw-r--r--pkgs/development/python-modules/dask/default.nix4
-rw-r--r--pkgs/development/python-modules/decorator/default.nix20
-rw-r--r--pkgs/development/python-modules/distro/default.nix4
-rw-r--r--pkgs/development/python-modules/django-jinja2/default.nix4
-rw-r--r--pkgs/development/python-modules/djangorestframework/default.nix4
-rw-r--r--pkgs/development/python-modules/docker/default.nix4
-rw-r--r--pkgs/development/python-modules/docker_compose/default.nix11
-rw-r--r--pkgs/development/python-modules/easy-thumbnails/default.nix4
-rw-r--r--pkgs/development/python-modules/evdev/default.nix29
-rw-r--r--pkgs/development/python-modules/eve/default.nix4
-rw-r--r--pkgs/development/python-modules/extras/default.nix23
-rw-r--r--pkgs/development/python-modules/faker/default.nix4
-rw-r--r--pkgs/development/python-modules/fastimport/default.nix8
-rw-r--r--pkgs/development/python-modules/faulthandler/default.nix4
-rw-r--r--pkgs/development/python-modules/filelock/default.nix4
-rw-r--r--pkgs/development/python-modules/fiona/default.nix4
-rw-r--r--pkgs/development/python-modules/flake8-debugger/default.nix4
-rw-r--r--pkgs/development/python-modules/flask-testing/default.nix4
-rw-r--r--pkgs/development/python-modules/flit/default.nix14
-rw-r--r--pkgs/development/python-modules/fonttools/default.nix4
-rw-r--r--pkgs/development/python-modules/ftfy/default.nix4
-rw-r--r--pkgs/development/python-modules/gensim/default.nix4
-rw-r--r--pkgs/development/python-modules/gflags/default.nix8
-rw-r--r--pkgs/development/python-modules/google_api_core/default.nix4
-rw-r--r--pkgs/development/python-modules/gpy/default.nix4
-rw-r--r--pkgs/development/python-modules/grpcio/default.nix4
-rw-r--r--pkgs/development/python-modules/gssapi/default.nix4
-rw-r--r--pkgs/development/python-modules/html5lib/default.nix42
-rw-r--r--pkgs/development/python-modules/htmlmin/default.nix4
-rw-r--r--pkgs/development/python-modules/httpbin/default.nix4
-rw-r--r--pkgs/development/python-modules/idna/default.nix20
-rw-r--r--pkgs/development/python-modules/ipykernel/default.nix4
-rw-r--r--pkgs/development/python-modules/ipywidgets/default.nix4
-rw-r--r--pkgs/development/python-modules/iso8601/default.nix27
-rw-r--r--pkgs/development/python-modules/jdcal/default.nix28
-rw-r--r--pkgs/development/python-modules/jedi/default.nix4
-rw-r--r--pkgs/development/python-modules/jellyfish/default.nix24
-rw-r--r--pkgs/development/python-modules/jinja2/default.nix20
-rw-r--r--pkgs/development/python-modules/jsbeautifier/default.nix4
-rw-r--r--pkgs/development/python-modules/jsondiff/default.nix24
-rw-r--r--pkgs/development/python-modules/jsonpatch/default.nix4
-rw-r--r--pkgs/development/python-modules/jsonpickle/default.nix23
-rw-r--r--pkgs/development/python-modules/jupyter_client/default.nix18
-rw-r--r--pkgs/development/python-modules/jupyter_client/wheel_workaround.patch13
-rw-r--r--pkgs/development/python-modules/jupyter_core/default.nix6
-rw-r--r--pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch44
-rw-r--r--pkgs/development/python-modules/keras/default.nix4
-rw-r--r--pkgs/development/python-modules/keyring/default.nix4
-rw-r--r--pkgs/development/python-modules/ldap/default.nix8
-rw-r--r--pkgs/development/python-modules/ldap3/default.nix5
-rw-r--r--pkgs/development/python-modules/libusb1/default.nix2
-rw-r--r--pkgs/development/python-modules/line_profiler/default.nix4
-rw-r--r--pkgs/development/python-modules/llfuse/default.nix4
-rw-r--r--pkgs/development/python-modules/llvmlite/default.nix13
-rw-r--r--pkgs/development/python-modules/lxml/default.nix27
-rw-r--r--pkgs/development/python-modules/marionette-harness/default.nix4
-rw-r--r--pkgs/development/python-modules/markdown/default.nix28
-rw-r--r--pkgs/development/python-modules/marshmallow/default.nix4
-rw-r--r--pkgs/development/python-modules/matplotlib/default.nix4
-rw-r--r--pkgs/development/python-modules/mistune/default.nix4
-rw-r--r--pkgs/development/python-modules/moto/default.nix20
-rw-r--r--pkgs/development/python-modules/mygpoclient/default.nix5
-rw-r--r--pkgs/development/python-modules/nbxmpp/default.nix4
-rw-r--r--pkgs/development/python-modules/networkx/default.nix34
-rw-r--r--pkgs/development/python-modules/nilearn/default.nix4
-rw-r--r--pkgs/development/python-modules/notebook/default.nix4
-rw-r--r--pkgs/development/python-modules/numba/default.nix13
-rw-r--r--pkgs/development/python-modules/odfpy/default.nix16
-rw-r--r--pkgs/development/python-modules/pandas/default.nix4
-rw-r--r--pkgs/development/python-modules/parse-type/default.nix7
-rw-r--r--pkgs/development/python-modules/partd/default.nix35
-rw-r--r--pkgs/development/python-modules/path.py/default.nix4
-rw-r--r--pkgs/development/python-modules/pathlib2/default.nix7
-rw-r--r--pkgs/development/python-modules/pexpect/default.nix4
-rw-r--r--pkgs/development/python-modules/phonenumbers/default.nix4
-rw-r--r--pkgs/development/python-modules/pip-tools/default.nix6
-rw-r--r--pkgs/development/python-modules/plone-testing/default.nix27
-rw-r--r--pkgs/development/python-modules/plotly/default.nix4
-rw-r--r--pkgs/development/python-modules/pluggy/default.nix29
-rw-r--r--pkgs/development/python-modules/plumbum/default.nix4
-rw-r--r--pkgs/development/python-modules/psutil/default.nix4
-rw-r--r--pkgs/development/python-modules/py/default.nix4
-rw-r--r--pkgs/development/python-modules/pyaml/default.nix27
-rw-r--r--pkgs/development/python-modules/pyasn1-modules/default.nix4
-rw-r--r--pkgs/development/python-modules/pyasn1/default.nix4
-rw-r--r--pkgs/development/python-modules/pyblake2/default.nix4
-rw-r--r--pkgs/development/python-modules/pycangjie/default.nix13
-rw-r--r--pkgs/development/python-modules/pychromecast/default.nix4
-rw-r--r--pkgs/development/python-modules/pycollada/default.nix7
-rw-r--r--pkgs/development/python-modules/pydot/default.nix4
-rw-r--r--pkgs/development/python-modules/pygit2/default.nix4
-rw-r--r--pkgs/development/python-modules/pyglet/default.nix11
-rw-r--r--pkgs/development/python-modules/pylast/default.nix4
-rw-r--r--pkgs/development/python-modules/pylint/default.nix4
-rw-r--r--pkgs/development/python-modules/pymongo/default.nix4
-rw-r--r--pkgs/development/python-modules/pyobjc/default.nix4
-rw-r--r--pkgs/development/python-modules/pyopencl/default.nix13
-rw-r--r--pkgs/development/python-modules/pysc2/default.nix2
-rw-r--r--pkgs/development/python-modules/pysoundfile/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest-localserver/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest-xdist/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest/3_2.nix27
-rw-r--r--pkgs/development/python-modules/pytest/default.nix12
-rw-r--r--pkgs/development/python-modules/python-fuse/default.nix28
-rw-r--r--pkgs/development/python-modules/pytoml/default.nix16
-rw-r--r--pkgs/development/python-modules/pytools/default.nix39
-rw-r--r--pkgs/development/python-modules/pywbem/default.nix2
-rw-r--r--pkgs/development/python-modules/pywinrm/default.nix4
-rw-r--r--pkgs/development/python-modules/regex/default.nix23
-rw-r--r--pkgs/development/python-modules/relatorio/default.nix4
-rw-r--r--pkgs/development/python-modules/restview/default.nix4
-rw-r--r--pkgs/development/python-modules/robomachine/default.nix4
-rw-r--r--pkgs/development/python-modules/ropper/default.nix12
-rw-r--r--pkgs/development/python-modules/scrapy/default.nix4
-rw-r--r--pkgs/development/python-modules/seaborn/default.nix4
-rw-r--r--pkgs/development/python-modules/serpy/default.nix4
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix4
-rw-r--r--pkgs/development/python-modules/shapely/default.nix4
-rw-r--r--pkgs/development/python-modules/simplejson/default.nix4
-rw-r--r--pkgs/development/python-modules/six/default.nix3
-rw-r--r--pkgs/development/python-modules/smart_open/default.nix4
-rw-r--r--pkgs/development/python-modules/spacy/default.nix17
-rw-r--r--pkgs/development/python-modules/splinter/default.nix30
-rw-r--r--pkgs/development/python-modules/sqlalchemy/default.nix4
-rw-r--r--pkgs/development/python-modules/sqlmap/default.nix4
-rw-r--r--pkgs/development/python-modules/stevedore/default.nix4
-rw-r--r--pkgs/development/python-modules/stripe/default.nix4
-rw-r--r--pkgs/development/python-modules/structlog/default.nix32
-rw-r--r--pkgs/development/python-modules/supervise_api/default.nix4
-rw-r--r--pkgs/development/python-modules/sybil/default.nix4
-rw-r--r--pkgs/development/python-modules/tabulate/default.nix4
-rw-r--r--pkgs/development/python-modules/testtools/default.nix12
-rw-r--r--pkgs/development/python-modules/textacy/default.nix4
-rw-r--r--pkgs/development/python-modules/texttable/default.nix20
-rw-r--r--pkgs/development/python-modules/thespian/default.nix4
-rw-r--r--pkgs/development/python-modules/toolz/default.nix4
-rw-r--r--pkgs/development/python-modules/tox/default.nix24
-rw-r--r--pkgs/development/python-modules/tqdm/default.nix4
-rw-r--r--pkgs/development/python-modules/tzlocal/default.nix4
-rw-r--r--pkgs/development/python-modules/vowpalwabbit/default.nix4
-rw-r--r--pkgs/development/python-modules/websockets/default.nix4
-rw-r--r--pkgs/development/python-modules/werkzeug/default.nix14
-rw-r--r--pkgs/development/python-modules/widgetsnbextension/default.nix4
-rw-r--r--pkgs/development/python-modules/ws4py/default.nix4
-rw-r--r--pkgs/development/python-modules/xarray/default.nix19
-rw-r--r--pkgs/development/python-modules/yapf/default.nix4
-rw-r--r--pkgs/development/python-modules/yarl/default.nix19
-rw-r--r--pkgs/development/python-modules/zope_copy/default.nix27
-rw-r--r--pkgs/development/r-modules/default.nix6
-rw-r--r--pkgs/development/ruby-modules/bundled-common/default.nix4
-rw-r--r--pkgs/development/ruby-modules/bundled-common/functions.nix4
-rw-r--r--pkgs/development/ruby-modules/bundler-env/default.nix5
-rw-r--r--pkgs/development/ruby-modules/bundler/default.nix2
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix9
-rw-r--r--pkgs/development/ruby-modules/gem/default.nix15
-rw-r--r--pkgs/development/tools/build-managers/bazel/default.nix4
-rwxr-xr-xpkgs/development/tools/build-managers/cmake/setup-hook.sh6
-rw-r--r--pkgs/development/tools/coursier/default.nix4
-rw-r--r--pkgs/development/tools/database/shmig/default.nix4
-rw-r--r--pkgs/development/tools/database/sqldeveloper/default.nix6
-rw-r--r--pkgs/development/tools/misc/automake/setup-hook.sh2
-rw-r--r--pkgs/development/tools/misc/binutils/always-search-rpath.patch14
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix17
-rw-r--r--pkgs/development/tools/misc/d-feet/default.nix4
-rw-r--r--pkgs/development/tools/misc/pkgconfig/setup-hook.sh6
-rw-r--r--pkgs/development/tools/misc/sysbench/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/findlib/default.nix2
-rw-r--r--pkgs/development/tools/scalafmt/default.nix4
-rw-r--r--pkgs/development/tools/tora/default.nix4
-rw-r--r--pkgs/development/web/nodejs/setup-hook.sh2
-rw-r--r--pkgs/development/web/nodejs/v4.nix4
-rw-r--r--pkgs/development/web/nodejs/v6.nix4
-rw-r--r--pkgs/development/web/nodejs/v8.nix4
-rw-r--r--pkgs/games/linux-steam-integration/default.nix80
-rw-r--r--pkgs/games/steam/chrootenv.nix24
-rw-r--r--pkgs/games/zod/default.nix6
-rw-r--r--pkgs/misc/drivers/sc-controller/default.nix62
-rw-r--r--pkgs/misc/themes/deepin/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh2
-rw-r--r--pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix2
-rw-r--r--pkgs/os-specific/darwin/ghc-standalone-archive/default.nix3
-rw-r--r--pkgs/os-specific/linux/busybox/default.nix2
-rw-r--r--pkgs/os-specific/linux/hyperv-daemons/default.nix109
-rw-r--r--pkgs/os-specific/linux/kernel-headers/4.4.nix3
-rw-r--r--pkgs/os-specific/linux/kernel/hardened-config.nix3
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.14.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.9.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix4
-rw-r--r--pkgs/os-specific/linux/nftables/default.nix4
-rw-r--r--pkgs/os-specific/linux/sysdig/default.nix4
-rw-r--r--pkgs/os-specific/linux/thunderbolt/default.nix39
-rw-r--r--pkgs/os-specific/windows/mingw-w64/pthreads.nix4
-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/emby/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/irker/default.nix6
-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/memcached/default.nix5
-rw-r--r--pkgs/servers/nosql/redis/default.nix14
-rw-r--r--pkgs/servers/osrm-backend/default.nix7
-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/sql/postgresql/default.nix20
-rw-r--r--pkgs/servers/traefik/default.nix4
-rw-r--r--pkgs/servers/uwsgi/default.nix5
-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/web-apps/searx/default.nix33
-rw-r--r--pkgs/servers/x11/xorg/builder.sh7
-rw-r--r--pkgs/servers/x11/xorg/default.nix6
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.7.list2
-rw-r--r--pkgs/shells/bash/4.4.nix4
-rw-r--r--pkgs/stdenv/adapters.nix11
-rw-r--r--pkgs/stdenv/darwin/default.nix20
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix76
-rw-r--r--pkgs/stdenv/generic/setup.sh338
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-cross.nix236
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix34
-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/admin/awscli/default.nix5
-rw-r--r--pkgs/tools/audio/pnmixer/default.nix8
-rw-r--r--pkgs/tools/backup/bareos/default.nix8
-rw-r--r--pkgs/tools/backup/mydumper/default.nix4
-rw-r--r--pkgs/tools/graphics/zbar/default.nix10
-rw-r--r--pkgs/tools/inputmethods/ibus/default.nix179
-rw-r--r--pkgs/tools/misc/colord-kde/default.nix4
-rw-r--r--pkgs/tools/misc/coreutils/default.nix4
-rw-r--r--pkgs/tools/misc/fd/default.nix6
-rw-r--r--pkgs/tools/misc/tmuxinator/default.nix8
-rw-r--r--pkgs/tools/networking/hss/default.nix2
-rw-r--r--pkgs/tools/networking/kea/default.nix4
-rw-r--r--pkgs/tools/networking/mailutils/default.nix21
-rw-r--r--pkgs/tools/networking/mitmproxy/default.nix28
-rw-r--r--pkgs/tools/networking/ncftp/default.nix6
-rw-r--r--pkgs/tools/networking/offlineimap/default.nix4
-rw-r--r--pkgs/tools/networking/snabb/default.nix4
-rw-r--r--pkgs/tools/networking/stunnel/default.nix4
-rw-r--r--pkgs/tools/security/apg/default.nix7
-rw-r--r--pkgs/tools/security/fail2ban/default.nix4
-rw-r--r--pkgs/tools/security/gnupg/22.nix4
-rw-r--r--pkgs/tools/security/gopass/default.nix4
-rw-r--r--pkgs/tools/security/john/default.nix27
-rw-r--r--pkgs/tools/security/pass-otp/default.nix29
-rw-r--r--pkgs/tools/security/pcsclite/default.nix6
-rw-r--r--pkgs/tools/security/thc-hydra/default.nix4
-rw-r--r--pkgs/tools/system/collectd/default.nix5
-rw-r--r--pkgs/tools/system/rsyslog/default.nix9
-rw-r--r--pkgs/tools/text/diffutils/default.nix3
-rw-r--r--pkgs/tools/text/dos2unix/default.nix8
-rw-r--r--pkgs/tools/text/gawk/default.nix2
-rw-r--r--pkgs/tools/text/gist/default.nix2
-rw-r--r--pkgs/tools/text/sgml/opensp/setup-hook.sh2
-rw-r--r--pkgs/tools/typesetting/tex/dblatex/default.nix4
-rw-r--r--pkgs/tools/typesetting/tex/tetex/setup-hook.sh2
-rw-r--r--pkgs/tools/typesetting/tex/texlive/setup-hook.sh2
-rw-r--r--pkgs/tools/video/flvtool2/default.nix2
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix61
-rw-r--r--pkgs/top-level/haskell-packages.nix2
-rw-r--r--pkgs/top-level/lua-packages.nix7
-rw-r--r--pkgs/top-level/python-packages.nix670
-rw-r--r--pkgs/top-level/release-cross.nix5
-rw-r--r--pkgs/top-level/release.nix5
-rw-r--r--pkgs/top-level/splice.nix69
534 files changed, 5801 insertions, 3972 deletions
diff --git a/doc/cross-compilation.xml b/doc/cross-compilation.xml
index 4b35b72feae03..118a82bf0b06c 100644
--- a/doc/cross-compilation.xml
+++ b/doc/cross-compilation.xml
@@ -187,7 +187,7 @@
       How does this work in practice? Nixpkgs is now structured so that build-time dependencies are taken from <varname>buildPackages</varname>, whereas run-time dependencies are taken from the top level attribute set.
       For example, <varname>buildPackages.gcc</varname> should be used at build time, while <varname>gcc</varname> should be used at run time.
       Now, for most of Nixpkgs's history, there was no <varname>buildPackages</varname>, and most packages have not been refactored to use it explicitly.
-      Instead, one can use the four attributes used for specifying dependencies as documented in <xref linkend="ssec-stdenv-attributes"/>.
+      Instead, one can use the six (<emphasis>gasp</emphasis>) attributes used for specifying dependencies as documented in <xref linkend="ssec-stdenv-dependencies"/>.
       We "splice" together the run-time and build-time package sets with <varname>callPackage</varname>, and then <varname>mkDerivation</varname> for each of four attributes pulls the right derivation out.
       This splicing can be skipped when not cross compiling as the package sets are the same, but is a bit slow for cross compiling.
       Because of this, a best-of-both-worlds solution is in the works with no splicing or explicit access of <varname>buildPackages</varname> needed.
@@ -200,6 +200,45 @@
     </para></note>
   </section>
 
+  <section>
+    <title>Cross packagaing cookbook</title>
+    <para>
+      Some frequently problems when packaging for cross compilation are good to just spell and answer.
+      Ideally the information above is exhaustive, so this section cannot provide any new information,
+      but its ludicrous and cruel to expect everyone to spend effort working through the interaction of many features just to figure out the same answer to the same common problem.
+      Feel free to add to this list!
+    </para>
+    <qandaset>
+      <qandaentry>
+        <question><para>
+          What if my package's build system needs to build a C program to be run under the build environment?
+        </para></question>
+        <answer><para>
+          <programlisting>depsBuildBuild = [ buildPackages.stdenv.cc ];</programlisting>
+          Add it to your <function>mkDerivation</function> invocation.
+        </para></answer>
+      </qandaentry>
+      <qandaentry>
+        <question><para>
+          My package fails to find <command>ar</command>.
+        </para></question>
+        <answer><para>
+          Many packages assume that an unprefixed <command>ar</command> is available, but Nix doesn't provide one.
+          It only provides a prefixed one, just as it only does for all the other binutils programs.
+          It may be necessary to patch the package to fix the build system to use a prefixed `ar`.
+        </para></answer>
+      </qandaentry>
+      <qandaentry>
+        <question><para>
+          My package's testsuite needs to run host platform code.
+        </para></question>
+        <answer><para>
+          <programlisting>doCheck = stdenv.hostPlatform != stdenv.buildPlatfrom;</programlisting>
+          Add it to your <function>mkDerivation</function> invocation.
+        </para></answer>
+      </qandaentry>
+    </qandaset>
+  </section>
 </section>
 
 <!--============================================================-->
diff --git a/doc/stdenv.xml b/doc/stdenv.xml
index 91c659408c4bb..7154a576def9b 100644
--- a/doc/stdenv.xml
+++ b/doc/stdenv.xml
@@ -179,68 +179,283 @@ genericBuild
 </section>
 
 
-<section xml:id="ssec-stdenv-attributes"><title>Attributes</title>
+<section xml:id="ssec-stdenv-dependencies"><title>Specifying dependencies</title>
+
+<para>
+  As described in the Nix manual, almost any <filename>*.drv</filename> store path in a derivation's attribute set will induce a dependency on that derivation.
+  <varname>mkDerivation</varname>, however, takes a few attributes intended to, between them, include all the dependencies of a package.
+  This is done both for structure and consistency, but also so that certain other setup can take place.
+  For example, certain dependencies need their bin directories added to the <envar>PATH</envar>.
+  That is built-in, but other setup is done via a pluggable mechanism that works in conjunction with these dependency attributes.
+  See <xref linkend="ssec-setup-hooks"/> for details.
+</para>
+<para>
+  Dependencies can be broken down along three axes: their host and target platforms relative to the new derivation's, and whether they are propagated.
+  The platform distinctions are motivated by cross compilation; see <xref linkend="chap-cross"/> for exactly what each platform means.
+  <footnote><para>
+    The build platform is ignored because it is a mere implementation detail of the package satisfying the dependency:
+    As a general programming principle, dependencies are always <emphasis>specified</emphasis> as interfaces, not concrete implementation.
+  </para></footnote>
+  But even if one is not cross compiling, the platforms imply whether or not the dependency is needed at run-time or build-time, a concept that makes perfect sense outside of cross compilation.
+  For now, the run-time/build-time distinction is just a hint for mental clarity, but in the future it perhaps could be enforced.
+</para>
+<para>
+  The extension of <envar>PATH</envar> with dependencies, alluded to above, proceeds according to the relative platforms alone.
+  The process is carried out only for dependencies whose host platform matches the new derivation's build platform–i.e. which run on the platform where the new derivation will be built.
+  <footnote><para>
+    Currently, that means for native builds all dependencies are put on the <envar>PATH</envar>.
+    But in the future that may not be the case for sake of matching cross:
+    the platforms would be assumed to be unique for native and cross builds alike, so only the <varname>depsBuild*</varname> and <varname>nativeBuildDependencies</varname> dependencies would affect the <envar>PATH</envar>.
+  </para></footnote>
+  For each dependency <replaceable>dep</replaceable> of those dependencies, <filename><replaceable>dep</replaceable>/bin</filename>, if present, is added to the <envar>PATH</envar> environment variable.
+</para>
+<para>
+  The dependency is propagated when it forces some of its other-transitive (non-immediate) downstream dependencies to also take it on as an immediate dependency.
+  Nix itself already takes a package's transitive dependencies into account, but this propagation ensures nixpkgs-specific infrastructure like setup hooks (mentioned above) also are run as if the propagated dependency.
+</para>
+<para>
+  It is important to note dependencies are not necessary propagated as the same sort of dependency that they were before, but rather as the corresponding sort so that the platform rules still line up.
+  The exact rules for dependency propagation can be given by assigning each sort of dependency two integers based one how it's host and target platforms are offset from the depending derivation's platforms.
+  Those offsets are given are given below in the descriptions of each dependency list attribute.
+  Algorithmically, we traverse propagated inputs, accumulating every propagated dep's propagated deps and adjusting them to account for the "shift in perspective" described by the current dep's platform offsets.
+  This results in sort a transitive closure of the dependency relation, with the offsets being approximately summed when two dependency links are combined.
+  We also prune transitive deps whose combined offsets go out-of-bounds, which can be viewed as a filter over that transitive closure removing dependencies that are blatantly absurd.
+</para>
+<para>
+  We can define the process precisely with <link xlink:href="https://en.wikipedia.org/wiki/Natural_deduction">Natural Deduction</link> using the inference rules.
+  This probably seems a bit obtuse, but so is the bash code that actually implements it!
+  <footnote><para>
+    The <function>findInputs</function> function, currently residing in <filename>pkgs/stdenv/generic/setup.sh</filename>, implements the propagation logic.
+  </para></footnote>
+  They're confusing in very different ways so...hopefully if something doesn't make sense in one presentation, it does in the other!
+  <programlisting>
+let mapOffset(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
+
+propagated-dep(h0, t0, A, B)
+propagated-dep(h1, t1, B, C)
+h0 + h1 in {-1, 0, 1}
+h0 + t1 in {-1, 0, 1}
+-------------------------------------- Transitive property
+propagated-dep(mapOffset(h0, t0, h1),
+               mapOffset(h0, t0, t1),
+               A, C)</programlisting>
+  <programlisting>
+let mapOffset(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
+
+dep(h0, _, A, B)
+propagated-dep(h1, t1, B, C)
+h0 + h1 in {-1, 0, 1}
+h0 + t1 in {-1, 0, -1}
+-------------------------------------- Take immediate deps' propagated deps
+propagated-dep(mapOffset(h0, t0, h1),
+               mapOffset(h0, t0, t1),
+               A, C)</programlisting>
+  <programlisting>
+propagated-dep(h, t, A, B)
+-------------------------------------- Propagated deps count as deps
+dep(h, t, A, B)</programlisting>
+  Some explanation of this monstrosity is in order.
+  In the common case, the target offset of a dependency is the successor to the target offset: <literal>t = h + 1</literal>.
+  That means that:
+  <programlisting>
+let f(h, t, i) = i + (if i &lt;= 0 then h else t - 1)
+let f(h, h + 1, i) = i + (if i &lt;= 0 then h else (h + 1) - 1)
+let f(h, h + 1, i) = i + (if i &lt;= 0 then h else h)
+let f(h, h + 1, i) = i + h
+  </programlisting>
+  This is where the "sum-like" comes from above:
+  We can just sum all the host offset to get the host offset of the transitive dependency.
+  The target offset is the transitive dep is simply the host offset + 1, just as it was with the dependencies composed to make this transitive one;
+  it can be ignored as it doesn't add any new information.
+</para>
+<para>
+  Because of the bounds checks, the uncommon cases are <literal>h = t</literal> and <literal>h + 2 = t</literal>.
+  In the former case, the motivation for <function>mapOffset</function> is that since its host and target platforms are the same, no transitive dep of it should be able to "discover" an offset greater than its reduced target offsets.
+  <function>mapOffset</function> effectively "squashes" all its transitive dependencies' offsets so that none will ever be greater than the target offset of the original <literal>h = t</literal> package.
+  In the other case, <literal>h + 1</literal> is skipped over between the host and target offsets.
+  Instead of squashing the offsets, we need to "rip" them apart so no transitive dependencies' offset is that one.
+</para>
+<para>
+Overall, the unifying theme here is that propagation shouldn't be introducing transitive dependencies involving platforms the needing package is unaware of.
+The offset bounds checking and definition of <function>mapOffset</function> together ensure that this is the case.
+Discovering a new offset is discovering a new platform, and since those platforms weren't in the derivation "spec" of the needing package, they cannot be relevant.
+From a capability perspective, we can imagine that the host and target platforms of a package are the capabilities a package requires, and the depending package must provide the capability to the dependency.
+</para>
 
 <variablelist>
-  <title>Variables affecting <literal>stdenv</literal>
-  initialisation</title>
+  <title>Variables specifying dependencies</title>
+
+   <varlistentry>
+     <term><varname>depsBuildBuild</varname></term>
+     <listitem>
+       <para>
+         A list of dependencies whose host and target platforms are the new derivation's build platform.
+         This means a <literal>-1</literal> host and <literal>-1</literal> target offset from the new derivation's platforms.
+         They are programs/libraries used at build time that furthermore produce programs/libraries also used at build time.
+         If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it in <varname>nativeBuildInputs</varname>instead.
+         The most common use for this <literal>buildPackages.stdenv.cc</literal>, the default C compiler for this role.
+         That example crops up more than one might think in old commonly used C libraries.
+       </para>
+       <para>
+         Since these packages are able to be run at build time, that are always added to the <envar>PATH</envar>, as described above.
+         But since these packages are only guaranteed to be able to run then, they shouldn't persist as run-time dependencies.
+         This isn't currently enforced, but could be in the future.
+       </para>
+     </listitem>
+  </varlistentry>
 
   <varlistentry>
-    <term><varname>NIX_DEBUG</varname></term>
+    <term><varname>nativeBuildInputs</varname></term>
+    <listitem>
+      <para>
+        A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's host platform.
+        This means a <literal>-1</literal> host offset and <literal>0</literal> target offset from the new derivation's platforms.
+        They are programs/libraries used at build time that, if they are a compiler or similar tool, produce code to run at run time—i.e. tools used to build the new derivation.
+        If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in <varname>depsBuildBuild</varname> or <varname>depsBuildTarget</varname>.
+        This would be called <varname>depsBuildHost</varname> but for historical continuity.
+      </para>
+      <para>
+         Since these packages are able to be run at build time, that are added to the <envar>PATH</envar>, as described above.
+         But since these packages only are guaranteed to be able to run then, they shouldn't persist as run-time dependencies.
+         This isn't currently enforced, but could be in the future.
+       </para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><varname>depsBuildTarget</varname></term>
+    <listitem>
+      <para>
+        A list of dependencies whose host platform is the new derivation's build platform, and target platform is the new derivation's target platform.
+        This means a <literal>-1</literal> host offset and <literal>1</literal> target offset from the new derivation's platforms.
+        They are programs used at build time that produce code to run at run with code produced by the depending package.
+        Most commonly, these would tools used to build the runtime or standard library the currently-being-built compiler will inject into any code it compiles.
+        In many cases, the currently-being built compiler is itself employed for that task, but when that compiler won't run (i.e. its build and host platform differ) this is not possible.
+        Other times, the compiler relies on some other tool, like binutils, that is always built separately so the dependency is unconditional.
+      </para>
+      <para>
+        This is a somewhat confusing dependency to wrap ones head around, and for good reason.
+        As the only one where the platform offsets are not adjacent integers, it requires thinking of a bootstrapping stage <emphasis>two</emphasis> away from the current one.
+        It and it's use-case go hand in hand and are both considered poor form:
+        try not to need this sort dependency, and try not avoid building standard libraries / runtimes in the same derivation as the compiler produces code using them.
+        Instead strive to build those like a normal library, using the newly-built compiler just as a normal library would.
+        In short, do not use this attribute unless you are packaging a compiler and are sure it is needed.
+     </para>
+     <para>
+       Since these packages are able to be run at build time, that are added to the <envar>PATH</envar>, as described above.
+       But since these packages only are guaranteed to be able to run then, they shouldn't persist as run-time dependencies.
+       This isn't currently enforced, but could be in the future.
+     </para>
+    </listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><varname>depsHostHost</varname></term>
     <listitem><para>
-      A natural number indicating how much information to log.
-      If set to 1 or higher, <literal>stdenv</literal> will print moderate debug information during the build.
-      In particular, the <command>gcc</command> and <command>ld</command> wrapper scripts will print out the complete command line passed to the wrapped tools.
-      If set to 6 or higher, the <literal>stdenv</literal> setup script will be run with <literal>set -x</literal> tracing.
-      If set to 7 or higher, the <command>gcc</command> and <command>ld</command> wrapper scripts will also be run with <literal>set -x</literal> tracing.
+      A list of dependencies whose host and target platforms match the new derivation's host platform.
+      This means a both <literal>0</literal> host offset and <literal>0</literal> target offset from the new derivation's host platform.
+      These are packages used at run-time to generate code also used at run-time.
+      In practice, that would usually be tools used by compilers for metaprogramming/macro systems, or libraries used by the macros/metaprogramming code itself.
+      It's always preferable to use a <varname>depsBuildBuild</varname> dependency in the derivation being built than a <varname>depsHostHost</varname> on the tool doing the building for this purpose.
     </para></listitem>
   </varlistentry>
 
-</variablelist>
+  <varlistentry>
+    <term><varname>buildInputs</varname></term>
+    <listitem>
+      <para>
+        A list of dependencies whose host platform and target platform match the new derivation's.
+        This means a <literal>0</literal> host offset and <literal>1</literal> target offset from the new derivation's host platform.
+        This would be called <varname>depsHostTarget</varname> but for historical continuity.
+        If the dependency doesn't care about the target platform (i.e. isn't a compiler or similar tool), put it here, rather than in <varname>depsBuildBuild</varname>.
+      </para>
+      <para>
+        These often are programs/libraries used by the new derivation at <emphasis>run</emphasis>-time, but that isn't always the case.
+        For example, the machine code in a statically linked library is only used at run time, but the derivation containing the library is only needed at build time.
+        Even in the dynamic case, the library may also be needed at build time to appease the linker.
+      </para>
+    </listitem>
+  </varlistentry>
 
-<variablelist>
-  <title>Variables specifying dependencies</title>
+  <varlistentry>
+    <term><varname>depsTargetTarget</varname></term>
+    <listitem><para>
+      A list of dependencies whose host platform matches the new derivation's target platform.
+      This means a <literal>1</literal> offset from the new derivation's platforms.
+      These are packages that run on the target platform, e.g. the standard library or run-time deps of standard library that a compiler insists on knowing about.
+      It's poor form in almost all cases for a package to depend on another from a future stage [future stage corresponding to positive offset].
+      Do not use this attribute unless you are packaging a compiler and are sure it is needed.
+    </para></listitem>
+  </varlistentry>
 
   <varlistentry>
-    <term><varname>nativeBuildInputs</varname></term>
+    <term><varname>depsBuildBuildPropagated</varname></term>
     <listitem><para>
-      A list of dependencies used by the new derivation at <emphasis>build</emphasis>-time.
-      I.e. these dependencies should not make it into the package's runtime-closure, though this is currently not checked.
-      For each dependency <replaceable>dir</replaceable>, the directory <filename><replaceable>dir</replaceable>/bin</filename>, if it exists, is added to the <envar>PATH</envar> environment variable.
-      Other environment variables are also set up via a pluggable mechanism.
-      For instance, if <varname>buildInputs</varname> contains Perl, then the <filename>lib/site_perl</filename> subdirectory of each input is added to the <envar>PERL5LIB</envar> environment variable.
-      See <xref linkend="ssec-setup-hooks"/> for details.
+      The propagated equivalent of <varname>depsBuildBuild</varname>.
+      This perhaps never ought to be used, but it is included for consistency [see below for the others].
     </para></listitem>
   </varlistentry>
 
   <varlistentry>
-    <term><varname>buildInputs</varname></term>
+    <term><varname>propagatedNativeBuildInputs</varname></term>
     <listitem><para>
-      A list of dependencies used by the new derivation at <emphasis>run</emphasis>-time.
-      Currently, the build-time environment is modified in the exact same way as with <varname>nativeBuildInputs</varname>.
-      This is problematic in that when cross-compiling, foreign executables can clobber native ones on the <envar>PATH</envar>.
-      Even more confusing is static-linking.
-      A statically-linked library should be listed here because ultimately that generated machine code will be used at run-time, even though a derivation containing the object files or static archives will only be used at build-time.
-      A less confusing solution to this would be nice.
+      The propagated equivalent of <varname>nativeBuildInputs</varname>.
+      This would be called <varname>depsBuildHostPropagated</varname> but for historical continuity.
+      For example, if package <varname>Y</varname> has <literal>propagatedNativeBuildInputs = [X]</literal>, and package <varname>Z</varname> has <literal>buildInputs = [Y]</literal>, then package <varname>Z</varname> will be built as if it included package <varname>X</varname> in its <varname>nativeBuildInputs</varname>.
+      If instead, package <varname>Z</varname> has <literal>nativeBuildInputs = [Y]</literal>, then <varname>Z</varname> will be built as if it included <varname>X</varname> in the <varname>depsBuildBuild</varname> of package <varname>Z</varname>, because of the sum of the two <literal>-1</literal> host offsets.
     </para></listitem>
   </varlistentry>
 
+  <varlistentry>
+    <term><varname>depsBuildTargetPropagated</varname></term>
+    <listitem><para>
+      The propagated equivalent of <varname>depsBuildTarget</varname>.
+      This is prefixed for the same reason of alerting potential users.
+    </para></listitem>
+  </varlistentry>
 
   <varlistentry>
-    <term><varname>propagatedNativeBuildInputs</varname></term>
+    <term><varname>depsHostHostPropagated</varname></term>
     <listitem><para>
-      Like <varname>nativeBuildInputs</varname>, but these dependencies are <emphasis>propagated</emphasis>:
-      that is, the dependencies listed here are added to the <varname>nativeBuildInputs</varname> of any package that uses <emphasis>this</emphasis> package as a dependency.
-      So if package Y has <literal>propagatedNativeBuildInputs = [X]</literal>, and package Z has <literal>nativeBuildInputs = [Y]</literal>,
-      then package X will appear in Z’s build environment automatically.
+      The propagated equivalent of <varname>depsHostHost</varname>.
     </para></listitem>
   </varlistentry>
 
   <varlistentry>
     <term><varname>propagatedBuildInputs</varname></term>
     <listitem><para>
-      Like <varname>buildInputs</varname>, but propagated just like <varname>propagatedNativeBuildInputs</varname>.
-      This inherits <varname>buildInputs</varname>'s flaws of clobbering native executables when cross-compiling and being confusing for static linking.
+      The propagated equivalent of <varname>buildInputs</varname>.
+      This would be called <varname>depsHostTargetPropagated</varname> but for historical continuity.
+    </para></listitem>
+  </varlistentry>
+
+  <varlistentry>
+    <term><varname>depsTargetTarget</varname></term>
+    <listitem><para>
+      The propagated equivalent of <varname>depsTargetTarget</varname>.
+      This is prefixed for the same reason of alerting potential users.
+    </para></listitem>
+  </varlistentry>
+
+</variablelist>
+
+</section>
+
+
+<section xml:id="ssec-stdenv-attributes"><title>Attributes</title>
+
+<variablelist>
+  <title>Variables affecting <literal>stdenv</literal>
+  initialisation</title>
+
+  <varlistentry>
+    <term><varname>NIX_DEBUG</varname></term>
+    <listitem><para>
+      A natural number indicating how much information to log.
+      If set to 1 or higher, <literal>stdenv</literal> will print moderate debug information during the build.
+      In particular, the <command>gcc</command> and <command>ld</command> wrapper scripts will print out the complete command line passed to the wrapped tools.
+      If set to 6 or higher, the <literal>stdenv</literal> setup script will be run with <literal>set -x</literal> tracing.
+      If set to 7 or higher, the <command>gcc</command> and <command>ld</command> wrapper scripts will also be run with <literal>set -x</literal> tracing.
     </para></listitem>
   </varlistentry>
 
@@ -656,7 +871,7 @@ script) if it exists.</para>
       By default, when cross compiling, the configure script has <option>--build=...</option> and <option>--host=...</option> passed.
       Packages can instead pass <literal>[ "build" "host" "target" ]</literal> or a subset to control exactly which platform flags are passed.
       Compilers and other tools should use this to also pass the target platform, for example.
-      Note eventually these will be passed when in native builds too, to improve determinism: build-time guessing, as is done today, is a risk of impurity.
+      <footnote><para>Eventually these will be passed when in native builds too, to improve determinism: build-time guessing, as is done today, is a risk of impurity.</para></footnote>
     </para></listitem>
   </varlistentry>
 
@@ -923,6 +1138,20 @@ following:
     <listitem><para>If set, libraries and executables are not
     stripped.  By default, they are.</para></listitem>
   </varlistentry>
+  <varlistentry>
+    <term><varname>dontStripHost</varname></term>
+    <listitem><para>
+      Like <varname>dontStripHost</varname>, but only affects the <command>strip</command> command targetting the package's host platform.
+      Useful when supporting cross compilation, but otherwise feel free to ignore.
+    </para></listitem>
+  </varlistentry>
+  <varlistentry>
+    <term><varname>dontStripTarget</varname></term>
+    <listitem><para>
+      Like <varname>dontStripHost</varname>, but only affects the <command>strip</command> command targetting the packages' target platform.
+      Useful when supporting cross compilation, but otherwise feel free to ignore.
+    </para></listitem>
+  </varlistentry>
 
   <varlistentry>
     <term><varname>dontMoveSbin</varname></term>
@@ -1353,8 +1582,55 @@ someVar=$(stripHash $name)
 
 <section xml:id="ssec-setup-hooks"><title>Package setup hooks</title>
 
-<para>The following packages provide a setup hook:
-
+<para>
+  Nix itself considers a build-time dependency merely something that should previously be built and accessible at build time—packages themselves are on their own to perform any additional setup.
+  In most cases, that is fine, and the downstream derivation can deal with it's own dependencies.
+  But for a few common tasks, that would result in almost every package doing the same sort of setup work---depending not on the package itself, but entirely on which dependencies were used.
+</para>
+<para>
+  In order to alleviate this burden, the <firstterm>setup hook></firstterm>mechanism was written, where any package can include a shell script that [by convention rather than enforcement by Nix], any downstream reverse-dependency will source as part of its build process.
+  That allows the downstream dependency to merely specify its dependencies, and lets those dependencies effectively initialize themselves.
+  No boilerplate mirroring the list of dependencies is needed.
+</para>
+<para>
+  The Setup hook mechanism is a bit of a sledgehammer though: a powerful feature with a broad and indiscriminate area of effect.
+  The combination of its power and implicit use may be expedient, but isn't without costs.
+  Nix itself is unchanged, but the spirit of adding dependencies being effect-free is violated even if the letter isn't.
+  For example, if a derivation path is mentioned more than once, Nix itself doesn't care and simply makes sure the dependency derivation is already built just the same—depending is just needing something to exist, and needing is idempotent.
+  However, a dependency specified twice will have its setup hook run twice, and that could easily change the build environment (though a well-written setup hook will therefore strive to be idempotent so this is in fact not observable).
+  More broadly, setup hooks are anti-modular in that multiple dependencies, whether the same or different, should not interfere and yet their setup hooks may well do so.
+</para>
+<para>
+  The most typical use of the setup hook is actually to add other hooks which are then run (i.e. after all the setup hooks) on each dependency.
+  For example, the C compiler wrapper's setup hook feeds itself flags for each dependency that contains relevant libaries and headers.
+  This is done by defining a bash function, and appending its name to one of
+  <envar>envBuildBuildHooks</envar>`,
+  <envar>envBuildHostHooks</envar>`,
+  <envar>envBuildTargetHooks</envar>`,
+  <envar>envHostHostHooks</envar>`,
+  <envar>envHostTargetHooks</envar>`, or
+  <envar>envTargetTargetHooks</envar>`.
+  These 6 bash variables correspond to the 6 sorts of dependencies by platform (there's 12 total but we ignore the propagated/non-propagated axis).
+</para>
+<para>
+  Packages adding a hook should not hard code a specific hook, but rather choose a variable <emphasis>relative</emphasis> to how they are included.
+  Returning to the C compiler wrapper example, if it itself is an <literal>n</literal> dependency, then it only wants to accumulate flags from <literal>n + 1</literal> dependencies, as only those ones match the compiler's target platform.
+  The <envar>hostOffset</envar> variable is defined with the current dependency's host offset <envar>targetOffset</envar> with its target offset, before it's setup hook is sourced.
+  Additionally, since most environment hooks don't care about the target platform,
+  That means the setup hook can append to the right bash array by doing something like
+  <programlisting language="bash">
+addEnvHooks "$hostOffset" myBashFunction
+  </programlisting>
+</para>
+<para>
+  The <emphasis>existence</emphasis> of setups hooks has long been documented and packages inside Nixpkgs are free to use these mechanism.
+  Other packages, however, should not rely on these mechanisms not changing between Nixpkgs versions.
+  Because of the existing issues with this system, there's little benefit from mandating it be stable for any period of time.
+</para>
+<para>
+  Here are some packages that provide a setup hook.
+  Since the mechanism is modular, this probably isn't an exhaustive list.
+  Then again, since the mechanism is only to be used as a last resort, it might be.
 <variablelist>
 
   <varlistentry>
@@ -1421,9 +1697,12 @@ someVar=$(stripHash $name)
 
   <varlistentry>
     <term>Perl</term>
-    <listitem><para>Adds the <filename>lib/site_perl</filename> subdirectory
-    of each build input to the <envar>PERL5LIB</envar>
-    environment variable.</para></listitem>
+    <listitem>
+      <para>
+        Adds the <filename>lib/site_perl</filename> subdirectory of each build input to the <envar>PERL5LIB</envar> environment variable.
+        For instance, if <varname>buildInputs</varname> contains Perl, then the <filename>lib/site_perl</filename> subdirectory of each input is added to the <envar>PERL5LIB</envar> environment variable.
+      </para>
+    </listitem>
   </varlistentry>
 
   <varlistentry>
diff --git a/lib/generators.nix b/lib/generators.nix
index b27ab485f41ec..f207033c95545 100644
--- a/lib/generators.nix
+++ b/lib/generators.nix
@@ -130,6 +130,6 @@ rec {
               (name: value:
                 "${toPretty args name} = ${toPretty args value};") v)
         + " }"
-    else "toPretty: should never happen (v = ${v})";
+    else abort "toPretty: should never happen (v = ${v})";
 
 }
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index fd9d673b3b08a..13e66a55b9142 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -584,6 +584,7 @@
   ryanartecona = "Ryan Artecona <ryanartecona@gmail.com>";
   ryansydnor = "Ryan Sydnor <ryan.t.sydnor@gmail.com>";
   ryantm = "Ryan Mulligan <ryan@ryantm.com>";
+  ryantrinkle = "Ryan Trinkle <ryan.trinkle@gmail.com>";
   rybern = "Ryan Bernstein <ryan.bernstein@columbia.edu>";
   rycee = "Robert Helgesson <robert@rycee.net>";
   ryneeverett = "Ryne Everett <ryneeverett@gmail.com>";
diff --git a/maintainers/scripts/copy-tarballs.pl b/maintainers/scripts/copy-tarballs.pl
index 178dcfb38da4c..f3fe7236760bd 100755
--- a/maintainers/scripts/copy-tarballs.pl
+++ b/maintainers/scripts/copy-tarballs.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env nix-shell
-#! nix-shell -i perl -p perl perlPackages.NetAmazonS3 perlPackages.FileSlurp nixUnstable
+#! nix-shell -i perl -p perl perlPackages.NetAmazonS3 perlPackages.FileSlurp nixUnstable nixUnstable.perl-bindings
 
 # This command uploads tarballs to tarballs.nixos.org, the
 # content-addressed cache used by fetchurl as a fallback for when
@@ -59,6 +59,7 @@ my $s3 = Net::Amazon::S3->new(
     { aws_access_key_id     => $aws_access_key_id,
       aws_secret_access_key => $aws_secret_access_key,
       retry                 => 1,
+      host                  => "s3-eu-west-1.amazonaws.com",
     });
 
 my $bucket = $s3->bucket("nixpkgs-tarballs") or die;
diff --git a/nixos/doc/manual/release-notes/rl-1803.xml b/nixos/doc/manual/release-notes/rl-1803.xml
index 971d88e8a9c68..0ab119232eeb0 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>
@@ -103,6 +119,26 @@ following incompatible changes:</para>
       Other more obscure ones are just moved.
     </para>
   </listitem>
+  <listitem>
+    <para>
+      The propagation logic has been changed.
+      The new logic, along with new types of dependencies that go with, is thoroughly documented in the "Specifying dependencies" section of the "Standard Environment" chapter of the nixpkgs manual.
+      <!-- That's <xref linkend="ssec-stdenv-attributes"> were we to merge the manuals. -->
+      The old logic isn't but is easy to describe: dependencies were propagated as the same type of dependency no matter what.
+      In practice, that means that many <function>propagatedNativeBuildInputs</function> should instead be  <function>propagatedBuildInputs</function>.
+      Thankfully, that was and is the least used type of dependency.
+      Also, it means that some <function>propagatedBuildInputs</function> should instead be <function>depsTargetTargetPropagated</function>.
+      Other types dependencies should be unaffected.
+    </para>
+  </listitem>
+  <listitem>
+    <para>
+      The <literal>memcached</literal> service no longer accept dynamic socket
+      paths via <option>services.memcached.socket</option>. Unix sockets can be
+      still enabled by <option>services.memcached.enableUnixSocket</option> and
+      will be accessible at <literal>/run/memcached/memcached.sock</literal>.
+    </para>
+  </listitem>
 </itemizedlist>
 
 </section>
diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm
index a01c3c336a1b8..78598b3efb4b1 100644
--- a/nixos/lib/test-driver/Machine.pm
+++ b/nixos/lib/test-driver/Machine.pm
@@ -362,8 +362,8 @@ sub mustFail {
 
 
 sub getUnitInfo {
-    my ($self, $unit) = @_;
-    my ($status, $lines) = $self->execute("systemctl --no-pager show '$unit'");
+    my ($self, $unit, $user) = @_;
+    my ($status, $lines) = $self->systemctl("--no-pager show \"$unit\"", $user);
     return undef if $status != 0;
     my $info = {};
     foreach my $line (split '\n', $lines) {
@@ -373,6 +373,16 @@ sub getUnitInfo {
     return $info;
 }
 
+sub systemctl {
+    my ($self, $q, $user) = @_;
+    if ($user) {
+        $q =~ s/'/\\'/g;
+        return $self->execute("su -l $user -c \$'XDG_RUNTIME_DIR=/run/user/`id -u` systemctl --user $q'");
+    }
+
+    return $self->execute("systemctl $q");
+}
+
 # Fail if the given systemd unit is not in the "active" state.
 sub requireActiveUnit {
     my ($self, $unit) = @_;
@@ -387,16 +397,16 @@ sub requireActiveUnit {
 
 # Wait for a systemd unit to reach the "active" state.
 sub waitForUnit {
-    my ($self, $unit) = @_;
+    my ($self, $unit, $user) = @_;
     $self->nest("waiting for unit ‘$unit’", sub {
         retry sub {
-            my $info = $self->getUnitInfo($unit);
+            my $info = $self->getUnitInfo($unit, $user);
             my $state = $info->{ActiveState};
             die "unit ‘$unit’ reached state ‘$state’\n" if $state eq "failed";
             if ($state eq "inactive") {
                 # If there are no pending jobs, then assume this unit
                 # will never reach active state.
-                my ($status, $jobs) = $self->execute("systemctl list-jobs --full 2>&1");
+                my ($status, $jobs) = $self->systemctl("list-jobs --full 2>&1", $user);
                 if ($jobs =~ /No jobs/) {  # FIXME: fragile
                     # Handle the case where the unit may have started
                     # between the previous getUnitInfo() and
@@ -430,14 +440,14 @@ sub waitForFile {
 }
 
 sub startJob {
-    my ($self, $jobName) = @_;
-    $self->execute("systemctl start $jobName");
+    my ($self, $jobName, $user) = @_;
+    $self->systemctl("start $jobName", $user);
     # FIXME: check result
 }
 
 sub stopJob {
-    my ($self, $jobName) = @_;
-    $self->execute("systemctl stop $jobName");
+    my ($self, $jobName, $user) = @_;
+    $self->systemctl("stop $jobName", $user);
 }
 
 
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix
index 678593a2d8b46..c6440dd906fdd 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;
@@ -197,10 +197,10 @@
       #input = 174; # unused
       sddm = 175;
       tss = 176;
-      memcached = 177;
+      #memcached = 177; removed 2018-01-03
       ntp = 179;
       zabbix = 180;
-      redis = 181;
+      #redis = 181; removed 2018-01-03
       unifi = 183;
       uptimed = 184;
       zope2 = 185;
@@ -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;
@@ -475,10 +475,10 @@
       input = 174;
       sddm = 175;
       tss = 176;
-      #memcached = 177; # unused
+      #memcached = 177; # unused, removed 2018-01-03
       #ntp = 179; # unused
       #zabbix = 180; # unused
-      #redis = 181; # unused
+      #redis = 181; # unused, removed 2018-01-03
       #unifi = 183; # unused
       #uptimed = 184; # unused
       #zope2 = 185; # unused
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index f32fb50368e34..45e4279fecb79 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
@@ -261,6 +260,7 @@
   ./services/logging/rsyslogd.nix
   ./services/logging/syslog-ng.nix
   ./services/logging/syslogd.nix
+  ./services/mail/dkimproxy-out.nix
   ./services/mail/dovecot.nix
   ./services/mail/dspam.nix
   ./services/mail/exim.nix
@@ -746,6 +746,7 @@
   ./virtualisation/lxcfs.nix
   ./virtualisation/lxd.nix
   ./virtualisation/amazon-options.nix
+  ./virtualisation/hyperv-guest.nix
   ./virtualisation/openvswitch.nix
   ./virtualisation/parallels-guest.nix
   ./virtualisation/rkt.nix
diff --git a/nixos/modules/services/databases/memcached.nix b/nixos/modules/services/databases/memcached.nix
index c6875af506d35..46bc6fc5c1320 100644
--- a/nixos/modules/services/databases/memcached.nix
+++ b/nixos/modules/services/databases/memcached.nix
@@ -40,11 +40,7 @@ in
         description = "The port to bind to";
       };
 
-      socket = mkOption {
-        default = "";
-        description = "Unix socket path to listen on. Setting this will disable network support";
-        example = "/var/run/memcached";
-      };
+      enableUnixSocket = mkEnableOption "unix socket at /run/memcached/memcached.sock";
 
       maxMemory = mkOption {
         default = 64;
@@ -68,31 +64,40 @@ in
 
   config = mkIf config.services.memcached.enable {
 
-    users.extraUsers.memcached =
-      { name = cfg.user;
-        uid = config.ids.uids.memcached;
-        description = "Memcached server user";
-      };
+    users.extraUsers = optional (cfg.user == "memcached") {
+      name = "memcached";
+      description = "Memcached server user";
+    };
 
     environment.systemPackages = [ memcached ];
 
-    systemd.services.memcached =
-      { description = "Memcached server";
-
-        wantedBy = [ "multi-user.target" ];
-        after = [ "network.target" ];
-
-        serviceConfig = {
-          ExecStart =
-            let
-              networking = if cfg.socket != ""
-                then "-s ${cfg.socket}"
-                else "-l ${cfg.listen} -p ${toString cfg.port}";
-            in "${memcached}/bin/memcached ${networking} -m ${toString cfg.maxMemory} -c ${toString cfg.maxConnections} ${concatStringsSep " " cfg.extraOptions}";
-
-          User = cfg.user;
-        };
+    systemd.services.memcached = {
+      description = "Memcached server";
+
+      wantedBy = [ "multi-user.target" ];
+      after = [ "network.target" ];
+
+      serviceConfig = {
+        PermissionsStartOnly = true;
+        ExecStartPre = optionals cfg.enableUnixSocket [
+          "${pkgs.coreutils}/bin/install -d -o ${cfg.user} /run/memcached/"
+          "${pkgs.coreutils}/bin/chown -R ${cfg.user} /run/memcached/"
+        ];
+        ExecStart =
+        let
+          networking = if cfg.enableUnixSocket
+          then "-s /run/memcached/memcached.sock"
+          else "-l ${cfg.listen} -p ${toString cfg.port}";
+        in "${memcached}/bin/memcached ${networking} -m ${toString cfg.maxMemory} -c ${toString cfg.maxConnections} ${concatStringsSep " " cfg.extraOptions}";
+
+        User = cfg.user;
       };
+    };
   };
+  imports = [
+    (mkRemovedOptionModule ["services" "memcached" "socket"] ''
+      This option was replaced by a fixed unix socket path at /run/memcached/memcached.sock enabled using services.memached.enableUnixSocket.
+    '')
+  ];
 
 }
diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix
index a3bf4f9ba925c..36d5340a306fa 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/databases/redis.nix b/nixos/modules/services/databases/redis.nix
index a039ad138f6fc..e4e38a4364a0d 100644
--- a/nixos/modules/services/databases/redis.nix
+++ b/nixos/modules/services/databases/redis.nix
@@ -219,7 +219,6 @@ in
 
     users.extraUsers.redis =
       { name = cfg.user;
-        uid = config.ids.uids.redis;
         description = "Redis database user";
       };
 
diff --git a/nixos/modules/services/games/ghost-one.nix b/nixos/modules/services/games/ghost-one.nix
deleted file mode 100644
index 71ff6bb2f3f06..0000000000000
--- 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/nixos/modules/services/mail/dkimproxy-out.nix b/nixos/modules/services/mail/dkimproxy-out.nix
new file mode 100644
index 0000000000000..894b88e25c1b2
--- /dev/null
+++ b/nixos/modules/services/mail/dkimproxy-out.nix
@@ -0,0 +1,118 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+let
+  cfg = config.services.dkimproxy-out;
+  keydir = "/var/lib/dkimproxy-out";
+  privkey = "${keydir}/private.key";
+  pubkey = "${keydir}/public.key";
+in
+{
+  ##### interface
+  options = {
+    services.dkimproxy-out = {
+      enable = mkOption {
+        type = types.bool;
+        default = false;
+        description =
+          ''
+            Whether to enable dkimproxy_out.
+
+            Note that a key will be auto-generated, and can be found in
+            ${keydir}.
+          '';
+      };
+
+      listen = mkOption {
+        type = types.str;
+        example = "127.0.0.1:10027";
+        description = "Address:port DKIMproxy should listen on.";
+      };
+
+      relay = mkOption {
+        type = types.str;
+        example = "127.0.0.1:10028";
+        description = "Address:port DKIMproxy should forward mail to.";
+      };
+
+      domains = mkOption {
+        type = with types; listOf str;
+        example = [ "example.org" "example.com" ];
+        description = "List of domains DKIMproxy can sign for.";
+      };
+
+      selector = mkOption {
+        type = types.str;
+        example = "selector1";
+        description =
+          ''
+            The selector to use for DKIM key identification.
+
+            For example, if 'selector1' is used here, then for each domain
+            'example.org' given in `domain`, 'selector1._domainkey.example.org'
+            should contain the TXT record indicating the public key is the one
+            in ${pubkey}: "v=DKIM1; t=s; p=[THE PUBLIC KEY]".
+          '';
+      };
+
+      keySize = mkOption {
+        type = types.int;
+        default = 2048;
+        description =
+          ''
+            Size of the RSA key to use to sign outgoing emails. Note that the
+            maximum mandatorily verified as per RFC6376 is 2048.
+          '';
+      };
+
+      # TODO: allow signature for other schemes than dkim(c=relaxed/relaxed)?
+      # This being the scheme used by gmail, maybe nothing more is needed for
+      # reasonable use.
+    };
+  };
+
+  ##### implementation
+  config = let
+    configfile = pkgs.writeText "dkimproxy_out.conf"
+      ''
+        listen ${cfg.listen}
+        relay ${cfg.relay}
+
+        domain ${concatStringsSep "," cfg.domains}
+        selector ${cfg.selector}
+
+        signature dkim(c=relaxed/relaxed)
+
+        keyfile ${privkey}
+      '';
+  in
+    mkIf cfg.enable {
+      users.groups.dkimproxy-out = {};
+      users.users.dkimproxy-out = {
+        description = "DKIMproxy_out daemon";
+        group = "dkimproxy-out";
+        isSystemUser = true;
+      };
+
+      systemd.services.dkimproxy-out = {
+        description = "DKIMproxy_out";
+        wantedBy = [ "multi-user.target" ];
+        preStart = ''
+          if [ ! -d "${keydir}" ]; then
+            mkdir -p "${keydir}"
+            chmod 0700 "${keydir}"
+            ${pkgs.openssl}/bin/openssl genrsa -out "${privkey}" ${toString cfg.keySize}
+            ${pkgs.openssl}/bin/openssl rsa -in "${privkey}" -pubout -out "${pubkey}"
+            chown -R dkimproxy-out:dkimproxy-out "${keydir}"
+          fi
+        '';
+        script = ''
+          exec ${pkgs.dkimproxy}/bin/dkimproxy.out --conf_file=${configfile}
+        '';
+        serviceConfig = {
+          User = "dkimproxy-out";
+          PermissionsStartOnly = true;
+        };
+      };
+    };
+}
diff --git a/nixos/modules/services/networking/nat.nix b/nixos/modules/services/networking/nat.nix
index bfaf30c117833..df4246d216d8d 100644
--- a/nixos/modules/services/networking/nat.nix
+++ b/nixos/modules/services/networking/nat.nix
@@ -19,6 +19,8 @@ let
     iptables -w -t nat -D POSTROUTING -j nixos-nat-post 2>/dev/null || true
     iptables -w -t nat -F nixos-nat-post 2>/dev/null || true
     iptables -w -t nat -X nixos-nat-post 2>/dev/null || true
+
+    ${cfg.extraStopCommands}
   '';
 
   setupNat = ''
@@ -59,6 +61,8 @@ let
 	--to-destination ${cfg.dmzHost}
     ''}
 
+    ${cfg.extraCommands}
+
     # Append our chains to the nat tables
     iptables -w -t nat -A PREROUTING -j nixos-nat-pre
     iptables -w -t nat -A POSTROUTING -j nixos-nat-post
@@ -170,6 +174,28 @@ in
         '';
     };
 
+    networking.nat.extraCommands = mkOption {
+      type = types.lines;
+      default = "";
+      example = "iptables -A INPUT -p icmp -j ACCEPT";
+      description =
+        ''
+          Additional shell commands executed as part of the nat
+          initialisation script.
+        '';
+    };
+
+    networking.nat.extraStopCommands = mkOption {
+      type = types.lines;
+      default = "";
+      example = "iptables -D INPUT -p icmp -j ACCEPT || true";
+      description =
+        ''
+          Additional shell commands executed as part of the nat
+          teardown script.
+        '';
+    };
+
   };
 
 
diff --git a/nixos/modules/services/x11/window-managers/awesome.nix b/nixos/modules/services/x11/window-managers/awesome.nix
index eb97449c6bd91..71eb02ec59549 100644
--- a/nixos/modules/services/x11/window-managers/awesome.nix
+++ b/nixos/modules/services/x11/window-managers/awesome.nix
@@ -6,7 +6,11 @@ let
 
   cfg = config.services.xserver.windowManager.awesome;
   awesome = cfg.package;
-  inherit (pkgs.luaPackages) getLuaPath getLuaCPath;
+  getLuaPath = lib : dir : "${lib}/${dir}/lua/${pkgs.luaPackages.lua.luaversion}";
+  makeSearchPath = lib.concatMapStrings (path:
+    " --search " + (getLuaPath path "share") +
+    " --search " + (getLuaPath path "lib")
+  );
 in
 
 {
@@ -46,10 +50,7 @@ in
       { name = "awesome";
         start =
           ''
-            export LUA_CPATH="${lib.concatStringsSep ";" (map getLuaCPath cfg.luaModules)}"
-            export LUA_PATH="${lib.concatStringsSep ";" (map getLuaPath cfg.luaModules)}"
-
-            ${awesome}/bin/awesome &
+            ${awesome}/bin/awesome ${makeSearchPath cfg.luaModules} &
             waitPID=$!
           '';
       };
diff --git a/nixos/modules/virtualisation/hyperv-guest.nix b/nixos/modules/virtualisation/hyperv-guest.nix
new file mode 100644
index 0000000000000..ecd2a8117710f
--- /dev/null
+++ b/nixos/modules/virtualisation/hyperv-guest.nix
@@ -0,0 +1,37 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.virtualisation.hypervGuest;
+
+in {
+  options = {
+    virtualisation.hypervGuest = {
+      enable = mkEnableOption "Hyper-V Guest Support";
+    };
+  };
+
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ config.boot.kernelPackages.hyperv-daemons.bin ];
+
+    security.rngd.enable = false;
+
+    # enable hotadding memory
+    services.udev.packages = lib.singleton (pkgs.writeTextFile {
+      name = "hyperv-memory-hotadd-udev-rules";
+      destination = "/etc/udev/rules.d/99-hyperv-memory-hotadd.rules";
+      text = ''
+        ACTION="add", SUBSYSTEM=="memory", ATTR{state}="online"
+      '';
+    });
+
+    systemd = {
+      packages = [ config.boot.kernelPackages.hyperv-daemons.lib ];
+
+      targets.hyperv-daemons = {
+        wantedBy = [ "multi-user.target" ];
+      };
+    };
+  };
+}
diff --git a/pkgs/applications/altcoins/zcash/default.nix b/pkgs/applications/altcoins/zcash/default.nix
index e9236544ee7fc..6a8fba3c2bb70 100644
--- a/pkgs/applications/altcoins/zcash/default.nix
+++ b/pkgs/applications/altcoins/zcash/default.nix
@@ -2,20 +2,19 @@
 , zlib, gtest, gmock, callPackage, gmp, qt4, utillinux, protobuf, qrencode, libevent
 , withGui }:
 
-let libsnark     = callPackage ./libsnark { inherit boost openssl; };
-    librustzcash = callPackage ./librustzcash {};
+let librustzcash = callPackage ./librustzcash {};
 in
 with stdenv.lib;
 stdenv.mkDerivation rec {
 
   name = "zcash" + (toString (optional (!withGui) "d")) + "-" + version;
-  version = "1.0.12";
+  version = "1.0.13";
 
   src = fetchFromGitHub {
     owner = "zcash";
     repo  = "zcash";
     rev = "v${version}";
-    sha256 = "19bxhdnkvgncgl9x6nbaf5nwgrdfw99icvdbi9adfh646pd5z64s";
+    sha256 = "05y7wxs66anxr5akbf05r36mmjfzqpwawn6vyh3jhpva51hzzzyz";
   };
 
   # Dependencies are underspecified: "make -C src gtest/zcash_gtest-test_merkletree.o"
@@ -23,17 +22,15 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = false;
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
-  buildInputs = [ gtest gmock gmp libsnark openssl wget db62 boost zlib
+  buildInputs = [ gtest gmock gmp openssl wget db62 boost zlib
                   protobuf libevent libsodium librustzcash ]
                   ++ optionals stdenv.isLinux [ utillinux ]
                   ++ optionals withGui [ qt4 qrencode ];
 
-  configureFlags = [ "LIBSNARK_INCDIR=${libsnark}/include/libsnark"
-                     "--with-boost-libdir=${boost.out}/lib"
+  configureFlags = [ "--with-boost-libdir=${boost.out}/lib"
                    ] ++ optionals withGui [ "--with-gui=qt4" ];
 
   patchPhase = ''
-    sed -i"" '/^\[LIBSNARK_INCDIR/d'               configure.ac
     sed -i"" 's,-lboost_system-mt,-lboost_system,' configure.ac
     sed -i"" 's,-fvisibility=hidden,,g'            src/Makefile.am
   '';
diff --git a/pkgs/applications/altcoins/zcash/libsnark/ate-pairing.nix b/pkgs/applications/altcoins/zcash/libsnark/ate-pairing.nix
deleted file mode 100644
index 303b3bc171ef8..0000000000000
--- a/pkgs/applications/altcoins/zcash/libsnark/ate-pairing.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, xbyak, gmp, fetchFromGitHub }:
-
-stdenv.mkDerivation rec {
-  name = "ate-pairing-unstable-${version}";
-  version = "2016-05-03";
-
-  src = fetchFromGitHub {
-    owner = "herumi";
-    repo  = "ate-pairing";
-    rev = "dcb9da999b1113f90b115bccb6f4b57ddf3a8452";
-    sha256 = "0jr6r1cma414k8mhsyp7n8hqaqxi7zklsp6820a095sbb3zajckh";
-  };
-
-  buildInputs = [ gmp xbyak ];
-
-  installPhase = ''
-    mkdir -p $out
-    cp -r lib $out
-    cp -r include $out
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Optimal Ate Pairing over Barreto-Naehrig Curves";
-    homepage = https://github.com/herumi/ate-pairing;
-    maintainers = with maintainers; [ rht ];
-    license = licenses.bsd3;
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/applications/altcoins/zcash/libsnark/default.nix b/pkgs/applications/altcoins/zcash/libsnark/default.nix
deleted file mode 100644
index be885493dcda8..0000000000000
--- a/pkgs/applications/altcoins/zcash/libsnark/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ stdenv, libsodium, callPackage, boost, zlib, openssl, gmp, procps, fetchFromGitHub }:
-
-let atePairing = callPackage ./ate-pairing.nix { inherit xbyak; };
-    mie        = callPackage ./mie.nix { };
-    xbyak      = callPackage ./xbyak.nix {};
-in
-stdenv.mkDerivation rec{
-  name = "libsnark-unstable-${version}";
-  version = "2017-02-09";
-
-  src = fetchFromGitHub {
-    owner = "zcash";
-    repo  = "libsnark";
-    rev = "9ada3f84ab484c57b2247c2f41091fd6a0916573";
-    sha256 = "0vhslcb9rwqab9szavyn856z4h9w1syiamfcixqmj0s908zzlaaq";
-  };
-
-  buildInputs = [ libsodium atePairing mie xbyak zlib openssl boost gmp ];
-
-  makeFlags = [
-    "PREFIX=$(out)"
-    "CURVE=ALT_BN128"
-    "NO_SUPERCOP=1"
-    "STATIC=1"
-  ];
-
-  buildPhase = ''
-    CXXFLAGS="-fPIC -DBINARY_OUTPUT -DNO_PT_COMPRESSION=1" \
-    make lib \
-      CURVE=ALT_BN128 \
-      MULTICORE=1 \
-      STATIC=1 \
-      NO_PROCPS=1 \
-      NO_GTEST=1 \
-      FEATUREFLAGS=-DMONTGOMERY_OUTPUT \
-  '';
-
-  meta = with stdenv.lib; {
-    description = "a C++ library for zkSNARK proofs";
-    homepage = https://github.com/zcash/libsnark;
-    maintainers = with maintainers; [ rht ];
-    license = licenses.mit;
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/applications/altcoins/zcash/libsnark/mie.nix b/pkgs/applications/altcoins/zcash/libsnark/mie.nix
deleted file mode 100644
index a66ff128293ea..0000000000000
--- a/pkgs/applications/altcoins/zcash/libsnark/mie.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-stdenv.mkDerivation rec {
-  name = "mie-unstable-${version}";
-  version = "2016-05-10";
-
-  src = fetchFromGitHub {
-    owner = "herumi";
-    repo  = "mie";
-    rev = "704b625b7770a8e1eab26ac65d1fed14c2fcf090";
-    sha256 = "144bpmgfs2m4qqv7a2mccgi1aq5jmlr25gnk78ryq09z8cyv88y2";
-  };
-
-  phases = ["unpackPhase" "installPhase"];
-
-  installPhase = ''
-    mkdir -p $out
-    cp -r include $out
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = https://github.com/herumi/mie;
-    maintainers = with maintainers; [ rht ];
-    license = licenses.bsd3;
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/applications/altcoins/zcash/libsnark/xbyak.nix b/pkgs/applications/altcoins/zcash/libsnark/xbyak.nix
deleted file mode 100644
index 88d432fd1637d..0000000000000
--- a/pkgs/applications/altcoins/zcash/libsnark/xbyak.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, fetchFromGitHub }:
-
-stdenv.mkDerivation rec {
-  name = "xbyak-unstable-${version}";
-  version = "2016-05-03";
-
-  src = fetchFromGitHub {
-    owner = "herumi";
-    repo  = "xbyak";
-    rev = "b6133a02dd6b7116bea31d0e6b7142bf97f071aa";
-    sha256 = "1rc2nx8kj2lj13whxb9chhh79f4hmjjj4j1hpqsd0lbdb60jikrn";
-  };
-
-  dontBuild = true;
-
-  installPhase = ''
-    mkdir -p $out/include
-    cp -r xbyak $out/include
-  '';
-
-  meta = with stdenv.lib; {
-    description = "JIT assembler for x86, x64";
-    homepage = https://github.com/herumi/xbyak;
-    maintainers = with maintainers; [ rht ];
-    license = licenses.bsd3;
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/applications/audio/amarok/kf5.nix b/pkgs/applications/audio/amarok/kf5.nix
index a96aa3ed65d0e..a4ac2943bfbc2 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/editors/emacs-modes/elpa-generated.nix b/pkgs/applications/editors/emacs-modes/elpa-generated.nix
index 5ee3d61a65ae2..9c3be2e6ac18c 100644
--- a/pkgs/applications/editors/emacs-modes/elpa-generated.nix
+++ b/pkgs/applications/editors/emacs-modes/elpa-generated.nix
@@ -135,10 +135,10 @@
     arbitools = callPackage ({ cl-lib ? null, elpaBuild, fetchurl, lib }:
     elpaBuild {
         pname = "arbitools";
-        version = "0.91";
+        version = "0.93";
         src = fetchurl {
-          url = "https://elpa.gnu.org/packages/arbitools-0.91.el";
-          sha256 = "0r0nbpwjxal40ydvx7hmjq56x12jcfqgld7yc4fjfz93wn8m40qf";
+          url = "https://elpa.gnu.org/packages/arbitools-0.93.el";
+          sha256 = "0z3lqp8dqfkams5h4sw569p48d2rvpd3d8lb4xaw0z8l49y2mvg8";
         };
         packageRequires = [ cl-lib ];
         meta = {
@@ -768,10 +768,10 @@
     el-search = callPackage ({ elpaBuild, emacs, fetchurl, lib, stream }:
     elpaBuild {
         pname = "el-search";
-        version = "1.4.0.11";
+        version = "1.4.0.12";
         src = fetchurl {
-          url = "https://elpa.gnu.org/packages/el-search-1.4.0.11.tar";
-          sha256 = "12m468fxwfrwjkm0wcraafb7n9shh9fmw43nggc216ch3syxmfaw";
+          url = "https://elpa.gnu.org/packages/el-search-1.4.0.12.tar";
+          sha256 = "140p1ian8dwip6305spg4rvm3rqxhznlq0w5msixw6ykwm735a8z";
         };
         packageRequires = [ emacs stream ];
         meta = {
@@ -2254,10 +2254,10 @@
       }) {};
     vlf = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
         pname = "vlf";
-        version = "1.7";
+        version = "1.7.1";
         src = fetchurl {
-          url = "https://elpa.gnu.org/packages/vlf-1.7.tar";
-          sha256 = "007zdr5szimr6nwwrqz9s338s0qq82r006pdwgcm8nc41jsmsx7r";
+          url = "https://elpa.gnu.org/packages/vlf-1.7.1.tar";
+          sha256 = "0cnwxk20573iqkwk0c0h7pyjk0rkr8l2qd0xmyqj8mvdxjb8nnkz";
         };
         packageRequires = [];
         meta = {
diff --git a/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix b/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix
index 7b7004b72f306..733393307d3ff 100644
--- a/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix
+++ b/pkgs/applications/editors/emacs-modes/font-lock-plus/default.nix
@@ -2,11 +2,11 @@
 
 melpaBuild {
   pname = "font-lock-plus";
-  version = "20170222.1755";
+  version = "20180101.25";
 
   src = fetchurl {
-    url = "https://www.emacswiki.org/emacs/download/font-lock+.el";
-    sha256 = "0iajkgh0n3pbrwwxx9rmrrwz8dw2m7jsp4mggnhq7zsb20ighs30";
+    url = "https://www.emacswiki.org/emacs/download/font-lock%2b.el?revision=25";
+    sha256 = "0197yzn4hbjmw5h3m08264b7zymw63pdafph5f3yzfm50q8p7kp4";
     name = "font-lock+.el";
   };
 
diff --git a/pkgs/applications/editors/emacs-modes/melpa-generated.nix b/pkgs/applications/editors/emacs-modes/melpa-generated.nix
index f4c6e9a8a2092..8c9585ae151c5 100644
--- a/pkgs/applications/editors/emacs-modes/melpa-generated.nix
+++ b/pkgs/applications/editors/emacs-modes/melpa-generated.nix
@@ -1093,12 +1093,12 @@
     ace-popup-menu = callPackage ({ avy-menu, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ace-popup-menu";
-        version = "20170518.2244";
+        version = "20171231.2215";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "ace-popup-menu";
-          rev = "eae1b0ea1a56cc1da2543e95570867a1a026669d";
-          sha256 = "1w1q0r104v9fngzi3q8l6gwzb0c9gdq2jmbjb372j7969py73ywc";
+          rev = "7b8ad628a058d32c420f7615927a34a5d51a7ad3";
+          sha256 = "183gc5lidxahfzik9ima2vph2sdi2rd9805kfnghsmwhck275i2r";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/53742e2242101c4b3b3901f5c74e24facf62c7d6/recipes/ace-popup-menu";
@@ -1114,12 +1114,12 @@
     ace-window = callPackage ({ avy, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ace-window";
-        version = "20171211.921";
+        version = "20171228.1109";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "ace-window";
-          rev = "6c52b0bbcfa2a6f62236050bacd9d915f99732b7";
-          sha256 = "0j84gv4f4z1l11dyd6ckwgr2bmghxmlqfpr48q8ccwy270x1qxdi";
+          rev = "c0fbdd51be8fdd43fd7a89140ebd4b4c311d45fc";
+          sha256 = "0jiq2d2bgp6f26d5hjmd56cv68l2x6rlbpsvp6ig42nydv2yjjkz";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/42fe131d3c2ea498e4df30ba539a6b91c00f5b07/recipes/ace-window";
@@ -3656,6 +3656,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    auto-sudoedit = callPackage ({ emacs, f, fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "auto-sudoedit";
+        version = "20171227.156";
+        src = fetchFromGitHub {
+          owner = "ncaq";
+          repo = "auto-sudoedit";
+          rev = "5a6f7da018fbb880c4c51032b39d7628a478989c";
+          sha256 = "190izcami97h2yzw267crs0xny494b9b58dmmb7bqslv38ayl396";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/7cf6bc8bb7b618d74427622b9b2812daa79a3767/recipes/auto-sudoedit";
+          sha256 = "1clp52fqxsilyi62p1cabhan55lbwax6fqlhccyjbl36yrdig3fh";
+          name = "auto-sudoedit";
+        };
+        packageRequires = [ emacs f ];
+        meta = {
+          homepage = "https://melpa.org/#/auto-sudoedit";
+          license = lib.licenses.free;
+        };
+      }) {};
     auto-virtualenv = callPackage ({ cl-lib ? null, fetchFromGitHub, fetchurl, lib, melpaBuild, pyvenv, s }:
     melpaBuild {
         pname = "auto-virtualenv";
@@ -3953,12 +3974,12 @@
     avy = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "avy";
-        version = "20171211.923";
+        version = "20171230.220";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "avy";
-          rev = "6459f7f12aef1e71ff5e265b1edb414fd81123e6";
-          sha256 = "192pmqi35r3s01q2m91iscj1yzqx2wv6m47rdgzhgpb32irzvsgh";
+          rev = "34d3531a3cd35ae6b9e8dbc37343c027504fdcb0";
+          sha256 = "0rgwbm5jcbv132xldbz2kcp09c7hs96329mwfa019v99qdbb5k32";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/77fac7a702d4086fb860514e377037acedc60412/recipes/avy";
@@ -3995,12 +4016,12 @@
     avy-menu = callPackage ({ avy, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "avy-menu";
-        version = "20170518.2245";
+        version = "20171231.2220";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "avy-menu";
-          rev = "c36e28cabbcea8fdd2ada723b9a28ecc35a2d6c0";
-          sha256 = "14ci1saksmhnnk5a7dy2v9dbsw7c030524vwb3y1wpw0vv863zjh";
+          rev = "990cc94d708c923f761be083b3a57f6f844566c8";
+          sha256 = "0kjxfg8wx5c8cixazih24s0mv4crk648v9bb6pd1i6lmh266rc6g";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/2f0b4cfb30c405d44803b36ebcaccef0cf87fe2d/recipes/avy-menu";
@@ -6669,8 +6690,8 @@
         src = fetchFromGitHub {
           owner = "ocaml";
           repo = "ocaml";
-          rev = "1707e24f0001a122f6e71eba237b1044e5f0bfa1";
-          sha256 = "0dfykliby2jx466ckvxyrzmhyzdz23khhdq5faf4h9ndhd8ca9br";
+          rev = "34a11aaa62ff54cbff4403b16ede46a3c3b04799";
+          sha256 = "06im9ixs7z9ysnhdgw9v57x3r5sb4hkmj4j2j4qa5yfcp6cmm07f";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d5a3263cdcc229b11a3e96edbf632d56f32c47aa/recipes/caml";
@@ -6770,12 +6791,12 @@
     cask = callPackage ({ cl-lib ? null, dash, epl, f, fetchFromGitHub, fetchurl, lib, melpaBuild, package-build, s, shut-up }:
     melpaBuild {
         pname = "cask";
-        version = "20171225.2312";
+        version = "20171230.452";
         src = fetchFromGitHub {
           owner = "cask";
           repo = "cask";
-          rev = "324d99d209eec53fa8f289e65004d2403344f284";
-          sha256 = "0aaqf1m786b8sg4n0agpbawnm03la5gvn09c3rf9k5bzq4m77a6i";
+          rev = "4c3c8890f72456f3ae4bc2213978f675c39c7a66";
+          sha256 = "02jvmrr8xr77lqdr5jsmqr1w7ix48yfkvr1vi7nsc7gzmx8vp28z";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b86c666ee9b0620390a250dddd42b17cbec2409f/recipes/cask";
@@ -7294,12 +7315,12 @@
     challenger-deep-theme = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "challenger-deep-theme";
-        version = "20171118.437";
+        version = "20171229.435";
         src = fetchFromGitHub {
           owner = "MaxSt";
           repo = "challenger-deep";
-          rev = "08985cc17302f0e90a532fd5d67cfe2429b22444";
-          sha256 = "1qn1l48fwhqw3lkag4322r16cq2ms9spg42jf0w1fc0y6w691p54";
+          rev = "0dd5b03310d6607f445a123e91487b358501db3c";
+          sha256 = "0dvglln69h01p74fw2fm2qc9hj8psz3p1y0wfjpc7alm0cbfh3gk";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7942f539d025c1e2b059d49e1984716cbbc90a67/recipes/challenger-deep-theme";
@@ -7357,12 +7378,12 @@
     char-menu = callPackage ({ avy-menu, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "char-menu";
-        version = "20170518.2247";
+        version = "20171231.2218";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "char-menu";
-          rev = "b4542123e8c9bc40de1328f9a8078a0704a9a98d";
-          sha256 = "101r6gryj5ic3mbv400klcjw8zfpn1rwi8ayyki93a53pali5g96";
+          rev = "3235f8e3c88848ce10d25f84a5da39061fd35c0d";
+          sha256 = "05pjfj6g4gdbdj4z63283j5qzkvhvrzsx1jhbc5iih0nsffwapc3";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/f6676747e853045b3b19e7fc9524c793c6a08303/recipes/char-menu";
@@ -7756,12 +7777,12 @@
     cider = callPackage ({ clojure-mode, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, pkg-info, queue, seq, spinner }:
     melpaBuild {
         pname = "cider";
-        version = "20171224.931";
+        version = "20180101.958";
         src = fetchFromGitHub {
           owner = "clojure-emacs";
           repo = "cider";
-          rev = "84de0dcd22a2df289cc14954897f8e52bdd97f5a";
-          sha256 = "1y14wf3nv0bqh06kh3rfl18rxdipmdcd077addkk3lp9704rd4w4";
+          rev = "f1dc7543cef77f560ae82c4407d9bf3787b66866";
+          sha256 = "0jj7jqcvy12lk9rrk99icalk7szhylqbbl9w68lgrma3lnrpi04d";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/55a937aed818dbe41530037da315f705205f189b/recipes/cider";
@@ -8521,22 +8542,22 @@
           license = lib.licenses.free;
         };
       }) {};
-    clomacs = callPackage ({ cider, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
+    clomacs = callPackage ({ cider, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s, simple-httpd }:
     melpaBuild {
         pname = "clomacs";
-        version = "20170726.436";
+        version = "20180101.1354";
         src = fetchFromGitHub {
           owner = "clojure-emacs";
           repo = "clomacs";
-          rev = "8d3e12a2f73e81499fa18f30adaea8c861e4a9b1";
-          sha256 = "01wpzbv4vjad0nvbydc0rwb3jdqbncwajs5xrng88n1xxhrajh1x";
+          rev = "20706c65f218dd0671b0331f35bd8965e443062a";
+          sha256 = "1mkn5y2mgdxv6njhy1njbpigzhx3x2hb618fzcd54yxn59mb5r47";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/345f9797e87e3f5f957c167a5e3d33d1e31b50a3/recipes/clomacs";
           sha256 = "1vfjzrzp58ap75i0dh5bwnlkb8qbpfmrd3fg9n6aaibvvd2m3hyh";
           name = "clomacs";
         };
-        packageRequires = [ cider emacs s ];
+        packageRequires = [ cider emacs s simple-httpd ];
         meta = {
           homepage = "https://melpa.org/#/clomacs";
           license = lib.licenses.free;
@@ -8696,8 +8717,8 @@
         src = fetchFromGitHub {
           owner = "Kitware";
           repo = "CMake";
-          rev = "cd2ed4b87adf83e406a1c02c169d50e29743879c";
-          sha256 = "1wj59vf7d7mmcd9gyxqsnf59m3jzwdr8nc25q0xkb0p6krq8spsd";
+          rev = "011f2de484c0be3a4c21cca5982c0b7452a32e30";
+          sha256 = "1fazl514qwdcmwz4d47svay7g7sjw5yvcc8szsqhm3zq71ck5q2v";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/598723893ae4bc2e60f527a072efe6ed9d4e2488/recipes/cmake-mode";
@@ -9448,12 +9469,12 @@
     company = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "company";
-        version = "20171219.133";
+        version = "20180101.1101";
         src = fetchFromGitHub {
           owner = "company-mode";
           repo = "company-mode";
-          rev = "a57441832674f88ba1c166678ad024c1e6665b5a";
-          sha256 = "10wj0878d3yg5yfipgclx2imm99bgi8625136flgar2v51qn5iaw";
+          rev = "4a8289dc257c3991c3953b64671fc25c887b2ca4";
+          sha256 = "178wf0n1mdfx6yqwdqlw7drbr5fy7gf6x6p4094s9br7slk9kssk";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/96e7b4184497d0d0db532947f2801398b72432e4/recipes/company";
@@ -9928,8 +9949,8 @@
         src = fetchFromGitHub {
           owner = "nsf";
           repo = "gocode";
-          rev = "0444ce1cda44fedd8f89f853dfb9d3ee6973fa13";
-          sha256 = "1zr8ql7blacz4iz8l969sz3dmy9cfp4v15bwzxv71rg9vhz1ip9g";
+          rev = "22bc785b7506257947079201bd1a117e885af8bb";
+          sha256 = "16pkv3xc19i0gaxgvixjsdm17ikmibvaq6rr4bg4rpzk2z2l11fg";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/04867a574773e8794335a2664d4f5e8b243f3ec9/recipes/company-go";
@@ -10375,8 +10396,8 @@
         src = fetchFromGitHub {
           owner = "nathankot";
           repo = "company-sourcekit";
-          rev = "8ba62ac25bf533b7f148f333bcb5c1db799f749b";
-          sha256 = "01dh0wdaydiai4v13r8g05rpiwqr5qqi34wif8vbk2mrr25wc7i9";
+          rev = "abf9bc5a0102eb666d3aa6d6bf22f6efcc852781";
+          sha256 = "1g8a4fgy2c5nqk8gysbnzn5jvfw6ynmfhc6j3hkrbswgf9188v5n";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/45969cd5cd936ea61fbef4722843b0b0092d7b72/recipes/company-sourcekit";
@@ -10959,12 +10980,12 @@
     counsel = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, swiper }:
     melpaBuild {
         pname = "counsel";
-        version = "20171225.159";
+        version = "20180101.832";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "swiper";
-          rev = "864fbfeb0328d13e7d4641fcba9d001326229d37";
-          sha256 = "045fqwgc02fh5mb09b0kzjwadr7b9vvsksicklffsx31fwbav4d6";
+          rev = "c2bc6ac92a6cea730d7887813a816bdf873f9b92";
+          sha256 = "040z731dm66w4c0475q8vl1lm4dnvi9yz2qslxdma0qdx70hymrr";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/06c50f32b8d603db0d70e77907e36862cd66b811/recipes/counsel";
@@ -11022,12 +11043,12 @@
     counsel-etags = callPackage ({ counsel, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "counsel-etags";
-        version = "20171227.2228";
+        version = "20171228.1836";
         src = fetchFromGitHub {
           owner = "redguardtoo";
           repo = "counsel-etags";
-          rev = "921fa5a062bda9a0f9226fdaa76530ad809ff7b9";
-          sha256 = "1qvp3ihchfwy57sfnnkk6m591s381w57ppig9c0izlbzw3n7hi7n";
+          rev = "e39bb84a590ba121dcd4ca75a3a9ac20a41b7cba";
+          sha256 = "19wp4klk1kxrhx2qkdxfdxlhha0v5dz0s90m2kdhqk4s87sggg7d";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/87528349a3ab305bfe98f30c5404913272817a38/recipes/counsel-etags";
@@ -11505,12 +11526,12 @@
     crux = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild, seq }:
     melpaBuild {
         pname = "crux";
-        version = "20170801.1334";
+        version = "20171230.1100";
         src = fetchFromGitHub {
           owner = "bbatsov";
           repo = "crux";
-          rev = "4f5c8fefd5a6aa52e128c4a0401cc86410d6ac8f";
-          sha256 = "1fdxvv25cs01sg6fmvmzxpzvs50i6v8n2jya60lbavxqqhi0sbxd";
+          rev = "6c02dab04fadd8ffb96dc513467e443b0549d1d3";
+          sha256 = "08yv469k3rvnxnqrj7iwywq974z9lp0szkrgxlxxfap03wv59f66";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/575e3442a925500a5806e0b900208c1e6bfd11ae/recipes/crux";
@@ -12030,12 +12051,12 @@
     cyphejor = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "cyphejor";
-        version = "20171221.236";
+        version = "20171231.2218";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "cyphejor";
-          rev = "47a6f6ad62f552bacea397626e6e8b2618951ab8";
-          sha256 = "0mvlymqy5xasv17dsndqhwkyiginhbqipvr0526abh2aaaycpixc";
+          rev = "d2faf26420ac16c4056f6eda067b845d33e102cd";
+          sha256 = "0vg0n8xcqiv28i3xmnxzji77dbnyxrld4ncdzpa3hpc1j92s9a09";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/ad7cacfa39d8f85e26372ef21898663aebb68e43/recipes/cyphejor";
@@ -12223,8 +12244,8 @@
         src = fetchFromGitHub {
           owner = "rails-to-cosmos";
           repo = "danneskjold-theme";
-          rev = "de694a6cac4e72c5a36b2776b12503fa736ba590";
-          sha256 = "0aj71nhilmv4bqm5ynlah75wsf3m6rn71xmr7m6ip3wa0bz6pr99";
+          rev = "b2cb6afa47755f9c426aebd19394d6d0ce317a1d";
+          sha256 = "1q9ayi985kd5pk78ik7rywpzkzpbdb3010nwp8gnrkgli17lkvaa";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/557244a3b60c7cd3ca964ff843aa1e9d5a1e32ec/recipes/danneskjold-theme";
@@ -12534,12 +12555,12 @@
     dashboard = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, page-break-lines }:
     melpaBuild {
         pname = "dashboard";
-        version = "20170923.719";
+        version = "20180101.2352";
         src = fetchFromGitHub {
           owner = "rakanalh";
           repo = "emacs-dashboard";
-          rev = "8594c4f55448148b720eda5b72d51667fb7a8a39";
-          sha256 = "1hhh1kfsz87qfmh45wjf2r93rz79rq0vbyxlfrsl02092zjbl1zr";
+          rev = "7b514b2c4895034b645cb2028220a411882e3b0e";
+          sha256 = "0wrlj4nvqr6qcdap0wa6f1pjf77mnyrw820249qb2flb2j4xbd7x";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e9a79341ccaa82a8c065e71c02fe6aee22007c66/recipes/dashboard";
@@ -12912,12 +12933,12 @@
     define-word = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "define-word";
-        version = "20171125.25";
+        version = "20171231.1005";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "define-word";
-          rev = "1e8e537c3b5b25e770c1b2f993497298405225b2";
-          sha256 = "1phbyak6m97h2md0a8id5aqb5rmkpfw5259l2a7d87gk0lgkaqa2";
+          rev = "7ed98a55221075dc55f629972fd0d15d8c402417";
+          sha256 = "0lvvs5xnkfd0mvya8qzvgnl6pigq3vlbm4l5a87ydppnr0c7z605";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e318b30d8b2b89981f4b89d78e5a46e77d3de412/recipes/define-word";
@@ -13415,12 +13436,12 @@
     dimmer = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "dimmer";
-        version = "20171226.2250";
+        version = "20180101.1022";
         src = fetchFromGitHub {
           owner = "gonewest818";
           repo = "dimmer.el";
-          rev = "1801a6868dcf84a2b00848c5a4961ec621478e20";
-          sha256 = "1yadl6qvb9dlnaj64928i4wmjxnk8q04rhz48fbn58g71yrfizl8";
+          rev = "4963092d1d37987e6b9b3eca21be425a1ae44d99";
+          sha256 = "1b4wg20038ji54bbiwnmvr3ghkkm6x7skhz16110saqwfdfibmdx";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/8ae80e9202d69ed3214325dd15c4b2f114263954/recipes/dimmer";
@@ -13503,8 +13524,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/568e524b7bdf91b31655bdbb30fe9481d7a0ffbf/recipes/dired-avfs";
@@ -13524,8 +13545,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/6aab23df1451682ff18d9ad02c35cb7ec612bc38/recipes/dired-collapse";
@@ -13650,8 +13671,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/568e524b7bdf91b31655bdbb30fe9481d7a0ffbf/recipes/dired-filter";
@@ -13671,8 +13692,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/568e524b7bdf91b31655bdbb30fe9481d7a0ffbf/recipes/dired-hacks-utils";
@@ -13797,8 +13818,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/8994330f90a925df17ae425ccdc87865df8e19cd/recipes/dired-narrow";
@@ -13818,8 +13839,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/568e524b7bdf91b31655bdbb30fe9481d7a0ffbf/recipes/dired-open";
@@ -13860,8 +13881,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/568e524b7bdf91b31655bdbb30fe9481d7a0ffbf/recipes/dired-rainbow";
@@ -13877,12 +13898,12 @@
     dired-ranger = callPackage ({ dash, dired-hacks-utils, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "dired-ranger";
-        version = "20160924.335";
+        version = "20171229.753";
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c03f6f8c779c8784f52adb20b266404cb537113a/recipes/dired-ranger";
@@ -13944,8 +13965,8 @@
         src = fetchFromGitHub {
           owner = "Fuco1";
           repo = "dired-hacks";
-          rev = "edea7534b36297211fe1c0e493220a5cc1bdec93";
-          sha256 = "1g05r0krgyyj91digvd07vn6qi9m8yigj6w97bg8zgcsrxhlmc07";
+          rev = "f0628fb58ae25563a5bba211f613f8bd7e23fabd";
+          sha256 = "02dwazx62297wyyxxvb1zw2yz031lsw2h9kc1zgn63ra33kb4b2a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d6a947ac9476f10b95a3c153ec784d2a8330dd4c/recipes/dired-subtree";
@@ -14850,12 +14871,12 @@
     dokuwiki = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, xml-rpc }:
     melpaBuild {
         pname = "dokuwiki";
-        version = "20170213.122";
+        version = "20180101.1659";
         src = fetchFromGitHub {
           owner = "accidentalrebel";
           repo = "emacs-dokuwiki";
-          rev = "a78289d99068ec3dfb4945877c32751e789d099d";
-          sha256 = "0hynymx3gm9nqmpb0a9j8d9g298vsl0gxa9f1yx9xp60mq6y7l3r";
+          rev = "594c4d4904dcc2796bbbd2c0845d9e7c09ccf6f7";
+          sha256 = "0vqx8npw0i02dhw2yb7s4z7njw60r3xyncw4z8l6fj99pp6pfh15";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/dokuwiki";
@@ -14934,12 +14955,12 @@
     doom-themes = callPackage ({ all-the-icons, cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "doom-themes";
-        version = "20171214.1412";
+        version = "20180101.2140";
         src = fetchFromGitHub {
           owner = "hlissner";
           repo = "emacs-doom-themes";
-          rev = "5189ef50a0224c0557d6f604b93a58ee91727e7d";
-          sha256 = "0hd8l1aalmvjvr2f92ragmirwyx949jg9fkk84f9xa07xg9wbipv";
+          rev = "bc747b3b65baf737f99dc4ccf68558581958bbba";
+          sha256 = "0j5aywwh8cw0bb55frrpmyfmbzg6d6jv29ys61p1xf49gvki870m";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c5084bc2c3fe378af6ff39d65e40649c6359b7b5/recipes/doom-themes";
@@ -15878,12 +15899,12 @@
     easy-hugo = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "easy-hugo";
-        version = "20171226.17";
+        version = "20171231.306";
         src = fetchFromGitHub {
           owner = "masasam";
           repo = "emacs-easy-hugo";
-          rev = "1a8c4286ac1d92114dbda9042ed831cc83175db9";
-          sha256 = "11vwzgy1dn4sj1yhnvvim6p9w3dl896azh3wlrmg8g6y6qfzblc7";
+          rev = "253d91cda8722fa69b8ee67b1802137863bc3d9a";
+          sha256 = "1i5hdm9xwajid7kzx6gq8lhx5w2aihvb0ka5h2s88zb1xnnxss46";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/easy-hugo";
@@ -15899,12 +15920,12 @@
     easy-jekyll = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "easy-jekyll";
-        version = "20171226.246";
+        version = "20171231.401";
         src = fetchFromGitHub {
           owner = "masasam";
           repo = "emacs-easy-jekyll";
-          rev = "d5226405c035d0dd675cacfd514388c348a4559a";
-          sha256 = "1pmaa0ry1yd8d2pbn4srv5bf1hqss046zjl2p3ag1ag0qb35fh39";
+          rev = "4eac3993d9bbec9ddfe38b128fd3ed6670f526e2";
+          sha256 = "0ffspw6xavfbk0klqjp8va7ybvsdcxlw1qmqhi6paqam90m6vazz";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c3f281145bad12c27bdbef32ccc07b6a5f13b577/recipes/easy-jekyll";
@@ -15983,12 +16004,12 @@
     ebal = callPackage ({ emacs, f, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ebal";
-        version = "20170810.631";
+        version = "20171231.2216";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "ebal";
-          rev = "65a131b95a1e934c0cab384ef533b0ac58961f0c";
-          sha256 = "1b8i7qh743lhmkrmw1ac486i8nk8fdxl0ayxjs2sfb8fk4621rfr";
+          rev = "3a7a9a66efed30416e2013da80fed2f79b91def1";
+          sha256 = "0vxxswbx8l9jcv81akw1bd7ra4k51gjmv79z11fhbzf17n7y910a";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/629aa451162a0085488caad4052a56366b7ce392/recipes/ebal";
@@ -16725,11 +16746,11 @@
       }) {};
     eide = callPackage ({ fetchgit, fetchurl, lib, melpaBuild }: melpaBuild {
         pname = "eide";
-        version = "20170906.1216";
+        version = "20171229.1435";
         src = fetchgit {
           url = "git://git.tuxfamily.org/gitroot/eide/emacs-ide.git";
-          rev = "25f9af215781163b10d411fe2b5674033eb24165";
-          sha256 = "0mwy5a67hap9bx1klk2pzfaav65drd6mfkkhnk2045z4jvzgkn70";
+          rev = "faae6f1384826d18f70b28826dc528d70e91a5c9";
+          sha256 = "02hylmgs6il59kkq59i9lpdg9gdirpb2y37xzybh7n5lqyzdafai";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/eide";
@@ -17225,12 +17246,12 @@
     electric-operator = callPackage ({ dash, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, names }:
     melpaBuild {
         pname = "electric-operator";
-        version = "20171221.1330";
+        version = "20171229.304";
         src = fetchFromGitHub {
           owner = "davidshepherd7";
           repo = "electric-operator";
-          rev = "0c5439689e22806550bb2856a2da57967e87611e";
-          sha256 = "12qnaxqj0kvjcf207cg11v084pi1gbixmmrz8pjl0pphpz9rcjgi";
+          rev = "e414534bd0a4149919647beec8fe4e342d2d1219";
+          sha256 = "0ahxxjlfpr2zj3sbiz9xyb422pld8xhzzj5nkzxyfksbnbvms5hd";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/906cdf8647524bb76f644373cf8b65397d9053a5/recipes/electric-operator";
@@ -17309,12 +17330,12 @@
     elfeed = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "elfeed";
-        version = "20171224.1850";
+        version = "20180101.1921";
         src = fetchFromGitHub {
           owner = "skeeto";
           repo = "elfeed";
-          rev = "5ba4b1b0b47dc5cd40c52d51227f2dd6436859f2";
-          sha256 = "1rsx371cz48lw78hjnjc54rqjx6965dc3ddqfn6k98qjlcvgr599";
+          rev = "fc081840e56f3eb3a28265e7c4bcb03a0458bdb9";
+          sha256 = "0jka43vas7g5dj5yg7i3hnxvff2m24fkbv3izxv58wv6ydc5amkh";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/407ae027fcec444622c2a822074b95996df9e6af/recipes/elfeed";
@@ -17404,8 +17425,8 @@
         src = fetchFromGitHub {
           owner = "skeeto";
           repo = "elfeed";
-          rev = "5ba4b1b0b47dc5cd40c52d51227f2dd6436859f2";
-          sha256 = "1rsx371cz48lw78hjnjc54rqjx6965dc3ddqfn6k98qjlcvgr599";
+          rev = "fc081840e56f3eb3a28265e7c4bcb03a0458bdb9";
+          sha256 = "0jka43vas7g5dj5yg7i3hnxvff2m24fkbv3izxv58wv6ydc5amkh";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/62459d16ee44d5fcf170c0ebc981ca2c7d4672f2/recipes/elfeed-web";
@@ -17862,12 +17883,12 @@
     elpy = callPackage ({ company, emacs, fetchFromGitHub, fetchurl, find-file-in-project, highlight-indentation, lib, melpaBuild, pyvenv, s, yasnippet }:
     melpaBuild {
         pname = "elpy";
-        version = "20171220.504";
+        version = "20171228.1239";
         src = fetchFromGitHub {
           owner = "jorgenschaefer";
           repo = "elpy";
-          rev = "ef4cc68d5e68f3b81160e3556573f216d86af474";
-          sha256 = "1gjad8xfvrdfj6ql23khjps5znnsnf0ga3vk97rcfpzkjq1b95lm";
+          rev = "d0c6121148f97adafa1ae1828b59569e0f5c11d0";
+          sha256 = "1fps5ll0sdrn341k0pp4shli3qadmkdc2dn6vbl19zdlhzyb2lda";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/1d8fcd8745bb15402c9f3b6f4573ea151415237a/recipes/elpy";
@@ -18479,11 +18500,11 @@
     emms = callPackage ({ cl-lib ? null, fetchgit, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "emms";
-        version = "20171226.113";
+        version = "20171229.1306";
         src = fetchgit {
           url = "https://git.savannah.gnu.org/git/emms.git";
-          rev = "f5b2da5876a66b9a7570001feba7dfc06668787b";
-          sha256 = "1rw0as7iq8yyxdn214g7hnl5bcxxjl12hwrybk4lk673n4grjdg6";
+          rev = "f586070b598b1a19842212686e88df346f1ebc1f";
+          sha256 = "14k49gkhn1b6fmw8zx8125j6cymbww8bha7fs0kbjcqvfp9isr8c";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/caaa21f235c4864f6008fb454d0a970a2fd22a86/recipes/emms";
@@ -19383,8 +19404,8 @@
         src = fetchFromGitHub {
           owner = "drewbarbs";
           repo = "erc-status-sidebar";
-          rev = "48ed93ca8e225b4a212d89ffc01803355f66ee0a";
-          sha256 = "1pxs48rsmna177qvglyk32hy3rdfydg0spr4rzkf1gvn169ispss";
+          rev = "9e972f4e31287362020daa81dc7af26999ea6c5b";
+          sha256 = "0g7m5r5f01i73k05wny0xycrjcyhzwc314a5lb8h09kglwnmisgv";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/29631de8ec4140a8e35cc500902b58115faa3955/recipes/erc-status-sidebar";
@@ -19677,8 +19698,8 @@
         src = fetchFromGitHub {
           owner = "erlang";
           repo = "otp";
-          rev = "0052a4641d6f904fe632a9c056b9eed7ffc18b54";
-          sha256 = "1v05miw43hd039nc0fy56lh8fybchzjymyaxh7gwginfq34v5b6q";
+          rev = "3d124b9ea557fd26ca7a33276b84c72d9e72044e";
+          sha256 = "16ya5416mdyramdapzvnnxxfiqr92ls8888z9lbcgl1igqsmhrcn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d9cd526f43981e0826af59cdc4bb702f644781d9/recipes/erlang";
@@ -20659,12 +20680,12 @@
     evil = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, goto-chg, lib, melpaBuild, undo-tree }:
     melpaBuild {
         pname = "evil";
-        version = "20171224.929";
+        version = "20171228.926";
         src = fetchFromGitHub {
           owner = "emacs-evil";
           repo = "evil";
-          rev = "8d2477231e0326df42a3a3a17492e34df91ea86b";
-          sha256 = "19ykkznjdqg428ar10l38j5nzrjnixnyifzcv3b99c84ikkfzrc1";
+          rev = "3475b3260c290e5ea5e45d9bfc89005c06846152";
+          sha256 = "16m6ry56rxyxn4nh9n4743zx108zjnqzhld22ffipfj5ckqxlspn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/440482c0edac8ee8bd4fe22f6bc5c1607f34c7ad/recipes/evil";
@@ -20806,12 +20827,12 @@
     evil-collection = callPackage ({ emacs, evil, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "evil-collection";
-        version = "20171224.1553";
+        version = "20171229.1311";
         src = fetchFromGitHub {
           owner = "jojojames";
           repo = "evil-collection";
-          rev = "78e0797d152c7a46783ce8a12f17b0ed4f549635";
-          sha256 = "0hzngyw6z998dfwzg5af7zir7h3kpd0s79xr4kf38a9chdafdy43";
+          rev = "4ce6968d221e98d0ad522082711ea927d80017af";
+          sha256 = "1x50i42i7wy8b2qx9kb1lhbifsrdxb6n6cs1mkjrljqyqqg57lj1";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d7538c9eb00b6826867891b037e7aa537ac5b160/recipes/evil-collection";
@@ -21797,8 +21818,8 @@
         src = fetchFromGitHub {
           owner = "emacs-evil";
           repo = "evil";
-          rev = "8d2477231e0326df42a3a3a17492e34df91ea86b";
-          sha256 = "19ykkznjdqg428ar10l38j5nzrjnixnyifzcv3b99c84ikkfzrc1";
+          rev = "3475b3260c290e5ea5e45d9bfc89005c06846152";
+          sha256 = "16m6ry56rxyxn4nh9n4743zx108zjnqzhld22ffipfj5ckqxlspn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/87da8c50f9167ad9c3844b23becb6904f809611d/recipes/evil-test-helpers";
@@ -22409,12 +22430,12 @@
     f = callPackage ({ dash, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
     melpaBuild {
         pname = "f";
-        version = "20171119.723";
+        version = "20171230.1229";
         src = fetchFromGitHub {
           owner = "rejeep";
           repo = "f.el";
-          rev = "595519ea07d6ff49e5cb1cbd442eb689f9142ed1";
-          sha256 = "1nxkfya6bwn0bmiwcq5q68qpyhkdsc9b4n75vav06nn7w1k5y3gv";
+          rev = "78fb8ba22c660027c607c6df09343120610d993c";
+          sha256 = "0wirps6zy493kybkcmkdp4rdgpj3piqndqdalcgxl7f14vx8k5z7";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/f";
@@ -23267,12 +23288,12 @@
     fix-input = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "fix-input";
-        version = "20170518.2311";
+        version = "20171231.2220";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "fix-input";
-          rev = "a0fd233bba6206854c5d7365d7182aaae842f210";
-          sha256 = "1zwbysh9fq6dbdi93cdzgrsp2azy8b3j0gz32ih0vbs9xyysbhlz";
+          rev = "e053fcc641f1f835f2fdb71143e095c1889b8233";
+          sha256 = "1w8vv2ijmsch02xsc1r97r6s3jz0dkd8kwz5wgiizq5ghx7x6x6j";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7d31f907997d1d07ec794a4f09824f43818f035c/recipes/fix-input";
@@ -23309,12 +23330,12 @@
     fix-word = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "fix-word";
-        version = "20170518.2343";
+        version = "20171231.2215";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "fix-word";
-          rev = "7df98ac9f9b0e6e09d7999d83e678cb22248be77";
-          sha256 = "13i604lmx30r0kk0s998dp4czzazqavyqqi3kx6lh6mj2csgkgda";
+          rev = "3e3339f5d44dd8be100cec1c88bcaefd328a2bde";
+          sha256 = "0hd5bhq57qgabs881xfrz1v1n8sp1nv2hrfs386dx7g5b3ancr0i";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/22636390e8a15c09293a1506a901286dd72e565f/recipes/fix-word";
@@ -24701,12 +24722,12 @@
     flycheck-objc-clang = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "flycheck-objc-clang";
-        version = "20171014.651";
+        version = "20171231.453";
         src = fetchFromGitHub {
           owner = "GyazSquare";
           repo = "flycheck-objc-clang";
-          rev = "29a9eb320d62400564360986f7ad400b74070d8e";
-          sha256 = "0b4vwbxzhds9vb4nknfdywvfpr1gkk86vsbbq6f5ds0pfk75x022";
+          rev = "07f17d1dbe878fdcabac791a8916ddf643571a68";
+          sha256 = "03624xn6g1ybcjw634c7nd5s2yllwfffk2gzn5hm70vfz06q7wb9";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/4ff4412f507371b93cfb85fc744e54110cd87338/recipes/flycheck-objc-clang";
@@ -24764,12 +24785,12 @@
     flycheck-perl6 = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "flycheck-perl6";
-        version = "20150414.1832";
+        version = "20171231.445";
         src = fetchFromGitHub {
           owner = "hinrik";
           repo = "flycheck-perl6";
-          rev = "6999f1b439fb4bc9504bc73f550b369c0bd47156";
-          sha256 = "0s01f0fy2q7j52334wpp38kyflnprn279q1cbrcd609878c94nf7";
+          rev = "7a69ddbb54dc0748734ace95f598c69e9882aa94";
+          sha256 = "1bsbw5pjin7m556pnphq8plgfjvbp1pl738lf5qc85jcvinv998m";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/2f6ecdb2ce6bc74a27dca01ab4942778e986ac8f/recipes/flycheck-perl6";
@@ -25079,12 +25100,12 @@
     flycheck-swift3 = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "flycheck-swift3";
-        version = "20170926.317";
+        version = "20171231.452";
         src = fetchFromGitHub {
           owner = "GyazSquare";
           repo = "flycheck-swift3";
-          rev = "756833425f51baa9eb0a2fa7493df6e68612c88d";
-          sha256 = "1hvrg717q0nlz4r8wby82gs3vdx8fdhf38rg4j77j3fqfmxdd3fi";
+          rev = "34973cd28ca5e63f8f6328a17fd7b78cc913b93d";
+          sha256 = "1iy6j05dzpi7pi87y6rpjzmlnl2s9izqpbzknis2kx9072qddm3q";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/f1fb8c731c118327dc0bbb726e046fec46bcfb82/recipes/flycheck-swift3";
@@ -26486,12 +26507,12 @@
     fountain-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "fountain-mode";
-        version = "20171227.2105";
+        version = "20180102.41";
         src = fetchFromGitHub {
           owner = "rnkn";
           repo = "fountain-mode";
-          rev = "307d71269503746099ad72c58ab0d1eae6c65510";
-          sha256 = "0vq5r4fi7h5z8h56pxh5lhdrbxn8dbbhhz6j2hqs22c4n5f90wrw";
+          rev = "3f953ae30ad55bbbbb80aa0350992e79f4b00f56";
+          sha256 = "1zksjvpvhbr79fg281yhx8k419q9kd4jpi47i9943cs0m088ykyn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/913386ac8d5049d37154da3ab32bde408a226511/recipes/fountain-mode";
@@ -26779,8 +26800,8 @@
         src = fetchFromGitHub {
           owner = "factor";
           repo = "factor";
-          rev = "9dbfc9351cf4a45fa2e23e1b493ea37f66b4d92b";
-          sha256 = "11pl2gj036ib4x3fbzs0na8pbyccnk1qc8bf3wz91m3py65ls07c";
+          rev = "fb9c3920ae99f051b5fa2939a5fc62d4d1015536";
+          sha256 = "0099sfvf3cxyqnraf52ba6883kh5gck665skwpkn322jk74qi6vb";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/1e2a0e4698d4e71ec28656594f6a83504a823490/recipes/fuel";
@@ -26905,8 +26926,8 @@
         src = fetchFromGitHub {
           owner = "HIPERFIT";
           repo = "futhark";
-          rev = "bdbbdcbe91929e1045c5d5acf8313f80bbe51f18";
-          sha256 = "1j1ybjgcdyvrkf4sclhzvzwaimf1xxqc9zcqk1p7ny5k90asn1ga";
+          rev = "c7b67d469f896fa9b93a0804c4ecc36cb1b4b320";
+          sha256 = "0idyfkrdrmq3cmizjxvl8iqdz3769c38pkpib4vazyaglgn703mb";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/0607f01aad7e77d53595ad8db95d32acfd29b148/recipes/futhark-mode";
@@ -27722,8 +27743,8 @@
         src = fetchFromGitHub {
           owner = "magit";
           repo = "magit";
-          rev = "0ee62ee80eca660a5d05dab34bcf4b80a3ee749d";
-          sha256 = "0hgkb6vf53f0hannbb6a50kdlwzhx73wf4hr3y3yw7ihjr9qd89h";
+          rev = "ebd8c6510dc1c95e6ca4007a7f62ed037379d251";
+          sha256 = "1qjnbkrm8svham59pddzwzjvp7s0icszc7dkm97s4yciikgmsirf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/cec5af50ae7634cc566adfbfdf0f95c3e2951c0c/recipes/git-commit";
@@ -28663,12 +28684,12 @@
     gnus-summary-ext = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "gnus-summary-ext";
-        version = "20171201.1850";
+        version = "20171231.549";
         src = fetchFromGitHub {
           owner = "vapniks";
           repo = "gnus-summary-ext";
-          rev = "fa75cdccc4d0775c775bae1ef92f4429e0341a37";
-          sha256 = "1954r76228wcp1kmhrprgvywrzmmzj0qsp3n0rcsypz9i6y8qrz0";
+          rev = "b2259a2501f4e0c23b51aedf056b812c8140b958";
+          sha256 = "1y4379wrd2y9jzbg2bhifwa03nbf84xzb4rhfih6xmh9h5gg4bi1";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/5ca4a905b5f81991074c7d3e41d4422c7e6713d5/recipes/gnus-summary-ext";
@@ -28751,8 +28772,8 @@
         src = fetchFromGitHub {
           owner = "nsf";
           repo = "gocode";
-          rev = "0444ce1cda44fedd8f89f853dfb9d3ee6973fa13";
-          sha256 = "1zr8ql7blacz4iz8l969sz3dmy9cfp4v15bwzxv71rg9vhz1ip9g";
+          rev = "22bc785b7506257947079201bd1a117e885af8bb";
+          sha256 = "16pkv3xc19i0gaxgvixjsdm17ikmibvaq6rr4bg4rpzk2z2l11fg";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/04867a574773e8794335a2664d4f5e8b243f3ec9/recipes/go-autocomplete";
@@ -28975,6 +28996,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    go-imports = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "go-imports";
+        version = "20171227.858";
+        src = fetchFromGitHub {
+          owner = "yasushi-saito";
+          repo = "go-imports";
+          rev = "403c93f717fcd62c4e4804e6aaa3d2aa961e9709";
+          sha256 = "1dv383i45ca26s8g0y93n22di44f4q0si81pxihsf7vci5ic333g";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/4118ebf0db84cc047fab311c789bfbffd6eb2d92/recipes/go-imports";
+          sha256 = "0xxlh4rmyvfxiynsdqng6wd3js7h3azhb8ii0ch7n0hhqkcnda4x";
+          name = "go-imports";
+        };
+        packageRequires = [];
+        meta = {
+          homepage = "https://melpa.org/#/go-imports";
+          license = lib.licenses.free;
+        };
+      }) {};
     go-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "go-mode";
@@ -29150,8 +29192,8 @@
         src = fetchFromGitHub {
           owner = "brantou";
           repo = "emacs-go-tag";
-          rev = "51b032465405a62f84d9181168a570610ba04085";
-          sha256 = "0158c3yjw21skwa03qmh3xpg9wg7rnk6xbxqx5vxi24205zsz0kd";
+          rev = "9a55097c34e9c3170ecec31129c92e897e35058d";
+          sha256 = "0m4h13czlsp0l46dkfhzvis7bikwi2g9azd4b1lzq5hls7nc6fwz";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/fc4cd3fd8fb0707912e205b9d71789ea8126c442/recipes/go-tag";
@@ -29566,12 +29608,12 @@
     goto-chg = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "goto-chg";
-        version = "20170917.1200";
+        version = "20171231.312";
         src = fetchFromGitHub {
           owner = "emacs-evil";
           repo = "goto-chg";
-          rev = "81fca94d2592cf32bab451c39a9cd2d9b03fbd6b";
-          sha256 = "033msplvpahkva9ha09gsg9232fyz2bjihrdxaa2z9g4yzql8jkq";
+          rev = "6cb244922b733358fd6985b36c4b87ef2e177293";
+          sha256 = "0miscmk5gg7mqqwjb5mlrkbpsx4pny2w3rpr90f7yiv30rf83b5j";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/cf1fc176430fe3ab55ce537a0efc59780bb812be/recipes/goto-chg";
@@ -29633,8 +29675,8 @@
         src = fetchFromGitHub {
           owner = "vmware";
           repo = "govmomi";
-          rev = "3f8349f3b2ee9bc74ed11c2649e6c65d08f44f5f";
-          sha256 = "02l48jarwx9hi7y91mn1k6sl1bqkbpba2fg8qiyjypirnznpdapq";
+          rev = "d70eca22cace05a6ed7a5787ecd660724d65d911";
+          sha256 = "0rgvlvv8dbm47qcw9wxrdd85rxa1csysqiyrhql6gwd4a5iwrbp1";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/92d6391318021c63b06fe39b0ca38f667bb45ae9/recipes/govc";
@@ -29759,8 +29801,8 @@
         src = fetchFromGitHub {
           owner = "Groovy-Emacs-Modes";
           repo = "groovy-emacs-modes";
-          rev = "c1e4cf8378bdd7e0d8205b2bcdcb3ff3e05ad8d2";
-          sha256 = "0jk0a0n43jabyn8shv2i0fzqcy2aw16hanjqcsfzmrv5881hzyy1";
+          rev = "2bfaf08cd76981620f36b2b7fc52a9a0b8214d13";
+          sha256 = "07l28zgjzvrm1jpnpzidx316x3k0n6ar1pkxjwzr56ikjlcgszxa";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/3fe318b4e51a280a55c01fa30455e4a180df8bd6/recipes/grails-mode";
@@ -29797,12 +29839,12 @@
     grandshell-theme = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "grandshell-theme";
-        version = "20171227.29";
+        version = "20171230.440";
         src = fetchFromGitHub {
           owner = "steckerhalter";
           repo = "grandshell-theme";
-          rev = "22c8df52c0fb8899fa748fa2980947ab38b53380";
-          sha256 = "08556ci80iycm4qkvbnrci55wyv91b4fh6sjp0im0ywndmrq3yyc";
+          rev = "c8f1dd4ceb3b752bcb4a0122af45e3a197c4fa99";
+          sha256 = "1b0azylab54183kf9nmpx6qb8hrr91fsxladwfmiljrcpvf6pdh8";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/5b04b0024f5a0367e2998d35ca88c2613a8e3470/recipes/grandshell-theme";
@@ -30139,22 +30181,22 @@
           license = lib.licenses.free;
         };
       }) {};
-    groovy-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
+    groovy-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
     melpaBuild {
         pname = "groovy-mode";
-        version = "20171024.221";
+        version = "20171230.930";
         src = fetchFromGitHub {
           owner = "Groovy-Emacs-Modes";
           repo = "groovy-emacs-modes";
-          rev = "c1e4cf8378bdd7e0d8205b2bcdcb3ff3e05ad8d2";
-          sha256 = "0jk0a0n43jabyn8shv2i0fzqcy2aw16hanjqcsfzmrv5881hzyy1";
+          rev = "2bfaf08cd76981620f36b2b7fc52a9a0b8214d13";
+          sha256 = "07l28zgjzvrm1jpnpzidx316x3k0n6ar1pkxjwzr56ikjlcgszxa";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/3fe318b4e51a280a55c01fa30455e4a180df8bd6/recipes/groovy-mode";
           sha256 = "1pxw7rdn56klmr6kw21lhzh7zhp338gyf54ypsml64ibzr1x9kal";
           name = "groovy-mode";
         };
-        packageRequires = [ s ];
+        packageRequires = [ emacs s ];
         meta = {
           homepage = "https://melpa.org/#/groovy-mode";
           license = lib.licenses.free;
@@ -30268,12 +30310,12 @@
     gtk-pomodoro-indicator = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "gtk-pomodoro-indicator";
-        version = "20170517.900";
+        version = "20171230.840";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "gtk-pomodoro-indicator";
-          rev = "0fa0e682b3bd1595f230275d73ca231e93c6d28a";
-          sha256 = "1jm7kcray6qd867hacyhs5c7hhdm0fyfa1jx35sh09g5c9xa4x2f";
+          rev = "eb59b229de0dde307b20654075a9bbac69899a66";
+          sha256 = "0dmaazcscg9mdsmij26873af5jl2np4q9xf2klw1jmcl61wzggb0";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b98ec72605077f3b3f587713a681eb2144f29645/recipes/gtk-pomodoro-indicator";
@@ -30352,12 +30394,12 @@
     guix = callPackage ({ bui, dash, emacs, fetchFromGitHub, fetchurl, geiser, lib, magit-popup, melpaBuild }:
     melpaBuild {
         pname = "guix";
-        version = "20171223.1417";
+        version = "20171228.1131";
         src = fetchFromGitHub {
           owner = "alezost";
           repo = "guix.el";
-          rev = "cacfb7c063f29193d71ef3588f0d0c342d2f84c8";
-          sha256 = "1aaggksxcwvsddlv2aj8n2bwh0j8bbg8wn7yrl4kjf5ahp07gx6a";
+          rev = "a43828f6e5d6dc4e623a4b78e0dfdddbf5b20185";
+          sha256 = "0c19njb5cg6g3fav9322hkbl4h9zwcbymhc5wr0k9yqi7pv8gz0v";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b3d8c73e8a946b8265487a0825d615d80aa3337d/recipes/guix";
@@ -30918,12 +30960,12 @@
     hasky-extensions = callPackage ({ avy-menu, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "hasky-extensions";
-        version = "20171209.736";
+        version = "20171231.941";
         src = fetchFromGitHub {
           owner = "hasky-mode";
           repo = "hasky-extensions";
-          rev = "d4f4eb136ccbf880d7f50c541450dbb0b403b7f2";
-          sha256 = "03h5nvwdp75sj0ggf92zd5d8kpd8zff7nx6d2jk70hybwwszzv1a";
+          rev = "c8f6abf9a05a573261a2b708ffbbcf28b717c1d8";
+          sha256 = "0hy89yyv50ynywij0cpbd7k9ljc66j0zxj23wc6dsfvn5m2l9534";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e3f73e3df8476fa231d04211866671dd74911603/recipes/hasky-extensions";
@@ -30939,12 +30981,12 @@
     hasky-stack = callPackage ({ emacs, f, fetchFromGitHub, fetchurl, lib, magit-popup, melpaBuild }:
     melpaBuild {
         pname = "hasky-stack";
-        version = "20171218.9";
+        version = "20171231.942";
         src = fetchFromGitHub {
           owner = "hasky-mode";
           repo = "hasky-stack";
-          rev = "17b9facafcff8203012c037c5a589f290169fc33";
-          sha256 = "00k13sl2yjnqjjdqlmz8ril07xw5al2ysbsnpmz81sccqa1kbikr";
+          rev = "7a97d039489ff23b3362b543dea1007357e2ada9";
+          sha256 = "1rqj7yypsd25h4x9lx6vkqchq70fwnjs4dpivd7n105h41pz3kiv";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c3faf544872478c3bccf2fe7dc51d406031e4d80/recipes/hasky-stack";
@@ -31127,12 +31169,12 @@
     helm = callPackage ({ async, emacs, fetchFromGitHub, fetchurl, helm-core, lib, melpaBuild, popup }:
     melpaBuild {
         pname = "helm";
-        version = "20171227.2150";
+        version = "20180101.14";
         src = fetchFromGitHub {
           owner = "emacs-helm";
           repo = "helm";
-          rev = "b25ac4818cec94b07d6d1ce82880a4f842115aec";
-          sha256 = "0ibqyz9pqvh9rbqkk44kx1r1wp7crxzvbnnddzqq7m9gs1gkxxl2";
+          rev = "2399979be21bd622c17c2f1719b7e133e85cb229";
+          sha256 = "1k55p4vcqxpkd30wcjb7ghxb568vgx4rnzbd8qp582f9bw3sl5vf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7e8bccffdf69479892d76b9336a4bec3f35e919d/recipes/helm";
@@ -31757,12 +31799,12 @@
     helm-core = callPackage ({ async, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "helm-core";
-        version = "20171227.2227";
+        version = "20180102.19";
         src = fetchFromGitHub {
           owner = "emacs-helm";
           repo = "helm";
-          rev = "b25ac4818cec94b07d6d1ce82880a4f842115aec";
-          sha256 = "0ibqyz9pqvh9rbqkk44kx1r1wp7crxzvbnnddzqq7m9gs1gkxxl2";
+          rev = "2399979be21bd622c17c2f1719b7e133e85cb229";
+          sha256 = "1k55p4vcqxpkd30wcjb7ghxb568vgx4rnzbd8qp582f9bw3sl5vf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/ef7a700c5665e6d72cb4cecf7fb5a2dd43ef9bf7/recipes/helm-core";
@@ -34256,12 +34298,12 @@
     helpful = callPackage ({ dash, dash-functional, elisp-refs, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s, shut-up }:
     melpaBuild {
         pname = "helpful";
-        version = "20171222.1456";
+        version = "20180101.352";
         src = fetchFromGitHub {
           owner = "Wilfred";
           repo = "helpful";
-          rev = "ed23fa740151cd15c27ad56d8cef5fc84b63d003";
-          sha256 = "0skhmy131aq5cwqn0by5838vcirswnfzinl67svla85cr2wvjfh1";
+          rev = "08233ef9e9a4aacf046d7b0177b5d53bd5c9e926";
+          sha256 = "0x3j2lcw4s0c7vrfbmxi3wpziqq1526sj40kldfh93qvgrllvkzl";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/889d34b654de13bd413d46071a5ff191cbf3d157/recipes/helpful";
@@ -34931,8 +34973,8 @@
         src = fetchFromGitHub {
           owner = "chrisdone";
           repo = "hindent";
-          rev = "cb0987ca0a0a97db298cbb70167b81c195d54884";
-          sha256 = "013m48ynrv1p3xfgphzmjj3izf3q64wv1wr1lxjya7fcjjzwpcia";
+          rev = "7101c1da8b0a4fc62a45967c5f02c2922bbfcfd4";
+          sha256 = "1w7l79mx9hf9x5igkpy794db7nipr6skvvlhf1zm28r3dk5s1r2v";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/dbae71a47446095f768be35e689025aed57f462f/recipes/hindent";
@@ -35928,6 +35970,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    ialign = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "ialign";
+        version = "20171229.410";
+        src = fetchFromGitHub {
+          owner = "mkcms";
+          repo = "interactive-align";
+          rev = "82055a5546e6ae9f766896dfe8afc78092241ab5";
+          sha256 = "07bmkmhw38ls94d9c1kpq7ilw7bny4n5y0g7iiyvdhm45vvq4if8";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/072f1f7ce17e2972863bce10af9c52b3c6502eab/recipes/ialign";
+          sha256 = "070a0fa2vbdfvbnpbzv4z0c7311lf8sy2zw2ifn9k548n4l8k62j";
+          name = "ialign";
+        };
+        packageRequires = [ emacs ];
+        meta = {
+          homepage = "https://melpa.org/#/ialign";
+          license = lib.licenses.free;
+        };
+      }) {};
     iasm-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "iasm-mode";
@@ -37230,12 +37293,12 @@
     inf-clojure = callPackage ({ clojure-mode, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "inf-clojure";
-        version = "20171214.1444";
+        version = "20180101.2315";
         src = fetchFromGitHub {
           owner = "clojure-emacs";
           repo = "inf-clojure";
-          rev = "8c27b0603971e603db686131c3e411a02579501d";
-          sha256 = "0834x1kmbhmny8fcb6kh0qnvkg7pwn7q2wikrw9w2swgmjg1c47k";
+          rev = "c4adc89c1c17c01c8da039464cdb5211030cbd1d";
+          sha256 = "05qrbncf0snvh46ngfqklzy65kmcm7w4hpp017swl7kbrdgcfqqy";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/5d6112e06d1efcb7cb5652b0bec8d282d7f67bd9/recipes/inf-clojure";
@@ -38300,12 +38363,12 @@
     ivy = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ivy";
-        version = "20171224.842";
+        version = "20171231.144";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "swiper";
-          rev = "864fbfeb0328d13e7d4641fcba9d001326229d37";
-          sha256 = "045fqwgc02fh5mb09b0kzjwadr7b9vvsksicklffsx31fwbav4d6";
+          rev = "c2bc6ac92a6cea730d7887813a816bdf873f9b92";
+          sha256 = "040z731dm66w4c0475q8vl1lm4dnvi9yz2qslxdma0qdx70hymrr";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/06c24112a5e17c423a4d92607356b25eb90a9a7b/recipes/ivy";
@@ -38451,8 +38514,8 @@
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "swiper";
-          rev = "864fbfeb0328d13e7d4641fcba9d001326229d37";
-          sha256 = "045fqwgc02fh5mb09b0kzjwadr7b9vvsksicklffsx31fwbav4d6";
+          rev = "c2bc6ac92a6cea730d7887813a816bdf873f9b92";
+          sha256 = "040z731dm66w4c0475q8vl1lm4dnvi9yz2qslxdma0qdx70hymrr";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/06c24112a5e17c423a4d92607356b25eb90a9a7b/recipes/ivy-hydra";
@@ -38636,12 +38699,12 @@
     ivy-xref = callPackage ({ emacs, fetchFromGitHub, fetchurl, ivy, lib, melpaBuild }:
     melpaBuild {
         pname = "ivy-xref";
-        version = "20171202.1351";
+        version = "20171229.252";
         src = fetchFromGitHub {
           owner = "alexmurray";
           repo = "ivy-xref";
-          rev = "43b7c35be871b04635864334ffd2b315401150d5";
-          sha256 = "13v4l95smna8jgv1c8al9bkj4nfdcrplra9yphxzac9rz77mim3m";
+          rev = "aa97103ea8ce6ab8891e34deff7d43aa83fe36dd";
+          sha256 = "1j4xnr16am5hz02y1jgiz516rqmn43564394qilckmzvi9clhny8";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/a4cd8724e8a4119b61950a97b88219bf56ce3945/recipes/ivy-xref";
@@ -39537,12 +39600,12 @@
     js-auto-format-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "js-auto-format-mode";
-        version = "20171220.1859";
+        version = "20171229.414";
         src = fetchFromGitHub {
           owner = "ybiquitous";
           repo = "js-auto-format-mode";
-          rev = "cad63f1760e765298cc91e3503ac46c8771da4be";
-          sha256 = "1pg4ghfi0fzmnwrw3y4z3gy031psxvzjydwm4jbdrm33ais7919g";
+          rev = "7872e6f1d8280830c70cae8f1e3edb8049aba295";
+          sha256 = "0a9rbs0pjx953rbblmia9jznxykz5qa9q5wzkj341z6vfq9rq3rf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/2d3be16771b5b5fde639da3ee97890620354ee7a/recipes/js-auto-format-mode";
@@ -40394,12 +40457,12 @@
     kaolin-themes = callPackage ({ autothemer, cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "kaolin-themes";
-        version = "20171227.1451";
+        version = "20171231.2330";
         src = fetchFromGitHub {
           owner = "ogdenwebb";
           repo = "emacs-kaolin-themes";
-          rev = "c5876bdd121076a13bc2a439ae1068e9c42b385d";
-          sha256 = "0p4i9ksf6fja1m4fdpnm07xkdbcysdz75gibbhyk5rjhpkydabzw";
+          rev = "1c9185516c969fb70a51afca1ba01727b54557ea";
+          sha256 = "0bs90drv377n5cxnpmrfld66w82pzjk955jmfc469syr6fx8mqbz";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/043a4e3bd5301ef8f4df2cbda0b3f4111eb399e4/recipes/kaolin-themes";
@@ -40793,12 +40856,12 @@
     kill-or-bury-alive = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "kill-or-bury-alive";
-        version = "20170518.2358";
+        version = "20171231.2218";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "kill-or-bury-alive";
-          rev = "415de48695efd30163a015063873b03f4ca5b743";
-          sha256 = "1jsgvwi3zy22wirxgzkbbjzk4q6f6mxf3223cf5pkk7x2prv6fcn";
+          rev = "d21aa7a12f1a76d47249db36eb9825242df9d512";
+          sha256 = "1m790afdrns8afh7f690slq2gcya5bp7630fxwi8fqp5vil7lswg";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/25016ed09b6333bd79b989a8f6b7b03cd92e08b3/recipes/kill-or-bury-alive";
@@ -40902,8 +40965,8 @@
         src = fetchFromGitHub {
           owner = "kivy";
           repo = "kivy";
-          rev = "4c6f7be66628e01a22e3bd72b19db2380a6444bb";
-          sha256 = "1vpj02af8mck8jwdc855svxkmwsnhm57s9jz2mgpli0pqpvfwmvj";
+          rev = "1d1935206085a220c3de090f1d269a0f35969976";
+          sha256 = "1s2w74g39qqybssg29xgjgxid9hx09172fm1nlr2p814pq9q31yy";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/688e2a114073958c413e56e1d117d48db9d16fb8/recipes/kivy-mode";
@@ -42270,12 +42333,12 @@
     lispy = callPackage ({ ace-window, emacs, fetchFromGitHub, fetchurl, hydra, iedit, lib, melpaBuild, swiper, zoutline }:
     melpaBuild {
         pname = "lispy";
-        version = "20171226.103";
+        version = "20180101.1312";
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "lispy";
-          rev = "c75ca63199d035dd71183aac2d9be5c4ea736d35";
-          sha256 = "10j19ff52and3x244lw3v5bz1ns5ly6qcdhssjq9mql2sl1awmg2";
+          rev = "28bf928db432c61a59ec4eb78966844b8d7bbfe5";
+          sha256 = "1i5vx2phxhwm38igfb9xxaas4q85mncs8zql87l1jwwij14v71xa";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e23c062ff32d7aeae486c01e29c56a74727dcf1d/recipes/lispy";
@@ -42693,8 +42756,8 @@
         version = "20150910.644";
         src = fetchgit {
           url = "https://llvm.org/git/llvm";
-          rev = "fc240a136aa7138e2876330db933446e675c0851";
-          sha256 = "06bfifz08q8madprlj51kklb5xdzm0cyp8nb4zi2q61myngf2qg3";
+          rev = "21623270b8b07e1e82eca1f1dbd88d079176ca48";
+          sha256 = "1c9j5dk5wl849kjalqd7jnq76055gc643mv2zn99prj9ziimqgcc";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/1e2a0e4698d4e71ec28656594f6a83504a823490/recipes/llvm-mode";
@@ -43233,12 +43296,12 @@
     lsp-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "lsp-mode";
-        version = "20171223.442";
+        version = "20171230.2213";
         src = fetchFromGitHub {
           owner = "emacs-lsp";
           repo = "lsp-mode";
-          rev = "18f13f84aab37c5bb6ca355fe99e829c4fbbaae4";
-          sha256 = "0dssg7v47zf4781995dw7bz5baqn880bknd4la7c5q6730lvnh5n";
+          rev = "6aa831ac2ea8996e0ad5a0ab9573ec17c83d20f1";
+          sha256 = "00sp25qhpk1y6qkhdfdp356w916awf0sap9bgvy23hwchi03g31v";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/1a7b69312e688211089a23b75910c05efb507e35/recipes/lsp-mode";
@@ -43314,6 +43377,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    lsp-ui = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, lsp-mode, markdown-mode, melpaBuild }:
+    melpaBuild {
+        pname = "lsp-ui";
+        version = "20180101.1522";
+        src = fetchFromGitHub {
+          owner = "emacs-lsp";
+          repo = "lsp-ui";
+          rev = "5292ac5434bcb9ce31af444177236a2622a57959";
+          sha256 = "00g0hh494mfdygd4qlbmq9hcyrqhkikjx53xv03mkwnnbff1qag3";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/1e4fa7cdf71f49f6998b26d81de9522248bc58e6/recipes/lsp-ui";
+          sha256 = "00y5i44yd79z0v00a9lvgixb4mrx9nq5vcgmib70h41ffffaq42j";
+          name = "lsp-ui";
+        };
+        packageRequires = [ emacs flycheck lsp-mode markdown-mode ];
+        meta = {
+          homepage = "https://melpa.org/#/lsp-ui";
+          license = lib.licenses.free;
+        };
+      }) {};
     lsp-vue = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, lsp-mode, melpaBuild }:
     melpaBuild {
         pname = "lsp-vue";
@@ -43653,12 +43737,12 @@
     magit = callPackage ({ async, dash, emacs, fetchFromGitHub, fetchurl, ghub, git-commit, let-alist, lib, magit-popup, melpaBuild, with-editor }:
     melpaBuild {
         pname = "magit";
-        version = "20171219.1342";
+        version = "20171227.2034";
         src = fetchFromGitHub {
           owner = "magit";
           repo = "magit";
-          rev = "0ee62ee80eca660a5d05dab34bcf4b80a3ee749d";
-          sha256 = "0hgkb6vf53f0hannbb6a50kdlwzhx73wf4hr3y3yw7ihjr9qd89h";
+          rev = "ebd8c6510dc1c95e6ca4007a7f62ed037379d251";
+          sha256 = "1qjnbkrm8svham59pddzwzjvp7s0icszc7dkm97s4yciikgmsirf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/0263ca6aea7bf6eae26a637454affbda6bd106df/recipes/magit";
@@ -44510,12 +44594,12 @@
     markdown-mode = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "markdown-mode";
-        version = "20171222.927";
+        version = "20180101.503";
         src = fetchFromGitHub {
           owner = "jrblevin";
           repo = "markdown-mode";
-          rev = "faf60003180bc9db5e69fcef08040f544217d08f";
-          sha256 = "1kfz9w2lb2afjd9vxmpcbkgcsxa39iwhx6af2m7gwxa1mh2grfj3";
+          rev = "fc4e143831f8590dc9b25da76961536eade02411";
+          sha256 = "05q7962wc8px9v2810v6z68qrqr7kvjicc53byyqbxlp4sqcz6x4";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/74610ec93d4478e835f8b3b446279efc0c71d644/recipes/markdown-mode";
@@ -44706,12 +44790,12 @@
     marshal = callPackage ({ eieio ? null, fetchFromGitHub, fetchurl, ht, json ? null, lib, melpaBuild }:
     melpaBuild {
         pname = "marshal";
-        version = "20171018.932";
+        version = "20180102.201";
         src = fetchFromGitHub {
           owner = "sigma";
           repo = "marshal.el";
-          rev = "6a31133b25addabc5ec9c87ba959d69c5122171b";
-          sha256 = "1h5ilihlpqg1as6cd58z3flxzhj7izk7sz1nzwhwzvh3kfm47h9d";
+          rev = "e25b170779ca8d0cdef0bfeb6f35c264a23a44e8";
+          sha256 = "01m5cjjhi02aqpv1c9h7n4kq1b7vplb9cwncb4kx17k5xyml7yb1";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/203f2061c5c7d4aefab3175de5e0538f12158ee3/recipes/marshal";
@@ -45062,12 +45146,12 @@
     meghanada = callPackage ({ company, emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild, yasnippet }:
     melpaBuild {
         pname = "meghanada";
-        version = "20171122.626";
+        version = "20171230.802";
         src = fetchFromGitHub {
           owner = "mopemope";
           repo = "meghanada-emacs";
-          rev = "555b8b9ea8ef56dda645ea605b38501cb4222b12";
-          sha256 = "1z3vvasah4gq6byq4ibkihy5mbch5zzxnn0gy86jldapwi1z74sq";
+          rev = "98ad6a5361c725319a355522d2d1ba0e0fbb7cde";
+          sha256 = "06iryz4dbldc9vxy67g977hih8r1bfvjld53lvwnjsc7r3x9i07q";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/4c75c69b2f00be9a93144f632738272c1e375785/recipes/meghanada";
@@ -45900,12 +45984,12 @@
     mmt = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "mmt";
-        version = "20170519.4";
+        version = "20171231.2219";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "mmt";
-          rev = "5cc5d1ee3efe675fa49d62fe0ae6b483d7ad9392";
-          sha256 = "1vkj28351si30l3szjpkdgjlmp2vfjp6jxk3dvlbxicfqd1k823p";
+          rev = "b8cc8d29e185c15a1e43ecc2a78e36a6d2f86b8f";
+          sha256 = "17v26116g05py2yd24a5rjlr2lbdacahglxar10k5291v9i4msdw";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d1137bb53ecd92b1a8537abcd2635602c5ab3277/recipes/mmt";
@@ -46047,12 +46131,12 @@
     modalka = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "modalka";
-        version = "20170519.32";
+        version = "20171231.2213";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "modalka";
-          rev = "3cb3fdd20def5888e232863e13bd9ad68ea85a01";
-          sha256 = "1zkfby6m16yafzz511jgjlh3cyjnqaknbrdky05h1a4hbk2rvsnl";
+          rev = "e69ec8fa01e86cb789f7f2b27b6d5a47e1ca3069";
+          sha256 = "10yn56vamcfblilsnfqfagssr4060gr7qbpnqa2fjqv1l8fg6jrf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/fa0a02da851a603b81e183f461da55bf4c71f0e9/recipes/modalka";
@@ -46086,6 +46170,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    mode-line-bell = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "mode-line-bell";
+        version = "20171231.1939";
+        src = fetchFromGitHub {
+          owner = "purcell";
+          repo = "mode-line-bell";
+          rev = "dcfad0929a606af0e836d93e78be989a8ac16f87";
+          sha256 = "0vpi3x60izvwwcck6scdm4386bc67693nqwwll0mbzf8n9args4v";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/26f19808655b0242a1e9e5e5d41f7f794542e243/recipes/mode-line-bell";
+          sha256 = "1ri771hb91b7hd203f8zp83h5hcndh8ccc1y8shhqmak6a6l04wk";
+          name = "mode-line-bell";
+        };
+        packageRequires = [];
+        meta = {
+          homepage = "https://melpa.org/#/mode-line-bell";
+          license = lib.licenses.free;
+        };
+      }) {};
     mode-line-debug = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "mode-line-debug";
@@ -46534,8 +46639,8 @@
         src = fetchFromGitHub {
           owner = "retroj";
           repo = "mowedline";
-          rev = "fcf01eafc6d201396dff521012f40c18a0c7a8d8";
-          sha256 = "0v0pxbnf1xs25nrnyyvxjk3pz3pxhlpabnbhhd80s31jcnh5zy1s";
+          rev = "6121b7d4aacd18f7b24da226e61dbae054e50a7c";
+          sha256 = "16j3y4hffnv2rg97p49hqz3x1icp7qkpcjxhalny5l4gysx9mfqg";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/86f7df6b8df3398ef476c0ed31722b03f16b2fec/recipes/mowedline";
@@ -46593,12 +46698,12 @@
     mozc = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "mozc";
-        version = "20160102.1506";
+        version = "20180101.0";
         src = fetchFromGitHub {
           owner = "google";
           repo = "mozc";
-          rev = "4767ce2f2b6a63f1f139daea6e98bc7a564d5e4e";
-          sha256 = "1azx128zsr7mlg2k538483c3qi1zmm8cc4z8sk06534wnx7wxs88";
+          rev = "6b878e31fb6ac4347dc9dfd8ccc1080fe718479f";
+          sha256 = "03gcda62xl6hfibw3y15lf6b04998kj1v95gyzs3q0bqxav74ahw";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/30fef77e1d7194ee3c3c1d4775c349a4a9f6af2c/recipes/mozc";
@@ -47830,12 +47935,12 @@
     neato-graph-bar = callPackage ({ emacs, fetchFromGitLab, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "neato-graph-bar";
-        version = "20170731.2341";
+        version = "20171230.1753";
         src = fetchFromGitLab {
           owner = "RobertCochran";
           repo = "neato-graph-bar";
-          rev = "3ebd5168c9b8cc56cc4163206c03864b9b802f27";
-          sha256 = "133k1lwmb7ky91ij03nd4vipkivvx4bz56m4waf1pdmaynsidy6j";
+          rev = "c59f15ed9a40aecc174aa22c4bbfa7978e182705";
+          sha256 = "0bdgsxdlwpkd3hjnw1jmj30slakzmj2pinj3pyr5qqba9apxnvri";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/49c5bd4e1506a28ada9856e5f70e520890123d16/recipes/neato-graph-bar";
@@ -48603,11 +48708,11 @@
       }) {};
     notmuch = callPackage ({ fetchgit, fetchurl, lib, melpaBuild }: melpaBuild {
         pname = "notmuch";
-        version = "20171208.1819";
+        version = "20171231.526";
         src = fetchgit {
           url = "git://git.notmuchmail.org/git/notmuch";
-          rev = "9ced40228b2524bd09dc8e0063f1ce3db450caea";
-          sha256 = "0ravkhrfzdbc5lcwd0lyq0vzjjhkxvx43f20r25y1380ysy95zss";
+          rev = "c8fc3d1428d86a653a23a5f8c32ea8ac52c8f160";
+          sha256 = "10prhf2xnz76f8xvyys7yg2rs7ci69bq33cy61y2pvii13hd9lcl";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b19f21ed7485036e799ccd88edbf7896a379d759/recipes/notmuch";
@@ -49150,6 +49255,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    ob-clojure-literate = callPackage ({ cider, dash, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, org }:
+    melpaBuild {
+        pname = "ob-clojure-literate";
+        version = "20180101.427";
+        src = fetchFromGitHub {
+          owner = "stardiviner";
+          repo = "ob-clojure-literate";
+          rev = "e3c05e0926558f2bf614ca8611940644b798835f";
+          sha256 = "08l5lw1gk0lgbq2mkz11iw2ni79wcc6crks53rqvx8dfvhbd7wy6";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/e958745861c9673248955443bcc2c76d504b32f7/recipes/ob-clojure-literate";
+          sha256 = "0jprgnslkc9m404n32rr510is823yr9kziqcw70z828fy7wl2glk";
+          name = "ob-clojure-literate";
+        };
+        packageRequires = [ cider dash emacs org ];
+        meta = {
+          homepage = "https://melpa.org/#/ob-clojure-literate";
+          license = lib.licenses.free;
+        };
+      }) {};
     ob-coffee = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild, org }:
     melpaBuild {
         pname = "ob-coffee";
@@ -49178,8 +49304,8 @@
         src = fetchFromGitHub {
           owner = "brantou";
           repo = "ob-coffeescript";
-          rev = "b70f3d822c707cb02333fcb739ba4874614cad2a";
-          sha256 = "0284v3km41427q7dr0wmvf3zhbsgzj0j2r9zny0g3n85qvyk0rgd";
+          rev = "d68a8335d29c947f388b4fa556de4f3ee75a19c6";
+          sha256 = "0hjyvvq089c0m9hqjlk3fb07z24vha7fmvfy8w9203jxqkazm1di";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/ba1a808c77653bac1948d6c44bd1db09301ffeff/recipes/ob-coffeescript";
@@ -49388,8 +49514,8 @@
         src = fetchFromGitHub {
           owner = "brantou";
           repo = "ob-hy";
-          rev = "a3512f274709dc4ab6c18d7955d361f8715505f0";
-          sha256 = "1i796041svy7njjl3aqaxzjydmm24q688vpxvqd0pj5hyajqdgqw";
+          rev = "cad6a1aaa463e8d72d37b12744be1c5732bb8cc4";
+          sha256 = "0cm238139vf356vayv3xzx5gw2hlklzgrbpzk3ixnfh4gkgnmdj0";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/12a7a7dba169010a3a047f961010236a203c16c2/recipes/ob-hy";
@@ -50842,12 +50968,12 @@
     org-brain = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, org }:
     melpaBuild {
         pname = "org-brain";
-        version = "20171223.19";
+        version = "20180101.821";
         src = fetchFromGitHub {
           owner = "Kungsgeten";
           repo = "org-brain";
-          rev = "93c3517d0c659b30cfc3371def9e8c4fc7daf73c";
-          sha256 = "1q2571y444mvx78v4a0z5n007aw8pv4qzm284pr6fjm4n7j9qpcx";
+          rev = "8625974c444f2dddbdd1eeeb9e4063aa8977503b";
+          sha256 = "040hxhq82cgfdmdk1sisklx9m5m6bpwp8w1l1fwb9rxnyzcsji4y";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/47480fbae06e4110d50bc89db7df05fa80afc7d3/recipes/org-brain";
@@ -51699,6 +51825,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    org-noter = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, org }:
+    melpaBuild {
+        pname = "org-noter";
+        version = "20171229.1823";
+        src = fetchFromGitHub {
+          owner = "weirdNox";
+          repo = "org-noter";
+          rev = "ad3ecfc75bba19625dab07f4ff0483f043ddaf70";
+          sha256 = "09y9pamb7zld41qlvfpp5szl0lyblrjd2211qzbs8zm4mk3hlzy3";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/4a2bc0d95dc2744277d6acbba1f7483b4c14d75c/recipes/org-noter";
+          sha256 = "0vsc2b1yz9lw0zv1vnm722pl35kxpwhcdi7h6mijhnw8vv7rhixf";
+          name = "org-noter";
+        };
+        packageRequires = [ cl-lib emacs org ];
+        meta = {
+          homepage = "https://melpa.org/#/org-noter";
+          license = lib.licenses.free;
+        };
+      }) {};
     org-octopress = callPackage ({ ctable, fetchFromGitHub, fetchurl, lib, melpaBuild, org, orglue }:
     melpaBuild {
         pname = "org-octopress";
@@ -52206,6 +52353,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    org-send-ebook = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, seq }:
+    melpaBuild {
+        pname = "org-send-ebook";
+        version = "20171231.2313";
+        src = fetchFromGitHub {
+          owner = "stardiviner";
+          repo = "org-send-ebook";
+          rev = "a22d565413b82c415c4f12daab5bfcc489053ec5";
+          sha256 = "19qf3a8vagbfbdj2cd7wklran4z6w9ddlimy0r15pxs23abicwjl";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/646106cf43649544056285aef8c4035b6e5bbbdb/recipes/org-send-ebook";
+          sha256 = "0gvnrl4rfqn3zd0wmj4bhd63zkjk68lwwcgmsqrfw7af22wlfv3d";
+          name = "org-send-ebook";
+        };
+        packageRequires = [ cl-lib emacs seq ];
+        meta = {
+          homepage = "https://melpa.org/#/org-send-ebook";
+          license = lib.licenses.free;
+        };
+      }) {};
     org-static-blog = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "org-static-blog";
@@ -52950,22 +53118,22 @@
           license = lib.licenses.free;
         };
       }) {};
-    origami = callPackage ({ dash, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
+    origami = callPackage ({ cl-lib ? null, dash, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
     melpaBuild {
         pname = "origami";
-        version = "20170129.805";
+        version = "20180101.753";
         src = fetchFromGitHub {
           owner = "gregsexton";
           repo = "origami.el";
-          rev = "5630536d04613476e13b413fe05fd0bbff4107ca";
-          sha256 = "1w6cyyvjw6x4x0a7mbybw37f70cdnwajv8snvmnrqd73vggm70fd";
+          rev = "1f38085c8f9af7842765ed63f7d6dfe4dab59366";
+          sha256 = "0ha1qsz2p36pqa0sa2sp83lspbgx5lr7930qxnwd585liajzdd9x";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b816be227dfc7330292a50346c4bb37394d3e998/recipes/origami";
           sha256 = "0rkb55zcvsgxzp190vrnbzdfbcjd8zi6vhbhwpqxi0qmyq6a08pr";
           name = "origami";
         };
-        packageRequires = [ dash emacs s ];
+        packageRequires = [ cl-lib dash emacs s ];
         meta = {
           homepage = "https://melpa.org/#/origami";
           license = lib.licenses.free;
@@ -54551,8 +54719,8 @@
         src = fetchFromGitHub {
           owner = "cute-jumper";
           repo = "parsec.el";
-          rev = "212f848d95c2614a86f135c1bf3de15ef0e09805";
-          sha256 = "11qr9i55530pzmiwilfazaqxcjw8sx1iry19jvzdqsffjqvx2mnl";
+          rev = "72c1897a42b3b0b59505b3562e8f46c6354faec1";
+          sha256 = "0yg35fs9gr07j6x7xi4f3v11xdanmkhr5sr9lqim0m10aglv7vwf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/248aaf5ff9c98cd3e439d0a26611cdefe6b6c32a/recipes/parsec";
@@ -57470,12 +57638,12 @@
     prassee-theme = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "prassee-theme";
-        version = "20171222.2326";
+        version = "20171231.1852";
         src = fetchFromGitHub {
           owner = "prassee";
           repo = "prassee-emacs-theme";
-          rev = "c798d59817ef7a9fe1d9d01cb5d9908b84f1a626";
-          sha256 = "0ci54w8clv3igbnhw8q27js3c4yyshvj165nbacrknr5qcczxbbl";
+          rev = "293926b947bc5f479880addce87eb114aaa977f6";
+          sha256 = "0qnxhql3dv99yjxhzcqg71h0wrxjr3n1qmibmbzk74c68rzp3nrn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/15425b576045af1c508912e2091daf475b80b429/recipes/prassee-theme";
@@ -57931,12 +58099,12 @@
     projectile = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, pkg-info }:
     melpaBuild {
         pname = "projectile";
-        version = "20171126.6";
+        version = "20171229.1155";
         src = fetchFromGitHub {
           owner = "bbatsov";
           repo = "projectile";
-          rev = "184d3451c9258cfbbfa2b26a07c7daeee2e9a605";
-          sha256 = "0a3h980xyqx7wx90gnfzqjs5zhakq8cygvxgc7iy0v54d6qp5v5s";
+          rev = "5b3ac9b7eb7c1c70fbd05db11bdd67c5b2f0a4b0";
+          sha256 = "1c7djn90yjm34yg6s3ibvx424fnfb9f6fzw7ppkcf2qq0jqh3z51";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/ca7bf43ef8893bf04e9658390e306ef69e80a156/recipes/projectile";
@@ -58376,8 +58544,8 @@
         src = fetchFromGitHub {
           owner = "google";
           repo = "protobuf";
-          rev = "099d99759101c295244c24d8954ec85b8ac65ce3";
-          sha256 = "0mi7ym70ff0i9qrspqzavdsywvqv2sax26n74ingkny4lzq8ay4h";
+          rev = "8529f2aee33ae793c9ce362a45370b98f675370a";
+          sha256 = "0nsygvv5vd7apfirjilsp59gm2kxr82xl038l3zw6h40rr69kq3f";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b4e7f5f641251e17add561991d3bcf1fde23467b/recipes/protobuf-mode";
@@ -58414,12 +58582,12 @@
     psc-ide = callPackage ({ cl-lib ? null, company, dash, dash-functional, emacs, fetchFromGitHub, fetchurl, flycheck, let-alist, lib, melpaBuild, s, seq }:
     melpaBuild {
         pname = "psc-ide";
-        version = "20171122.347";
+        version = "20180101.1421";
         src = fetchFromGitHub {
           owner = "epost";
           repo = "psc-ide-emacs";
-          rev = "633b07b238aff51dc4b95a75c67910a18ba28da1";
-          sha256 = "0myvb9dqxm5g1zf7hgx6frgkr5h5839sdnrv25xf2h1w8jmyc0cn";
+          rev = "085e9d5541ccf35e876a6135daaddaa0a58f3bb2";
+          sha256 = "0q7xqrjvllngz658w32zm9jbz1njqwpaqgiv3b377nfnay9rsh3p";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/384ffc463cc6edb4806f8da68bd251e662718e65/recipes/psc-ide";
@@ -59115,12 +59283,12 @@
     pyim = callPackage ({ async, cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, popup, pyim-basedict }:
     melpaBuild {
         pname = "pyim";
-        version = "20171212.2309";
+        version = "20180101.2256";
         src = fetchFromGitHub {
           owner = "tumashu";
           repo = "pyim";
-          rev = "3b1c5fbdf3b910f96771935785e28cf33d8d54cc";
-          sha256 = "1ijfsnjvyys941kgcq00d5dgnkbzj14gb7c9pks0x11bsdl0vr6p";
+          rev = "1868d2dbcd73b072bf63a7dfe7c034068c9c4ebf";
+          sha256 = "16avf1h40rhai3lyn1klhdpksxqp7xliblalcvmdp5mh2v2g19w7";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/151a0af91a58e27f724854d85d5dd9668229fe8d/recipes/pyim";
@@ -59245,8 +59413,8 @@
         src = fetchFromGitHub {
           owner = "PyCQA";
           repo = "pylint";
-          rev = "00f77bff3743d92c01aa1335b22297e06f788575";
-          sha256 = "1bpsnxfymalkxnzlys0hy3x70m95vd9frafx587mqbxaj2p88sji";
+          rev = "2d461678e2c1c02985c4042bbc15ac6f3611c61d";
+          sha256 = "1gmx6xlj6rzil7x42pcqrgslzsaf4h59b10d9cpqc9nsfyfy42ac";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/a073c91d6f4d31b82f6bfee785044c4e3ae96d3f/recipes/pylint";
@@ -60501,12 +60669,12 @@
     realgud = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, load-relative, loc-changes, melpaBuild, test-simple }:
     melpaBuild {
         pname = "realgud";
-        version = "20171218.1850";
+        version = "20171228.919";
         src = fetchFromGitHub {
           owner = "rocky";
           repo = "emacs-dbgr";
-          rev = "3ccd602ec02b9c82e3a6f60fda2116ea1b18aeb0";
-          sha256 = "10cik0b2dlsbp1n5kf4g1737m48h5f4gs5n16wcdxb1ra4s66cxq";
+          rev = "c593d0cb226e1517d47670efc68325b12fe20057";
+          sha256 = "03hqngshin19108p4k4zz1f240rmar2h5f7slb85mx69nip1svnd";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7ca56f05df6c8430a5cbdc55caac58ba79ed6ce5/recipes/realgud";
@@ -60822,12 +60990,12 @@
     redprl = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "redprl";
-        version = "20171204.757";
+        version = "20180101.2200";
         src = fetchFromGitHub {
           owner = "RedPRL";
           repo = "sml-redprl";
-          rev = "c6f7ba8655f4bbf6332900483a194eaf18bb5fa8";
-          sha256 = "1s2pa53cgv33ady43wglh969kl43p1v5fkwg5ijmsx7miilwmr99";
+          rev = "3df6aa8888c282112c7df9508ff94cfded2bbff9";
+          sha256 = "0fyps4h2ckcgyz0mx633nlkcl7nzgbsyaq0jd6ci58hgapqmkfnw";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/06e7371d703ffdc5b6ea555f2ed289e57e71e377/recipes/redprl";
@@ -62501,12 +62669,12 @@
     ryo-modal = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ryo-modal";
-        version = "20170217.1021";
+        version = "20180102.547";
         src = fetchFromGitHub {
           owner = "Kungsgeten";
           repo = "ryo-modal";
-          rev = "f6073b56c43a8bc4fc01eb27faba3335d556606a";
-          sha256 = "1pq8c79qrs2zwp8q89rhm5lmcpl48axnc9mwl10gq4jy2rlzfrks";
+          rev = "fee33898b5726b3c15b6ceb2ebb051bebd4f3592";
+          sha256 = "1rpn309s7a7rgs2n9l4m409x2r5p83xkgaq1aa2dab4p594hy29g";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/ryo-modal";
@@ -62883,8 +63051,8 @@
         src = fetchFromGitHub {
           owner = "openscad";
           repo = "openscad";
-          rev = "ec4cdec902b29d52289b1120cd8f3aa9301c95eb";
-          sha256 = "0y80wrrn3a9n96fwcr1k8v2v13xa42lhn0c23ay1s8qvm7884kca";
+          rev = "47402a706468da612ad752dc59917d0d00d6218c";
+          sha256 = "0j7i3zcnz4j8h611bwq8nxw59k99p8l7k4qzzlii2k2xnplqq6iv";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/2d27782b9ac8474fbd4f51535351207c9c84984c/recipes/scad-mode";
@@ -64473,12 +64641,12 @@
     shx = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "shx";
-        version = "20171108.910";
+        version = "20171230.1219";
         src = fetchFromGitHub {
           owner = "riscy";
           repo = "shx-for-emacs";
-          rev = "aa2fda2419b6e2540f1e6eb3789b6a247c319050";
-          sha256 = "1imnpbc1wkx8gwac1v3ailycjxs4yxwhbhifgn20jib85nn8s66i";
+          rev = "33383bd359d795df2d7ef725b5349c953f5a6aa8";
+          sha256 = "1arwsb6as8jpah0bs3b92a3kdnbfkhnsm1jglspfh4lqpafmx5vf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7a2ff78ae3c4289ebf9e06cdfd8f8082c395a16f/recipes/shx";
@@ -64725,12 +64893,12 @@
     simple-paren = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "simple-paren";
-        version = "20171222.1158";
+        version = "20171229.1018";
         src = fetchFromGitHub {
           owner = "andreas-roehler";
           repo = "simple-paren";
-          rev = "ae1e14fd78840011f73347a857c1a20e4e39d546";
-          sha256 = "10hwqkvz97amh4v0aw497ajhnbxybgg0gfb5v11l41i85dspc7wi";
+          rev = "40b3ef7e3e8aae8b0148b621895a692f47924526";
+          sha256 = "035lcbi901124fcvpg4f9yg74ff80ycidh6drvyskb7w94lhhsc2";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/5e8886feb4a034fddd40d7381508b09db79f608f/recipes/simple-paren";
@@ -65061,12 +65229,12 @@
     slime = callPackage ({ cl-lib ? null, fetchFromGitHub, fetchurl, lib, macrostep, melpaBuild }:
     melpaBuild {
         pname = "slime";
-        version = "20171225.337";
+        version = "20171230.1630";
         src = fetchFromGitHub {
           owner = "slime";
           repo = "slime";
-          rev = "f26744d2ad7b5257e13eba46b69512a556d224ac";
-          sha256 = "0rvh8qc5fda37h0virw49nbkqd5jbgrs4ifri3ny0cylczk0gfdd";
+          rev = "179741a0616f78f4e5901fe04dea79654c504fba";
+          sha256 = "0vljhr6gkmw5jkdzhq6vsl9sa48hv1a02d9g4sfwqraz85k4x85k";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/14c60acbfde13d5e9256cea83d4d0d33e037d4b9/recipes/slime";
@@ -65837,12 +66005,12 @@
     smbc = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "smbc";
-        version = "20160706.1522";
+        version = "20171229.1008";
         src = fetchFromGitHub {
           owner = "sakshamsharma";
           repo = "emacs-smbc";
-          rev = "c377b806118d82140197d9cb1095548477e00497";
-          sha256 = "16cj6jsy1psmcjshxb46i44sf1zb9s4mfiagl5cr22njy01ajq1h";
+          rev = "10538e3d575ba6ef3c94d555af2744b42dfd36c7";
+          sha256 = "0b2fndvp9kzlr65b0gr0z5hmapa4y96a6zvc2nrlijffkgyk05nn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/05b4f16cd8028edc758ada842432df11c8276fd3/recipes/smbc";
@@ -66320,12 +66488,12 @@
     solarized-theme = callPackage ({ cl-lib ? null, dash, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "solarized-theme";
-        version = "20171215.2313";
+        version = "20180101.42";
         src = fetchFromGitHub {
           owner = "bbatsov";
           repo = "solarized-emacs";
-          rev = "e77ddc10b43a5155e6c72608539df7c68802371d";
-          sha256 = "1xg9my5galzbkylsn9mmq5ii45s8dph45ilcakkmkdiwlhsvv1c5";
+          rev = "2dd2699b2f315374333292b132dc0dc03719aba2";
+          sha256 = "04365kpw8a3f3963v6c3q8zka5xivx9jikvcar7fx59l4l7k5i2p";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/cae2ac3513e371a256be0f1a7468e38e686c2487/recipes/solarized-theme";
@@ -66341,12 +66509,12 @@
     solidity-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "solidity-mode";
-        version = "20171227.735";
+        version = "20171231.741";
         src = fetchFromGitHub {
           owner = "ethereum";
           repo = "emacs-solidity";
-          rev = "07714e315920e3fbe564845559d0b5b2d56a9edc";
-          sha256 = "1cxpqnjrmwiv5g8g7gspm1111m0ggjh2ps76hlrhv6jvck9mrfs7";
+          rev = "b5d95ef678305ca70b17e94fc2ee4289a8328048";
+          sha256 = "04l3hvfpgqiaxdxh8s2cg2rx4cy50i7a411q81g8661fx60c6h6p";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/bb9df5ec0692352b6494d435d11166f4ea26c99e/recipes/solidity-mode";
@@ -66558,12 +66726,12 @@
     sourcekit = callPackage ({ dash, dash-functional, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, request }:
     melpaBuild {
         pname = "sourcekit";
-        version = "20170126.353";
+        version = "20180101.34";
         src = fetchFromGitHub {
           owner = "nathankot";
           repo = "company-sourcekit";
-          rev = "8ba62ac25bf533b7f148f333bcb5c1db799f749b";
-          sha256 = "01dh0wdaydiai4v13r8g05rpiwqr5qqi34wif8vbk2mrr25wc7i9";
+          rev = "abf9bc5a0102eb666d3aa6d6bf22f6efcc852781";
+          sha256 = "1g8a4fgy2c5nqk8gysbnzn5jvfw6ynmfhc6j3hkrbswgf9188v5n";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/45969cd5cd936ea61fbef4722843b0b0092d7b72/recipes/sourcekit";
@@ -66851,12 +67019,12 @@
     speed-type = callPackage ({ cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "speed-type";
-        version = "20171217.624";
+        version = "20171230.847";
         src = fetchFromGitHub {
           owner = "parkouss";
           repo = "speed-type";
-          rev = "6a1784c80a6b62d6bf76eb0ff0058e36ade70e1e";
-          sha256 = "1z1x3n9cxchbylima4w7is8j98ny58c8y68ygyp55c3s4h0qm892";
+          rev = "7a67fcd7bf825eee890097bd4a1b3c4f531a1135";
+          sha256 = "0nlmqgf4rg5qmkhpsal7j18wr5h74971k6d0wzw7rmjmpnjqhzvc";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d6c33b5bd15875baea0fd2f24ee8ec9414a6f7aa/recipes/speed-type";
@@ -66977,12 +67145,12 @@
     spiral = callPackage ({ a, clojure-mode, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, treepy }:
     melpaBuild {
         pname = "spiral";
-        version = "20171227.744";
+        version = "20180101.614";
         src = fetchFromGitHub {
           owner = "unrepl";
           repo = "spiral";
-          rev = "5c24e7fbeec7467e85fd5cd6796520c73af6ba0d";
-          sha256 = "10n4i137al5812fvmdwjkn1pfrgxqm0g8yif0aiw53fr2nc50wxb";
+          rev = "bd9ec34ab1f3e5a442614d9ad61970e1280b8825";
+          sha256 = "193dr2a7lv5yrgs8as5785azbpivspbv97fvd29qg2k02a74cr65";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/77609e10c836a26de43ddb304ecfa275e314da21/recipes/spiral";
@@ -68109,12 +68277,12 @@
     suggest = callPackage ({ dash, emacs, f, fetchFromGitHub, fetchurl, lib, loop, melpaBuild, s }:
     melpaBuild {
         pname = "suggest";
-        version = "20171016.1420";
+        version = "20171229.1712";
         src = fetchFromGitHub {
           owner = "Wilfred";
           repo = "suggest.el";
-          rev = "345e00569333095eb24e61239a80b0f0c77b2d11";
-          sha256 = "0npqvhnfmrx7jq1slz489rh2l4rnfhqhbi6ybdzw5rism8r3jqwb";
+          rev = "5caf98ab49c6b3c421d8f274c0682bbb7fc662fe";
+          sha256 = "1niifkdirlwcyx5rk398dgk9lqnqr06ilhh0r89hx1xxdnbjglbi";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b9fd27e812549587dc2ec26bb58974177ff263ff/recipes/suggest";
@@ -68424,12 +68592,12 @@
     swift-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, seq }:
     melpaBuild {
         pname = "swift-mode";
-        version = "20171222.2242";
+        version = "20171228.2315";
         src = fetchFromGitHub {
           owner = "chrisbarrett";
           repo = "swift-mode";
-          rev = "359efc05cceecac363f4b0d34d0c06de803cf3ee";
-          sha256 = "17n32xr5agig062d3vxp0h4k09lmgijn5an8kcbsar6gyki8zij0";
+          rev = "8c45f69a078c41619a7a3db6d54a732c3fad8e3f";
+          sha256 = "1isy71vkws3ywm4iwa85dk12810az3h85n6bimd36dfqbhfwdrli";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/19cb133191cd6f9623e99e958d360113595e756a/recipes/swift-mode";
@@ -68470,8 +68638,8 @@
         src = fetchFromGitHub {
           owner = "abo-abo";
           repo = "swiper";
-          rev = "864fbfeb0328d13e7d4641fcba9d001326229d37";
-          sha256 = "045fqwgc02fh5mb09b0kzjwadr7b9vvsksicklffsx31fwbav4d6";
+          rev = "c2bc6ac92a6cea730d7887813a816bdf873f9b92";
+          sha256 = "040z731dm66w4c0475q8vl1lm4dnvi9yz2qslxdma0qdx70hymrr";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e64cad81615ef3ec34fab1f438b0c55134833c97/recipes/swiper";
@@ -68885,12 +69053,12 @@
     systemd = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "systemd";
-        version = "20171006.1352";
+        version = "20180101.1803";
         src = fetchFromGitHub {
           owner = "holomorph";
           repo = "systemd-mode";
-          rev = "22f024fe8f433af7b6a6b99520cea1e766894fe5";
-          sha256 = "11h1nr9gz0mw2gwlplv00i06s9ziw77a7zfcrrzd01rmanz1m4fa";
+          rev = "228f0b99ca3e1f3139ae8cacd15f9698d5b6da90";
+          sha256 = "0cdqpzkx01qm0pk66hs6yhzv5iccrzzgfv3bh5c8i91v55d66bff";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/ca810e512c357d1d0130aeeb9b46b38c595e3351/recipes/systemd";
@@ -69847,6 +70015,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    texfrag = callPackage ({ auctex, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "texfrag";
+        version = "20171229.1913";
+        src = fetchFromGitHub {
+          owner = "TobiasZawada";
+          repo = "texfrag";
+          rev = "ba1382c073b1f73cb411fb30e618480b9a804916";
+          sha256 = "19cinynqicsfdvpa8jmrrx9xmbplw2wnykm3bcii8rs5vkwdh61b";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/756649bbe2dc6233c66c3d128a8096be12231078/recipes/texfrag";
+          sha256 = "195vdpwqzypz35v8hc7ai9xpv1flrik60lgrk5m7xypnlp7mpr2x";
+          name = "texfrag";
+        };
+        packageRequires = [ auctex emacs ];
+        meta = {
+          homepage = "https://melpa.org/#/texfrag";
+          license = lib.licenses.free;
+        };
+      }) {};
     textile-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "textile-mode";
@@ -70999,12 +71188,12 @@
     transmission = callPackage ({ emacs, fetchFromGitHub, fetchurl, let-alist, lib, melpaBuild }:
     melpaBuild {
         pname = "transmission";
-        version = "20171209.905";
+        version = "20180101.1803";
         src = fetchFromGitHub {
           owner = "holomorph";
           repo = "transmission";
-          rev = "7ba791404541c5cf7b063bbfe390ee7384dd2bdd";
-          sha256 = "0nibvw1d5ykdgm7im6nil0hclribss7lk3ynn9whqcjbk790xg2f";
+          rev = "b52760e0160f99312a1773953e7725800c13bb40";
+          sha256 = "195z30yaj0qibkaci7imfhp4sr7zxhmlg4fq4bjzvawlmxi1i56p";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/9ed7e414687c0bd82b140a1bd8044084d094d18f/recipes/transmission";
@@ -71585,12 +71774,12 @@
     twittering-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "twittering-mode";
-        version = "20170312.735";
+        version = "20171231.24";
         src = fetchFromGitHub {
           owner = "hayamiz";
           repo = "twittering-mode";
-          rev = "63c96fb029033b1a300b90aa922e167c7c405bcb";
-          sha256 = "0kax42y0f1pa1pgybz3f57ig9g8fvmgcw8j7zl9nsw70dar4amqk";
+          rev = "bc0dfd600a19860f79eec1b0f8ab18c8094f79ee";
+          sha256 = "0apwkiqiq53b3skpy643bb9cxi4n0gkxvi8j7a4sdxix48lwmwkp";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/091dcc3775ec2137cb61d66df4e72aca4900897a/recipes/twittering-mode";
@@ -71627,12 +71816,12 @@
     typescript-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "typescript-mode";
-        version = "20171213.541";
+        version = "20171229.810";
         src = fetchFromGitHub {
           owner = "ananthakumaran";
           repo = "typescript.el";
-          rev = "861d5983b6894a101b6417ef3f4bd2999ea17ea1";
-          sha256 = "1bld49njpbd8r86d886yc96i91z722553r1d9zy94iz76yw98fnw";
+          rev = "330c887241cf585aa4e2e3f3e9d851f28b92b08e";
+          sha256 = "05bsr5drz8d5p0fx4ai2cfgmgzyi3245gpbr61iyv37an3zkcrav";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d3f534a1e2cee4ad2e32e32802c5080207417b3d/recipes/typescript-mode";
@@ -71690,12 +71879,12 @@
     typit = callPackage ({ emacs, f, fetchFromGitHub, fetchurl, lib, melpaBuild, mmt }:
     melpaBuild {
         pname = "typit";
-        version = "20170519.51";
+        version = "20171231.2214";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "typit";
-          rev = "bf6e72d76c0f3a68d7cd53c6580e92aa15d28dc5";
-          sha256 = "0qf2599x60nipmr78cmlnswid0lj552b0fjcw2lbyg7mnhxlnkmj";
+          rev = "41309d8a64a992f532753093742c15d413c446b5";
+          sha256 = "1fqaf4n236l4qzy4ac370laysb9jnj98769nri6qkirsfzk6hcgd";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d17d019155e19c156f123dcd702f18cfba488701/recipes/typit";
@@ -72292,8 +72481,8 @@
         src = fetchFromGitHub {
           owner = "grettke";
           repo = "universal-emotions-emoticons";
-          rev = "9f249b39172bf9b8e148856ad941eee485161215";
-          sha256 = "1qn757pn1hcfik05i458bic32dm812xznsfz5vgxn2v8wxihjlf8";
+          rev = "c89063a4f8e00f8e9c4dc6c252474b6d4bfc4e01";
+          sha256 = "0wgff3bbjgskbm1c4cww6akia93hd5sqr9md5szkqm6iiqi3q95z";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/57f913112c98db2248cf69e44deb69fd09cee042/recipes/universal-emotions-emoticons";
@@ -73128,12 +73317,12 @@
     vimish-fold = callPackage ({ cl-lib ? null, emacs, f, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "vimish-fold";
-        version = "20170730.2206";
+        version = "20171231.2212";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "vimish-fold";
-          rev = "5e2875c18e2d8ef27f594e0ea1ca15a2f759be42";
-          sha256 = "1a24diw5xwk10d9y8dr1bgpc78d36f3swvlll0igl5b91q4x86dn";
+          rev = "1469c953bc20d21d87ce5d92def767e551cda07c";
+          sha256 = "0nywz6nk1qanx7z9sykf28h9c2qj7xzs9w4hya4vmhwigqqbhldl";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b4862b0a3d43f073e645803cbbf11d973a4b51d5/recipes/vimish-fold";
@@ -75478,12 +75667,12 @@
     xah-fly-keys = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "xah-fly-keys";
-        version = "20171223.1832";
+        version = "20171229.1015";
         src = fetchFromGitHub {
           owner = "xahlee";
           repo = "xah-fly-keys";
-          rev = "f4df23c658815b8988b7a2ceefc21bb2ce428963";
-          sha256 = "1shrykhrifl32rm1ns484n2iljdjcmp5isd6wjhb2k20hwmym85d";
+          rev = "2c7abcf737112ee8c6da4182be3c1c9b54eeb189";
+          sha256 = "1lvfc5smckcb5j4hrdv21983cyzhwys3smjkaxnf2xmys2bwi1fy";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/05eed39bae37cc8359d2cc678052cbbcc946e379/recipes/xah-fly-keys";
@@ -76423,12 +76612,12 @@
     yasnippet = callPackage ({ cl-lib ? null, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "yasnippet";
-        version = "20170923.1646";
+        version = "20180101.1211";
         src = fetchFromGitHub {
           owner = "joaotavora";
           repo = "yasnippet";
-          rev = "4ab9cb5bac683112852f58b26557a7dc283b717b";
-          sha256 = "1sjvzdzzkifw6751gplvm964b85c04jcl1sbq6pjm75alsjv6mrp";
+          rev = "ce11fd66900eb9f871af03dc945c85a8ac980821";
+          sha256 = "103z5702dg4n0laivk17b0l49b4fq7njmvmxghmxsjr3l0n8mh26";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/5d1927dc3351d3522de1baccdc4ce200ba52bd6e/recipes/yasnippet";
@@ -76485,11 +76674,11 @@
       }) {};
     yatex = callPackage ({ fetchhg, fetchurl, lib, melpaBuild }: melpaBuild {
         pname = "yatex";
-        version = "20171030.502";
+        version = "20180102.635";
         src = fetchhg {
           url = "https://www.yatex.org/hgrepos/yatex/";
-          rev = "16763e5b7481";
-          sha256 = "1mrcc9amz0kflm570bd2cprhin0z8lr668k2s56mj6shixb61dwh";
+          rev = "feef2aa1f50f";
+          sha256 = "0453y7a9lq28bmbrrcbsnsrwnhjphq4s4vcr9ncb5252m6fnwdyl";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e28710244a1bef8f56156fe1c271520896a9c694/recipes/yatex";
@@ -76850,12 +77039,12 @@
     zerodark-theme = callPackage ({ all-the-icons, fetchFromGitHub, fetchurl, flycheck, lib, magit, melpaBuild }:
     melpaBuild {
         pname = "zerodark-theme";
-        version = "20171128.610";
+        version = "20171228.1139";
         src = fetchFromGitHub {
           owner = "NicolasPetton";
           repo = "zerodark-theme";
-          rev = "8f348962ea876980f09e01a945026e8e3e629add";
-          sha256 = "1czdf34iwj4znvyjn3rphrq04jvvyrc38djrq0c2k9vmb9rwhxwa";
+          rev = "bbad75027d56e49ee13eb2c93ccc26100d48650e";
+          sha256 = "0ci7wzkg9dy95s2svmsfdvlh29wdc321yxhnab5ka27h8v75jwy8";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/d00b78ead693e844e35c760fe2c39b8ed6cb0d81/recipes/zerodark-theme";
@@ -77290,12 +77479,12 @@
     zzz-to-char = callPackage ({ avy, cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "zzz-to-char";
-        version = "20170519.335";
+        version = "20171231.2219";
         src = fetchFromGitHub {
           owner = "mrkkrp";
           repo = "zzz-to-char";
-          rev = "96dfe16a990474267cd290498cf9ac6dd6b3e7c0";
-          sha256 = "1jvysrq9ya77x2xg0wqy1q27y0r43578d10bdhihpj2281nxng1y";
+          rev = "8ddda49de3356d8fa0308d79b5d68272baf2c57b";
+          sha256 = "17d8mmmgj2w4nm2nfg12g35i7zbp4bp47ix5ifqqm1zvwmbmzrqx";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7063cbc1f1501ce81552d7ef1d42d1309f547c42/recipes/zzz-to-char";
diff --git a/pkgs/applications/editors/emacs-modes/melpa-stable-generated.nix b/pkgs/applications/editors/emacs-modes/melpa-stable-generated.nix
index ac0d4d2598e3f..f0a6ceb68dd79 100644
--- a/pkgs/applications/editors/emacs-modes/melpa-stable-generated.nix
+++ b/pkgs/applications/editors/emacs-modes/melpa-stable-generated.nix
@@ -4256,12 +4256,12 @@
     cider = callPackage ({ clojure-mode, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, pkg-info, queue, seq, spinner }:
     melpaBuild {
         pname = "cider";
-        version = "0.15.1";
+        version = "0.16.0";
         src = fetchFromGitHub {
           owner = "clojure-emacs";
           repo = "cider";
-          rev = "8a9eab32646abcaaf31fe83b2d897c01971b98f1";
-          sha256 = "0ddkm87l9ann05a6j57r0x59qqgfavwrvlzhkc5xhak1nmk5556h";
+          rev = "74f7901b416efbd032bb4f8b5c25f57fdf731115";
+          sha256 = "0n2b6q8r2gzr3ghyvg5sawir47rk7jmsslvxx6by27bn77h4nzil";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/55a937aed818dbe41530037da315f705205f189b/recipes/cider";
@@ -7190,6 +7190,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    dimmer = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "dimmer";
+        version = "0.2.1";
+        src = fetchFromGitHub {
+          owner = "gonewest818";
+          repo = "dimmer.el";
+          rev = "b0faaa6919e633229ced07ff8bd8b5c68b90243a";
+          sha256 = "04k7m5kg2a32ldgxfc2jkdwbmxzyc3yv66871ywv9152db2g7iml";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/8ae80e9202d69ed3214325dd15c4b2f114263954/recipes/dimmer";
+          sha256 = "0w8n5svckk1jp8856pg2gkws9798prqjjkdqf8ili2hjcqnd1a3r";
+          name = "dimmer";
+        };
+        packageRequires = [ emacs ];
+        meta = {
+          homepage = "https://melpa.org/#/dimmer";
+          license = lib.licenses.free;
+        };
+      }) {};
     dionysos = callPackage ({ alert, cl-lib ? null, dash, fetchFromGitHub, fetchurl, lib, libmpdee, melpaBuild, pkg-info, s }:
     melpaBuild {
         pname = "dionysos";
@@ -7809,12 +7830,12 @@
     doom-themes = callPackage ({ all-the-icons, cl-lib ? null, emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "doom-themes";
-        version = "2.0.9";
+        version = "2.1.0";
         src = fetchFromGitHub {
           owner = "hlissner";
           repo = "emacs-doom-themes";
-          rev = "8ff86e456b22ab4c28605c44e544b3ef0b4b4637";
-          sha256 = "0zfr6487hvn08dc9hhwf2snhd3ds4kfaglribxddx38dhd87hk73";
+          rev = "bc747b3b65baf737f99dc4ccf68558581958bbba";
+          sha256 = "0j5aywwh8cw0bb55frrpmyfmbzg6d6jv29ys61p1xf49gvki870m";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c5084bc2c3fe378af6ff39d65e40649c6359b7b5/recipes/doom-themes";
@@ -8270,12 +8291,12 @@
     easy-hugo = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "easy-hugo";
-        version = "2.7.19";
+        version = "2.8.20";
         src = fetchFromGitHub {
           owner = "masasam";
           repo = "emacs-easy-hugo";
-          rev = "1a8c4286ac1d92114dbda9042ed831cc83175db9";
-          sha256 = "11vwzgy1dn4sj1yhnvvim6p9w3dl896azh3wlrmg8g6y6qfzblc7";
+          rev = "253d91cda8722fa69b8ee67b1802137863bc3d9a";
+          sha256 = "1i5hdm9xwajid7kzx6gq8lhx5w2aihvb0ka5h2s88zb1xnnxss46";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/855ea20024b606314f8590129259747cac0bcc97/recipes/easy-hugo";
@@ -8291,12 +8312,12 @@
     easy-jekyll = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "easy-jekyll";
-        version = "1.4.10";
+        version = "1.5.11";
         src = fetchFromGitHub {
           owner = "masasam";
           repo = "emacs-easy-jekyll";
-          rev = "d5226405c035d0dd675cacfd514388c348a4559a";
-          sha256 = "1pmaa0ry1yd8d2pbn4srv5bf1hqss046zjl2p3ag1ag0qb35fh39";
+          rev = "4eac3993d9bbec9ddfe38b128fd3ed6670f526e2";
+          sha256 = "0ffspw6xavfbk0klqjp8va7ybvsdcxlw1qmqhi6paqam90m6vazz";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/c3f281145bad12c27bdbef32ccc07b6a5f13b577/recipes/easy-jekyll";
@@ -12988,12 +13009,12 @@
     flycheck-objc-clang = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "flycheck-objc-clang";
-        version = "2.0.0";
+        version = "2.0.1";
         src = fetchFromGitHub {
           owner = "GyazSquare";
           repo = "flycheck-objc-clang";
-          rev = "29a9eb320d62400564360986f7ad400b74070d8e";
-          sha256 = "0b4vwbxzhds9vb4nknfdywvfpr1gkk86vsbbq6f5ds0pfk75x022";
+          rev = "07f17d1dbe878fdcabac791a8916ddf643571a68";
+          sha256 = "03624xn6g1ybcjw634c7nd5s2yllwfffk2gzn5hm70vfz06q7wb9";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/4ff4412f507371b93cfb85fc744e54110cd87338/recipes/flycheck-objc-clang";
@@ -13219,12 +13240,12 @@
     flycheck-swift3 = callPackage ({ emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild }:
     melpaBuild {
         pname = "flycheck-swift3";
-        version = "2.0.0";
+        version = "2.0.1";
         src = fetchFromGitHub {
           owner = "GyazSquare";
           repo = "flycheck-swift3";
-          rev = "756833425f51baa9eb0a2fa7493df6e68612c88d";
-          sha256 = "1hvrg717q0nlz4r8wby82gs3vdx8fdhf38rg4j77j3fqfmxdd3fi";
+          rev = "34973cd28ca5e63f8f6328a17fd7b78cc913b93d";
+          sha256 = "1iy6j05dzpi7pi87y6rpjzmlnl2s9izqpbzknis2kx9072qddm3q";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/f1fb8c731c118327dc0bbb726e046fec46bcfb82/recipes/flycheck-swift3";
@@ -14038,12 +14059,12 @@
     fountain-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "fountain-mode";
-        version = "2.3.1";
+        version = "2.4.0";
         src = fetchFromGitHub {
           owner = "rnkn";
           repo = "fountain-mode";
-          rev = "5c63d2f199e96bdf8fd60d375b2b6e305a5f9017";
-          sha256 = "0vxizl4pr0668b1d94wrl42li2709srvnn5likn8lskv2mv0bnvn";
+          rev = "3f953ae30ad55bbbbb80aa0350992e79f4b00f56";
+          sha256 = "1zksjvpvhbr79fg281yhx8k419q9kd4jpi47i9943cs0m088ykyn";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/913386ac8d5049d37154da3ab32bde408a226511/recipes/fountain-mode";
@@ -15765,6 +15786,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    go-tag = callPackage ({ emacs, fetchFromGitHub, fetchurl, go-mode, lib, melpaBuild }:
+    melpaBuild {
+        pname = "go-tag";
+        version = "1.0.0";
+        src = fetchFromGitHub {
+          owner = "brantou";
+          repo = "emacs-go-tag";
+          rev = "51b032465405a62f84d9181168a570610ba04085";
+          sha256 = "0158c3yjw21skwa03qmh3xpg9wg7rnk6xbxqx5vxi24205zsz0kd";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/fc4cd3fd8fb0707912e205b9d71789ea8126c442/recipes/go-tag";
+          sha256 = "18ff41i0gr708fl4gzzspf9cc09nv4wy21wsn609yhwlh7w0vs1f";
+          name = "go-tag";
+        };
+        packageRequires = [ emacs go-mode ];
+        meta = {
+          homepage = "https://melpa.org/#/go-tag";
+          license = lib.licenses.free;
+        };
+      }) {};
     godoctor = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "godoctor";
@@ -15936,12 +15978,12 @@
     goto-chg = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "goto-chg";
-        version = "1.7";
+        version = "1.7.1";
         src = fetchFromGitHub {
           owner = "emacs-evil";
           repo = "goto-chg";
-          rev = "171b1331022caf12d8c3593e9b5075f87ee958d4";
-          sha256 = "1jcnrin4j1x8p63fd9r37dq1vr5a7a1nvzk6kp0bdsgn9vbjmapc";
+          rev = "6cb244922b733358fd6985b36c4b87ef2e177293";
+          sha256 = "0miscmk5gg7mqqwjb5mlrkbpsx4pny2w3rpr90f7yiv30rf83b5j";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/cf1fc176430fe3ab55ce537a0efc59780bb812be/recipes/goto-chg";
@@ -16104,12 +16146,12 @@
     grails-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "grails-mode";
-        version = "1.0.2";
+        version = "2.0";
         src = fetchFromGitHub {
           owner = "Groovy-Emacs-Modes";
           repo = "groovy-emacs-modes";
-          rev = "f8e9628916d4d41e1816b53d02f0b5a00c499555";
-          sha256 = "1myb15n207yl2cgacmn105r1xbjq076paq6anvw53smy3fhw9sh9";
+          rev = "d7b362e6186d263ec3eefc141dbb5b27a8773f24";
+          sha256 = "0c1d4cbnlny8gpcd20zr1wxx6ggf28jgh7sgd5r1skpsvjpbfqx2";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/3fe318b4e51a280a55c01fa30455e4a180df8bd6/recipes/grails-mode";
@@ -16383,22 +16425,22 @@
           license = lib.licenses.free;
         };
       }) {};
-    groovy-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    groovy-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
     melpaBuild {
         pname = "groovy-mode";
-        version = "1.0.2";
+        version = "2.0";
         src = fetchFromGitHub {
           owner = "Groovy-Emacs-Modes";
           repo = "groovy-emacs-modes";
-          rev = "f8e9628916d4d41e1816b53d02f0b5a00c499555";
-          sha256 = "1myb15n207yl2cgacmn105r1xbjq076paq6anvw53smy3fhw9sh9";
+          rev = "d7b362e6186d263ec3eefc141dbb5b27a8773f24";
+          sha256 = "0c1d4cbnlny8gpcd20zr1wxx6ggf28jgh7sgd5r1skpsvjpbfqx2";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/3fe318b4e51a280a55c01fa30455e4a180df8bd6/recipes/groovy-mode";
           sha256 = "1pxw7rdn56klmr6kw21lhzh7zhp338gyf54ypsml64ibzr1x9kal";
           name = "groovy-mode";
         };
-        packageRequires = [];
+        packageRequires = [ emacs s ];
         meta = {
           homepage = "https://melpa.org/#/groovy-mode";
           license = lib.licenses.free;
@@ -16533,12 +16575,12 @@
     guix = callPackage ({ bui, dash, emacs, fetchFromGitHub, fetchurl, geiser, lib, magit-popup, melpaBuild }:
     melpaBuild {
         pname = "guix";
-        version = "0.3.3";
+        version = "0.3.4";
         src = fetchFromGitHub {
           owner = "alezost";
           repo = "guix.el";
-          rev = "54bd174b514c5de11e82c4263ac2723addb0fe87";
-          sha256 = "1i5kwzwlb6lx65rgixm8mbdi6x03n0hb4hbc7j76lar4j58ypwz2";
+          rev = "a43828f6e5d6dc4e623a4b78e0dfdddbf5b20185";
+          sha256 = "0c19njb5cg6g3fav9322hkbl4h9zwcbymhc5wr0k9yqi7pv8gz0v";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b3d8c73e8a946b8265487a0825d615d80aa3337d/recipes/guix";
@@ -21002,12 +21044,12 @@
     js-auto-format-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "js-auto-format-mode";
-        version = "1.0.4";
+        version = "1.0.5";
         src = fetchFromGitHub {
           owner = "ybiquitous";
           repo = "js-auto-format-mode";
-          rev = "cad63f1760e765298cc91e3503ac46c8771da4be";
-          sha256 = "1pg4ghfi0fzmnwrw3y4z3gy031psxvzjydwm4jbdrm33ais7919g";
+          rev = "7872e6f1d8280830c70cae8f1e3edb8049aba295";
+          sha256 = "0a9rbs0pjx953rbblmia9jznxykz5qa9q5wzkj341z6vfq9rq3rf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/2d3be16771b5b5fde639da3ee97890620354ee7a/recipes/js-auto-format-mode";
@@ -23647,12 +23689,12 @@
     meghanada = callPackage ({ company, emacs, fetchFromGitHub, fetchurl, flycheck, lib, melpaBuild, yasnippet }:
     melpaBuild {
         pname = "meghanada";
-        version = "0.8.4";
+        version = "0.9.0";
         src = fetchFromGitHub {
           owner = "mopemope";
           repo = "meghanada-emacs";
-          rev = "555b8b9ea8ef56dda645ea605b38501cb4222b12";
-          sha256 = "1z3vvasah4gq6byq4ibkihy5mbch5zzxnn0gy86jldapwi1z74sq";
+          rev = "98ad6a5361c725319a355522d2d1ba0e0fbb7cde";
+          sha256 = "06iryz4dbldc9vxy67g977hih8r1bfvjld53lvwnjsc7r3x9i07q";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/4c75c69b2f00be9a93144f632738272c1e375785/recipes/meghanada";
@@ -25364,11 +25406,11 @@
       }) {};
     notmuch = callPackage ({ fetchgit, fetchurl, lib, melpaBuild }: melpaBuild {
         pname = "notmuch";
-        version = "0.25.3";
+        version = "0.26pre1";
         src = fetchgit {
           url = "git://git.notmuchmail.org/git/notmuch";
-          rev = "ae55a86639f86ad1b547e961f71b1bde2180752d";
-          sha256 = "0kq2j23381qr50zkvx68yciq1xag20fzidgy5jd69bd7z6gziq90";
+          rev = "1ed211d042d5f413731f812b5af7e82819a6e8ae";
+          sha256 = "140c3bhh24dy2cfsvgf9y7h02sjp6cjv8qam6kd8wjlrd3y9zd80";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/b19f21ed7485036e799ccd88edbf7896a379d759/recipes/notmuch";
@@ -25633,6 +25675,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    ob-coffeescript = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "ob-coffeescript";
+        version = "1.0.0";
+        src = fetchFromGitHub {
+          owner = "brantou";
+          repo = "ob-coffeescript";
+          rev = "b70f3d822c707cb02333fcb739ba4874614cad2a";
+          sha256 = "0284v3km41427q7dr0wmvf3zhbsgzj0j2r9zny0g3n85qvyk0rgd";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/ba1a808c77653bac1948d6c44bd1db09301ffeff/recipes/ob-coffeescript";
+          sha256 = "05q1wnabw52kd3fpcpinpxs9z6xmi4n1p19jbcz0bgjpnw05s27p";
+          name = "ob-coffeescript";
+        };
+        packageRequires = [];
+        meta = {
+          homepage = "https://melpa.org/#/ob-coffeescript";
+          license = lib.licenses.free;
+        };
+      }) {};
     ob-http = callPackage ({ cl-lib ? null, fetchFromGitHub, fetchurl, lib, melpaBuild, s }:
     melpaBuild {
         pname = "ob-http";
@@ -25654,6 +25717,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    ob-hy = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "ob-hy";
+        version = "1.0.0";
+        src = fetchFromGitHub {
+          owner = "brantou";
+          repo = "ob-hy";
+          rev = "a3512f274709dc4ab6c18d7955d361f8715505f0";
+          sha256 = "1i796041svy7njjl3aqaxzjydmm24q688vpxvqd0pj5hyajqdgqw";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/12a7a7dba169010a3a047f961010236a203c16c2/recipes/ob-hy";
+          sha256 = "18a8fpda0f28wxmjprhd9dmz7bpk1j3iayl20lqffrcal6m4f1h7";
+          name = "ob-hy";
+        };
+        packageRequires = [ emacs ];
+        meta = {
+          homepage = "https://melpa.org/#/ob-hy";
+          license = lib.licenses.free;
+        };
+      }) {};
     ob-prolog = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "ob-prolog";
@@ -32959,12 +33043,12 @@
     shx = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild }:
     melpaBuild {
         pname = "shx";
-        version = "0.0.12";
+        version = "0.0.13";
         src = fetchFromGitHub {
           owner = "riscy";
           repo = "shx-for-emacs";
-          rev = "aa45e7b586b1215ca1af05c14984ce872571b5f7";
-          sha256 = "0ya7vbp71vmvli35rwcwspbclss5ngr1ck9074i2gg1dzrqyxijn";
+          rev = "33383bd359d795df2d7ef725b5349c953f5a6aa8";
+          sha256 = "1arwsb6as8jpah0bs3b92a3kdnbfkhnsm1jglspfh4lqpafmx5vf";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/7a2ff78ae3c4289ebf9e06cdfd8f8082c395a16f/recipes/shx";
@@ -33817,6 +33901,27 @@
           license = lib.licenses.free;
         };
       }) {};
+    solidity-mode = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild }:
+    melpaBuild {
+        pname = "solidity-mode";
+        version = "0.1.8";
+        src = fetchFromGitHub {
+          owner = "ethereum";
+          repo = "emacs-solidity";
+          rev = "b5d95ef678305ca70b17e94fc2ee4289a8328048";
+          sha256 = "04l3hvfpgqiaxdxh8s2cg2rx4cy50i7a411q81g8661fx60c6h6p";
+        };
+        recipeFile = fetchurl {
+          url = "https://raw.githubusercontent.com/milkypostman/melpa/bb9df5ec0692352b6494d435d11166f4ea26c99e/recipes/solidity-mode";
+          sha256 = "1qdzdivrf5yaa80p61b9r1gryw112v5l2m2jkvkc7glhkhrcvwsx";
+          name = "solidity-mode";
+        };
+        packageRequires = [];
+        meta = {
+          homepage = "https://melpa.org/#/solidity-mode";
+          license = lib.licenses.free;
+        };
+      }) {};
     sos = callPackage ({ fetchFromGitHub, fetchurl, lib, melpaBuild, org }:
     melpaBuild {
         pname = "sos";
@@ -34743,12 +34848,12 @@
     swift-mode = callPackage ({ emacs, fetchFromGitHub, fetchurl, lib, melpaBuild, seq }:
     melpaBuild {
         pname = "swift-mode";
-        version = "4.0.0";
+        version = "4.0.1";
         src = fetchFromGitHub {
           owner = "chrisbarrett";
           repo = "swift-mode";
-          rev = "18c3dc47dfece59640ad501266f2e47b918f2a14";
-          sha256 = "0qk962xzxm8si1h5p7vdnqw7xcaxdjxsaz1yad11pvn9l2b2zpzq";
+          rev = "8c45f69a078c41619a7a3db6d54a732c3fad8e3f";
+          sha256 = "1isy71vkws3ywm4iwa85dk12810az3h85n6bimd36dfqbhfwdrli";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/19cb133191cd6f9623e99e958d360113595e756a/recipes/swift-mode";
@@ -38675,8 +38780,8 @@
         version = "1.80";
         src = fetchhg {
           url = "https://www.yatex.org/hgrepos/yatex/";
-          rev = "16763e5b7481";
-          sha256 = "1mrcc9amz0kflm570bd2cprhin0z8lr668k2s56mj6shixb61dwh";
+          rev = "feef2aa1f50f";
+          sha256 = "0453y7a9lq28bmbrrcbsnsrwnhjphq4s4vcr9ncb5252m6fnwdyl";
         };
         recipeFile = fetchurl {
           url = "https://raw.githubusercontent.com/milkypostman/melpa/e28710244a1bef8f56156fe1c271520896a9c694/recipes/yatex";
diff --git a/pkgs/applications/editors/emacs-modes/org-generated.nix b/pkgs/applications/editors/emacs-modes/org-generated.nix
index ae80ab2ba8dcf..933dfd9d3d065 100644
--- a/pkgs/applications/editors/emacs-modes/org-generated.nix
+++ b/pkgs/applications/editors/emacs-modes/org-generated.nix
@@ -1,10 +1,10 @@
 { callPackage }: {
     org = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
         pname = "org";
-        version = "20171225";
+        version = "20180102";
         src = fetchurl {
-          url = "http://orgmode.org/elpa/org-20171225.tar";
-          sha256 = "1wp1mbp0b8vygrlx0bb79d9zb91kca13nlhrxh59h9w496jj30dy";
+          url = "https://orgmode.org/elpa/org-20180102.tar";
+          sha256 = "1jz92wv637x1kp726kgcc29s4s4rscfhb7rhhnr69ny83r1hlczi";
         };
         packageRequires = [];
         meta = {
@@ -14,10 +14,10 @@
       }) {};
     org-plus-contrib = callPackage ({ elpaBuild, fetchurl, lib }: elpaBuild {
         pname = "org-plus-contrib";
-        version = "20171225";
+        version = "20180102";
         src = fetchurl {
-          url = "http://orgmode.org/elpa/org-plus-contrib-20171225.tar";
-          sha256 = "10d44sqm9sh8gjy7xlnpqhyq35yxdijjm2322khc5bylvq60ianc";
+          url = "https://orgmode.org/elpa/org-plus-contrib-20180102.tar";
+          sha256 = "02ajqc8k44w2gskjazkglmn2v0jsxfns0wq3pgslhb7ychs3yrlv";
         };
         packageRequires = [];
         meta = {
diff --git a/pkgs/applications/gis/grass/default.nix b/pkgs/applications/gis/grass/default.nix
index 3382bb3e56d7d..987b544c55657 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/gis/saga/default.nix b/pkgs/applications/gis/saga/default.nix
index 4d229450a4a72..847421de3b1f4 100644
--- a/pkgs/applications/gis/saga/default.nix
+++ b/pkgs/applications/gis/saga/default.nix
@@ -2,15 +2,15 @@
   libharu, opencv, vigra, postgresql }:
 
 stdenv.mkDerivation rec {
-  name = "saga-5.0.0";
+  name = "saga-6.2.0";
 
   buildInputs = [ gdal wxGTK30 proj libharu opencv vigra postgresql libiodbc lzma jasper ];
 
   enableParallelBuilding = true;
 
   src = fetchurl {
-    url = "mirror://sourceforge/project/saga-gis/SAGA%20-%205/SAGA%20-%205.0.0/saga-5.0.0.tar.gz";
-    sha256 = "9be997209737e80262d9f13fd9b9797194a9f2facb10e5b9bd756d8cda675089";
+    url = "mirror://sourceforge/project/saga-gis/SAGA%20-%206/SAGA%20-%206.2.0/saga-6.2.0.tar.gz";
+    sha256 = "91b030892c894ba02eb4292ebfc9ccbf4acf3062118f2a89a9a11208773fa280";
   };
 
   meta = {
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index c955a61d3696c..9a26dcdaa6a09 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/kde/kmime.nix b/pkgs/applications/kde/kmime.nix
index b18a3f7fdc1e4..4523a69fc1be0 100644
--- a/pkgs/applications/kde/kmime.nix
+++ b/pkgs/applications/kde/kmime.nix
@@ -10,7 +10,7 @@ mkDerivation {
     license = [ lib.licenses.lgpl21 ];
     maintainers = kdepimTeam;
   };
-  nativeBuildInputs = [ extra-cmake-modules ki18n ];
-  buildInputs = [ kcodecs qtbase ];
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcodecs ki18n qtbase ];
   outputs = [ "out" "dev" ];
 }
diff --git a/pkgs/applications/kde/libkcddb.nix b/pkgs/applications/kde/libkcddb.nix
index edd9732d051bc..3fd4860565428 100644
--- a/pkgs/applications/kde/libkcddb.nix
+++ b/pkgs/applications/kde/libkcddb.nix
@@ -8,8 +8,8 @@ mkDerivation {
     license = with licenses; [ gpl2 lgpl21 bsd3 ];
     maintainers = with maintainers; [ peterhoeg ];
   };
-  nativeBuildInputs = [ extra-cmake-modules ];
-  buildInputs = [ qtbase kdoctools ];
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ qtbase ];
   propagatedBuildInputs = [
     kcodecs ki18n kio kwidgetsaddons
     libmusicbrainz5
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index b406f38613d58..14e9375cb7941 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -5,12 +5,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "3.12.0";
+  version = "3.14.0";
   name = "calibre-${version}";
 
   src = fetchurl {
     url = "https://download.calibre-ebook.com/${version}/${name}.tar.xz";
-    sha256 = "0l7r5ny9a36yg22fqzz3as6wh1xqpa3hrlx2gy25yp649sbkd9vq";
+    sha256 = "1367jh82mhjjlvyd30mfz3qwscg60l0gimakvzpbkrah918kfk51";
   };
 
   patches = [
diff --git a/pkgs/applications/misc/deepin-terminal/default.nix b/pkgs/applications/misc/deepin-terminal/default.nix
index e08a2827b83ab..12ceb0958f0d8 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 6d67d3a340f5d..8c63c85657811 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/haxor-news/default.nix b/pkgs/applications/misc/haxor-news/default.nix
index dc771fc2d5e41..c82e5026ff18b 100644
--- a/pkgs/applications/misc/haxor-news/default.nix
+++ b/pkgs/applications/misc/haxor-news/default.nix
@@ -1,15 +1,17 @@
-{ stdenv, fetchurl, pythonPackages }:
+{ stdenv, fetchurl, python }:
 
-pythonPackages.buildPythonApplication rec {
-  version = "0.4.2";
-  name = "haxor-news-${version}";
+with python.pkgs;
 
-  src = fetchurl {
-    url = "https://github.com/donnemartin/haxor-news/archive/${version}.tar.gz";
-    sha256 = "0543k5ys044f2a1q8k36djnnq2h2dffnwbkva9snjjy30nlwwdgs";
+buildPythonApplication rec {
+  pname = "haxor-news";
+  version = "0.4.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5b9af8338a0f8b95a8133b66ef106553823813ac171c0aefa3f3f2dbeb4d7f88";
   };
 
-  propagatedBuildInputs = with pythonPackages; [
+  propagatedBuildInputs = [
     click
     colorama
     requests
@@ -18,6 +20,12 @@ pythonPackages.buildPythonApplication rec {
     six
   ];
 
+  checkInputs = [ mock ];
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover -s tests -v
+  '';
+
   meta = with stdenv.lib; {
     homepage = https://github.com/donnemartin/haxor-news;
     description = "Browse Hacker News like a haxor";
diff --git a/pkgs/applications/misc/kupfer/default.nix b/pkgs/applications/misc/kupfer/default.nix
index f3bb825cbf743..e2290105c9258 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/lxterminal/default.nix b/pkgs/applications/misc/lxterminal/default.nix
index 145672cad380a..a514b0ff63ddc 100644
--- a/pkgs/applications/misc/lxterminal/default.nix
+++ b/pkgs/applications/misc/lxterminal/default.nix
@@ -16,11 +16,13 @@ stdenv.mkDerivation rec {
     "--enable-man"
   ];
 
-  buildInputs = [
-    automake autoconf intltool pkgconfig gtk2 vte libxslt docbook_xml_dtd_412
-    docbook_xml_xslt libxml2 findXMLCatalogs
+  nativeBuildInputs = [
+    automake autoconf intltool pkgconfig
+    libxslt docbook_xml_dtd_412 docbook_xml_xslt libxml2 findXMLCatalogs
   ];
 
+  buildInputs = [ gtk2 vte ];
+
   patches = [
     ./respect-xml-catalog-files-var.patch
   ];
diff --git a/pkgs/applications/misc/pdfpc/default.nix b/pkgs/applications/misc/pdfpc/default.nix
index 8e0fc6137210e..9fc14d0cae717 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 04f38968142a0..13f3fa98d56d6 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/toot/default.nix b/pkgs/applications/misc/toot/default.nix
index d1b1daa26d6fd..be86526191256 100644
--- a/pkgs/applications/misc/toot/default.nix
+++ b/pkgs/applications/misc/toot/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, fetchFromGitHub, pythonPackages }:
+{ stdenv, fetchFromGitHub, python3Packages }:
 
-pythonPackages.buildPythonApplication rec {
-  version = "0.15.0";
+python3Packages.buildPythonApplication rec {
+  version = "0.16.2";
   name    = "toot-${version}";
 
   src = fetchFromGitHub {
     owner  = "ihabunek";
     repo   = "toot";
     rev    = "${version}";
-    sha256 = "08k913gw0ip2q686z9k63bcn1n5s4w6b7jj6jmmamm427xmibkph";
+    sha256 = "19n6rmm44y24zvkpk56vd2xmx49sn6wc5qayi1jm83jlnlbbwfh7";
   };
 
-  checkInputs = with pythonPackages; [ pytest ];
+  checkInputs = with python3Packages; [ pytest ];
 
-  propagatedBuildInputs = with pythonPackages;
+  propagatedBuildInputs = with python3Packages;
     [ requests beautifulsoup4 future ];
 
   checkPhase = ''
diff --git a/pkgs/applications/misc/valauncher/default.nix b/pkgs/applications/misc/valauncher/default.nix
index f780e5469d027..38c4055a10bb8 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/misc/xkbmon/default.nix b/pkgs/applications/misc/xkbmon/default.nix
new file mode 100644
index 0000000000000..38bda9a8f560e
--- /dev/null
+++ b/pkgs/applications/misc/xkbmon/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "xkbmon-${version}";
+  version = "0.1";
+
+  src = fetchFromGitHub {
+    owner = "xkbmon";
+    repo = "xkbmon";
+    rev = version;
+    sha256 = "1smyqsd9cpbzqaplm221a8mq0nham6rg6hjsm9g5gph94xmk6d67";
+  };
+
+  buildInputs = [ libX11 ];
+
+  installPhase = "install -D -t $out/bin xkbmon";
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/xkbmon/xkbmon;
+    description = "Command-line keyboard layout monitor for X11";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix
index 0f6c4ed36d40a..4e68d21be0c11 100644
--- a/pkgs/applications/networking/browsers/lynx/default.nix
+++ b/pkgs/applications/networking/browsers/lynx/default.nix
@@ -22,9 +22,9 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-widec" ] ++ stdenv.lib.optional sslSupport "--with-ssl";
 
-  nativeBuildInputs = stdenv.lib.optional sslSupport pkgconfig
-    ++ stdenv.lib.optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc
-    ++ [ nukeReferences ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ nukeReferences ]
+    ++ stdenv.lib.optional sslSupport pkgconfig;
 
   buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl.dev;
 
diff --git a/pkgs/applications/networking/feedreaders/rssguard/default.nix b/pkgs/applications/networking/feedreaders/rssguard/default.nix
index b25d4e109ebc5..0a89ec6023bec 100644
--- a/pkgs/applications/networking/feedreaders/rssguard/default.nix
+++ b/pkgs/applications/networking/feedreaders/rssguard/default.nix
@@ -1,22 +1,27 @@
-{ stdenv, fetchgit, qmake, qtwebengine, qttools, wrapGAppsHook }:
+{ stdenv, fetchFromGitHub, qmake, qtwebengine, qttools, wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
-  name = "rssguard-${version}";
-  version = "3.4.2";
+  name = "${pname}-${version}";
+  pname = "rssguard";
+  version = "3.5.5";
 
-  src = fetchgit {
-    url = https://github.com/martinrotter/rssguard;
-    rev = "refs/tags/${version}";
-    sha256 = "0iy0fd3qr2dm0pc6xr7sin6cjfxfa0pxhxiwzs55dhsdk9zir62s";
-    # Submodules are required only for Windows (and one of them is a huge binary
-    # package ~400MB). See project wiki for more details.
-    fetchSubmodules = false;
+  src = fetchFromGitHub {
+    owner = "martinrotter";
+    repo = pname;
+    rev = version;
+    sha256 = "0swjh664y1yqr1rn3ym2kicyx7r97ypr4qf7qrjl4a5q1spzsv48";
   };
 
   buildInputs =  [ qtwebengine qttools ];
   nativeBuildInputs = [ qmake wrapGAppsHook ];
   qmakeFlags = [ "CONFIG+=release" ];
 
+  # FIXME: This shouldn't be needed after 3.5.5.
+  # See: https://github.com/martinrotter/rssguard/issues/175
+  preConfigure = ''
+    lrelease rssguard.pro
+  '';
+
   meta = with stdenv.lib; {
     description = "Simple RSS/Atom feed reader with online synchronization";
     longDescription = ''
diff --git a/pkgs/applications/networking/instant-messengers/jackline/default.nix b/pkgs/applications/networking/instant-messengers/jackline/default.nix
index 9f9236244ae2d..32e7c877614a7 100644
--- a/pkgs/applications/networking/instant-messengers/jackline/default.nix
+++ b/pkgs/applications/networking/instant-messengers/jackline/default.nix
@@ -3,20 +3,20 @@
 assert stdenv.lib.versionAtLeast ocamlPackages.ocaml.version "4.02.2";
 
 stdenv.mkDerivation rec {
-  version = "2017-08-17";
+  version = "2017-12-24";
   name = "jackline-${version}";
 
   src = fetchFromGitHub {
     owner  = "hannesm";
     repo   = "jackline";
-    rev    = "26688f07c3edc3b83e7aa0b9136cd1e9dcb58ed5";
-    sha256 = "0yspgjhp7zy9rzvwl4pxppf5wkpa07y0122s7n09kvr0fzsh6aqf";
+    rev    = "8678e8a1a06e641218a31ae25150040202f89289";
+    sha256 = "05z9kvd7gwr59ic7hnmbayhwyyqd41xxz01cvdlcgplk3z7zlwg5";
   };
 
   buildInputs = with ocamlPackages; [
                   ocaml ocamlbuild findlib topkg ppx_sexp_conv
                   erm_xmpp_0_3 tls nocrypto x509 ocaml_lwt otr astring
-                  ptime notty sexplib_p4 hex uutf
+                  ptime notty sexplib hex uutf
                 ];
 
   buildPhase = "${ocamlPackages.topkg.run} build --pinned true";
diff --git a/pkgs/applications/networking/p2p/deluge/default.nix b/pkgs/applications/networking/p2p/deluge/default.nix
index 7f8594b8bbb1c..c6e5d0f3cb31e 100644
--- a/pkgs/applications/networking/p2p/deluge/default.nix
+++ b/pkgs/applications/networking/p2p/deluge/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, libtorrentRasterbar_1_0, pythonPackages }:
+{ stdenv, fetchurl, intltool, libtorrentRasterbar, pythonPackages }:
 pythonPackages.buildPythonPackage rec {
   name = "deluge-${version}";
   version = "1.3.15";
@@ -9,7 +9,7 @@ pythonPackages.buildPythonPackage rec {
   };
 
   propagatedBuildInputs = with pythonPackages; [
-    pyGtkGlade libtorrentRasterbar_1_0 twisted Mako chardet pyxdg pyopenssl service-identity
+    pyGtkGlade libtorrentRasterbar twisted Mako chardet pyxdg pyopenssl service-identity
   ];
 
   nativeBuildInputs = [ intltool ];
diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix
index 1cf6db21bedb0..a2b72ea99dc0c 100644
--- a/pkgs/applications/networking/p2p/qbittorrent/default.nix
+++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix
@@ -10,11 +10,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "qbittorrent-${version}";
-  version = "4.0.1";
+  version = "4.0.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/qbittorrent/${name}.tar.xz";
-    sha256 = "0khy875ahh9rlk8lyfpwsbxjsbp7i1cwqvd1j1s4cqc812szh3z3";
+    sha256 = "1lkbrvpzdfbqwilj09a9vraai7pz6dh999w4vl51mj1adm7bh0ws";
   };
 
   nativeBuildInputs = [ pkgconfig which ];
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 2ed87c71a9060..5fe818a506bf8 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -12,7 +12,7 @@ assert withQt  -> !withGtk && qt5  != null;
 with stdenv.lib;
 
 let
-  version = "2.4.2";
+  version = "2.4.3";
   variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
 
 in stdenv.mkDerivation {
@@ -20,7 +20,7 @@ in stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.wireshark.org/download/src/all-versions/wireshark-${version}.tar.xz";
-    sha256 = "0zglapd3sz08p2z9x8a5va3jnz17b3n5a1bskf7f2dgx6m3v5b6i";
+    sha256 = "0bpiby916k3k8bm7q8b1dflva6zs0a4ircskrck0d538dfcrb50q";
   };
 
   cmakeFlags = optional withGtk "-DBUILD_wireshark_gtk=TRUE";
diff --git a/pkgs/applications/office/kexi/default.nix b/pkgs/applications/office/kexi/default.nix
index 66aee6bd96280..8463703c01791 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/office/skrooge/default.nix b/pkgs/applications/office/skrooge/default.nix
index f88cc1470981c..1aaf05a123e12 100644
--- a/pkgs/applications/office/skrooge/default.nix
+++ b/pkgs/applications/office/skrooge/default.nix
@@ -14,9 +14,12 @@ mkDerivation rec {
     sha256 = "1dbvdrkdpgv39v8h7k3mri0nzlslfyd5kk410czj0jdn4qq400md";
   };
 
-  nativeBuildInputs = [ cmake extra-cmake-modules shared_mime_info ];
+  nativeBuildInputs = [
+    cmake extra-cmake-modules kdoctools shared_mime_info
+  ];
 
-  buildInputs = [ qtwebkit qtscript grantlee kxmlgui kwallet kparts kdoctools
+  buildInputs = [
+    qtwebkit qtscript grantlee kxmlgui kwallet kparts
     kjobwidgets kdesignerplugin kiconthemes knewstuff sqlcipher qca-qt5
     kactivities karchive kguiaddons knotifyconfig krunner kwindowsystem libofx
   ];
diff --git a/pkgs/applications/office/watson/default.nix b/pkgs/applications/office/watson/default.nix
index a1fcfd5de700d..e0f0c58b45063 100644
--- a/pkgs/applications/office/watson/default.nix
+++ b/pkgs/applications/office/watson/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, pythonPackages }:
+{ stdenv, pythonPackages, fetchpatch }:
 
-pythonPackages.buildPythonApplication rec {
+with pythonPackages;
+
+buildPythonApplication rec {
   pname = "td-watson";
-  name = "${pname}-${version}";
-  version = "1.4.0";
+  version = "1.5.2";
 
-  src = pythonPackages.fetchPypi {
+  src = fetchPypi {
     inherit version pname;
-    sha256 = "1py0g4990jmvq0dn7jasda7f10kzr41bix46hnbyc1rshjzc17hq";
+    sha256 = "6e03d44a9278807fe5245e9ed0943f13ffb88e11249a02655c84cb86260b27c8";
   };
 
   # uses tox, test invocation fails
@@ -15,8 +16,16 @@ pythonPackages.buildPythonApplication rec {
   checkPhase = ''
     py.test -vs tests
  '';
-  checkInputs = with pythonPackages; [ py pytest pytest-datafiles mock pytest-mock pytestrunner ];
-  propagatedBuildInputs = with pythonPackages; [ requests click arrow ];
+
+  patches = [
+    (fetchpatch {
+      url = https://github.com/TailorDev/Watson/commit/f5760c71cbc22de4e12ede8f6f7257515a9064d3.patch;
+      sha256 = "0s9h26915ilpbd0qhmvk77r3gmrsdrl5l7dqxj0l5q66fp0z6b0g";
+    })
+  ];
+
+  checkInputs = [ py pytest pytest-datafiles mock pytest-mock pytestrunner ];
+  propagatedBuildInputs = [ requests click arrow ];
 
   meta = with stdenv.lib; {
     homepage = https://tailordev.github.io/Watson/;
@@ -24,4 +33,4 @@ pythonPackages.buildPythonApplication rec {
     license = licenses.mit;
     maintainers = with maintainers; [ mguentner ] ;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/applications/science/logic/coq/8.4.nix b/pkgs/applications/science/logic/coq/8.4.nix
index 1f7ef571eaf90..64b0f85aed2ad 100644
--- a/pkgs/applications/science/logic/coq/8.4.nix
+++ b/pkgs/applications/science/logic/coq/8.4.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation {
       fi
     }
 
-    envHooks=(''${envHooks[@]} addCoqPath)
+    addEnvHooks "$targetOffset" addCoqPath
   '';
 
   passthru = {
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index 4c67904b2b195..9ed535cfe639d 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -110,7 +110,7 @@ self = stdenv.mkDerivation {
       fi
     }
 
-    envHooks=(''${envHooks[@]} addCoqPath)
+    addEnvHooks "$targetOffset" addCoqPath
   '';
 
   preConfigure = ''
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
index be25738a6076a..532df11209b80 100644
--- a/pkgs/applications/science/logic/z3/default.nix
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -4,13 +4,13 @@ let
   python = python2;
 in stdenv.mkDerivation rec {
   name = "z3-${version}";
-  version = "4.5.0-2017-11-06";
+  version = "4.6.0";
 
   src = fetchFromGitHub {
     owner  = "Z3Prover";
     repo   = "z3";
-    rev    = "3350f32e1f2c01c9df63b7d71899796a18ce2272";
-    sha256 = "00jn0njn5h9v49pl67yxj6225m6334ndrx6mp37vcqac05pdbpw7";
+    rev    = "b0aaa4c6d7a739eb5e8e56a73e0486df46483222";
+    sha256 = "1cgwlmjdbf4rsv2rriqi2sdpz9qxihxrcpm6a4s37ijy437xg78l";
   };
 
   buildInputs = [ python fixDarwinDylibNames ];
diff --git a/pkgs/applications/science/math/R/setup-hook.sh b/pkgs/applications/science/math/R/setup-hook.sh
index 09a775db9bf5b..6951e2a4b61bd 100644
--- a/pkgs/applications/science/math/R/setup-hook.sh
+++ b/pkgs/applications/science/math/R/setup-hook.sh
@@ -1,5 +1,7 @@
 addRLibPath () {
-    addToSearchPath R_LIBS_SITE $1/library
+    if [[ -d "$1/library" ]]; then
+        addToSearchPath R_LIBS_SITE "$1/library"
+    fi
 }
 
-envHooks+=(addRLibPath)
+addEnvHooks "$targetOffset" addRLibPath
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index 3e4c8c7028695..67dcfd8dc1de4 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/gnome-mplayer/default.nix b/pkgs/applications/video/gnome-mplayer/default.nix
index ba72e085bf7c4..9f98d46d53bdd 100644
--- a/pkgs/applications/video/gnome-mplayer/default.nix
+++ b/pkgs/applications/video/gnome-mplayer/default.nix
@@ -1,20 +1,33 @@
-{stdenv, fetchurl, pkgconfig, glib, gtk2, dbus, dbus_glib, GConf}:
+{stdenv, substituteAll, fetchFromGitHub, pkgconfig, gettext, glib, gtk3, gmtk, dbus, dbus_glib
+, libnotify, libpulseaudio, mplayer, wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
-  name = "gnome-mplayer-1.0.4";
+  name = "gnome-mplayer-${version}";
+  version = "1.0.9";
 
-  src = fetchurl {
-    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/gnome-mplayer/${name}.tar.gz";
-    sha256 = "1k5yplsvddcm7xza5h4nfb6vibzjcqsk8gzis890alizk07f5xp2";
+  src = fetchFromGitHub {
+    owner = "kdekorte";
+    repo = "gnome-mplayer";
+    rev = "v${version}";
+    sha256 = "0qvy9fllvg1mad6y1j79iaqa6khs0q2cb0z62yfg4srbr07fi8xr";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ glib gtk2 dbus dbus_glib GConf];
+  nativeBuildInputs = [ pkgconfig gettext wrapGAppsHook ];
+  buildInputs = [ glib gtk3 gmtk dbus dbus_glib libnotify libpulseaudio ];
 
-  hardeningDisable = [ "format" ];
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      mencoder = "${mplayer}/bin/mencoder";
+      mplayer = "${mplayer}/bin/mplayer";
+    })
+  ];
 
-  meta = {
-    homepage = http://kdekorte.googlepages.com/gnomemplayer;
+  meta = with stdenv.lib; {
     description = "Gnome MPlayer, a simple GUI for MPlayer";
+    homepage = https://sites.google.com/site/kdekorte2/gnomemplayer;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/video/gnome-mplayer/fix-paths.patch b/pkgs/applications/video/gnome-mplayer/fix-paths.patch
new file mode 100644
index 0000000000000..ede4991c4662c
--- /dev/null
+++ b/pkgs/applications/video/gnome-mplayer/fix-paths.patch
@@ -0,0 +1,87 @@
+--- a/src/gui.c
++++ b/src/gui.c
+@@ -7470,7 +7470,7 @@
+         filename = g_strdup_printf("%s/00000001.jpg", dirname);
+         g_free(basepath);
+         // run mplayer and try to get the first frame and convert it to a jpeg
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+         av[ac++] = g_strdup_printf("-vo");
+         av[ac++] = g_strdup_printf("jpeg:outdir=%s", dirname);
+         av[ac++] = g_strdup_printf("-ao");
+--- a/src/property_page_common.c
++++ b/src/property_page_common.c
+@@ -80,7 +80,7 @@
+     MetaData *ret;
+     ret = g_new0(MetaData, 1);
+ 
+-    av[ac++] = g_strdup_printf("mplayer");
++    av[ac++] = g_strdup_printf("@mplayer@");
+     av[ac++] = g_strdup_printf("-vo");
+     av[ac++] = g_strdup_printf("null");
+     av[ac++] = g_strdup_printf("-ao");
+--- a/src/support.c
++++ b/src/support.c
+@@ -566,7 +566,7 @@
+     } else {
+         playlist = FALSE;
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -728,7 +728,7 @@
+         playlist = FALSE;
+         // run mplayer and try to get the first frame and convert it to a jpeg
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -825,7 +825,7 @@
+         playlist = FALSE;
+ 
+         if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-            av[ac++] = g_strdup_printf("mplayer");
++            av[ac++] = g_strdup_printf("@mplayer@");
+         } else {
+             av[ac++] = g_strdup_printf("%s", mplayer_bin);
+         }
+@@ -1251,7 +1251,7 @@
+     gm_log(verbose, G_LOG_LEVEL_INFO, "getting file metadata for %s", name);
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
+@@ -1532,7 +1532,7 @@
+         return 0;
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
+@@ -1597,7 +1597,7 @@
+ 
+     if (control_id == 0) {
+         ac = 0;
+-        av[ac++] = g_strdup_printf("mencoder");
++        av[ac++] = g_strdup_printf("@mencoder@");
+         av[ac++] = g_strdup_printf("-ovc");
+         av[ac++] = g_strdup_printf("copy");
+         av[ac++] = g_strdup_printf("-oac");
+@@ -2830,7 +2830,7 @@
+     gboolean ret = TRUE;
+ 
+     if (mplayer_bin == NULL || !g_file_test(mplayer_bin, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", mplayer_bin);
+     }
diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix
index 125a6d492a32b..28577a429bd20 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/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 24c5b4335c46c..fe6090c3230e9 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -102,7 +102,8 @@ stdenv.mkDerivation rec {
     rm -rf ffmpeg
   '';
 
-  nativeBuildInputs = [ buildPackages.stdenv.cc pkgconfig yasm ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ pkgconfig yasm ];
   buildInputs = with stdenv.lib;
     [ freetype ffmpeg ]
     ++ optional aalibSupport aalib
diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix
index 09e7de898d5a6..c4c0adbb9bf9e 100644
--- a/pkgs/applications/virtualization/docker/default.nix
+++ b/pkgs/applications/virtualization/docker/default.nix
@@ -105,6 +105,7 @@ rec {
       cd ./components/engine
       export AUTO_GOPATH=1
       export DOCKER_GITCOMMIT="${rev}"
+      export VERSION="${version}"
       ./hack/make.sh dynbinary
       cd -
     '') + ''
@@ -136,11 +137,7 @@ rec {
     extraPath = optionals (stdenv.isLinux) (makeBinPath [ iproute iptables e2fsprogs xz xfsprogs procps utillinux ]);
 
     installPhase = optionalString (stdenv.isLinux) ''
-      if [ -d "./components/engine/bundles/${version}" ]; then
-        install -Dm755 ./components/engine/bundles/${version}/dynbinary-daemon/dockerd-${version} $out/libexec/docker/dockerd
-      else
-        install -Dm755 ./components/engine/bundles/dynbinary-daemon/dockerd-${version} $out/libexec/docker/dockerd
-      fi
+      install -Dm755 ./components/engine/bundles/dynbinary-daemon/dockerd $out/libexec/docker/dockerd
 
       makeWrapper $out/libexec/docker/dockerd $out/bin/dockerd \
         --prefix PATH : "$out/libexec/docker:$extraPath"
@@ -207,26 +204,14 @@ rec {
   # Get revisions from
   # https://github.com/docker/docker-ce/blob/v${version}/components/engine/hack/dockerfile/binaries-commits
 
-  docker_17_09 = dockerGen rec {
-    version = "17.09.1-ce";
-    rev = "19e2cf6259bd7f027a3fff180876a22945ce4ba8"; # git commit
-    sha256 = "10glpbaw7bg2acgf1nmfn79is2b3xsm4shz67rp72dmpzzaavb42";
-    runcRev = "3f2f8b84a77f73d38244dd690525642a72156c64";
-    runcSha256 = "0vaagmav8443kmyxac2y1y5l2ipcs1c7gdmsnvj48y9bafqx72rq";
-    containerdRev = "06b9cb35161009dcb7123345749fef02f7cea8e0";
-    containerdSha256 = "10hms8a2nn69nfnwly6923jzx40c3slpsdhjhff4bxh36flpf9gd";
-    tiniRev = "949e6facb77383876aeff8a6944dde66b3089574";
-    tiniSha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw";
-  };
-
-  docker_17_11 = dockerGen rec {
-    version = "17.11.0-ce";
-    rev = "1caf76ce6baa889133ece59fab3c36aaf143d4ef"; # git commit
-    sha256 = "09s7lxcs4wdjj69l7z3nybbms7iqspk1wy7qnr4r52s8vr3fd5s4";
-    runcRev = "0351df1c5a66838d0c392b4ac4cf9450de844e2d";
-    runcSha256 = "1cmkdv6rli7v0y0fddqxvrvzd486fg9ssp3kgkya3szkljzz4xj0";
-    containerdRev = "992280e8e265f491f7a624ab82f3e238be086e49";
-    containerdSha256 = "1ci6jlgrrgz4ph451035sl98lj2jd467pd4qnv85ma9gzblrxs7n";
+  docker_17_12 = dockerGen rec {
+    version = "17.12.0-ce";
+    rev = "486a48d2701493bb65385788a291e36febb44ec1"; # git commit
+    sha256 = "14kp7wrzf3s9crk8px1dc575lchyrcl2dqiwr3sgxb9mzjfiyqps";
+    runcRev = "b2567b37d7b75eb4cf325b77297b140ea686ce8f";
+    runcSha256 = "0zarsrbfcm1yp6mdl6rcrigdf7nb70xmv2cbggndz0qqyrw0mk0l";
+    containerdRev = "89623f28b87a6004d4b785663257362d1658a729";
+    containerdSha256 = "0irx7ps6rhq7z69cr3gspxdr7ywrv6dz62gkr1z2723cki9hsxma";
     tiniRev = "949e6facb77383876aeff8a6944dde66b3089574";
     tiniSha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw";
   };
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index 4043c05e3d6d2..ca596cdfddc1f 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -49,8 +49,8 @@ with luaPackages; stdenv.mkDerivation rec {
   postInstall = ''
     wrapProgram $out/bin/awesome \
       --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
-      --prefix LUA_CPATH ";" '${lgi}/lib/lua/${lua.luaversion}/?.so' \
-      --prefix LUA_PATH ";" '${lgi}/share/lua/${lua.luaversion}/?.lua' \
+      --add-flags '--search ${lgi}/lib/lua/${lua.luaversion}' \
+      --add-flags '--search ${lgi}/share/lua/${lua.luaversion}' \
       --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
       --prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \
       --prefix PATH : "${stdenv.lib.makeBinPath [ compton unclutter procps iproute coreutils curl alsaUtils findutils xterm ]}"
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix
index 0dcae204824d5..bb0e6b82aa5d3 100644
--- a/pkgs/build-support/bintools-wrapper/default.nix
+++ b/pkgs/build-support/bintools-wrapper/default.nix
@@ -164,7 +164,21 @@ stdenv.mkDerivation {
       set +u
     '';
 
-  propagatedBuildInputs = extraPackages;
+  emulation = let
+    fmt =
+      /**/ if targetPlatform.isDarwin  then "mach-o"
+      else if targetPlatform.isWindows then "pe"
+      else "elf" + toString targetPlatform.parsed.cpu.bits;
+    endianPrefix = if targetPlatform.isBigEndian then "big" else "little";
+    arch =
+      /**/ if targetPlatform.isAarch64 then endianPrefix + "aarch64"
+      else if targetPlatform.isArm     then endianPrefix + "arm"
+      else if targetPlatform.isx86_64  then "x86-64"
+      else if targetPlatform.isi686    then "i386"
+      else throw "unknown emulation for platform: " + targetPlatform.config;
+    in targetPlatform.platform.bfdEmulation or (fmt + "-" + arch);
+
+  depsTargetTargetPropagated = extraPackages;
 
   setupHook = ./setup-hook.sh;
 
diff --git a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh
index 136621d27af55..991ed0fe263c1 100644
--- a/pkgs/build-support/bintools-wrapper/ld-wrapper.sh
+++ b/pkgs/build-support/bintools-wrapper/ld-wrapper.sh
@@ -67,6 +67,11 @@ fi
 
 extraAfter+=($NIX_@infixSalt@_LDFLAGS_AFTER)
 
+# Specify the target emulation if nothing is passed in ("-m" overrides this
+# environment variable). Ensures we never blindly fallback on targeting the host
+# platform.
+: ${LDEMULATION:=@emulation@}
+
 # Three tasks:
 #
 #   1. Find all -L... switches for rpath
diff --git a/pkgs/build-support/bintools-wrapper/setup-hook.sh b/pkgs/build-support/bintools-wrapper/setup-hook.sh
index 43f79ec59200f..48a00b0b9b074 100644
--- a/pkgs/build-support/bintools-wrapper/setup-hook.sh
+++ b/pkgs/build-support/bintools-wrapper/setup-hook.sh
@@ -2,12 +2,20 @@
 #
 # See comments in cc-wrapper's setup hook. This works exactly the same way.
 
+set -u
+
+# Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a
+# native compile.
+#
+# TODO(@Ericson2314): No native exception
+[[ -z ${crossConfig-} ]] || (( "$hostOffset" < 0 )) || return 0
+
 bintoolsWrapper_addLDVars () {
-    case $depOffset in
+    case $depHostOffset in
         -1) local role='BUILD_' ;;
         0)  local role='' ;;
         1)  local role='TARGET_' ;;
-        *)  echo "bintools-wrapper: Error: Cannot be used with $depOffset-offset deps, " >2;
+        *)  echo "bintools-wrapper: Error: Cannot be used with $depHostOffset-offset deps" >2;
             return 1 ;;
     esac
 
@@ -20,17 +28,29 @@ bintoolsWrapper_addLDVars () {
     fi
 }
 
-if [ -n "${crossConfig:-}" ]; then
-    export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_BUILD=1
-    role_pre='BUILD_'
-    role_post='_FOR_BUILD'
-else
-    export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_HOST=1
-    role_pre=""
-    role_post=''
-fi
+case $targetOffset in
+    -1)
+        export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_BUILD=1
+        role_pre='BUILD_'
+        role_post='_FOR_BUILD'
+        ;;
+    0)
+        export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_HOST=1
+        role_pre=''
+        role_post=''
+        ;;
+    1)
+        export NIX_BINTOOLS_WRAPPER_@infixSalt@_TARGET_TARGET=1
+        role_pre='TARGET_'
+        role_post='_FOR_TARGET'
+        ;;
+    *)
+        echo "cc-wrapper: used as improper sort of dependency" >2;
+        return 1
+        ;;
+esac
 
-envHooks+=(bintoolsWrapper_addLDVars)
+addEnvHooks "$targetOffset" bintoolsWrapper_addLDVars
 
 # shellcheck disable=SC2157
 if [ -n "@bintools_bin@" ]; then
@@ -65,3 +85,4 @@ done
 
 # No local scope in sourced file
 unset -v role_pre role_post cmd upper_case
+set +u
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index 73d6fb3e368b5..8de2366ff5f57 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -201,7 +201,8 @@ stdenv.mkDerivation {
       ln -s $ccPath/${targetPrefix}ghdl $out/bin/${targetPrefix}ghdl
     '';
 
-  propagatedBuildInputs = [ bintools ] ++ extraPackages;
+  propagatedBuildInputs = [ bintools ];
+  depsTargetTargetPropagated = extraPackages;
 
   setupHook = ./setup-hook.sh;
 
diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh
index a922193ad2e7d..29a7306b9b7e9 100644
--- a/pkgs/build-support/cc-wrapper/setup-hook.sh
+++ b/pkgs/build-support/cc-wrapper/setup-hook.sh
@@ -54,19 +54,26 @@
 # For more details, read the individual files where the mechanisms used to
 # accomplish this will be individually documented.
 
+set -u
+
+# Skip setup hook if we're neither a build-time dep, nor, temporarily, doing a
+# native compile.
+#
+# TODO(@Ericson2314): No native exception
+[[ -z ${crossConfig-} ]] || (( "$hostOffset" < 0 )) || return 0
 
 # It's fine that any other cc-wrapper will redefine this. Bash functions close
 # over no state, and there's no @-substitutions within, so any redefined
 # function is guaranteed to be exactly the same.
 ccWrapper_addCVars () {
-    # The `depOffset` describes how the platforms of the dependencies are slid
-    # relative to the depending package. It is brought into scope of the
-    # environment hook defined as the role of the dependency being applied.
-    case $depOffset in
+    # The `depHostOffset` describes how the host platform of the dependencies
+    # are slid relative to the depending package. It is brought into scope of
+    # the environment hook defined as the role of the dependency being applied.
+    case $depHostOffset in
         -1) local role='BUILD_' ;;
         0)  local role='' ;;
         1)  local role='TARGET_' ;;
-        *)  echo "cc-wrapper: Error: Cannot be used with $depOffset-offset deps, " >2;
+        *)  echo "cc-wrapper: Error: Cannot be used with $depHostOffset-offset deps" >2;
             return 1 ;;
     esac
 
@@ -87,20 +94,31 @@ ccWrapper_addCVars () {
 #
 # We also need to worry about what role is being added on *this* invocation of
 # setup-hook, which `role` tracks.
-if [ -n "${crossConfig:-}" ]; then
-    export NIX_CC_WRAPPER_@infixSalt@_TARGET_BUILD=1
-    role_pre='BUILD_'
-    role_post='_FOR_BUILD'
-else
-    export NIX_CC_WRAPPER_@infixSalt@_TARGET_HOST=1
-    role_pre=''
-    role_post=''
-fi
+case $targetOffset in
+    -1)
+        export NIX_CC_WRAPPER_@infixSalt@_TARGET_BUILD=1
+        role_pre='BUILD_'
+        role_post='_FOR_BUILD'
+        ;;
+    0)
+        export NIX_CC_WRAPPER_@infixSalt@_TARGET_HOST=1
+        role_pre=''
+        role_post=''
+        ;;
+    1)
+        export NIX_CC_WRAPPER_@infixSalt@_TARGET_TARGET=1
+        role_pre='TARGET_'
+        role_post='_FOR_TARGET'
+        ;;
+    *)
+        echo "cc-wrapper: used as improper sort of dependency" >2;
+        return 1
+        ;;
+esac
 
-# Eventually the exact sort of env-hook we create will depend on the role. This
-# is because based on what relative platform we are targeting, we use different
-# dependencies.
-envHooks+=(ccWrapper_addCVars)
+# We use the `targetOffset` to choose the right env hook to accumulate the right
+# sort of deps (those with that offset).
+addEnvHooks "$targetOffset" ccWrapper_addCVars
 
 # Note 1: these come *after* $out in the PATH (see setup.sh).
 # Note 2: phase separation makes this look useless to shellcheck.
@@ -131,3 +149,4 @@ export CXX${role_post}=@named_cxx@
 
 # No local scope in sourced file
 unset -v role_pre role_post
+set +u
diff --git a/pkgs/build-support/emacs/setup-hook.sh b/pkgs/build-support/emacs/setup-hook.sh
index defef45b55f5e..e1db3e828fd7b 100644
--- a/pkgs/build-support/emacs/setup-hook.sh
+++ b/pkgs/build-support/emacs/setup-hook.sh
@@ -4,4 +4,8 @@ addEmacsVars () {
   fi
 }
 
-envHooks+=(addEmacsVars)
+# If this is for a wrapper derivation, emacs and the dependencies are all
+# run-time dependencies. If this is for precompiling packages into bytecode,
+# emacs is a compile-time dependency of the package.
+addEnvHooks "$targetOffset" addEmacsVars
+addEnvHooks "$targetOffset" addEmacsVars
diff --git a/pkgs/build-support/emacs/wrapper.nix b/pkgs/build-support/emacs/wrapper.nix
index bd733f1b9bafc..27633c912b234 100644
--- a/pkgs/build-support/emacs/wrapper.nix
+++ b/pkgs/build-support/emacs/wrapper.nix
@@ -55,12 +55,46 @@ stdenv.mkDerivation {
   deps = runCommand "emacs-packages-deps"
    { inherit explicitRequires lndir emacs; }
    ''
+     findInputsOld() {
+         local pkg="$1"; shift
+         local var="$1"; shift
+         local propagatedBuildInputsFiles=("$@")
+
+         # TODO(@Ericson2314): Restore using associative array once Darwin
+         # nix-shell doesn't use impure bash. This should replace the O(n)
+         # case with an O(1) hash map lookup, assuming bash is implemented
+         # well :D.
+         local varSlice="$var[*]"
+         # ''${..-} to hack around old bash empty array problem
+         case "''${!varSlice-}" in
+             *" $pkg "*) return 0 ;;
+         esac
+         unset -v varSlice
+
+         eval "$var"'+=("$pkg")'
+
+         if ! [ -e "$pkg" ]; then
+             echo "build input $pkg does not exist" >&2
+             exit 1
+         fi
+
+         local file
+         for file in "''${propagatedBuildInputsFiles[@]}"; do
+             file="$pkg/nix-support/$file"
+             [[ -f "$file" ]] || continue
+
+             local pkgNext
+             for pkgNext in $(< "$file"); do
+                 findInputsOld "$pkgNext" "$var" "''${propagatedBuildInputsFiles[@]}"
+             done
+         done
+     }
      mkdir -p $out/bin
      mkdir -p $out/share/emacs/site-lisp
 
      local requires
      for pkg in $explicitRequires; do
-       findInputs $pkg requires propagated-user-env-packages
+       findInputsOld $pkg requires propagated-user-env-packages
      done
      # requires now holds all requested packages and their transitive dependencies
 
diff --git a/pkgs/build-support/gcc-wrapper-old/setup-hook.sh b/pkgs/build-support/gcc-wrapper-old/setup-hook.sh
index d8bdf858ae58c..ad3ffeffbbbcb 100644
--- a/pkgs/build-support/gcc-wrapper-old/setup-hook.sh
+++ b/pkgs/build-support/gcc-wrapper-old/setup-hook.sh
@@ -1,4 +1,4 @@
-addCVars () {
+gccWrapperOld_addCVars () {
     if test -d $1/include; then
         export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -isystem $1/include"
     fi
@@ -12,7 +12,7 @@ addCVars () {
     fi
 }
 
-envHooks=(${envHooks[@]} addCVars)
+envBuildBuildHooks+=(gccWrapperOld_addCVars)
 
 # Note: these come *after* $out in the PATH (see setup.sh).
 
diff --git a/pkgs/build-support/setup-hooks/find-xml-catalogs.sh b/pkgs/build-support/setup-hooks/find-xml-catalogs.sh
index b742d5a8ffd9c..85364a61f612c 100644
--- a/pkgs/build-support/setup-hooks/find-xml-catalogs.sh
+++ b/pkgs/build-support/setup-hooks/find-xml-catalogs.sh
@@ -18,5 +18,5 @@ if [ -z "$libxmlHookDone" ]; then
     # xmllint and xsltproc from looking in /etc/xml/catalog.
     export XML_CATALOG_FILES
     if [ -z "$XML_CATALOG_FILES" ]; then XML_CATALOG_FILES=" "; fi
-    envHooks+=(addXMLCatalogs)
+    addEnvHooks "$hostOffset" addXMLCatalogs
 fi
diff --git a/pkgs/build-support/setup-hooks/set-java-classpath.sh b/pkgs/build-support/setup-hooks/set-java-classpath.sh
index 047da91bc97c6..5d3548dc2e886 100644
--- a/pkgs/build-support/setup-hooks/set-java-classpath.sh
+++ b/pkgs/build-support/setup-hooks/set-java-classpath.sh
@@ -10,4 +10,4 @@ addPkgToClassPath () {
     done
 }
 
-envHooks+=(addPkgToClassPath)
+addEnvHooks "$targetOffset" addPkgToClassPath
diff --git a/pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh b/pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh
index 2fd2a2d6da6fb..96bf48cf123ab 100644
--- a/pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh
+++ b/pkgs/build-support/setup-hooks/setup-debug-info-dirs.sh
@@ -2,4 +2,4 @@ setupDebugInfoDirs () {
     addToSearchPath NIX_DEBUG_INFO_DIRS $1/lib/debug
 }
 
-envHooks+=(setupDebugInfoDirs)
+addEnvHooks "$targetOffset" setupDebugInfoDirs
diff --git a/pkgs/build-support/setup-hooks/strip.sh b/pkgs/build-support/setup-hooks/strip.sh
index a33968ca18dea..fc4c7bfbaf957 100644
--- a/pkgs/build-support/setup-hooks/strip.sh
+++ b/pkgs/build-support/setup-hooks/strip.sh
@@ -3,24 +3,45 @@
 fixupOutputHooks+=(_doStrip)
 
 _doStrip() {
-    if [ -z "$dontStrip" ]; then
+    # We don't bother to strip build platform code because it shouldn't make it
+    # to $out anyways---if it does, that's a bigger problem that a lack of
+    # stripping will help catch.
+    local -ra flags=(dontStripHost dontStripTarget)
+    local -ra stripCmds=(STRIP TARGET_STRIP)
+
+    # Optimization
+    if [[ "$STRIP" == "$TARGET_STRIP" ]]; then
+        dontStripTarget+=1
+    fi
+
+    local i
+    for i in ${!stripCmds[@]}; do
+        local -n flag="${flags[$i]}"
+        local -n stripCmd="${stripCmds[$i]}"
+
+        # `dontStrip` disables them all
+        if [[ "$dontStrip" || "$flag" ]] || ! type -f "$stripCmd" 2>/dev/null
+        then continue; fi
+
         stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin}
         if [ -n "$stripDebugList" ]; then
-            stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
+            stripDirs "$stripCmd" "$stripDebugList" "${stripDebugFlags:--S}"
         fi
 
         stripAllList=${stripAllList:-}
         if [ -n "$stripAllList" ]; then
-            stripDirs "$stripAllList" "${stripAllFlags:--s}"
+            stripDirs "$stripCmd" "$stripAllList" "${stripAllFlags:--s}"
         fi
-    fi
+    done
 }
 
 stripDirs() {
-    local dirs="$1"
-    local stripFlags="$2"
+    local cmd="$1"
+    local dirs="$2"
+    local stripFlags="$3"
     local dirsNew=
 
+    local d
     for d in ${dirs}; do
         if [ -d "$prefix/$d" ]; then
             dirsNew="${dirsNew} $prefix/$d "
@@ -29,8 +50,8 @@ stripDirs() {
     dirs=${dirsNew}
 
     if [ -n "${dirs}" ]; then
-        header "stripping (with flags $stripFlags) in$dirs"
-        find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $STRIP $commonStripFlags $stripFlags 2>/dev/null || true
+        header "stripping (with command $cmd and flags $stripFlags) in$dirs"
+        find $dirs -type f -print0 | xargs -0 ${xargsFlags:--r} $cmd $commonStripFlags $stripFlags 2>/dev/null || true
         stopNest
     fi
 }
diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
index 79b8d5b73fa12..25ac12996cc10 100644
--- a/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
+++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
@@ -6,7 +6,7 @@ find_gio_modules() {
     fi
 }
 
-envHooks+=(find_gio_modules)
+addEnvHooks "$targetOffset" find_gio_modules
 
 # Note: $gappsWrapperArgs still gets defined even if $dontWrapGApps is set.
 wrapGAppsHook() {
diff --git a/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
index 05ab9b3d65df1..29306cb316af1 100644
--- a/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
+++ b/pkgs/data/icons/hicolor-icon-theme/setup-hook.sh
@@ -8,7 +8,8 @@ hicolorIconThemeHook() {
 	
 }
 
-envHooks+=(hicolorIconThemeHook)
+# I think this is meant to be a runtime dep
+addEnvHooks "$hostOffset" hicolorIconThemeHook
 
 # Remove icon cache
 hicolorPreFixupPhase() {
diff --git a/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix b/pkgs/desktops/gnome-3/apps/gnome-characters/default.nix
index 15f1f58b558cf..a354c4f6316ef 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 49ad25a8c5e72..ae0abfd715024 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/gconf/default.nix b/pkgs/desktops/gnome-3/core/gconf/default.nix
index 1729ec0662331..99883c8a3f678 100644
--- a/pkgs/desktops/gnome-3/core/gconf/default.nix
+++ b/pkgs/desktops/gnome-3/core/gconf/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, dbus_glib, gnome3 ? null, glib, libxml2
-, intltool, polkit, orbit, withGtk ? false }:
+, intltool, polkit, orbit, python, withGtk ? false }:
 
 assert withGtk -> (gnome3 != null);
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     sha256 = "0k3q9nh53yhc9qxf1zaicz4sk8p3kzq4ndjdsgpaa2db0ccbj4hr";
   };
 
-  buildInputs = [ libxml2 polkit orbit ] ++ stdenv.lib.optional withGtk gnome3.gtk;
+  buildInputs = [ libxml2 polkit orbit python ] ++ stdenv.lib.optional withGtk gnome3.gtk;
   propagatedBuildInputs = [ glib dbus_glib  ];
   nativeBuildInputs = [ pkgconfig intltool ];
 
diff --git a/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix b/pkgs/desktops/gnome-3/core/gnome-bluetooth/default.nix
index 9eaad021d320c..3dbb4e32654f3 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/grilo/setup-hook.sh b/pkgs/desktops/gnome-3/core/grilo/setup-hook.sh
index 3291e38addb81..9337c520a2075 100644
--- a/pkgs/desktops/gnome-3/core/grilo/setup-hook.sh
+++ b/pkgs/desktops/gnome-3/core/grilo/setup-hook.sh
@@ -4,4 +4,4 @@ make_grilo_find_plugins() {
     fi
 }
 
-envHooks+=(make_grilo_find_plugins)
+addEnvHooks "$hostOffset" make_grilo_find_plugins
diff --git a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
index e3b92a4aeaccc..45001e5512735 100644
--- a/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
+++ b/pkgs/desktops/gnome-3/core/gtksourceview/default.nix
@@ -1,7 +1,9 @@
 { 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 {
+let
+  checkInputs = [ xvfb_run dbus ];
+in stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
 
   propagatedBuildInputs = [
@@ -13,10 +15,10 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig intltool gettext perl ]
-    ++ checkInputs;
+  nativeBuildInputs = [ pkgconfig intltool gettext perl gobjectIntrospection ]
+    ++ stdenv.lib.optionals doCheck checkInputs;
+
   buildInputs = [ atk cairo glib pango libxml2 ];
-  checkInputs = stdenv.lib.optionals doCheck [ xvfb_run dbus ];
 
   preBuild = ''
     substituteInPlace gtksourceview/gtksourceview-utils.c --replace "@NIX_SHARE_PATH@" "$out/share"
diff --git a/pkgs/desktops/gnome-3/core/gucharmap/default.nix b/pkgs/desktops/gnome-3/core/gucharmap/default.nix
index 58d9901ad0129..731ff7e2688ee 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 8fddd8f7d5a68..998a1a02b3f97 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 27a1e4b0be5b9..a30467c1862da 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 e8c299685f703..2bbf219e3f3a2 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/gnustep/make/setup-hook.sh b/pkgs/desktops/gnustep/make/setup-hook.sh
index 71618ef960f97..5313890111645 100644
--- a/pkgs/desktops/gnustep/make/setup-hook.sh
+++ b/pkgs/desktops/gnustep/make/setup-hook.sh
@@ -74,4 +74,4 @@ addEnvVars() {
 	addToSearchPath NIX_GNUSTEP_SYSTEM_DOC_INFO "$tmp"
     fi
 }
-envHooks=(${envHooks[@]} addEnvVars)
+addEnvHooks "$targetOffset" addEnvVars
diff --git a/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix b/pkgs/desktops/pantheon/apps/pantheon-terminal/default.nix
index b7c27ec3d0a93..13a34f90fcdda 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/desktops/plasma-5/fetch.sh b/pkgs/desktops/plasma-5/fetch.sh
index 0469589e48cf1..921441c029229 100644
--- a/pkgs/desktops/plasma-5/fetch.sh
+++ b/pkgs/desktops/plasma-5/fetch.sh
@@ -1 +1 @@
-WGET_ARGS=( https://download.kde.org/stable/plasma/5.11.4/ -A '*.tar.xz' )
+WGET_ARGS=( https://download.kde.org/stable/plasma/5.11.5/ -A '*.tar.xz' )
diff --git a/pkgs/desktops/plasma-5/srcs.nix b/pkgs/desktops/plasma-5/srcs.nix
index 4b71e314fba96..ee605bdba8a28 100644
--- a/pkgs/desktops/plasma-5/srcs.nix
+++ b/pkgs/desktops/plasma-5/srcs.nix
@@ -3,355 +3,355 @@
 
 {
   bluedevil = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/bluedevil-5.11.4.tar.xz";
-      sha256 = "1xjvx5w2pkwj63hdxjkh4fdqyydxvc2sqg1pwkwqnw58z78lhq20";
-      name = "bluedevil-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/bluedevil-5.11.5.tar.xz";
+      sha256 = "0xzdf1qrf2nlpvn2hr9zk72hw027i318s9pnzgmqg1lwhdr276h5";
+      name = "bluedevil-5.11.5.tar.xz";
     };
   };
   breeze = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/breeze-5.11.4.tar.xz";
-      sha256 = "0nxp13x5326ahkrb37rbrsn7xhl9gbrrpnbhhflmr9zdx2af7700";
-      name = "breeze-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/breeze-5.11.5.tar.xz";
+      sha256 = "0xxwnhxpkdf4nyc1rvsjrnqsv1cgzs3a88mwfwpvci4snfva8jp1";
+      name = "breeze-5.11.5.tar.xz";
     };
   };
   breeze-grub = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/breeze-grub-5.11.4.tar.xz";
-      sha256 = "1yz31j3dgzkliz8sk80d6fs0afnd45nw6xkhrws2aar2rnn9d1w4";
-      name = "breeze-grub-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/breeze-grub-5.11.5.tar.xz";
+      sha256 = "1l3dv1acgs6ssydg985d90136p9n4h0xry3xlx12g5wg07i8s89g";
+      name = "breeze-grub-5.11.5.tar.xz";
     };
   };
   breeze-gtk = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/breeze-gtk-5.11.4.tar.xz";
-      sha256 = "0n9fn3jp610g617561c8pr7i9v4k6cdpyqi7kl4f56h6cwq6b0ga";
-      name = "breeze-gtk-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/breeze-gtk-5.11.5.tar.xz";
+      sha256 = "0mkd1gqih5irmabxly2y744sr1iwxy7r7hx68jrd452nbvqvyrqq";
+      name = "breeze-gtk-5.11.5.tar.xz";
     };
   };
   breeze-plymouth = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/breeze-plymouth-5.11.4.tar.xz";
-      sha256 = "099hl3dfcc3n4yh94hdhgnwy01a74s6as2yma57idcqw2akf6d0v";
-      name = "breeze-plymouth-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/breeze-plymouth-5.11.5.tar.xz";
+      sha256 = "0ydfrrsqvzn71j9x1f26771x99yiq59h745k476dcqajj2m0ari3";
+      name = "breeze-plymouth-5.11.5.tar.xz";
     };
   };
   discover = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/discover-5.11.4.tar.xz";
-      sha256 = "1n6s52n8ynsymcwjckkfxrnzsj15f10if8r3ka5qhd7w6nb2x2iz";
-      name = "discover-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/discover-5.11.5.tar.xz";
+      sha256 = "0yxsp4jimyrsxf72hinqa51ycg4hmfxrxdicm9n8qfz47srcgkml";
+      name = "discover-5.11.5.tar.xz";
     };
   };
   drkonqi = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/drkonqi-5.11.4.tar.xz";
-      sha256 = "0vnfx8sha9mdsdb5baw5xwlswm32wmd96kv8yzm3zr67fkz95n3s";
-      name = "drkonqi-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/drkonqi-5.11.5.tar.xz";
+      sha256 = "1kngafr1hdq6r02mpd4bj5lgbgzk2cd10f5zqsvdfgsirz91vfsf";
+      name = "drkonqi-5.11.5.tar.xz";
     };
   };
   kactivitymanagerd = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kactivitymanagerd-5.11.4.tar.xz";
-      sha256 = "10942fzaai30agzmbldwiwycpb7198qhgk3jr2p5wlfrawl1sl4q";
-      name = "kactivitymanagerd-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kactivitymanagerd-5.11.5.tar.xz";
+      sha256 = "11nnmqpw4kq96912rys2a539yzgncc5vp7b52wgc4is9i5czsr50";
+      name = "kactivitymanagerd-5.11.5.tar.xz";
     };
   };
   kde-cli-tools = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kde-cli-tools-5.11.4.tar.xz";
-      sha256 = "07415ssr25lnr9klv6r7jclf9l5mca6dxf6xskwgixcap1fl5vdg";
-      name = "kde-cli-tools-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kde-cli-tools-5.11.5.tar.xz";
+      sha256 = "0d4d360pq6winykjp6lgq77k9yc435d5g71dj7bivkyilqc4cp8c";
+      name = "kde-cli-tools-5.11.5.tar.xz";
     };
   };
   kdecoration = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kdecoration-5.11.4.tar.xz";
-      sha256 = "0vvhhdd3jlb7x9zdc3bjalchhvjkg411ip379rifn9z7zxbrsq9m";
-      name = "kdecoration-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kdecoration-5.11.5.tar.xz";
+      sha256 = "0hl9mqwyfkh1r5nbl46g5axi446fdf7fw09b7v6l3jg9c5xbx89d";
+      name = "kdecoration-5.11.5.tar.xz";
     };
   };
   kde-gtk-config = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kde-gtk-config-5.11.4.tar.xz";
-      sha256 = "08s5z7lck37cyzkkg5v9qrnlfxjrpfd565y2i1ng9k6vm9m39172";
-      name = "kde-gtk-config-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kde-gtk-config-5.11.5.tar.xz";
+      sha256 = "1y9ji82qlvp2z00xw0l32zj8asbg85n6azw8ringg2l6376r01l6";
+      name = "kde-gtk-config-5.11.5.tar.xz";
     };
   };
   kdeplasma-addons = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kdeplasma-addons-5.11.4.tar.xz";
-      sha256 = "19ywc3ryjax7g7wg969j256n4cr3n51lzxsw4gklf4n0px4pk2pi";
-      name = "kdeplasma-addons-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kdeplasma-addons-5.11.5.tar.xz";
+      sha256 = "1vp9r7ia5wriw5srpyq89nqdp82akz3jnh7dcbh2h0gdagw7hb94";
+      name = "kdeplasma-addons-5.11.5.tar.xz";
     };
   };
   kgamma5 = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kgamma5-5.11.4.tar.xz";
-      sha256 = "1njzb06hk0lpj3s6i2hmlww0k7122dca9mi0rbr0ilfwha36ib2s";
-      name = "kgamma5-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kgamma5-5.11.5.tar.xz";
+      sha256 = "16vlx51n52j5q1nfsz4ji6bz4x6sfagxzn6q3r6ckj41rkwmp9gg";
+      name = "kgamma5-5.11.5.tar.xz";
     };
   };
   khotkeys = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/khotkeys-5.11.4.tar.xz";
-      sha256 = "0wszl7bzjl6gszvg9n4p8x3m6h0x5xx3qz3yi1y6g5mplfg7h0c6";
-      name = "khotkeys-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/khotkeys-5.11.5.tar.xz";
+      sha256 = "051yjqkf5bigz6cz2qbq0lggw9i6ydfaxrvy4xh40mw2c6x3xmvh";
+      name = "khotkeys-5.11.5.tar.xz";
     };
   };
   kinfocenter = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kinfocenter-5.11.4.tar.xz";
-      sha256 = "0ff3v90fj187glb22rvp27kp1b83br71vshcq2cpfzrbv97wrqf4";
-      name = "kinfocenter-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kinfocenter-5.11.5.tar.xz";
+      sha256 = "0ym7i64k48x8dcln0lajj0379blp3c3a0axfcjibp3ya2xcaqdif";
+      name = "kinfocenter-5.11.5.tar.xz";
     };
   };
   kmenuedit = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kmenuedit-5.11.4.tar.xz";
-      sha256 = "0kbqrri7mnnarfw45k7j3ckxdpkasc25prvn1zlhci0acqhz0skk";
-      name = "kmenuedit-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kmenuedit-5.11.5.tar.xz";
+      sha256 = "0wh4hk51k2mz1gqm9brvdy16gp2ap2iz5b6yjiqbkpz6giy88kwc";
+      name = "kmenuedit-5.11.5.tar.xz";
     };
   };
   kscreen = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kscreen-5.11.4.tar.xz";
-      sha256 = "0rjy594qj9825gan3r4iw4qphnksnrfn2f1dgyvd63ds70xm272h";
-      name = "kscreen-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kscreen-5.11.5.tar.xz";
+      sha256 = "0qa23qs8v8hm91190ssdnlg7dyljra7csgykb7d8la30yxa9vzc7";
+      name = "kscreen-5.11.5.tar.xz";
     };
   };
   kscreenlocker = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kscreenlocker-5.11.4.tar.xz";
-      sha256 = "0r2438s7gs39qbkprx90smvb8mlgqm486qgv34ljx9vi0zm4kq47";
-      name = "kscreenlocker-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kscreenlocker-5.11.5.tar.xz";
+      sha256 = "0qrby8jxmvmnr1abkry8h5xapdswabj27n35s9l71d9lp9p96naz";
+      name = "kscreenlocker-5.11.5.tar.xz";
     };
   };
   ksshaskpass = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/ksshaskpass-5.11.4.tar.xz";
-      sha256 = "1wqzwvlimw5mkq1hfzjjw9az3g9bdqkiw9m7vrxfb67asgmmbrbx";
-      name = "ksshaskpass-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/ksshaskpass-5.11.5.tar.xz";
+      sha256 = "08jf6f1i9xn0zsz2j2czgdzcr203wrlj1nlam26dakrphhaj8vm2";
+      name = "ksshaskpass-5.11.5.tar.xz";
     };
   };
   ksysguard = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/ksysguard-5.11.4.tar.xz";
-      sha256 = "1dl5q6k2ipdwlg8i5bh2xsz20wg5dwn8401rba9jzp3la97id2sc";
-      name = "ksysguard-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/ksysguard-5.11.5.tar.xz";
+      sha256 = "161bcmsw4bjlsgkr3izfsqbiwambmm3za8mln3m96nf70gpqpa6i";
+      name = "ksysguard-5.11.5.tar.xz";
     };
   };
   kwallet-pam = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kwallet-pam-5.11.4.tar.xz";
-      sha256 = "0xkgm0i0x1kcw4rcsv762pqs1vk2gxi09n421whq9ibmj8cm2ky2";
-      name = "kwallet-pam-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kwallet-pam-5.11.5.tar.xz";
+      sha256 = "0wqnaszvwclz2gn74nmhqmci39525hwvpc3igxzjhdccnkfb5ac4";
+      name = "kwallet-pam-5.11.5.tar.xz";
     };
   };
   kwayland-integration = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kwayland-integration-5.11.4.tar.xz";
-      sha256 = "03azlds5iv3mq7g1livrqca4k30znac088qllzl4rh0mfmw4bmcy";
-      name = "kwayland-integration-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kwayland-integration-5.11.5.tar.xz";
+      sha256 = "0xisgzymlhmbngvmv3dkh6a51dqnhcwrjj2480f0yxsmhvknxrps";
+      name = "kwayland-integration-5.11.5.tar.xz";
     };
   };
   kwin = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kwin-5.11.4.tar.xz";
-      sha256 = "0lfp2nyh28mlqbm3qjhd9adgp8w8j2gfn6xzw8ckxmkrzpdv52gr";
-      name = "kwin-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kwin-5.11.5.tar.xz";
+      sha256 = "06bz2vm78i1x0i0ljdqd2a0bnnrfwz9zvlg7r86qlmhkzn2dpc4z";
+      name = "kwin-5.11.5.tar.xz";
     };
   };
   kwrited = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/kwrited-5.11.4.tar.xz";
-      sha256 = "16l280dh3fw0sn3h9yprb74wmc0adsqq092s4dyka55md06qzqif";
-      name = "kwrited-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/kwrited-5.11.5.tar.xz";
+      sha256 = "0sx5v1apambb8w6mndkkp2lvwlqwzbpxxp5d5zsz96lxndjx6sbv";
+      name = "kwrited-5.11.5.tar.xz";
     };
   };
   libkscreen = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/libkscreen-5.11.4.tar.xz";
-      sha256 = "0sv3q6zmplm0iz6ax87763mg771zvk1dfdh2gmiz2dn2lnxbkrzd";
-      name = "libkscreen-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/libkscreen-5.11.5.tar.xz";
+      sha256 = "03cnr7z74j2kjwbg1ddavmj0l8hpxg7bg2ipglirnzvp2ihv1wzg";
+      name = "libkscreen-5.11.5.tar.xz";
     };
   };
   libksysguard = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/libksysguard-5.11.4.tar.xz";
-      sha256 = "1ry4478fv7blp80zyhz0xr3qragsddrkzjzmxkdarh01f4p987aq";
-      name = "libksysguard-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/libksysguard-5.11.5.tar.xz";
+      sha256 = "0f2py4zkqzpxxf3mqaij0q8ka0v3nschj17dv6rbzzmr5mjv825f";
+      name = "libksysguard-5.11.5.tar.xz";
     };
   };
   milou = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/milou-5.11.4.tar.xz";
-      sha256 = "1zq6gcmjc4wa23b2c94nwsxranpangl2b3apj56qpl68bjfvlrbq";
-      name = "milou-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/milou-5.11.5.tar.xz";
+      sha256 = "0ja7a668wv67vb3mgsd2nbjdcp0lm7aix5dpc496wr1jy47pxv8a";
+      name = "milou-5.11.5.tar.xz";
     };
   };
   oxygen = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/oxygen-5.11.4.tar.xz";
-      sha256 = "0vfs220w6rc0vf5y2qshqby1jmd5kgm0gqkzg9ckgvjm0skbk75z";
-      name = "oxygen-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/oxygen-5.11.5.tar.xz";
+      sha256 = "1n2xr3a0002xfiy99gjqlny76nxjlss1d3sgcj8adpza44j91228";
+      name = "oxygen-5.11.5.tar.xz";
     };
   };
   plasma-desktop = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-desktop-5.11.4.tar.xz";
-      sha256 = "0adc9fi582x7gkxsxz3xhs0h6ardxbcxsl5xxzi3y2bmhd4f7vrq";
-      name = "plasma-desktop-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-desktop-5.11.5.tar.xz";
+      sha256 = "0djzs80mr0radmhai3k7jnlwlp76maf7vvrgkfckzs63n1jhdhb3";
+      name = "plasma-desktop-5.11.5.tar.xz";
     };
   };
   plasma-integration = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-integration-5.11.4.tar.xz";
-      sha256 = "0wialbswpgf03paxfr4473sgb11fymxw34xvwdql6wwks86xyf6k";
-      name = "plasma-integration-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-integration-5.11.5.tar.xz";
+      sha256 = "1rmq8i0flrvqcl21fnn94d58zyw55scagrzbjw92p34i1mllhif1";
+      name = "plasma-integration-5.11.5.tar.xz";
     };
   };
   plasma-nm = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-nm-5.11.4.tar.xz";
-      sha256 = "1kjbad69s3dfqgv1zyfzq7bmfyhr0hd4xwhf6bljad8d2l5azydi";
-      name = "plasma-nm-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-nm-5.11.5.tar.xz";
+      sha256 = "11lw26nd1rp2wbmqlf37wgk8qzv4fcc5x04g1i1h7c6hmjf5svqv";
+      name = "plasma-nm-5.11.5.tar.xz";
     };
   };
   plasma-pa = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-pa-5.11.4.tar.xz";
-      sha256 = "0zg34xs3fbxig63i1lf0hyfsmsis3d5gmlgyqc0vkdbwg6l2qpbw";
-      name = "plasma-pa-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-pa-5.11.5.tar.xz";
+      sha256 = "1gdkz9yx21skg3c95nwh1mwacvrklgpfl0cspsmyyfnbnv93cz94";
+      name = "plasma-pa-5.11.5.tar.xz";
     };
   };
   plasma-sdk = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-sdk-5.11.4.tar.xz";
-      sha256 = "0vis5psn2zyglkd6gcgqsnf99b38dcjpq3rwbyhj8rfjcakdg4nx";
-      name = "plasma-sdk-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-sdk-5.11.5.tar.xz";
+      sha256 = "013dc8dg0nhgdjlflgpqi28jsyparnwrj5am8lzvc0kkd9f69yhk";
+      name = "plasma-sdk-5.11.5.tar.xz";
     };
   };
   plasma-tests = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-tests-5.11.4.tar.xz";
-      sha256 = "1kifka84csqsm3qjycagwx093hv3n5wsxl8p6xpa44cxjg4xjqfa";
-      name = "plasma-tests-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-tests-5.11.5.tar.xz";
+      sha256 = "00n1i6s1811w5h37i2iyy924495d2w24vfsl348cxplfxpxhcqf0";
+      name = "plasma-tests-5.11.5.tar.xz";
     };
   };
   plasma-vault = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-vault-5.11.4.tar.xz";
-      sha256 = "1pymr6hiz0j4x98dchrzsq17ddlbcj5f9dggzr0fiw4sm5yvyxz0";
-      name = "plasma-vault-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-vault-5.11.5.tar.xz";
+      sha256 = "1pg891fahslnjn5jdsjjlw8i2l71ddznxjg96l9wycvh6nn7k0v6";
+      name = "plasma-vault-5.11.5.tar.xz";
     };
   };
   plasma-workspace = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-workspace-5.11.4.tar.xz";
-      sha256 = "1qin68zcczgf3rwa8gg4i3rcsy6i8na9z8kk4bm9q3mfagbzqfx8";
-      name = "plasma-workspace-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-workspace-5.11.5.tar.xz";
+      sha256 = "1ipklc6v2ml095sy80rgq4123vkk3famjwf8s3rgkk172s76qm98";
+      name = "plasma-workspace-5.11.5.tar.xz";
     };
   };
   plasma-workspace-wallpapers = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plasma-workspace-wallpapers-5.11.4.tar.xz";
-      sha256 = "09q63i85d82fdq9vafv55wiflndil048ryn9n3kpa4v9s0yjklkh";
-      name = "plasma-workspace-wallpapers-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plasma-workspace-wallpapers-5.11.5.tar.xz";
+      sha256 = "0zhcpbb74phnmr24kxcp0k6gr7gjzdfbrrv4xjjb2qpg2d00l3pm";
+      name = "plasma-workspace-wallpapers-5.11.5.tar.xz";
     };
   };
   plymouth-kcm = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/plymouth-kcm-5.11.4.tar.xz";
-      sha256 = "17jyg6133xb0f1dm1c0cpys2008aa65k1y1ap4b3y29xyv1p79rd";
-      name = "plymouth-kcm-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/plymouth-kcm-5.11.5.tar.xz";
+      sha256 = "152fyg5hc3rzvqw0z88pgapnhc64jx34vcqgsslsfja8mwk9h0ql";
+      name = "plymouth-kcm-5.11.5.tar.xz";
     };
   };
   polkit-kde-agent = {
-    version = "1-5.11.4";
+    version = "1-5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/polkit-kde-agent-1-5.11.4.tar.xz";
-      sha256 = "004ra4nb6dh3b1lmpfg303fg7201d2sm9f4glkj0mk3a0s9fkfcw";
-      name = "polkit-kde-agent-1-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/polkit-kde-agent-1-5.11.5.tar.xz";
+      sha256 = "0bwv567czi9h3rxgn19aw10nq5c674zd8wgk9nj006km1yyxrgy6";
+      name = "polkit-kde-agent-1-5.11.5.tar.xz";
     };
   };
   powerdevil = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/powerdevil-5.11.4.tar.xz";
-      sha256 = "0cncn8xv5sqv1wqmnmhmqn2jznzy7yik4hvq0vadsrh4blyzwyrj";
-      name = "powerdevil-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/powerdevil-5.11.5.tar.xz";
+      sha256 = "0jqf85bain8vj5plxvvbdwiwc2jyb1r6idajhr6igcpjryfa75hj";
+      name = "powerdevil-5.11.5.tar.xz";
     };
   };
   sddm-kcm = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/sddm-kcm-5.11.4.tar.xz";
-      sha256 = "1jhm5gbz296hk1dc7476kw23v73l7s939baln5v5pax349w40l23";
-      name = "sddm-kcm-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/sddm-kcm-5.11.5.tar.xz";
+      sha256 = "1ln1h4r614rg4w6b7g5l7yqqijkaaj04s4g4m41d8rg8z5ywq4v0";
+      name = "sddm-kcm-5.11.5.tar.xz";
     };
   };
   systemsettings = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/systemsettings-5.11.4.tar.xz";
-      sha256 = "1j555f505hbc2zmg7biv05llzd2bb58z5ccspdgcvmskkwm2rlb3";
-      name = "systemsettings-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/systemsettings-5.11.5.tar.xz";
+      sha256 = "0ycdfl585853481bjix63nnj7qvg767qpbyr015k32c1v3vllx8y";
+      name = "systemsettings-5.11.5.tar.xz";
     };
   };
   user-manager = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/user-manager-5.11.4.tar.xz";
-      sha256 = "0mz6kaqwns57bwp2gl7qzm7mwq3w2qh6kyp7m5qqh96wgq133c55";
-      name = "user-manager-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/user-manager-5.11.5.tar.xz";
+      sha256 = "1r4q411g2r6cz4z6bm5jwygfbvrfrl8dawdd69s6h93ixs7697s4";
+      name = "user-manager-5.11.5.tar.xz";
     };
   };
   xdg-desktop-portal-kde = {
-    version = "5.11.4";
+    version = "5.11.5";
     src = fetchurl {
-      url = "${mirror}/stable/plasma/5.11.4/xdg-desktop-portal-kde-5.11.4.tar.xz";
-      sha256 = "162gc6bfsxlj5rc4yz94sv41p75gf2kgayxa534gw3zhvry1jb52";
-      name = "xdg-desktop-portal-kde-5.11.4.tar.xz";
+      url = "${mirror}/stable/plasma/5.11.5/xdg-desktop-portal-kde-5.11.5.tar.xz";
+      sha256 = "07xwb4zbf0cp4a672vs631dh9cqyvn0j9wwlknc21jzr619mnkap";
+      name = "xdg-desktop-portal-kde-5.11.5.tar.xz";
     };
   };
 }
diff --git a/pkgs/development/compilers/chicken/setup-hook.sh b/pkgs/development/compilers/chicken/setup-hook.sh
index d7f28539dc647..b0d9b53b53784 100644
--- a/pkgs/development/compilers/chicken/setup-hook.sh
+++ b/pkgs/development/compilers/chicken/setup-hook.sh
@@ -4,4 +4,4 @@ addChickenRepositoryPath() {
     export CHICKEN_INCLUDE_PATH="$1/share;$CHICKEN_INCLUDE_PATH"
 }
 
-envHooks=(${envHooks[@]} addChickenRepositoryPath)
+addEnvHooks "$targetOffset" addChickenRepositoryPath
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index a29f856a6cc1b..8f29d5f2cb14c 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -229,11 +229,22 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ optional (perl != null) perl;
 
-  buildInputs = [ gmp mpfr libmpc libelf ]
-    ++ (optional (ppl != null) ppl)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (ppl != null) ppl)
     ++ (optional (cloogppl != null) cloogppl)
     ++ (optional (zlib != null) zlib)
     ++ (optional langJava boehmgc)
@@ -245,11 +256,7 @@ stdenv.mkDerivation ({
     ;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -314,56 +321,9 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
-  CC = "gcc";
-
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
   #
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 162da9e0613b7..a28ad871ead2d 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -267,6 +267,7 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
@@ -297,11 +298,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -397,57 +394,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs =  {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 621c45cdff381..844e0a7bebf43 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -262,12 +262,23 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
-  buildInputs = [ gmp mpfr libmpc libelf ]
-    ++ (optional (cloog != null) cloog)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (cloog != null) cloog)
     ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
@@ -296,11 +307,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -395,57 +402,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 709e87c344542..148409bee9bf2 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -49,9 +49,6 @@ assert libelf != null -> zlib != null;
 # Make sure we get GNU sed.
 assert hostPlatform.isDarwin -> gnused != null;
 
-# Need c++filt on darwin
-assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
-
 # The go frontend is written in c++
 assert langGo -> langCC;
 
@@ -277,17 +274,27 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
-  buildInputs = [ gmp mpfr libmpc libelf ]
-    ++ (optional (isl != null) isl)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
     ++ (optionals (targetPlatform != hostPlatform) [targetPackages.stdenv.cc.bintools])
-    ++ (optionals (buildPlatform != hostPlatform) [buildPackages.stdenv.cc])
     ++ (optionals langAda [gnatboot])
     ++ (optionals langVhdl [gnat])
 
@@ -309,11 +316,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -404,57 +407,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 33a034adf667f..c6114b7e63954 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -49,9 +49,6 @@ assert libelf != null -> zlib != null;
 # Make sure we get GNU sed.
 assert hostPlatform.isDarwin -> gnused != null;
 
-# Need c++filt on darwin
-assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
-
 # The go frontend is written in c++
 assert langGo -> langCC;
 
@@ -276,12 +273,23 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
-  buildInputs = [ gmp mpfr libmpc libelf ]
-    ++ (optional (isl != null) isl)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
@@ -311,11 +319,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -405,57 +409,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index 291ec944b554e..c20546b59e8ed 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -50,9 +50,6 @@ assert libelf != null -> zlib != null;
 # Make sure we get GNU sed.
 assert hostPlatform.isDarwin -> gnused != null;
 
-# Need c++filt on darwin
-assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
-
 # The go frontend is written in c++
 assert langGo -> langCC;
 
@@ -273,12 +270,23 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
-  buildInputs = [ gmp mpfr libmpc libelf flex ]
-    ++ (optional (isl != null) isl)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf flex
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
@@ -304,11 +312,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -399,57 +403,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index e8668712e2ea0..c571487361b28 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -50,9 +50,6 @@ assert libelf != null -> zlib != null;
 # Make sure we get GNU sed.
 assert hostPlatform.isDarwin -> gnused != null;
 
-# Need c++filt on darwin
-assert hostPlatform.isDarwin -> targetPackages.stdenv.cc.bintools or null != null;
-
 # The go frontend is written in c++
 assert langGo -> langCC;
 
@@ -260,12 +257,23 @@ stdenv.mkDerivation ({
   inherit noSysDirs staticCompiler langJava
     libcCross crossMingw;
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
-  buildInputs = [ gmp mpfr libmpc libelf flex ]
-    ++ (optional (isl != null) isl)
+  # For building runtime libs
+  depsBuildTarget =
+    if hostPlatform == buildPlatform then [
+      targetPackages.stdenv.cc.bintools # newly-built gcc will be used
+    ] else assert targetPlatform == hostPlatform; [ # build != host == target
+      stdenv.cc
+    ];
+
+  buildInputs = [
+    gmp mpfr libmpc libelf flex
+    targetPackages.stdenv.cc.bintools # For linking code at run-time
+  ] ++ (optional (isl != null) isl)
     ++ (optional (zlib != null) zlib)
     ++ (optionals langJava [ boehmgc zip unzip ])
     ++ (optionals javaAwtGtk ([ gtk2 libart_lgpl ] ++ xlibs))
@@ -291,11 +299,7 @@ stdenv.mkDerivation ({
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags =
     # Basic dependencies
@@ -386,57 +390,12 @@ stdenv.mkDerivation ({
 
   /* For cross-built gcc (build != host == target) */
   crossAttrs = {
-    AR_FOR_BUILD = "ar";
-    AS_FOR_BUILD = "as";
-    LD_FOR_BUILD = "ld";
-    NM_FOR_BUILD = "nm";
-    OBJCOPY_FOR_BUILD = "objcopy";
-    OBJDUMP_FOR_BUILD = "objdump";
-    RANLIB_FOR_BUILD = "ranlib";
-    SIZE_FOR_BUILD = "size";
-    STRINGS_FOR_BUILD = "strings";
-    STRIP_FOR_BUILD = "strip";
-    CC_FOR_BUILD = "gcc";
-    CXX_FOR_BUILD = "g++";
-
-    AR = "${targetPlatform.config}-ar";
-    AS = "${targetPlatform.config}-as";
-    LD = "${targetPlatform.config}-ld";
-    NM = "${targetPlatform.config}-nm";
-    OBJCOPY = "${targetPlatform.config}-objcopy";
-    OBJDUMP = "${targetPlatform.config}-objdump";
-    RANLIB = "${targetPlatform.config}-ranlib";
-    SIZE = "${targetPlatform.config}-size";
-    STRINGS = "${targetPlatform.config}-strings";
-    STRIP = "${targetPlatform.config}-strip";
-    CC = "${targetPlatform.config}-gcc";
-    CXX = "${targetPlatform.config}-g++";
-
-    AR_FOR_TARGET = "${targetPlatform.config}-ar";
-    AS_FOR_TARGET = "${targetPlatform.config}-as";
-    LD_FOR_TARGET = "${targetPlatform.config}-ld";
-    NM_FOR_TARGET = "${targetPlatform.config}-nm";
-    OBJCOPY_FOR_TARGET = "${targetPlatform.config}-objcopy";
-    OBJDUMP_FOR_TARGET = "${targetPlatform.config}-objdump";
-    RANLIB_FOR_TARGET = "${targetPlatform.config}-ranlib";
-    SIZE_FOR_TARGET = "${targetPlatform.config}-size";
-    STRINGS_FOR_TARGET = "${targetPlatform.config}-strings";
-    STRIP_FOR_TARGET = "${targetPlatform.config}-strip";
-    CC_FOR_TARGET = "${targetPlatform.config}-gcc";
-    CXX_FOR_TARGET = "${targetPlatform.config}-g++";
-
     dontStrip = true;
     buildFlags = "";
   };
 
-  NIX_BUILD_BINTOOLS = buildPackages.stdenv.cc.bintools;
-  NIX_BUILD_CC = buildPackages.stdenv.cc;
-
-  # Needed for the cross compilation to work
-  AR = "ar";
-  LD = "ld";
   # http://gcc.gnu.org/install/specific.html#x86-64-x-solaris210
-  CC = if stdenv.system == "x86_64-solaris" then "gcc -m64" else "gcc";
+  ${if hostPlatform.system == "x86_64-solaris" then "CC" else null} = "gcc -m64";
 
   # Setting $CPATH and $LIBRARY_PATH to make sure both `gcc' and `xgcc' find the
   # library headers and binaries, regarless of the language being compiled.
diff --git a/pkgs/development/compilers/gerbil/default.nix b/pkgs/development/compilers/gerbil/default.nix
index 622107c753452..23089ddda4e88 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/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix
index fb2e1a2a25953..03831f3b6b6f1 100644
--- a/pkgs/development/compilers/ghc/6.10.2-binary.nix
+++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix
@@ -4,6 +4,9 @@
 , enableIntegerSimple ? false
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 stdenv.mkDerivation rec {
   version = "6.10.2";
 
@@ -93,6 +96,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/6.10.4.nix b/pkgs/development/compilers/ghc/6.10.4.nix
index c56762edd24e4..0308edbd56c03 100644
--- a/pkgs/development/compilers/ghc/6.10.4.nix
+++ b/pkgs/development/compilers/ghc/6.10.4.nix
@@ -1,12 +1,15 @@
 {stdenv, fetchurl, libedit, ghc, perl, gmp, ncurses}:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 stdenv.mkDerivation rec {
   version = "6.10.4";
 
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "${meta.homepage}/dist/${version}/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "d66a8e52572f4ff819fe5c4e34c6dd1e84a7763e25c3fadcc222453c0bd8534d";
   };
 
@@ -22,6 +25,8 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-fomit-frame-pointer";
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/6.12.3.nix b/pkgs/development/compilers/ghc/6.12.3.nix
index a46ef66a8cb7c..16d6d39e95f4e 100644
--- a/pkgs/development/compilers/ghc/6.12.3.nix
+++ b/pkgs/development/compilers/ghc/6.12.3.nix
@@ -1,12 +1,15 @@
 {stdenv, fetchurl, ghc, perl, gmp, ncurses}:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 stdenv.mkDerivation rec {
   version = "6.12.3";
 
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://darcs.haskell.org/download/dist/${version}/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "0s2y1sv2nq1cgliv735q2w3gg4ykv1c0g1adbv8wgwhia10vxgbc";
   };
 
@@ -33,6 +36,8 @@ stdenv.mkDerivation rec {
   # that in turn causes GHCi to abort
   stripDebugFlags=["-S" "--keep-file-symbols"];
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix
index c518c67d16b10..d9b4ff1678257 100644
--- a/pkgs/development/compilers/ghc/7.0.4-binary.nix
+++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix
@@ -3,6 +3,9 @@
 , ncurses5, gmp, libiconv
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 let
   libPath = stdenv.lib.makeLibraryPath ([
     ncurses5 gmp
@@ -131,6 +134,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta.license = stdenv.lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
 }
diff --git a/pkgs/development/compilers/ghc/7.0.4.nix b/pkgs/development/compilers/ghc/7.0.4.nix
index 9d052ddb246fa..0f560313007f3 100644
--- a/pkgs/development/compilers/ghc/7.0.4.nix
+++ b/pkgs/development/compilers/ghc/7.0.4.nix
@@ -1,11 +1,14 @@
 { stdenv, fetchurl, ghc, perl, gmp, ncurses, libiconv }:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 stdenv.mkDerivation rec {
   version = "7.0.4";
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "1a9b78d9d66c9c21de6c0932e36bb87406a4856f1611bf83bd44539bdc6ed0ed";
   };
 
@@ -42,6 +45,8 @@ stdenv.mkDerivation rec {
   # that in turn causes GHCi to abort
   stripDebugFlags=["-S" "--keep-file-symbols"];
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/7.10.3-binary.nix b/pkgs/development/compilers/ghc/7.10.3-binary.nix
index 84b6157c86563..6fed39317c754 100644
--- a/pkgs/development/compilers/ghc/7.10.3-binary.nix
+++ b/pkgs/development/compilers/ghc/7.10.3-binary.nix
@@ -4,6 +4,9 @@
 , gcc
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 let
   libPath = stdenv.lib.makeLibraryPath ([
     ncurses5 gmp
@@ -148,6 +151,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta.license = stdenv.lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/7.10.3.nix b/pkgs/development/compilers/ghc/7.10.3.nix
index d573a22e0ae80..1d9e2814a1f65 100644
--- a/pkgs/development/compilers/ghc/7.10.3.nix
+++ b/pkgs/development/compilers/ghc/7.10.3.nix
@@ -1,14 +1,28 @@
-{ stdenv, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
-, libxml2, libxslt, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, hscolour
+{ stdenv, targetPackages
+, buildPlatform, hostPlatform, targetPlatform
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+# build-tools
+, bootPkgs, hscolour
+, coreutils, fetchurl, fetchpatch, perl
+, docbook_xsl, docbook_xml_dtd_45, docbook_xml_dtd_42, libxml2, libxslt
+
+, libiconv ? null, ncurses
+
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+assert !enableIntegerSimple -> gmp != null;
+
 let
   inherit (bootPkgs) ghc;
 
+  # TODO(@Ericson2314) Make unconditional
+  targetPrefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
+
   docFixes = fetchurl {
     url = "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3a.patch";
     sha256 = "1j45z4kcd3w1rzm4hapap2xc16bbh942qnzzdbdjcwqznsccznf0";
@@ -18,10 +32,10 @@ in
 
 stdenv.mkDerivation rec {
   version = "7.10.3";
-  name = "ghc-${version}";
+  name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/${version}/${name}-src.tar.xz";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
     sha256 = "1vsgmic8csczl62ciz51iv8nhrkm72lyhbz7p7id13y2w7fcx46g";
   };
 
@@ -58,11 +72,11 @@ stdenv.mkDerivation rec {
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   postInstall = ''
     # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
+    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
     # Patch scripts to include "readelf" and "cat" in $PATH.
     for i in "$out/bin/"*; do
@@ -73,7 +87,7 @@ stdenv.mkDerivation rec {
   '';
 
   passthru = {
-    inherit bootPkgs;
+    inherit bootPkgs targetPrefix;
   };
 
   meta = {
diff --git a/pkgs/development/compilers/ghc/7.2.2.nix b/pkgs/development/compilers/ghc/7.2.2.nix
index dd3b5cb2ebcb1..cb8470bcff124 100644
--- a/pkgs/development/compilers/ghc/7.2.2.nix
+++ b/pkgs/development/compilers/ghc/7.2.2.nix
@@ -1,16 +1,20 @@
 { stdenv, fetchurl, ghc, perl, ncurses, libiconv
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+assert !enableIntegerSimple -> gmp != null;
+
 stdenv.mkDerivation rec {
   version = "7.2.2";
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "0g87d3z9275dniaqzkf56qfgzp1msd89nqqhhm2gkc6iga072spz";
   };
 
@@ -51,6 +55,8 @@ stdenv.mkDerivation rec {
   # that in turn causes GHCi to abort
   stripDebugFlags=["-S" "--keep-file-symbols"];
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix
index 3cb28e2c82075..70c8797c264e9 100644
--- a/pkgs/development/compilers/ghc/7.4.2-binary.nix
+++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -3,6 +3,9 @@
 , ncurses5, gmp, libiconv
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 let
   libPath = stdenv.lib.makeLibraryPath ([
     ncurses5 gmp
@@ -133,6 +136,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta.license = stdenv.lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
 }
diff --git a/pkgs/development/compilers/ghc/7.4.2.nix b/pkgs/development/compilers/ghc/7.4.2.nix
index e5bc4724c9eb0..6f30b03efb911 100644
--- a/pkgs/development/compilers/ghc/7.4.2.nix
+++ b/pkgs/development/compilers/ghc/7.4.2.nix
@@ -1,17 +1,21 @@
 { stdenv, fetchurl, ghc, perl, ncurses, libiconv
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+assert !enableIntegerSimple -> gmp != null;
+
 stdenv.mkDerivation rec {
   version = "7.4.2";
 
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://haskell.org/ghc/dist/7.4.2/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "0vc3zmxqi4gflssmj35n5c8idbvyrhd88abi50whbirwlf4i5vpj";
   };
 
@@ -52,6 +56,8 @@ stdenv.mkDerivation rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix
index fde4ca2aa37d1..78202297686e4 100644
--- a/pkgs/development/compilers/ghc/7.6.3.nix
+++ b/pkgs/development/compilers/ghc/7.6.3.nix
@@ -1,10 +1,14 @@
 { stdenv, fetchurl, ghc, perl, ncurses, libiconv
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+assert !enableIntegerSimple -> gmp != null;
+
 let
   # The "-Wa,--noexecstack" options might be needed only with GNU ld (as opposed
   # to the gold linker). It prevents binaries' stacks from being marked as
@@ -18,7 +22,7 @@ in stdenv.mkDerivation rec {
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.bz2";
     sha256 = "1669m8k9q72rpd2mzs0bh2q6lcwqiwd1ax3vrard1dgn64yq4hxx";
   };
 
@@ -78,6 +82,8 @@ in stdenv.mkDerivation rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/7.8.4-binary.nix b/pkgs/development/compilers/ghc/7.8.4-binary.nix
index 9525536ef0dd7..58a9370b32135 100644
--- a/pkgs/development/compilers/ghc/7.8.4-binary.nix
+++ b/pkgs/development/compilers/ghc/7.8.4-binary.nix
@@ -3,6 +3,9 @@
 , ncurses5, gmp, libiconv
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 let
   libPath = stdenv.lib.makeLibraryPath ([
     ncurses5 gmp
@@ -146,6 +149,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta.license = stdenv.lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
 }
diff --git a/pkgs/development/compilers/ghc/7.8.4.nix b/pkgs/development/compilers/ghc/7.8.4.nix
index 5a380c75c69f5..b5e2ac256a7a9 100644
--- a/pkgs/development/compilers/ghc/7.8.4.nix
+++ b/pkgs/development/compilers/ghc/7.8.4.nix
@@ -1,16 +1,20 @@
 { stdenv, fetchurl, ghc, perl, ncurses, libiconv
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+# TODO(@Ericson2314): Cross compilation support
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+assert !enableIntegerSimple -> gmp != null;
+
 stdenv.mkDerivation (rec {
   version = "7.8.4";
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://www.haskell.org/ghc/dist/7.8.4/${name}-src.tar.xz";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
     sha256 = "1i4254akbb4ym437rf469gc0m40bxm31blp6s1z1g15jmnacs6f3";
   };
 
@@ -49,6 +53,8 @@ stdenv.mkDerivation (rec {
   # that in turn causes GHCi to abort
   stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
 
+  passthru = { targetPrefix = ""; };
+
   meta = {
     homepage = http://haskell.org/ghc;
     description = "The Glasgow Haskell Compiler";
diff --git a/pkgs/development/compilers/ghc/8.0.2.nix b/pkgs/development/compilers/ghc/8.0.2.nix
index d475e3438b4b4..762fe547ca9ce 100644
--- a/pkgs/development/compilers/ghc/8.0.2.nix
+++ b/pkgs/development/compilers/ghc/8.0.2.nix
@@ -1,21 +1,33 @@
-{ stdenv, lib, fetchurl, fetchpatch, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
-, hscolour, patchutils, sphinx
+{ stdenv, targetPackages
+, buildPlatform, hostPlatform, targetPlatform
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+# build-tools
+, bootPkgs, hscolour
+, coreutils, fetchurl, fetchpatch, patchutils, perl, sphinx
+
+, libiconv ? null, ncurses
+
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
-, cross ? null
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+assert !enableIntegerSimple -> gmp != null;
+
 let
   inherit (bootPkgs) ghc;
+
+  # TODO(@Ericson2314) Make unconditional
+  targetPrefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
 in
 stdenv.mkDerivation rec {
   version = "8.0.2";
-  name = "ghc-${version}";
+  name = "${targetPrefix}ghc-${version}";
 
   src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/8.0.2/${name}-src.tar.xz";
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
     sha256 = "1c8qc4fhkycynk4g1f9hvk53dj6a1vvqi6bklqznns6hw59m8qhi";
   };
 
@@ -47,19 +59,20 @@ stdenv.mkDerivation rec {
     "--with-gmp-includes=${gmp.dev}/include" "--with-gmp-libraries=${gmp.out}/lib"
   ] ++ stdenv.lib.optional stdenv.isDarwin [
     "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++
+  ] ++ stdenv.lib.optionals (targetPlatform.isDarwin && targetPlatform.isAarch64) [
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
+    "--disable-large-address-space"
+  ];
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   postInstall = ''
-    paxmark m $out/lib/${name}/bin/{ghc,haddock}
+    paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
 
     # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
+    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
     # Patch scripts to include "readelf" and "cat" in $PATH.
     for i in "$out/bin/"*; do
@@ -70,7 +83,7 @@ stdenv.mkDerivation rec {
   '';
 
   passthru = {
-    inherit bootPkgs;
+    inherit bootPkgs targetPrefix;
   };
 
   meta = {
diff --git a/pkgs/development/compilers/ghc/8.2.1-binary.nix b/pkgs/development/compilers/ghc/8.2.1-binary.nix
index 1242c6ae1b0fa..b3b5e2eceec05 100644
--- a/pkgs/development/compilers/ghc/8.2.1-binary.nix
+++ b/pkgs/development/compilers/ghc/8.2.1-binary.nix
@@ -3,6 +3,9 @@
 , ncurses5, gmp, libiconv
 }:
 
+# Prebuilt only does native
+assert stdenv.targetPlatform == stdenv.hostPlatform;
+
 let
   libPath = stdenv.lib.makeLibraryPath ([
     ncurses5 gmp
@@ -151,6 +154,8 @@ stdenv.mkDerivation rec {
     [ $(./main) == "yes" ]
   '';
 
+  passthru = { targetPrefix = ""; };
+
   meta.license = stdenv.lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux" "aarch64-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/8.2.2.nix b/pkgs/development/compilers/ghc/8.2.2.nix
index 736a6edc365b2..bffc7c3fc6c7a 100644
--- a/pkgs/development/compilers/ghc/8.2.2.nix
+++ b/pkgs/development/compilers/ghc/8.2.2.nix
@@ -1,18 +1,40 @@
-{ stdenv, lib, fetchurl, bootPkgs, perl, ncurses, libiconv, binutils, coreutils
-, autoconf, automake, happy, alex, python3, sphinx, hscolour
-, buildPlatform, targetPlatform , selfPkgs, cross ? null
+{ stdenv, targetPackages
+, buildPlatform, hostPlatform, targetPlatform
+, selfPkgs, cross ? null
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+# build-tools
+, bootPkgs, alex, happy, hscolour
+, autoconf, automake, coreutils, fetchurl, perl, python3, sphinx
+
+, libiconv ? null, ncurses
+
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
 }:
 
+assert !enableIntegerSimple -> gmp != null;
+
 let
   inherit (bootPkgs) ghc;
+
+  # TODO(@Ericson2314) Make unconditional
+  targetPrefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
+in
+stdenv.mkDerivation (rec {
   version = "8.2.2";
+  name = "${targetPrefix}ghc-${version}";
+
+  src = fetchurl {
+    url = "https://downloads.haskell.org/~ghc/${version}/ghc-${version}-src.tar.xz";
+    sha256 = "1z05vkpaj54xdypmaml50hgsdpw29dhbs2r7magx0cm199iw73mv";
+  };
+
+  postPatch = "patchShebangs .";
 
-  commonBuildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
-  commonPreConfigure =  ''
+  preConfigure = ''
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
   '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/ghc-${version}"
@@ -20,21 +42,11 @@ let
     export NIX_LDFLAGS+=" -no_dtrace_dof"
   '' + stdenv.lib.optionalString enableIntegerSimple ''
     echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
+  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
   '';
-in stdenv.mkDerivation (rec {
-  inherit version;
-  name = "ghc-${version}";
 
-  src = fetchurl {
-    url = "https://downloads.haskell.org/~ghc/8.2.2/${name}-src.tar.xz";
-    sha256 = "1z05vkpaj54xdypmaml50hgsdpw29dhbs2r7magx0cm199iw73mv";
-  };
-
-  postPatch = "patchShebangs .";
-
-  preConfigure = commonPreConfigure;
-
-  buildInputs = commonBuildInputs;
+  buildInputs = [ alex autoconf automake ghc happy hscolour perl python3 sphinx ];
 
   enableParallelBuilding = true;
 
@@ -50,28 +62,28 @@ in stdenv.mkDerivation (rec {
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
   postInstall = ''
-    paxmark m $out/lib/${name}/bin/{ghc,haddock}
+    paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
 
     # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
+    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
     # Patch scripts to include "readelf" and "cat" in $PATH.
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ binutils coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
   outputs = [ "out" "doc" ];
 
   passthru = {
-    inherit bootPkgs;
+    inherit bootPkgs targetPrefix;
   } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
     crossCompiler = selfPkgs.ghc.override {
       cross = targetPlatform;
@@ -87,31 +99,23 @@ in stdenv.mkDerivation (rec {
   };
 
 } // stdenv.lib.optionalAttrs (cross != null) {
-  name = "${cross.config}-ghc-${version}";
-
-  preConfigure = commonPreConfigure + ''
-    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
-  '';
-
   configureFlags = [
-    "CC=${stdenv.ccCross}/bin/${cross.config}-cc"
-    "LD=${stdenv.binutils}/bin/${cross.config}-ld"
-    "AR=${stdenv.binutils}/bin/${cross.config}-ar"
-    "NM=${stdenv.binutils}/bin/${cross.config}-nm"
-    "RANLIB=${stdenv.binutils}/bin/${cross.config}-ranlib"
+    "CC=${stdenv.cc}/bin/${cross.config}-cc"
+    "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
+    "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar"
+    "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm"
+    "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib"
     "--target=${cross.config}"
     "--enable-bootstrap-with-devel-snapshot"
   ] ++
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
-
-  buildInputs = commonBuildInputs ++ [ stdenv.ccCross stdenv.binutils ];
+    stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
-  dontSetConfigureCross = true;
+  configurePlatforms = [];
 
   passthru = {
     inherit bootPkgs cross;
-    cc = "${stdenv.ccCross}/bin/${cross.config}-cc";
-    ld = "${stdenv.binutils}/bin/${cross.config}-ld";
+    cc = "${stdenv.cc}/bin/${cross.config}-cc";
+    ld = "${stdenv.cc}/bin/${cross.config}-ld";
   };
 })
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 3f5dfa65958f7..9b4c932eb1150 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,21 +1,45 @@
-{ stdenv, lib, fetchgit, bootPkgs, perl, ncurses, libiconv, targetPackages, coreutils
-, autoconf, automake, happy, alex, python3, buildPlatform, targetPlatform
+{ stdenv, targetPackages
+, buildPlatform, hostPlatform, targetPlatform
 , selfPkgs, cross ? null
 
-  # If enabled GHC will be build with the GPL-free but slower integer-simple
+# build-tools
+, bootPkgs, alex, happy
+, autoconf, automake, coreutils, fetchgit, perl, python3
+
+, libiconv ? null, ncurses
+
+, # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-, enableIntegerSimple ? false, gmp
+  enableIntegerSimple ? false, gmp ? null
+
 , version ? "8.5.20171209"
 }:
 
+assert !enableIntegerSimple -> gmp != null;
+
 let
   inherit (bootPkgs) ghc;
 
-  commonBuildInputs = [ ghc perl autoconf automake happy alex python3 ];
-
   rev = "4335c07ca7e64624819b22644d7591853826bd75";
 
-  commonPreConfigure =  ''
+  # TODO(@Ericson2314) Make unconditional
+  targetPrefix = stdenv.lib.optionalString
+    (targetPlatform != hostPlatform)
+    "${targetPlatform.config}-";
+in
+stdenv.mkDerivation (rec {
+  inherit version rev;
+  name = "${targetPrefix}ghc-${version}";
+
+  src = fetchgit {
+    url = "git://git.haskell.org/ghc.git";
+    inherit rev;
+    sha256 = "19csad94sk0bw2nj97ppmnwh4c193jg0jmg5w2sx9rqm9ih4yg85";
+  };
+
+  postPatch = "patchShebangs .";
+
+  preConfigure = ''
     echo ${version} >VERSION
     echo ${rev} >GIT_COMMIT_ID
     ./boot
@@ -26,22 +50,11 @@ let
     export NIX_LDFLAGS+=" -no_dtrace_dof"
   '' + stdenv.lib.optionalString enableIntegerSimple ''
     echo "INTEGER_LIBRARY=integer-simple" > mk/build.mk
+  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
   '';
-in stdenv.mkDerivation (rec {
-  inherit version rev;
-  name = "ghc-${version}";
 
-  src = fetchgit {
-    url = "git://git.haskell.org/ghc.git";
-    inherit rev;
-    sha256 = "19csad94sk0bw2nj97ppmnwh4c193jg0jmg5w2sx9rqm9ih4yg85";
-  };
-
-  postPatch = "patchShebangs .";
-
-  preConfigure = commonPreConfigure;
-
-  buildInputs = commonBuildInputs;
+  buildInputs = [ ghc perl autoconf automake happy alex python3 ];
 
   enableParallelBuilding = true;
 
@@ -57,15 +70,15 @@ in stdenv.mkDerivation (rec {
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!stdenv.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
   postInstall = ''
-    paxmark m $out/lib/${name}/bin/{ghc,haddock}
+    paxmark m $out/lib/${name}/bin/${if targetPlatform != hostPlatform then "ghc" else "{ghc,haddock}"}
 
     # Install the bash completion file.
-    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/ghc
+    install -D -m 444 utils/completion/ghc.bash $out/share/bash-completion/completions/${targetPrefix}ghc
 
     # Patch scripts to include "readelf" and "cat" in $PATH.
     for i in "$out/bin/"*; do
@@ -78,7 +91,7 @@ in stdenv.mkDerivation (rec {
   outputs = [ "out" "doc" ];
 
   passthru = {
-    inherit bootPkgs;
+    inherit bootPkgs targetPrefix;
   } // stdenv.lib.optionalAttrs (targetPlatform != buildPlatform) {
     crossCompiler = selfPkgs.ghc.override {
       cross = targetPlatform;
@@ -94,33 +107,23 @@ in stdenv.mkDerivation (rec {
   };
 
 } // stdenv.lib.optionalAttrs (cross != null) {
-  name = "${cross.config}-ghc-${version}";
-
-  preConfigure = commonPreConfigure + ''
-    sed 's|#BuildFlavour  = quick-cross|BuildFlavour  = perf-cross|' mk/build.mk.sample > mk/build.mk
-  '';
-
   configureFlags = [
     "CC=${stdenv.cc}/bin/${cross.config}-cc"
-    "LD=${stdenv.cc}/bin/${cross.config}-ld"
-    "AR=${stdenv.cc}/bin/${cross.config}-ar"
-    "NM=${stdenv.cc}/bin/${cross.config}-nm"
-    "RANLIB=${stdenv.cc}/bin/${cross.config}-ranlib"
+    "LD=${stdenv.cc.bintools}/bin/${cross.config}-ld"
+    "AR=${stdenv.cc.bintools}/bin/${cross.config}-ar"
+    "NM=${stdenv.cc.bintools}/bin/${cross.config}-nm"
+    "RANLIB=${stdenv.cc.bintools}/bin/${cross.config}-ranlib"
     "--target=${cross.config}"
     "--enable-bootstrap-with-devel-snapshot"
   ] ++
     # fix for iOS: https://www.reddit.com/r/haskell/comments/4ttdz1/building_an_osxi386_to_iosarm64_cross_compiler/d5qvd67/
-    lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
-
-  buildInputs = commonBuildInputs;
+    stdenv.lib.optional (cross.config or null == "aarch64-apple-darwin14") "--disable-large-address-space";
 
   configurePlatforms = [];
 
   passthru = {
     inherit bootPkgs cross;
-
     cc = "${stdenv.cc}/bin/${cross.config}-cc";
-
     ld = "${stdenv.cc}/bin/${cross.config}-ld";
   };
 })
diff --git a/pkgs/development/compilers/go/setup-hook.sh b/pkgs/development/compilers/go/setup-hook.sh
index 1b91c8312b886..7dce15eeb1025 100644
--- a/pkgs/development/compilers/go/setup-hook.sh
+++ b/pkgs/development/compilers/go/setup-hook.sh
@@ -2,4 +2,4 @@ addToGoPath() {
     addToSearchPath GOPATH $1/share/go
 }
 
-envHooks=(${envHooks[@]} addToGoPath)
+addEnvHooks "$targetOffset" addToGoPath
diff --git a/pkgs/development/compilers/haxe/setup-hook.sh b/pkgs/development/compilers/haxe/setup-hook.sh
index 21cc0206859f6..e6496107a5ee1 100644
--- a/pkgs/development/compilers/haxe/setup-hook.sh
+++ b/pkgs/development/compilers/haxe/setup-hook.sh
@@ -4,4 +4,4 @@ addHaxeLibPath() {
   fi
 }
 
-envHooks+=(addHaxeLibPath)
+addEnvHooks "$targetOffset" addHaxeLibPath
diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix
index 2f84387a8888a..a66b2264f0739 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 35af978216c61..5cac04c044de6 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 bd79db012a636..a660d4aea5fdb 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 5ce51bc9c1222..c58adc3f92dae 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 fa61a6c22e71b..5a44cb868253e 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 fa8502ebd67aa..b003d2f334ac4 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 9891f3090ac1c..a7e16c08ce964 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 036161f7b8899..6f03e225ad658 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 5a2a269345d64..166f4260291ff 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 f19a9afc8044b..1d00b16cce1f8 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 fac23b290bcb9..03e65dde0e4d3 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 8358b6b18c35e..6c7fd9eb0a385 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 9ba42eed2e2e5..5a01c191b5aea 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 236273bf6bec8..4dce11f93b131 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/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index b800d71198af9..cd3120ed83127 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
 
   # Specifying $SBCL_HOME is only truly needed with `purgeNixReferences = true`.
   setupHook = writeText "setupHook.sh" ''
-    envHooks+=(_setSbclHome)
+    addEnvHooks "$targetOffset" _setSbclHome
     _setSbclHome() {
       export SBCL_HOME='@out@/lib/sbcl/'
     }
diff --git a/pkgs/development/compilers/urweb/default.nix b/pkgs/development/compilers/urweb/default.nix
index 74ca5dc4c4b0f..f2b6016ceb70e 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 40af4c312cf0c..f42cdcabae3fb 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 3502dc60c5f0f..c6c38df4e0dbf 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -48,7 +48,7 @@ self: super: {
   clock = dontCheck super.clock;
   Dust-crypto = dontCheck super.Dust-crypto;
   hasql-postgres = dontCheck super.hasql-postgres;
-  hspec = super.hspec.override { stringbuilder = dontCheck super.stringbuilder; };
+  hspec = super.hspec.override { stringbuilder = dontCheck self.stringbuilder; };
   hspec-core = super.hspec-core.override { silently = dontCheck super.silently; temporary = dontCheck super.temporary; };
   hspec-expectations = dontCheck super.hspec-expectations;
   HTTP = dontCheck super.HTTP;
@@ -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;
@@ -915,7 +915,8 @@ self: super: {
   grakn = dontCheck (doJailbreak super.grakn);
 
   # test suite requires git and does a bunch of git operations
-  restless-git = dontCheck super.restless-git;
+  # doJailbreak because of hardcoded time, seems to be fixed upstream
+  restless-git = dontCheck (doJailbreak super.restless-git);
 
   # Depends on broken fluid.
   fluid-idl-http-client = markBroken super.fluid-idl-http-client;
diff --git a/pkgs/development/haskell-modules/configuration-hackage2nix.yaml b/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
index 97d6d9960e09d..71b1d9b93b4fc 100644
--- a/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
+++ b/pkgs/development/haskell-modules/configuration-hackage2nix.yaml
@@ -2688,6 +2688,7 @@ extra-packages:
   - happy <1.19.6                       # newer versions break Agda
   - haskell-gi-overloading == 0.0       # gi-* packages use this dependency to disable overloading support
   - haskell-src-exts == 1.19.*          # required by hindent and structured-haskell-mode
+  - hoogle == 5.0.14                    # required by hie-hoogle
   - hpack == 0.20.*                     # required by stack-1.6.1
   - inline-c < 0.6                      # required on GHC 8.0.x
   - inline-c-cpp < 0.2                  # required on GHC 8.0.x
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index 8a8c6a90a9573..2320d6a8752a8 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/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index e4ae24f74fab0..29bcdfce2c937 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -1,7 +1,14 @@
-{ stdenv, fetchurl, ghc, pkgconfig, glibcLocales, coreutils, gnugrep, gnused
-, jailbreak-cabal, hscolour, cpphs, nodejs, lib, removeReferencesTo
+{ stdenv, buildPackages, ghc
+, jailbreak-cabal, hscolour, cpphs, nodejs
+, buildPlatform, hostPlatform
 }:
-let isCross = (ghc.cross or null) != null; in
+
+let
+  isCross = buildPlatform != hostPlatform;
+  inherit (buildPackages)
+    fetchurl removeReferencesTo
+    pkgconfig coreutils gnugrep gnused glibcLocales;
+in
 
 { pname
 , dontStrip ? (ghc.isGhcjs or false)
@@ -20,8 +27,8 @@ let isCross = (ghc.cross or null) != null; in
 , enableLibraryProfiling ? false
 , enableExecutableProfiling ? false
 # TODO enable shared libs for cross-compiling
-, enableSharedExecutables ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
-, enableSharedLibraries ? !isCross && (((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version))
+, enableSharedExecutables ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
+, enableSharedLibraries ? ((ghc.isGhcjs or false) || stdenv.lib.versionOlder "7.7" ghc.version)
 , enableSplitObjs ? null # OBSOLETE, use enableDeadCodeElimination
 , enableDeadCodeElimination ? (!stdenv.isDarwin)  # TODO: use -dead_strip  for darwin
 , enableStaticLibraries ? true
@@ -53,7 +60,7 @@ let isCross = (ghc.cross or null) != null; in
 , shellHook ? ""
 , coreSetup ? false # Use only core packages to build Setup.hs.
 , useCpphs ? false
-, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
+, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
 , enableSeparateDataOutput ? false
 , enableSeparateDocOutput ? doHaddock
 } @ args:
@@ -102,11 +109,12 @@ let
   enableParallelBuilding = (versionOlder "7.8" ghc.version && !hasActiveLibrary) || versionOlder "8.0.1" ghc.version;
 
   crossCabalFlags = [
-    "--with-ghc=${ghc.cross.config}-ghc"
-    "--with-ghc-pkg=${ghc.cross.config}-ghc-pkg"
-    "--with-gcc=${ghc.cc}"
-    "--with-ld=${ghc.ld}"
-    "--with-hsc2hs=${nativeGhc}/bin/hsc2hs"
+    "--with-ghc=${ghc.targetPrefix}ghc"
+    "--with-ghc-pkg=${ghc.targetPrefix}ghc-pkg"
+    "--with-gcc=${stdenv.cc.targetPrefix}cc"
+    "--with-ld=${stdenv.cc.bintools.targetPrefix}ld"
+    "--with-hsc2hs=${nativeGhc}/bin/hsc2hs" # not cross one
+    "--with-strip=${stdenv.cc.bintools.targetPrefix}strip"
   ] ++ (if isHaLVM then [] else ["--hsc2hs-options=--cross-compile"]);
 
   crossCabalFlagsString =
@@ -135,7 +143,7 @@ let
   ] ++ optionals isGhcjs [
     "--ghcjs"
   ] ++ optionals isCross ([
-    "--configure-option=--host=${ghc.cross.config}"
+    "--configure-option=--host=${hostPlatform.config}"
   ] ++ crossCabalFlags);
 
   setupCompileFlags = [
@@ -171,8 +179,7 @@ let
   setupBuilder = if isCross then "${nativeGhc}/bin/ghc" else ghcCommand;
   setupCommand = "./Setup";
   ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
-  crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
-  ghcCommand = "${crossPrefix}${ghcCommand'}";
+  ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
   ghcCommandCaps= toUpper ghcCommand';
 
 in
@@ -222,8 +229,8 @@ stdenv.mkDerivation ({
     setupCompileFlags="${concatStringsSep " " setupCompileFlags}"
     configureFlags="${concatStringsSep " " defaultConfigureFlags} $configureFlags"
 
-    # nativePkgs defined in stdenv/setup.hs
-    for p in "''${nativePkgs[@]}"; do
+    # host.*Pkgs defined in stdenv/setup.hs
+    for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do
       if [ -d "$p/lib/${ghc.name}/package.conf.d" ]; then
         cp -f "$p/lib/${ghc.name}/package.conf.d/"*.conf $packageConfDir/
         continue
@@ -269,6 +276,8 @@ stdenv.mkDerivation ({
     runHook postCompileBuildDriver
   '';
 
+  inherit configureFlags;
+
   configurePhase = ''
     runHook preConfigure
 
@@ -402,7 +411,6 @@ stdenv.mkDerivation ({
 // optionalAttrs (postCompileBuildDriver != "") { inherit postCompileBuildDriver; }
 // optionalAttrs (preUnpack != "")      { inherit preUnpack; }
 // optionalAttrs (postUnpack != "")     { inherit postUnpack; }
-// optionalAttrs (configureFlags != []) { inherit configureFlags; }
 // optionalAttrs (patches != [])        { inherit patches; }
 // optionalAttrs (patchPhase != "")     { inherit patchPhase; }
 // optionalAttrs (preConfigure != "")   { inherit preConfigure; }
@@ -421,5 +429,5 @@ stdenv.mkDerivation ({
 // optionalAttrs (postFixup != "")      { inherit postFixup; }
 // optionalAttrs (dontStrip)            { inherit dontStrip; }
 // optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; }
-// optionalAttrs (stdenv.isLinux)       { LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
+// optionalAttrs (buildPlatform.isLinux){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; }
 )
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index c4d9e490336f7..a3481d547e2b4 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -101685,6 +101685,38 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "hoogle_5_0_14" = callPackage
+    ({ mkDerivation, aeson, base, binary, bytestring, cmdargs, conduit
+     , conduit-extra, connection, containers, deepseq, directory, extra
+     , filepath, haskell-src-exts, http-conduit, http-types, js-flot
+     , js-jquery, mmap, network, network-uri, old-locale, process
+     , process-extras, QuickCheck, resourcet, stdenv, storable-tuple
+     , tar, template-haskell, text, time, transformers, uniplate
+     , utf8-string, vector, wai, wai-logger, warp, warp-tls, zlib
+     }:
+     mkDerivation {
+       pname = "hoogle";
+       version = "5.0.14";
+       sha256 = "e7cfa9ca7496d7a30b476f3502c0dfa38671d4235042bb46806568602e97bbf8";
+       isLibrary = true;
+       isExecutable = true;
+       enableSeparateDataOutput = true;
+       libraryHaskellDepends = [
+         aeson base binary bytestring cmdargs conduit conduit-extra
+         connection containers deepseq directory extra filepath
+         haskell-src-exts http-conduit http-types js-flot js-jquery mmap
+         network network-uri old-locale process process-extras QuickCheck
+         resourcet storable-tuple tar template-haskell text time
+         transformers uniplate utf8-string vector wai wai-logger warp
+         warp-tls zlib
+       ];
+       executableHaskellDepends = [ base ];
+       testTarget = "--test-option=--no-net";
+       homepage = "http://hoogle.haskell.org/";
+       description = "Haskell API Search";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "hoogle" = callPackage
     ({ mkDerivation, aeson, base, binary, bytestring, cmdargs, conduit
      , conduit-extra, connection, containers, deepseq, directory, extra
diff --git a/pkgs/development/haskell-modules/hie-packages.nix b/pkgs/development/haskell-modules/hie-packages.nix
index 41b28023348d3..5ed5fb62ca001 100644
--- a/pkgs/development/haskell-modules/hie-packages.nix
+++ b/pkgs/development/haskell-modules/hie-packages.nix
@@ -28,6 +28,7 @@ let src = pkgs.fetchFromGitHub
       };
     cabal-helper = self.cabal-helper_hie;
     haddock-library = self.haddock-library_1_4_4;
+    hoogle = self.hoogle_5_0_14;
     ghc-dump-tree = self.ghc-dump-tree_hie;
     ghc-mod = self.ghc-mod_hie;
     HaRe = self.HaRe_hie;
@@ -259,7 +260,7 @@ in
          homepage = "http://github.com/githubuser/haskell-ide-engine#readme";
          description = "Provide a common engine to power any Haskell IDE";
          license = stdenv.lib.licenses.bsd3;
-      }) {};
+      }) { inherit hoogle; };
     hie-apply-refact = callPackage
       ({ mkDerivation, aeson, apply-refact, base, either, extra, ghc-mod
        , ghc-mod-core, haskell-src-exts, hie-base, hie-plugin-api, hlint
@@ -435,7 +436,7 @@ in
          ];
          description = "Haskell IDE Hoogle plugin";
          license = stdenv.lib.licenses.bsd3;
-       }) { inherit ghc-mod; };
+       }) { inherit ghc-mod hoogle; };
     hie-plugin-api = callPackage
       ({ mkDerivation, aeson, base, containers, Diff, directory, either
        , filepath, fingertree, ghc, ghc-mod-core, haskell-lsp, hie-base
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index 7ac0ef509f41f..968773ded983f 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -1,7 +1,10 @@
 # This expression takes a file like `hackage-packages.nix` and constructs
 # a full package set out of that.
 
-{ # package-set used for non-haskell dependencies (all of nixpkgs)
+{ # package-set used for build tools (all of nixpkgs)
+  buildPackages
+
+, # package-set used for non-haskell dependencies (all of nixpkgs)
   pkgs
 
 , # stdenv to use for building haskell packages
@@ -28,19 +31,21 @@
 self:
 
 let
+  inherit (stdenv) buildPlatform hostPlatform;
 
   inherit (stdenv.lib) fix' extends makeOverridable;
   inherit (haskellLib) overrideCabal;
 
+  buildHaskellPackages = if hostPlatform != buildPlatform
+                         then self.ghc.bootPkgs
+                         else self;
+
   mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
     inherit stdenv;
-    inherit (pkgs) fetchurl pkgconfig glibcLocales coreutils gnugrep gnused;
-    nodejs = pkgs.nodejs-slim;
-    jailbreak-cabal = if (self.ghc.cross or null) != null
-      then self.ghc.bootPkgs.jailbreak-cabal
-      else self.jailbreak-cabal;
+    nodejs = buildPackages.nodejs-slim;
+    inherit (buildHaskellPackages) jailbreak-cabal;
     inherit (self) ghc;
-    hscolour = overrideCabal self.hscolour (drv: {
+    hscolour = overrideCabal buildHaskellPackages.hscolour (drv: {
       isLibrary = false;
       doHaddock = false;
       hyperlinkSource = false;      # Avoid depending on hscolour for this build.
@@ -95,7 +100,7 @@ let
   defaultScope = mkScope self;
   callPackage = drv: args: callPackageWithScope defaultScope drv args;
 
-  withPackages = packages: callPackage ./with-packages-wrapper.nix {
+  withPackages = packages: buildPackages.callPackage ./with-packages-wrapper.nix {
     inherit (self) llvmPackages;
     haskellPackages = self;
     inherit packages;
@@ -104,13 +109,13 @@ let
   haskellSrc2nix = { name, src, sha256 ? null }:
     let
       sha256Arg = if isNull sha256 then "--sha256=" else ''--sha256="${sha256}"'';
-    in pkgs.stdenv.mkDerivation {
+    in pkgs.buildPackages.stdenv.mkDerivation {
       name = "cabal2nix-${name}";
-      buildInputs = [ pkgs.haskellPackages.cabal2nix ];
+      nativeBuildInputs = [ pkgs.buildPackages.haskellPackages.cabal2nix ];
       preferLocalBuild = true;
       phases = ["installPhase"];
       LANG = "en_US.UTF-8";
-      LOCALE_ARCHIVE = pkgs.lib.optionalString pkgs.stdenv.isLinux "${pkgs.glibcLocales}/lib/locale/locale-archive";
+      LOCALE_ARCHIVE = pkgs.lib.optionalString buildPlatform.isLinux "${buildPackages.glibcLocales}/lib/locale/locale-archive";
       installPhase = ''
         export HOME="$TMP"
         mkdir -p "$out"
diff --git a/pkgs/development/haskell-modules/with-packages-wrapper.nix b/pkgs/development/haskell-modules/with-packages-wrapper.nix
index ac484b3c1124b..6b3d6dfd2b0c6 100644
--- a/pkgs/development/haskell-modules/with-packages-wrapper.nix
+++ b/pkgs/development/haskell-modules/with-packages-wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
+{ lib, targetPlatform, ghc, llvmPackages, packages, symlinkJoin, makeWrapper
 , ignoreCollisions ? false, withLLVM ? false
 , postBuild ? ""
 , haskellPackages
@@ -36,9 +36,8 @@ let
   isHaLVM       = ghc.isHaLVM or false;
   ghc761OrLater = isGhcjs || isHaLVM || lib.versionOlder "7.6.1" ghc.version;
   packageDBFlag = if ghc761OrLater then "--global-package-db" else "--global-conf";
-  ghcCommand'   = if isGhcjs then "ghcjs" else "ghc";
-  crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
-  ghcCommand = "${crossPrefix}${ghcCommand'}";
+  ghcCommand'    = if isGhcjs then "ghcjs" else "ghc";
+  ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
   ghcCommandCaps= lib.toUpper ghcCommand';
   libDir        = if isHaLVM then "$out/lib/HaLVM-${ghc.version}" else "$out/lib/${ghcCommand}-${ghc.version}";
   docDir        = "$out/share/doc/ghc/html";
@@ -49,7 +48,7 @@ let
   # https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/code-generators.html
   llvm          = lib.makeBinPath
                   ([ llvmPackages.llvm ]
-                   ++ lib.optional stdenv.isDarwin llvmPackages.clang);
+                   ++ lib.optional targetPlatform.isDarwin llvmPackages.clang);
 in
 if paths == [] && !withLLVM then ghc else
 symlinkJoin {
@@ -99,7 +98,7 @@ symlinkJoin {
         makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "${packageDBFlag}=${packageCfgDir}"
       fi
     done
-  '' + (lib.optionalString stdenv.isDarwin ''
+  '' + (lib.optionalString targetPlatform.isDarwin ''
     # Work around a linker limit in macOS Sierra (see generic-builder.nix):
     local packageConfDir="$out/lib/${ghc.name}/package.conf.d";
     local dynamicLinksDir="$out/lib/links"
diff --git a/pkgs/development/idris-modules/build-idris-package.nix b/pkgs/development/idris-modules/build-idris-package.nix
index 9dfa3430ed8be..66eddd0e3602d 100644
--- a/pkgs/development/idris-modules/build-idris-package.nix
+++ b/pkgs/development/idris-modules/build-idris-package.nix
@@ -18,7 +18,8 @@
       fi
     }
 
-    envHooks+=(addIdrisLibs)
+    # All run-time deps
+    addEnvHooks 0 addIdrisLibs
   '';
 
   buildPhase = ''
diff --git a/pkgs/development/idris-modules/with-packages.nix b/pkgs/development/idris-modules/with-packages.nix
index d2b09808ec153..d4638670f699d 100644
--- a/pkgs/development/idris-modules/with-packages.nix
+++ b/pkgs/development/idris-modules/with-packages.nix
@@ -14,7 +14,7 @@
       fi
     }
 
-    envHooks+=(installIdrisLib)
+    envHostTargetHooks+=(installIdrisLib)
   '';
 
   unpackPhase = ''
diff --git a/pkgs/development/interpreters/elixir/setup-hook.sh b/pkgs/development/interpreters/elixir/setup-hook.sh
index 2ed3b2e6454b1..501eca3cf02a3 100644
--- a/pkgs/development/interpreters/elixir/setup-hook.sh
+++ b/pkgs/development/interpreters/elixir/setup-hook.sh
@@ -2,4 +2,4 @@ addErlLibPath() {
     addToSearchPath ERL_LIBS $1/lib/elixir/lib
 }
 
-envHooks+=(addErlLibPath)
+addEnvHooks "$hostOffset" addErlLibPath
diff --git a/pkgs/development/interpreters/erlang/setup-hook.sh b/pkgs/development/interpreters/erlang/setup-hook.sh
index 68c0f762dfc5c..3962d154ba9f7 100644
--- a/pkgs/development/interpreters/erlang/setup-hook.sh
+++ b/pkgs/development/interpreters/erlang/setup-hook.sh
@@ -2,4 +2,4 @@ addErlangLibPath() {
     addToSearchPath ERL_LIBS $1/lib/erlang/lib
 }
 
-envHooks+=(addErlangLibPath)
+addEnvHooks "$hostOffset" addErlangLibPath
diff --git a/pkgs/development/interpreters/guile/setup-hook-2.0.sh b/pkgs/development/interpreters/guile/setup-hook-2.0.sh
index fd1dc944ed44b..c7fb4f70fc6a8 100644
--- a/pkgs/development/interpreters/guile/setup-hook-2.0.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-2.0.sh
@@ -10,4 +10,4 @@ addGuileLibPath () {
     fi
 }
 
-envHooks+=(addGuileLibPath)
+addEnvHooks "$hostOffset" addGuileLibPath
diff --git a/pkgs/development/interpreters/guile/setup-hook-2.2.sh b/pkgs/development/interpreters/guile/setup-hook-2.2.sh
index 86c1e0d3e4a9d..73e700bde026c 100644
--- a/pkgs/development/interpreters/guile/setup-hook-2.2.sh
+++ b/pkgs/development/interpreters/guile/setup-hook-2.2.sh
@@ -10,4 +10,4 @@ addGuileLibPath () {
     fi
 }
 
-envHooks+=(addGuileLibPath)
+addEnvHooks "$hostOffset" addGuileLibPath
diff --git a/pkgs/development/interpreters/guile/setup-hook.sh b/pkgs/development/interpreters/guile/setup-hook.sh
index c1d19e579ed53..bf04fee1e8936 100644
--- a/pkgs/development/interpreters/guile/setup-hook.sh
+++ b/pkgs/development/interpreters/guile/setup-hook.sh
@@ -5,4 +5,4 @@ addGuileLibPath () {
     fi
 }
 
-envHooks+=(addGuileLibPath)
+addEnvHooks "$hostOffset" addGuileLibPath
diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix
index ff192c072865f..2224a13ba7c06 100644
--- a/pkgs/development/interpreters/jruby/default.nix
+++ b/pkgs/development/interpreters/jruby/default.nix
@@ -36,7 +36,7 @@ jruby = stdenv.mkDerivation rec {
          addToSearchPath GEM_PATH \$1/${passthru.gemPath}
        }
 
-       envHooks+=(addGemPath)
+       addEnvHooks "$hostOffset" addGemPath
      EOF
   '';
 
diff --git a/pkgs/development/interpreters/perl/setup-hook.sh b/pkgs/development/interpreters/perl/setup-hook.sh
index a8656b8531dbc..7909412806c82 100644
--- a/pkgs/development/interpreters/perl/setup-hook.sh
+++ b/pkgs/development/interpreters/perl/setup-hook.sh
@@ -2,4 +2,4 @@ addPerlLibPath () {
     addToSearchPath PERL5LIB $1/lib/perl5/site_perl
 }
 
-envHooks+=(addPerlLibPath)
+addEnvHooks "$hostOffset" addPerlLibPath
diff --git a/pkgs/development/interpreters/php/default.nix b/pkgs/development/interpreters/php/default.nix
index 8bfc01ba46c20..40c01b15e5a00 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 5f7348ac825f6..d9cff16f448f8 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/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh
index dda9bed39f85e..77ec9e9ac0bf8 100644
--- a/pkgs/development/interpreters/python/setup-hook.sh
+++ b/pkgs/development/interpreters/python/setup-hook.sh
@@ -12,10 +12,13 @@ toPythonPath() {
     echo $result
 }
 
-envHooks+=(addPythonPath)
+addEnvHooks "$hostOffset" addPythonPath
 
 # Determinism: The interpreter is patched to write null timestamps when compiling python files.
 # This way python doesn't try to update them when we freeze timestamps in nix store.
 export DETERMINISTIC_BUILD=1;
 # Determinism: We fix the hashes of str, bytes and datetime objects.
 export PYTHONHASHSEED=0;
+# Determinism. Whenever Python is included, it should not check user site-packages.
+# This option is only relevant when the sandbox is disabled.
+export PYTHONNOUSERSITE=1;
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 3d18d5650a815..6a49107361abc 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -150,7 +150,7 @@ let
             addToSearchPath GEM_PATH \$1/${passthru.gemPath}
           }
 
-          envHooks+=(addGemPath)
+          addEnvHooks "$hostOffset" addGemPath
           EOF
         '' + opString useRailsExpress ''
           rbConfig=$(find $out/lib/ruby -name rbconfig.rb)
diff --git a/pkgs/development/libraries/SDL/setup-hook.sh b/pkgs/development/libraries/SDL/setup-hook.sh
index 3696e743a07a1..20382f18f529a 100644
--- a/pkgs/development/libraries/SDL/setup-hook.sh
+++ b/pkgs/development/libraries/SDL/setup-hook.sh
@@ -4,8 +4,4 @@ addSDLPath () {
   fi
 }
 
-if test -n "$crossConfig"; then
-  crossEnvHooks+=(addSDLPath)
-else
-  envHooks+=(addSDLPath)
-fi
+addEnvHooks "$hostOffset" addSDLPath
diff --git a/pkgs/development/libraries/SDL2/setup-hook.sh b/pkgs/development/libraries/SDL2/setup-hook.sh
index 5a26440f37b31..3acce9d473c56 100644
--- a/pkgs/development/libraries/SDL2/setup-hook.sh
+++ b/pkgs/development/libraries/SDL2/setup-hook.sh
@@ -4,8 +4,4 @@ addSDL2Path () {
   fi
 }
 
-if test -n "$crossConfig"; then
-  crossEnvHooks+=(addSDL2Path)
-else
-  envHooks+=(addSDL2Path)
-fi
+addEnvHooks "$hostOffset" addSDL2Path
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index 61c18837782d3..f7d3887cc180a 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.59.nix b/pkgs/development/libraries/boost/1.59.nix
index 2666b1d6c5d29..603d7883c647e 100644
--- a/pkgs/development/libraries/boost/1.59.nix
+++ b/pkgs/development/libraries/boost/1.59.nix
@@ -8,33 +8,33 @@ callPackage ./generic.nix (args // rec {
     sha256 = "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj";
   };
 
-  patches = if stdenv.isCygwin then [
-      ./cygwin-fedora-boost-1.50.0-fix-non-utf8-files.patch
-      ./cygwin-fedora-boost-1.50.0-pool.patch
-      ./cygwin-fedora-boost-1.57.0-mpl-print.patch
-      ./cygwin-fedora-boost-1.57.0-spirit-unused_typedef.patch
-      ./cygwin-fedora-boost-1.54.0-locale-unused_typedef.patch
-      ./cygwin-fedora-boost-1.54.0-python-unused_typedef.patch
-      ./cygwin-fedora-boost-1.57.0-pool-test_linking.patch
-      ./cygwin-fedora-boost-1.54.0-pool-max_chunks_shadow.patch
-      ./cygwin-fedora-boost-1.57.0-signals2-weak_ptr.patch
-      ./cygwin-fedora-boost-1.57.0-uuid-comparison.patch
-      ./cygwin-fedora-boost-1.57.0-move-is_class.patch
-      ./cygwin-1.40.0-cstdint-cygwin.patch
-      ./cygwin-1.57.0-asio-cygwin.patch
-      ./cygwin-1.55.0-asio-MSG_EOR.patch
-      ./cygwin-1.57.0-config-cygwin.patch
-      ./cygwin-1.57.0-context-cygwin.patch
-      ./cygwin-1.57.0-filesystem-cygwin.patch
-      ./cygwin-1.55.0-interlocked-cygwin.patch
-      ./cygwin-1.40.0-iostreams-cygwin.patch
-      ./cygwin-1.57.0-locale-cygwin.patch
-      ./cygwin-1.57.0-log-cygwin.patch
-      ./cygwin-1.40.0-python-cygwin.patch
-      ./cygwin-1.40.0-regex-cygwin.patch
-      ./cygwin-1.57.0-smart_ptr-cygwin.patch
-      ./cygwin-1.57.0-system-cygwin.patch
-      ./cygwin-1.45.0-jam-cygwin.patch
-      ./cygwin-1.50.0-jam-pep3149.patch
-    ] else null;
+  patches = stdenv.lib.optionals stdenv.isCygwin [
+    ./cygwin-fedora-boost-1.50.0-fix-non-utf8-files.patch
+    ./cygwin-fedora-boost-1.50.0-pool.patch
+    ./cygwin-fedora-boost-1.57.0-mpl-print.patch
+    ./cygwin-fedora-boost-1.57.0-spirit-unused_typedef.patch
+    ./cygwin-fedora-boost-1.54.0-locale-unused_typedef.patch
+    ./cygwin-fedora-boost-1.54.0-python-unused_typedef.patch
+    ./cygwin-fedora-boost-1.57.0-pool-test_linking.patch
+    ./cygwin-fedora-boost-1.54.0-pool-max_chunks_shadow.patch
+    ./cygwin-fedora-boost-1.57.0-signals2-weak_ptr.patch
+    ./cygwin-fedora-boost-1.57.0-uuid-comparison.patch
+    ./cygwin-fedora-boost-1.57.0-move-is_class.patch
+    ./cygwin-1.40.0-cstdint-cygwin.patch
+    ./cygwin-1.57.0-asio-cygwin.patch
+    ./cygwin-1.55.0-asio-MSG_EOR.patch
+    ./cygwin-1.57.0-config-cygwin.patch
+    ./cygwin-1.57.0-context-cygwin.patch
+    ./cygwin-1.57.0-filesystem-cygwin.patch
+    ./cygwin-1.55.0-interlocked-cygwin.patch
+    ./cygwin-1.40.0-iostreams-cygwin.patch
+    ./cygwin-1.57.0-locale-cygwin.patch
+    ./cygwin-1.57.0-log-cygwin.patch
+    ./cygwin-1.40.0-python-cygwin.patch
+    ./cygwin-1.40.0-regex-cygwin.patch
+    ./cygwin-1.57.0-smart_ptr-cygwin.patch
+    ./cygwin-1.57.0-system-cygwin.patch
+    ./cygwin-1.45.0-jam-cygwin.patch
+    ./cygwin-1.50.0-jam-pep3149.patch
+  ];
 })
diff --git a/pkgs/development/libraries/boost/1.65.nix b/pkgs/development/libraries/boost/1.65.nix
index 56b136cd99b44..9837e1c691930 100644
--- a/pkgs/development/libraries/boost/1.65.nix
+++ b/pkgs/development/libraries/boost/1.65.nix
@@ -9,6 +9,4 @@ callPackage ./generic.nix (args // rec {
     sha256 = "9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81";
   };
 
-  enableNumpy = true;
-
 })
diff --git a/pkgs/development/libraries/boost/1.66.nix b/pkgs/development/libraries/boost/1.66.nix
new file mode 100644
index 0000000000000..3fd9c16082482
--- /dev/null
+++ b/pkgs/development/libraries/boost/1.66.nix
@@ -0,0 +1,12 @@
+{ 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";
+  };
+
+})
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index b2ec31ace17b3..c2a59431ac041 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -1,18 +1,19 @@
 { stdenv, fetchurl, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
-, buildPlatform, hostPlatform
-, toolset ? if stdenv.cc.isClang then "clang" else null
+, which
+, buildPackages, buildPlatform, hostPlatform
+, toolset ? /**/ if stdenv.cc.isClang                                then "clang"
+            else if stdenv.cc.isGNU && hostPlatform != buildPlatform then "gcc-cross"
+            else null
 , enableRelease ? true
 , enableDebug ? false
 , enableSingleThreaded ? false
 , enableMultiThreaded ? true
 , enableShared ? !(hostPlatform.libc == "msvcrt") # problems for now
 , enableStatic ? !enableShared
-, enablePIC ? false
-, enableExceptions ? false
 , enablePython ? hostPlatform == buildPlatform
-, enableNumpy ? false
+, enableNumpy ? enablePython && stdenv.lib.versionAtLeast version "1.65"
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
-, patches ? null
+, patches ? []
 , mpi ? null
 
 # Attributes inherit from specific versions
@@ -21,8 +22,9 @@
 }:
 
 # We must build at least one type of libraries
-assert !enableShared -> enableStatic;
+assert enableShared || enableStatic;
 
+# Python isn't supported when cross-compiling
 assert enablePython -> hostPlatform == buildPlatform;
 assert enableNumpy -> enablePython;
 
@@ -46,86 +48,41 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
-  cflags = if enablePIC && enableExceptions then
-             "cflags=\"-fPIC -fexceptions\" cxxflags=-fPIC linkflags=-fPIC"
-           else if enablePIC then
-             "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if enableExceptions then
-             "cflags=-fexceptions"
-           else
-             "";
-
-  withToolset = stdenv.lib.optionalString (toolset != null) "--with-toolset=${toolset}";
-
-  genericB2Flags = [
+  b2Args = concatStringsSep " " ([
     "--includedir=$dev/include"
     "--libdir=$out/lib"
     "-j$NIX_BUILD_CORES"
     "--layout=${layout}"
     "variant=${variant}"
     "threading=${threading}"
-  ] ++ optional (link != "static") "runtime-link=${runtime-link}" ++ [
+    "runtime-link=${runtime-link}"
     "link=${link}"
-    "${cflags}"
-  ] ++ optional (variant == "release") "debug-symbols=off"
-    ++ optional (!enablePython) "--without-python";
-
-  nativeB2Flags = [
     "-sEXPAT_INCLUDE=${expat.dev}/include"
     "-sEXPAT_LIBPATH=${expat.out}/lib"
-  ] ++ optional (toolset != null) "toolset=${toolset}"
-    ++ optional (mpi != null) "--user-config=user-config.jam";
-  nativeB2Args = concatStringsSep " " (genericB2Flags ++ nativeB2Flags);
-
-  crossB2Flags = [
-    "-sEXPAT_INCLUDE=${expat.crossDrv}/include"
-    "-sEXPAT_LIBPATH=${expat.crossDrv}/lib"
-    "--user-config=user-config.jam"
-    "toolset=gcc-cross"
-  ] ++ optionals (hostPlatform.libc == "msvcrt") [
+  ] ++ optional (variant == "release") "debug-symbols=off"
+    ++ optional (toolset != null) "toolset=${toolset}"
+    ++ optional (mpi != null || hostPlatform != buildPlatform) "--user-config=user-config.jam"
+    ++ optionals (hostPlatform.libc == "msvcrt") [
     "target-os=windows"
     "threadapi=win32"
     "binary-format=pe"
     "address-model=${toString hostPlatform.parsed.cpu.bits}"
     "architecture=x86"
-  ];
-  crossB2Args = concatStringsSep " " (genericB2Flags ++ crossB2Flags);
-
-  builder = b2Args: ''
-    ./b2 ${b2Args}
-  '';
-
-  installer = b2Args: ''
-    # boostbook is needed by some applications
-    mkdir -p $dev/share/boostbook
-    cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
-
-    # Let boost install everything else
-    ./b2 ${b2Args} install
-  '';
-
-  commonConfigureFlags = [
-    "--includedir=$(dev)/include"
-    "--libdir=$(out)/lib"
-  ];
-
-  fixup = ''
-    # Make boost header paths relative so that they are not runtime dependencies
-    (
-      cd "$dev"
-      find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
-        -exec sed '1i#line 1 "{}"' -i '{}' \;
-    )
-  '' + optionalString (hostPlatform.libc == "msvcrt") ''
-    ${stdenv.cc.targetPrefix}ranlib "$out/lib/"*.a
-  '';
+  ]);
 
 in
 
 stdenv.mkDerivation {
   name = "boost-${version}";
 
-  inherit src patches version;
+  inherit src;
+
+  patchFlags = optionalString (hostPlatform.libc == "msvcrt") "-p0";
+  patches = patches ++ optional (hostPlatform.libc == "msvcrt") (fetchurl {
+    url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/"
+        + "boost-mingw.patch";
+    sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
+  });
 
   meta = {
     homepage = http://boost.org/;
@@ -142,9 +99,13 @@ stdenv.mkDerivation {
           --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)";
     fi;
   '' + optionalString (mpi != null) ''
-    cat << EOF > user-config.jam
+    cat << EOF >> user-config.jam
     using mpi : ${mpi}/bin/mpiCC ;
     EOF
+  '' + optionalString (hostPlatform != buildPlatform) ''
+    cat << EOF >> user-config.jam
+    using gcc : cross : ${stdenv.cc.targetPrefix}c++ ;
+    EOF
   '';
 
   NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin
@@ -152,6 +113,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
+  nativeBuildInputs = [ which buildPackages.stdenv.cc ];
   buildInputs = [ expat zlib bzip2 libiconv ]
     ++ optional (hostPlatform == buildPlatform) icu
     ++ optional stdenv.isDarwin fixDarwinDylibNames
@@ -159,39 +121,35 @@ stdenv.mkDerivation {
     ++ optional enableNumpy python.pkgs.numpy;
 
   configureScript = "./bootstrap.sh";
-  configureFlags = commonConfigureFlags
-    ++ [ "--with-python=${python.interpreter}" ]
-    ++ optional (hostPlatform == buildPlatform) "--with-icu=${icu.dev}"
+  configurePlatforms = [];
+  configureFlags = [
+    "--includedir=$(dev)/include"
+    "--libdir=$(out)/lib"
+  ] ++ optional enablePython "--with-python=${python.interpreter}"
+    ++ [ (if hostPlatform == buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ]
     ++ optional (toolset != null) "--with-toolset=${toolset}";
 
-  buildPhase = builder nativeB2Args;
+  buildPhase = ''
+    ./b2 ${b2Args}
+  '';
+
+  installPhase = ''
+    # boostbook is needed by some applications
+    mkdir -p $dev/share/boostbook
+    cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
 
-  installPhase = installer nativeB2Args;
+    # Let boost install everything else
+    ./b2 ${b2Args} install
+  '';
 
-  postFixup = fixup;
+  postFixup = ''
+    # Make boost header paths relative so that they are not runtime dependencies
+    find "$dev/include" \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
+      -exec sed '1i#line 1 "{}"' -i '{}' \;
+  '' + optionalString (hostPlatform.libc == "msvcrt") ''
+    $RANLIB "$out/lib/"*.a
+  '';
 
   outputs = [ "out" "dev" ];
   setOutputFlags = false;
-
-  crossAttrs = rec {
-    # We want to substitute the contents of configureFlags, removing thus the
-    # usual --build and --host added on cross building.
-    preConfigure = ''
-      export configureFlags="--without-icu ${concatStringsSep " " commonConfigureFlags}"
-      cat << EOF > user-config.jam
-      using gcc : cross : $crossConfig-g++ ;
-      EOF
-    '';
-    buildPhase = builder crossB2Args;
-    installPhase = installer crossB2Args;
-    postFixup = fixup;
-  } // optionalAttrs (hostPlatform.libc == "msvcrt") {
-    patches = fetchurl {
-      url = "https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/"
-          + "boost-mingw.patch";
-      sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
-    };
-
-    patchFlags = "-p0";
-  };
 }
diff --git a/pkgs/development/libraries/cppdb/default.nix b/pkgs/development/libraries/cppdb/default.nix
index 72fa309b721f2..07c6e1490e7e2 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 984d3da811983..54174e7cfe460 100644
--- a/pkgs/development/libraries/gdal/default.nix
+++ b/pkgs/development/libraries/gdal/default.nix
@@ -8,12 +8,12 @@
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  version = "2.2.1";
+  version = "2.2.3";
   name = "gdal-${version}";
 
   src = fetchurl {
     url = "http://download.osgeo.org/gdal/${version}/${name}.tar.xz";
-    sha256 = "0rk0p0k787whzzdl8m1f9wcrm7h9bf1pny3z96d93b4383arhw4j";
+    sha256 = "a328d63d476b3653f5a25b5f7971e87a15cdf8860ab0729d4b1157ba988b8d0b";
   };
 
   buildInputs = [ unzip libjpeg libtiff libpng proj openssl sqlite
@@ -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 c9f0c07610197..7a80ce7fdb667 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/gdk-pixbuf/setup-hook.sh b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
index ba7ab82f50b48..5a7dcd7929969 100644
--- a/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
+++ b/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -14,4 +14,4 @@ findGdkPixbufLoaders() {
 
 }
 
-envHooks+=(findGdkPixbufLoaders)
+addEnvHooks "$hostOffset" findGdkPixbufLoaders
diff --git a/pkgs/development/libraries/glib/setup-hook.sh b/pkgs/development/libraries/glib/setup-hook.sh
index c5cf293902cd4..98341376fdf63 100644
--- a/pkgs/development/libraries/glib/setup-hook.sh
+++ b/pkgs/development/libraries/glib/setup-hook.sh
@@ -5,7 +5,7 @@ make_glib_find_gsettings_schemas() {
         addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"*
     fi
 }
-envHooks+=(make_glib_find_gsettings_schemas)
+addEnvHooks "$hostOffset" make_glib_find_gsettings_schemas
 
 # Install gschemas, if any, in a package-specific directory
 glibPreInstallPhase() {
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 0000000000000..9bf1a4f7d39b2
--- /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 0000000000000..ce18b874c4272
--- /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 86f3be15fea6e..cfec3209b98aa 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;
 
@@ -121,7 +141,7 @@ stdenv.mkDerivation ({
 
   outputs = [ "out" "bin" "dev" "static" ];
 
-  nativeBuildInputs = lib.optional (cross != null) buildPackages.stdenv.cc;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   buildInputs = lib.optionals withGd [ gd libpng ];
 
   # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix
index e3bacc86d58ea..dce052f8baab2 100644
--- a/pkgs/development/libraries/gmp/6.x.nix
+++ b/pkgs/development/libraries/gmp/6.x.nix
@@ -19,8 +19,8 @@ let self = stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "info" ];
   passthru.static = self.out;
 
-  nativeBuildInputs = [ m4 ]
-    ++ stdenv.lib.optional (buildPlatform != hostPlatform) buildPackages.stdenv.cc;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ m4 ];
 
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
diff --git a/pkgs/development/libraries/gmtk/default.nix b/pkgs/development/libraries/gmtk/default.nix
new file mode 100644
index 0000000000000..0fac97aaa4397
--- /dev/null
+++ b/pkgs/development/libraries/gmtk/default.nix
@@ -0,0 +1,32 @@
+{stdenv, substituteAll, fetchFromGitHub, libtool, pkgconfig, intltool, glib, gtk3
+, libpulseaudio, mplayer, gnome_mplayer }:
+
+stdenv.mkDerivation rec {
+  name = "gmtk-${version}";
+  version = "1.0.9";
+
+  src = fetchFromGitHub {
+    owner = "kdekorte";
+    repo = "gmtk";
+    rev = "v${version}";
+    sha256 = "1zb5m1y1gckal3140gvx31572a6xpccwfmdwa1w5lx2wdq1pwk1i";
+  };
+
+  nativeBuildInputs = [ libtool pkgconfig intltool ];
+  buildInputs = [ glib gtk3 libpulseaudio ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      mplayer = "${mplayer}/bin/mplayer";
+    })
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Common functions for gnome-mplayer and gecko-mediaplayer";
+    homepage = https://sites.google.com/site/kdekorte2/gnomemplayer;
+    license = licenses.gpl2;
+    maintainers = gnome_mplayer.meta.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gmtk/fix-paths.patch b/pkgs/development/libraries/gmtk/fix-paths.patch
new file mode 100644
index 0000000000000..64738300aba42
--- /dev/null
+++ b/pkgs/development/libraries/gmtk/fix-paths.patch
@@ -0,0 +1,20 @@
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -2449,7 +2449,7 @@
+         player->minimum_mplayer = detect_mplayer_features(player);
+ 
+         if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-            argv[argn++] = g_strdup_printf("mplayer");
++            argv[argn++] = g_strdup_printf("@mplayer@");
+         } else {
+             argv[argn++] = g_strdup_printf("%s", player->mplayer_binary);
+         }
+@@ -4135,7 +4135,7 @@
+         return ret;
+ 
+     if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", player->mplayer_binary);
+     }
diff --git a/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
index 583d8475ec3b4..a79ce05a38df0 100644
--- a/pkgs/development/libraries/gobject-introspection/setup-hook.sh
+++ b/pkgs/development/libraries/gobject-introspection/setup-hook.sh
@@ -1,5 +1,4 @@
 make_gobject_introspection_find_gir_files() {
-
     # required for .typelib files, eg mypaint git version
     if [ -d "$1/lib/girepository-1.0" ]; then
       addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
@@ -11,11 +10,18 @@ make_gobject_introspection_find_gir_files() {
     fi
 }
 
-envHooks+=(make_gobject_introspection_find_gir_files)
+addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files
+
+giDiscoverSelf() {
+    if [ -d "$prefix/lib/girepository-1.0" ]; then
+      addToSearchPath GI_TYPELIB_PATH $prefix/lib/girepository-1.0
+    fi
+}
+
+preFixupHooks+=(giDiscoverSelf)
 
 _multioutMoveGlibGir() {
   moveToOutput share/gir-1.0 "${!outputDev}"
 }
 
 preFixupHooks+=(_multioutMoveGlibGir)
-
diff --git a/pkgs/development/libraries/grantlee/5/setup-hook.sh b/pkgs/development/libraries/grantlee/5/setup-hook.sh
index aaa64868dc946..b51cb4a319091 100644
--- a/pkgs/development/libraries/grantlee/5/setup-hook.sh
+++ b/pkgs/development/libraries/grantlee/5/setup-hook.sh
@@ -10,8 +10,4 @@ _grantleeEnvHook() {
         propagatedUserEnvPkgs+=" $1"
     fi
 }
-if [ "$crossEnv" ]; then
-    crossEnvHooks+=(_grantleeEnvHook)
-else
-    envHooks+=(_grantleeEnvHook)
-fi
+addEnvHooks "$hostOffset" _grantleeEnvHook
diff --git a/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
index 3dd7812ece6db..b8c741af578fd 100644
--- a/pkgs/development/libraries/gstreamer/core/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/core/setup-hook.sh
@@ -5,5 +5,5 @@ addGstreamer1LibPath () {
     fi
 }
 
-envHooks+=(addGstreamer1LibPath)
+addEnvHooks "$hostOffset" addGstreamer1LibPath
 
diff --git a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
index e89aeda5bc1cb..65ce26112519d 100644
--- a/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
+++ b/pkgs/development/libraries/gstreamer/legacy/gstreamer/setup-hook.sh
@@ -5,4 +5,4 @@ addGstreamerLibPath () {
     fi
 }
 
-envHooks+=(addGstreamerLibPath)
+addEnvHooks "$hostOffset" addGstreamerLibPath
diff --git a/pkgs/development/libraries/gtk+/2.x.nix b/pkgs/development/libraries/gtk+/2.x.nix
index 45222b7d7fcc1..169fd119d51f0 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 399d5914c2de9..e85190cdfcec9 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/kde-frameworks/extra-cmake-modules/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
index c1b1e21852cf2..88091e78a0cd7 100644
--- a/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
+++ b/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
@@ -2,7 +2,7 @@ _ecmEnvHook() {
     addToSearchPath XDG_DATA_DIRS "$1/share"
     addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
 }
-envHooks+=(_ecmEnvHook)
+addEnvHooks "$targetOffset" _ecmEnvHook
 
 _ecmPreConfigureHook() {
     # Because we need to use absolute paths here, we must set *all* the paths.
diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
index 661e89e30782a..0a600fe8d0570 100644
--- a/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
@@ -8,10 +8,18 @@
 mkDerivation {
   name = "kdoctools";
   meta = { maintainers = [ lib.maintainers.ttuegel ]; };
-  nativeBuildInputs = [ extra-cmake-modules ];
-  propagatedNativeBuildInputs = [ perl perlPackages.URI ];
+  nativeBuildInputs = [
+    extra-cmake-modules
+    # The build system insists on having native Perl.
+    perl perlPackages.URI
+  ];
+  propagatedBuildInputs = [
+    # kdoctools at runtime actually needs Perl for the platform kdoctools is
+    # running on, not necessarily native perl.
+    perl perlPackages.URI
+    qtbase
+  ];
   buildInputs = [ karchive ki18n ];
-  propagatedBuildInputs = [ qtbase ];
   outputs = [ "out" "dev" ];
   patches = [ ./kdoctools-no-find-docbook-xml.patch ];
   cmakeFlags = [
diff --git a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
index 5cfffbd622d12..2928d9b34dbed 100644
--- a/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
+++ b/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
@@ -2,4 +2,4 @@ addXdgData() {
     addToSearchPath XDG_DATA_DIRS "$1/share"
 }
 
-envHooks+=(addXdgData)
+addEnvHooks "$targetOffset" addXdgData
diff --git a/pkgs/development/libraries/libagar/default.nix b/pkgs/development/libraries/libagar/default.nix
index 1c9e8eca0d577..ee984a53b4c96 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 bad2a060cdca7..94369449ff3dd 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 77c09f3ed1583..2a03efd632ff1 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 533d5d4cac811..e5e1e2e7a3995 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/libelf/default.nix b/pkgs/development/libraries/libelf/default.nix
index bd0d23bd0cdbc..bb1dbe51765e6 100644
--- a/pkgs/development/libraries/libelf/default.nix
+++ b/pkgs/development/libraries/libelf/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, gettext, glibc
+{ stdenv
+, fetchurl, autoreconfHook, gettext
 , buildPlatform, hostPlatform
 }:
 
@@ -17,12 +17,20 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  # Libelf's custom NLS macros fail to determine the catalog file extension on
-  # Darwin, so disable NLS for now.
-  # FIXME: Eventually make Gettext a build input on all platforms.
-  configureFlags = stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
-
-  nativeBuildInputs = [ gettext ];
+  configureFlags = []
+       # Configure check for dynamic lib support is broken, see
+       # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
+    ++ stdenv.lib.optional (hostPlatform != buildPlatform) "mr_cv_target_elf=yes"
+       # Libelf's custom NLS macros fail to determine the catalog file extension
+       # on Darwin, so disable NLS for now.
+    ++ stdenv.lib.optional hostPlatform.isDarwin "--disable-nls";
+
+  nativeBuildInputs = [ gettext ]
+       # Need to regenerate configure script with newer version in order to pass
+       # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
+       # which doesn't work with the bootstrapTools bash, so can only do this
+       # for cross builds when `stdenv.shell` is a newer bash.
+    ++ stdenv.lib.optional (hostPlatform != buildPlatform) autoreconfHook;
 
   meta = {
     description = "ELF object file access library";
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index e32ba050c38ff..397000fc7d245 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 074c1a9dfd286..060f5ba4934c1 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/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix
index 7ffc40f149462..d6d6989761bca 100644
--- a/pkgs/development/libraries/libopcodes/default.nix
+++ b/pkgs/development/libraries/libopcodes/default.nix
@@ -19,7 +19,8 @@ stdenv.mkDerivation rec {
     find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
   '';
 
-  nativeBuildInputs = [ autoreconfHook264 bison buildPackages.stdenv.cc ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ autoreconfHook264 bison ];
   buildInputs = [ libiberty ];
   # dis-asm.h includes bfd.h
   propagatedBuildInputs = [ libbfd ];
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 8e6fa005635fb..402af5d6f5830 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/librep/setup-hook.sh b/pkgs/development/libraries/librep/setup-hook.sh
index 420d63d6c5132..4d875b6933040 100644
--- a/pkgs/development/libraries/librep/setup-hook.sh
+++ b/pkgs/development/libraries/librep/setup-hook.sh
@@ -2,4 +2,4 @@ addRepDLLoadPath () {
     addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
 }
 
-envHooks+=(addRepDLLoadPath)
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix b/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix
deleted file mode 100644
index fbd30ac04f761..0000000000000
--- a/pkgs/development/libraries/libtorrent-rasterbar/1.0.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-args@{ callPackage, fetchpatch, ... }:
-
-callPackage (import ./generic.nix {
-  version = "1.0.11";
-  sha256 = "17p34d3n29q04pvz975gfl1fyj3sg9cl5l6j673xqfq3fpyis58i";
-  patches = [
-    # Compatibility with new Boost
-    (fetchpatch {
-      url = "https://github.com/arvidn/libtorrent/commit/7eb3cf6bc6dbada3fa7bb7ff4d5981182813a0e2.patch";
-      sha256 = "07agbrii6i8q4wmgpqbln7ldhhadaf5npcinvi6hnyipsr48jbj5";
-    })
-  ];
-}) args
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index ff5027fd472ea..00ec229861790 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -1,6 +1,6 @@
 args@{ callPackage, ... }:
 
 callPackage (import ./generic.nix {
-  version = "1.1.5";
-  sha256 = "1ifpcqw5mj2dwk23lhc2vpb47mg3j573v5z4zp8dkczpz7wg5jxq";
+  version = "1.1.6";
+  sha256 = "1xlh0sqypjbx0imw3bkbjwgwb4bm6zl7c0y01p0xsw8ncfmwjll7";
 }) args
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index fca99550a3ca2..4c00df4c17d89 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/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index 9aade8b96725a..675756509c856 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -22,7 +22,9 @@ stdenv.mkDerivation rec {
     sha256 = "11adzj0k82nlgpfrflabvqn2m7fmhp2y6pd7ivmapynxqb9vvb92";
   });
 
-  patches = [ ./clang.patch ] ++ lib.optional (abiVersion == "5" && stdenv.cc.isGNU) ./gcc-5.patch;
+  # Unnecessarily complicated in order to avoid mass-rebuilds
+  patches = lib.optional (!stdenv.cc.isClang || abiVersion == "5") ./clang.patch
+    ++ lib.optional (stdenv.cc.isGNU && abiVersion == "5") ./gcc-5.patch;
 
   outputs = [ "out" "dev" "man" ];
   setOutputFlags = false; # some aren't supported
@@ -37,10 +39,11 @@ stdenv.mkDerivation rec {
   # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
   CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
 
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [
     pkgconfig
   ] ++ lib.optionals (buildPlatform != hostPlatform) [
-    buildPackages.ncurses buildPackages.stdenv.cc
+    buildPackages.ncurses
   ];
   buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
 
diff --git a/pkgs/development/libraries/nss/ckpem.patch b/pkgs/development/libraries/nss/ckpem.patch
new file mode 100644
index 0000000000000..c1a65a6c0b289
--- /dev/null
+++ b/pkgs/development/libraries/nss/ckpem.patch
@@ -0,0 +1,11 @@
+--- nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:12.000000000 -0800
++++ nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:20.000000000 -0800
+@@ -156,8 +156,6 @@
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
+ 
+-  PRBool          logged_in;
+-
+ /* our raw object data array */
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 3e8ed856bfa8e..47f5c1ef5cf93 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -28,6 +28,7 @@ in stdenv.mkDerivation rec {
     [
       # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
       ./85_security_load.patch
+      ./ckpem.patch
     ];
 
   patchFlags = "-p0";
@@ -45,7 +46,8 @@ in stdenv.mkDerivation rec {
     "NSS_ENABLE_ECC=1"
     "USE_SYSTEM_ZLIB=1"
     "NSS_USE_SYSTEM_SQLITE=1"
-  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1";
+  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"
+    ++ stdenv.lib.optional stdenv.isDarwin "CCC=clang++";
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
@@ -84,15 +86,22 @@ in stdenv.mkDerivation rec {
 
   postFixup = ''
     for libname in freebl3 nssdbm3 softokn3
-    do
-      libfile="$out/lib/lib$libname.so"
-      LD_LIBRARY_PATH=$out/lib $out/bin/shlibsign -v -i "$libfile"
+    do '' +
+    (if stdenv.isDarwin
+     then ''
+       libfile="$out/lib/lib$libname.dylib"
+       DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '' else ''
+       libfile="$out/lib/lib$libname.so"
+       LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '') + ''
+        $out/bin/shlibsign -v -i "$libfile"
     done
 
     moveToOutput bin "$tools"
     moveToOutput bin/nss-config "$dev"
     moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
-    rm "$out"/lib/*.a
+    rm -f "$out"/lib/*.a
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/opendbx/default.nix b/pkgs/development/libraries/opendbx/default.nix
index 37afa3fd50704..48ec5141e34fc 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 e6055151301c7..b34c9ff31f2c8 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 0000000000000..4bc97069b1e2c
--- /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 0f971cff64d4e..4075591373700 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 6d92de001cb7d..1bc4fd1085e11 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 32691faa68936..488306fc1ce25 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/hooks/qtbase-setup-hook.sh b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
index 8ec7eeda8aee7..754a75cbef4f7 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -42,11 +42,7 @@ qtEnvHook() {
         propagatedUserEnvPkgs+=" $1"
     fi
 }
-if [ "$crossConfig" ]; then
-   crossEnvHooks+=(qtEnvHook)
-else
-   envHooks+=(qtEnvHook)
-fi
+envHostTargetHooks+=(qtEnvHook)
 
 postPatchMkspecs() {
     local bin="${!outputBin}"
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index 172b20bc51bb6..5f65f71bbbaab 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/rep-gtk/setup-hook.sh b/pkgs/development/libraries/rep-gtk/setup-hook.sh
index 420d63d6c5132..4d875b6933040 100644
--- a/pkgs/development/libraries/rep-gtk/setup-hook.sh
+++ b/pkgs/development/libraries/rep-gtk/setup-hook.sh
@@ -2,4 +2,4 @@ addRepDLLoadPath () {
     addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
 }
 
-envHooks+=(addRepDLLoadPath)
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/pkgs/development/libraries/slib/setup-hook.sh b/pkgs/development/libraries/slib/setup-hook.sh
index 62b72d6dc0abf..3c7e91e81886b 100644
--- a/pkgs/development/libraries/slib/setup-hook.sh
+++ b/pkgs/development/libraries/slib/setup-hook.sh
@@ -10,4 +10,4 @@ addSlibPath () {
     fi
 }
 
-envHooks+=(addSlibPath)
+addEnvHooks "$hostOffset" addSlibPath
diff --git a/pkgs/development/libraries/tntdb/default.nix b/pkgs/development/libraries/tntdb/default.nix
index d11a5c344c9d2..75a494cfbdede 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 233fdd902541e..badcb7e661bbd 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 3adf4f1497f88..1d0bd20f66f04 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/libraries/x265/default.nix b/pkgs/development/libraries/x265/default.nix
index 29d7ddf1fdc94..418829e7af8af 100644
--- a/pkgs/development/libraries/x265/default.nix
+++ b/pkgs/development/libraries/x265/default.nix
@@ -16,14 +16,14 @@ in
 
 stdenv.mkDerivation rec {
   name = "x265-${version}";
-  version = "2.5";
+  version = "2.6";
 
   src = fetchurl {
     urls = [
       "http://get.videolan.org/x265/x265_${version}.tar.gz"
       "https://github.com/videolan/x265/archive/${version}.tar.gz"
     ];
-    sha256 = "05rxbnfcc8yl05q3xqkl1kk90k7zn5ih305r46dxnzjaa2djalrf";
+    sha256 = "1gyd94jkwdii9308m07nymsbxrmrcl81c0j8i10zhslr2mj07w0v";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix
index 23fee81e0a526..36a73bc6d2ba2 100644
--- a/pkgs/development/libraries/xapian/default.nix
+++ b/pkgs/development/libraries/xapian/default.nix
@@ -36,5 +36,5 @@ let
 in {
   # xapian-ruby needs 1.2.22 as of 2017-05-06
   xapian_1_2_22 = generic "1.2.22" "0zsji22n0s7cdnbgj0kpil05a6bgm5cfv0mvx12d8ydg7z58g6r6";
-  xapian_1_4_4 = generic "1.4.4" "1n9j2w2as0flih3hgim7gprfxsx6gimijs91rxsjsi8shjlqbad6";
+  xapian_1_4 = generic "1.4.5" "0axhqrj202hbll9mcx1qdm8gsqj19216w3z02gyjbycxvr9gkdc5";
 }
diff --git a/pkgs/development/libraries/xapian/tools/omega/default.nix b/pkgs/development/libraries/xapian/tools/omega/default.nix
index 2923bfc1fc680..09c2171945e44 100644
--- a/pkgs/development/libraries/xapian/tools/omega/default.nix
+++ b/pkgs/development/libraries/xapian/tools/omega/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://oligarchy.co.uk/xapian/${version}/xapian-omega-${version}.tar.xz";
-    sha256 = "0pl9gs0sbavxykfgrkm8syswqnfynmmqhf8429bv8a5qjh5pkp8l";
+    sha256 = "0zji8ckp4h5xdy2wbir3lvk680w1g1l4h5swmaxsx7ah12lkrjcr";
   };
 
   buildInputs = [ xapian perl pcre zlib libmagic ];
diff --git a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh
index 7ac8c70d59f8e..eb6052d58db54 100644
--- a/pkgs/development/lisp-modules/clwrapper/setup-hook.sh
+++ b/pkgs/development/lisp-modules/clwrapper/setup-hook.sh
@@ -31,7 +31,7 @@ collectNixLispLDLP () {
 
 export NIX_LISP_COMMAND NIX_LISP CL_SOURCE_REGISTRY NIX_LISP_ASDF
 
-envHooks+=(addASDFPaths setLisp collectNixLispLDLP)
+addEnvHooks "$targetOffset" addASDFPaths setLisp collectNixLispLDLP
 
 mkdir -p "$HOME"/.cache/common-lisp || HOME="$TMP/.temp-$USER-home"
 mkdir -p "$HOME"/.cache/common-lisp
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
index fae5818171bdd..09113bc30bb8a 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 b29ba53159e6c..d3cb7b36aeebe 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/eliom/setup-hook.sh b/pkgs/development/ocaml-modules/eliom/setup-hook.sh
index 096d8f8bf6354..9868ab93f7919 100644
--- a/pkgs/development/ocaml-modules/eliom/setup-hook.sh
+++ b/pkgs/development/ocaml-modules/eliom/setup-hook.sh
@@ -2,4 +2,4 @@ addOcsigenDistilleryTemplate() {
     addToSearchPathWithCustomDelimiter : ELIOM_DISTILLERY_PATH $1/eliom-distillery-templates
 }
 
-envHooks+=(addOcsigenDistilleryTemplate)
+addEnvHooks "$hostOffset" addOcsigenDistilleryTemplate
diff --git a/pkgs/development/ocaml-modules/mysql/default.nix b/pkgs/development/ocaml-modules/mysql/default.nix
index 3fa8e9d46b408..5482d7ac87cd6 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/ocaml-modules/notty/default.nix b/pkgs/development/ocaml-modules/notty/default.nix
index dcc57fddaf68f..2dffb472f3e8c 100644
--- a/pkgs/development/ocaml-modules/notty/default.nix
+++ b/pkgs/development/ocaml-modules/notty/default.nix
@@ -1,30 +1,27 @@
-{ stdenv, buildOcaml, fetchpatch, fetchFromGitHub, findlib, topkg, ocb-stubblr
+{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, ocb-stubblr
 , result, uucp, uuseg, uutf
 , lwt     ? null }:
 
 with stdenv.lib;
 
-let withLwt = lwt != null; in
+if !versionAtLeast ocaml.version "4.03"
+then throw "notty is not available for OCaml ${ocaml.version}"
+else
 
-buildOcaml rec {
-  version = "0.1.1a";
-  name = "notty";
+let withLwt = lwt != null; in
 
-  minimumSupportedOcamlVersion = "4.02";
+stdenv.mkDerivation rec {
+  version = "0.2.1";
+  name = "ocaml${ocaml.version}-notty-${version}";
 
-  src = fetchFromGitHub {
-    owner  = "pqwy";
-    repo   = "notty";
-    rev    = "53f5946653490fce980dc5d8cadf8b122cff4f19";
-    sha256 = "0qmwb1hrp04py2i5spy0yd6c5jqxyss3wzvlkgxyl9r07kvsx6xf";
+  src = fetchurl {
+    url = "https://github.com/pqwy/notty/releases/download/v${version}/notty-${version}.tbz";
+    sha256 = "0wdfmgx1mz77s7m451vy8r9i4iqwn7s7b39kpbpckf3w9417riq0";
   };
 
-  patches = [ (fetchpatch {
-    url = https://github.com/dbuenzli/notty/commit/b0e12930acc26d030a74d6d63d622ae220b12c92.patch;
-    sha256 = "0pklplbnjbsjriqj73pc8fsadg404px534w7zknz2617zb44m6x6";
-  })];
+  unpackCmd = "tar -xjf $curSrc";
 
-  buildInputs = [ findlib topkg ocb-stubblr ];
+  buildInputs = [ ocaml findlib ocamlbuild topkg ocb-stubblr ];
   propagatedBuildInputs = [ result uucp uuseg uutf ] ++
                           optional withLwt lwt;
 
@@ -34,7 +31,8 @@ buildOcaml rec {
   inherit (topkg) installPhase;
 
   meta = {
-    inherit (src.meta) homepage;
+    homepage = "https://github.com/pqwy/notty";
+    inherit (ocaml.meta) platforms;
     description = "Declarative terminal graphics for OCaml";
     license = licenses.isc;
     maintainers = with maintainers; [ sternenseemann ];
diff --git a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh
index a93a7250bebb7..6d95043701658 100644
--- a/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh
+++ b/pkgs/development/ocaml-modules/ocamlmake/setup-hook.sh
@@ -2,4 +2,4 @@ addOcamlMakefile () {
     export OCAMLMAKEFILE="@out@/include/OCamlMakefile"
 }
 
-envHooks+=(addOcamlMakefile)
+addEnvHooks "$targetOffset" addOcamlMakefile
diff --git a/pkgs/development/perl-modules/DBD-mysql/default.nix b/pkgs/development/perl-modules/DBD-mysql/default.nix
index 7302516d5429d..12ddcf166e259 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/pharo/vm/build-vm.nix b/pkgs/development/pharo/vm/build-vm.nix
index 74fa75e7aa569..b72b1851024ac 100644
--- a/pkgs/development/pharo/vm/build-vm.nix
+++ b/pkgs/development/pharo/vm/build-vm.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     else if stdenv.isLinux && stdenv.isx86_64  then "linux64x64"
     else if stdenv.isDarwin && stdenv.isi686   then "macos32x86"
     else if stdenv.isDarwin && stdenv.isx86_64 then "macos64x64"
-    else abort "Unsupported platform: only Linux/Darwin x86/x64 are supported.";
+    else throw "Unsupported platform: only Linux/Darwin x86/x64 are supported.";
 
   # Shared data (for the sources file)
   pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };
@@ -106,7 +106,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ bash unzip glibc openssl gcc48 mesa freetype xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share libuuid ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Clean and innovative Smalltalk-inspired environment";
     longDescription = ''
       Pharo's goal is to deliver a clean, innovative, free open-source
@@ -122,8 +122,8 @@ stdenv.mkDerivation rec {
       packaging (ppa:pharo/stable)' project.
     '';
     homepage = http://pharo.org;
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.lukego ];
-    platforms = [ "i686-linux" "x86_64-linux" "i686-darwin" "x86_64-darwin" ];
+    license = licenses.mit;
+    maintainers = [ maintainers.lukego ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/development/pure-modules/glpk/default.nix b/pkgs/development/pure-modules/glpk/default.nix
index 4927ac445f440..e86f08b57ca90 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/APScheduler/default.nix b/pkgs/development/python-modules/APScheduler/default.nix
index 5acb6cd5785d2..931239c098724 100644
--- a/pkgs/development/python-modules/APScheduler/default.nix
+++ b/pkgs/development/python-modules/APScheduler/default.nix
@@ -20,12 +20,12 @@
 
 buildPythonPackage rec {
   pname = "APScheduler";
-  version = "3.4.0";
+  version = "3.5.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "b51118a8ed014104f7e440456dcbd90f2015aea7bcc34c57e307fb34bc746316";
+    sha256 = "1ce44d5132b7951f4614067c88ca34cfee1ff97f6f0892581d79b636d83eab89";
   };
 
   buildInputs = [
diff --git a/pkgs/development/python-modules/Mako/default.nix b/pkgs/development/python-modules/Mako/default.nix
new file mode 100644
index 0000000000000..f3f1eed265d01
--- /dev/null
+++ b/pkgs/development/python-modules/Mako/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, markupsafe
+, nose
+, mock
+, pytest
+, isPyPy
+}:
+
+buildPythonPackage rec {
+  pname = "Mako";
+  version = "1.0.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "4e02fde57bd4abb5ec400181e4c314f56ac3e49ba4fb8b0d50bba18cb27d25ae";
+  };
+
+  checkInputs = [ markupsafe nose mock pytest ];
+  propagatedBuildInputs = [ markupsafe ];
+
+  doCheck = !isPyPy;  # https://bitbucket.org/zzzeek/mako/issue/238/2-tests-failed-on-pypy-24-25
+
+  meta = {
+    description = "Super-fast templating language";
+    homepage = http://www.makotemplates.org;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ domenkozar ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/MechanicalSoup/default.nix b/pkgs/development/python-modules/MechanicalSoup/default.nix
index 56e2cf501edaa..b5d202af50a4b 100644
--- a/pkgs/development/python-modules/MechanicalSoup/default.nix
+++ b/pkgs/development/python-modules/MechanicalSoup/default.nix
@@ -1,5 +1,5 @@
 { fetchPypi, buildPythonPackage, lib
-, requests, beautifulsoup4, six
+, requests, beautifulsoup4, six, lxml
 , pytestrunner, requests-mock, pytestcov, pytest
 }:
 
@@ -7,23 +7,23 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "MechanicalSoup";
-  version = "0.8.0";
+  version = "0.9.0.post4";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "38a6ca35428196be94f87f8f036ee4a88b1418d1f77e5634ad92acfaa22c28da";
+    sha256 = "ce8f822afbc9bef1499be417e8d5deecd0cd32606420165700e89477955f03ab";
   };
 
   checkInputs = [ pytest pytestrunner requests-mock pytestcov ];
 
-  propagatedBuildInputs = [ requests beautifulsoup4 six ];
+  propagatedBuildInputs = [ lxml requests beautifulsoup4 six ];
 
   # Requires network
   doCheck = false;
 
   postPatch = ''
     # Is in setup_requires but not used in setup.py...
-    substituteInPlace setup.py --replace "'pytest-runner'," ""
+    substituteInPlace setup.py --replace "'pytest-runner'" ""
   '';
 
   meta = with lib; {
diff --git a/pkgs/development/python-modules/Nikola/default.nix b/pkgs/development/python-modules/Nikola/default.nix
index f281a02d49b6a..8f8d91c64d2f0 100644
--- a/pkgs/development/python-modules/Nikola/default.nix
+++ b/pkgs/development/python-modules/Nikola/default.nix
@@ -30,7 +30,7 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "Nikola";
-  version = "7.8.10";
+  version = "7.8.11";
 
   # Nix contains only Python 3 supported version of doit, which is a dependency
   # of Nikola. Python 2 support would require older doit 0.29.0 (which on the
@@ -47,7 +47,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "e242c3d0dd175d95a0baf5268b108081ba160b83ceafec8c9bc2ec0a24a56537";
+    sha256 = "10d95b3af84e61496ef729665eafa2235fd0fd4cc6c57644dd0f2c19a968dd0f";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/Theano/default.nix b/pkgs/development/python-modules/Theano/default.nix
index e0ff839ce1b7d..03dc825218e25 100644
--- a/pkgs/development/python-modules/Theano/default.nix
+++ b/pkgs/development/python-modules/Theano/default.nix
@@ -35,13 +35,13 @@ let
 in buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "Theano";
-  version = "0.9.0";
+  version = "1.0.1";
 
   disabled = isPyPy || pythonOlder "2.6" || (isPy3k && pythonOlder "3.3");
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "05xwg00da8smkvkh6ywbywqzj8dw7x840jr74wqhdy9icmqncpbl";
+    sha256 = "88d8aba1fe2b6b75eacf455d01bc7e31e838c5a0fb8c13dde2d9472495ff4662";
   };
 
   postPatch = ''
diff --git a/pkgs/development/python-modules/absl-py/default.nix b/pkgs/development/python-modules/absl-py/default.nix
index 1c9fa3d786fb3..ca43e122a307c 100644
--- a/pkgs/development/python-modules/absl-py/default.nix
+++ b/pkgs/development/python-modules/absl-py/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec {
   pname = "absl-py";
-  version = "0.1.5";
+  version = "0.1.7";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "94943ed0cd77077fe2d18e79b2f28d3e92f585f7d1c6edc75e640121f3c5d580";
+    sha256 = "4ea22ae860f3a556511291e7f1284942199c81377f47ec4248163defb1b9e6ee";
   };
 
   propagatedBuildInputs = [ six ];
diff --git a/pkgs/development/python-modules/aenum/default.nix b/pkgs/development/python-modules/aenum/default.nix
index 3aa03aaa59936..45e7f8915acfb 100644
--- a/pkgs/development/python-modules/aenum/default.nix
+++ b/pkgs/development/python-modules/aenum/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "aenum";
-  version = "2.0.8";
+  version = "2.0.9";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "3209fa41b8c41345442e8d9b5158a57d3e96d84c3d5ebbe8e521e1e2eff1598d";
+    sha256 = "d98bc55136d696fcf323760c3db0de489da9e41fd51283fa6f90205deb85bf6a";
   };
 
   doCheck = !isPy3k;
diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix
index 53443b3b32faf..44e19072057f4 100644
--- a/pkgs/development/python-modules/aiohttp/default.nix
+++ b/pkgs/development/python-modules/aiohttp/default.nix
@@ -13,12 +13,12 @@
 
 buildPythonPackage rec {
   pname = "aiohttp";
-  version = "2.3.3";
+  version = "2.3.7";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0a2e33e90560dacb819b095b9d9611597925d75d1b93dd9490055d3826d98a82";
+    sha256 = "fe294df38e9c67374263d783a7a29c79372030f5962bd5734fa51c6f4bbfee3b";
   };
 
   disabled = pythonOlder "3.4";
diff --git a/pkgs/development/python-modules/arrow/default.nix b/pkgs/development/python-modules/arrow/default.nix
index a85987a95b165..374b82225a1a4 100644
--- a/pkgs/development/python-modules/arrow/default.nix
+++ b/pkgs/development/python-modules/arrow/default.nix
@@ -1,23 +1,26 @@
 { stdenv, buildPythonPackage, fetchPypi
-, nose, chai, simplejson
+, nose, chai, simplejson, backports_functools_lru_cache
 , dateutil }:
 
 buildPythonPackage rec {
-  name = "${pname}-${version}";
   pname = "arrow";
-  version = "0.10.0";
+  version = "0.12.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "08n7q2l69hlainds1byd4lxhwrq7zsw7s640zkqc3bs5jkq0cnc0";
+    sha256 = "a15ecfddf334316e3ac8695e48c15d1be0d6038603b33043930dcf0e675c86ee";
   };
 
   checkPhase = ''
     nosetests --cover-package=arrow
   '';
 
-  buildInputs = [ nose chai simplejson ];
-  propagatedBuildInputs = [ dateutil ];
+  checkInputs = [ nose chai simplejson ];
+  propagatedBuildInputs = [ dateutil backports_functools_lru_cache ];
+
+  postPatch = ''
+    substituteInPlace setup.py --replace "==1.2.1" ""
+  '';
 
   meta = with stdenv.lib; {
     description = "Python library for date manipulation";
diff --git a/pkgs/development/python-modules/asgiref/default.nix b/pkgs/development/python-modules/asgiref/default.nix
index 1b5112fb33584..fedd4b81a9d43 100644
--- a/pkgs/development/python-modules/asgiref/default.nix
+++ b/pkgs/development/python-modules/asgiref/default.nix
@@ -1,12 +1,12 @@
 { stdenv, buildPythonPackage, fetchurl, six }:
 buildPythonPackage rec {
-  version = "1.1.2";
+  version = "2.0.1";
   pname = "asgiref";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/a/asgiref/${name}.tar.gz";
-    sha256 = "8b46c3d6e2ad354d9da3cfb9873f9bd46fe1b768fbc11065275ba5430a46700c";
+    sha256 = "c3d70c473a2b7e525e18e68504630943e107f5b32f440c00c8543f94f565c855";
   };
 
   propagatedBuildInputs = [ six ];
diff --git a/pkgs/development/python-modules/asn1crypto/default.nix b/pkgs/development/python-modules/asn1crypto/default.nix
index eedaac50fac93..5f512fcd6f8bb 100644
--- a/pkgs/development/python-modules/asn1crypto/default.nix
+++ b/pkgs/development/python-modules/asn1crypto/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "asn1crypto";
-  version = "0.23.0";
+  version = "0.24.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0874981329cfebb366d6584c3d16e913f2a0eb026c9463efcc4aaf42a9d94d70";
+    sha256 = "9d5c20441baf0cb60a4ac34cc447c6c189024b6b4c6cd7877034f4965c464e49";
   };
 
   # No tests included
diff --git a/pkgs/development/python-modules/astor/default.nix b/pkgs/development/python-modules/astor/default.nix
index 965bf37d5200b..6f50b7157e5de 100644
--- a/pkgs/development/python-modules/astor/default.nix
+++ b/pkgs/development/python-modules/astor/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "astor";
-  version = "0.5";
+  version = "0.6.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1fdafq5hkis1fxqlmhw0sn44zp2ar46nxhbc22cvwg7hsd8z5gsa";
+    sha256 = "ff6d2e2962d834acb125cc4dcc80c54a8c17c253f4cc9d9c43b5102a560bb75d";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/astroid/default.nix b/pkgs/development/python-modules/astroid/default.nix
index 86a0daa045602..862157f686a30 100644
--- a/pkgs/development/python-modules/astroid/default.nix
+++ b/pkgs/development/python-modules/astroid/default.nix
@@ -6,11 +6,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "astroid";
-  version = "1.5.3";
+  version = "1.6.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "492c2a2044adbf6a84a671b7522e9295ad2f6a7c781b899014308db25312dd35";
+    sha256 = "71dadba2110008e2c03f9fde662ddd2053db3c0489d0e03c94e828a0399edd4f";
   };
 
   propagatedBuildInputs = [ logilab_common six lazy-object-proxy wrapt ]
diff --git a/pkgs/development/python-modules/astropy/default.nix b/pkgs/development/python-modules/astropy/default.nix
index 12f00be0cb749..514762b7a37d6 100644
--- a/pkgs/development/python-modules/astropy/default.nix
+++ b/pkgs/development/python-modules/astropy/default.nix
@@ -7,13 +7,13 @@
 buildPythonPackage rec {
   
   pname = "astropy";
-  version = "2.0.2";
+  version = "2.0.3";
 
   name = "${pname}-${version}";
   doCheck = false; #Some tests are failing. More importantly setup.py hangs on completion. Needs fixing with a proper shellhook.
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4544a422b1173d79b2d65ba74c627f04a5fd8530d97fb604752d657d754e103d";
+    sha256 = "fdfc0248f6250798ed6d1327be609cb901db89ae01fc768cfbc9e263bdf56f4f";
   };
 
   propagatedBuildInputs = [ pytest numpy ]; # yes it really has pytest in install_requires
diff --git a/pkgs/development/python-modules/attrs/default.nix b/pkgs/development/python-modules/attrs/default.nix
index e58bf3846dc92..8ef2b5989f450 100644
--- a/pkgs/development/python-modules/attrs/default.nix
+++ b/pkgs/development/python-modules/attrs/default.nix
@@ -2,17 +2,16 @@
 , pympler, coverage, six, clang }:
 
 buildPythonPackage rec {
-  name = "${pname}-${version}";
   pname = "attrs";
-  version = "17.2.0";
+  version = "17.4.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "04gx08ikpk26wnq22f7l42gapcvk8iz1512r927k6sadz6cinkax";
+    sha256 = "1c7960ccfd6a005cd9f7ba884e6316b5e430a3f1a6c37c5f87d8b43f83b54ec9";
   };
 
   # macOS needs clang for testing
-  buildInputs = [
+  checkInputs = [
     pytest hypothesis zope_interface pympler coverage six
   ] ++ lib.optionals (stdenv.isDarwin) [ clang ];
 
@@ -20,6 +19,9 @@ buildPythonPackage rec {
     py.test
   '';
 
+  # To prevent infinite recursion with pytest
+  doCheck = false;
+
   meta = with lib; {
     description = "Python attributes without boilerplate";
     homepage = https://github.com/hynek/attrs;
diff --git a/pkgs/development/python-modules/aws-xray-sdk/default.nix b/pkgs/development/python-modules/aws-xray-sdk/default.nix
new file mode 100644
index 0000000000000..dae88b34900e5
--- /dev/null
+++ b/pkgs/development/python-modules/aws-xray-sdk/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, jsonpickle
+, wrapt
+, requests
+}:
+
+buildPythonPackage rec {
+  pname = "aws-xray-sdk";
+  version = "0.95";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "9e7ba8dd08fd2939376c21423376206bff01d0deaea7d7721c6b35921fed1943";
+  };
+
+  propagatedBuildInputs = [
+    jsonpickle wrapt requests
+  ];
+
+  meta = {
+    description = "AWS X-Ray SDK for the Python programming language";
+    license = lib.licenses.asl20;
+    homepage = https://github.com/aws/aws-xray-sdk-python;
+  };
+
+  doCheck = false;
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/backports_abc/default.nix b/pkgs/development/python-modules/backports_abc/default.nix
new file mode 100644
index 0000000000000..ab34d376de081
--- /dev/null
+++ b/pkgs/development/python-modules/backports_abc/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "backports_abc";
+  version = "0.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "033be54514a03e255df75c5aee8f9e672f663f93abb723444caec8fe43437bde";
+  };
+
+  checkPhase = ''
+    ${python.interpreter} -m unittest discover
+  '';
+
+  meta = {
+    homepage = https://github.com/cython/backports_abc;
+    license = lib.licenses.psfl;
+    description = "A backport of recent additions to the 'collections.abc' module";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/backports_functools_lru_cache/default.nix b/pkgs/development/python-modules/backports_functools_lru_cache/default.nix
new file mode 100644
index 0000000000000..2442e132f1b9a
--- /dev/null
+++ b/pkgs/development/python-modules/backports_functools_lru_cache/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, setuptools_scm
+}:
+
+buildPythonPackage rec {
+  pname = "backports.functools_lru_cache";
+  version = "1.4";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "31f235852f88edc1558d428d890663c49eb4514ffec9f3650e7f3c9e4a12e36f";
+  };
+
+  buildInputs = [ setuptools_scm ];
+  doCheck = false; # No proper test
+
+  meta = {
+    description = "Backport of functools.lru_cache";
+    homepage = https://github.com/jaraco/backports.functools_lru_cache;
+    license = lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/backports_lzma/default.nix b/pkgs/development/python-modules/backports_lzma/default.nix
new file mode 100644
index 0000000000000..9b622eb6b065b
--- /dev/null
+++ b/pkgs/development/python-modules/backports_lzma/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, isPy3k
+, lzma
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "backports.lzma";
+  version = "0.0.8";
+
+  disabled = isPy3k;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "200584ad5079d8ca6b1bfe14890c7be58666ab0128d8ca26cfb2669b476085f3";
+  };
+
+  buildInputs = [ lzma ];
+
+  # Needs the compiled module in $out
+  checkPhase = ''
+    PYTHONPATH=$out/${python.sitePackages}:$PYTHONPATH ${python.interpreter} -m unittest discover -s test
+  '';
+
+  meta = {
+    description = "Backport of Python 3.3's 'lzma' module for XZ/LZMA compressed files";
+    homepage = https://github.com/peterjc/backports.lzma;
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/biopython/default.nix b/pkgs/development/python-modules/biopython/default.nix
new file mode 100644
index 0000000000000..ea09a003c66e0
--- /dev/null
+++ b/pkgs/development/python-modules/biopython/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, numpy
+}:
+
+buildPythonPackage rec {
+  pname = "biopython";
+  version = "1.70";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "4a7c5298f03d1a45523f32bae1fffcff323ea9dce007fb1241af092f5ab2e45b";
+  };
+
+  propagatedBuildInputs = [ numpy ];
+  # Checks try to write to $HOME, which does not work with nix
+  doCheck = false;
+  meta = {
+    description = "Python library for bioinformatics";
+    longDescription = ''
+      Biopython is a set of freely available tools for biological computation
+      written in Python by an international team of developers. It is a
+      distributed collaborative effort to develop Python libraries and
+      applications which address the needs of current and future work in
+      bioinformatics.
+    '';
+    homepage = http://biopython.org/wiki/Documentation;
+    maintainers = with lib.maintainers; [ luispedro ];
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/blaze/default.nix b/pkgs/development/python-modules/blaze/default.nix
index 017b85cacc7c0..74e327fd34230 100644
--- a/pkgs/development/python-modules/blaze/default.nix
+++ b/pkgs/development/python-modules/blaze/default.nix
@@ -25,12 +25,11 @@
 
 buildPythonPackage rec {
   pname = "blaze";
-  version = "0.11.0";
-  name = "${pname}-${version}";
+  version = "0.11.3";
 
   src = fetchurl {
     url = "https://github.com/blaze/blaze/archive/${version}.tar.gz";
-    sha256 = "07zrrxkmdqk84xvdmp29859zcfzlpx5pz6g62l28nqp6n6a7yq9a";
+    sha256 = "075gqc9d7g284z4nfwv5zbq99ln22w25l4lcndjg3v10kmsjadww";
   };
 
   checkInputs = [ pytest ];
@@ -56,13 +55,8 @@ buildPythonPackage rec {
     toolz
   ];
 
-  # Failing test
-  # ERROR collecting blaze/tests/test_interactive.py
-  # E   networkx.exception.NetworkXNoPath: node <class 'list'> not
-  # reachable from <class 'dask.array.core.Array'>
-  doCheck = false;
-
   checkPhase = ''
+    rm pytest.ini # Not interested in coverage
     py.test blaze/tests
   '';
 
diff --git a/pkgs/development/python-modules/bokeh/default.nix b/pkgs/development/python-modules/bokeh/default.nix
index 244ee43d0aabe..e3c77fa65cf4c 100644
--- a/pkgs/development/python-modules/bokeh/default.nix
+++ b/pkgs/development/python-modules/bokeh/default.nix
@@ -34,11 +34,11 @@
 buildPythonPackage rec {
   pname = "bokeh";
   name = "${pname}${version}";
-  version = "0.12.10";
+  version = "0.12.13";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6465fae82e94223f16584645b38d34a73d95712870f29c0244649c2cbf2c8393";
+    sha256 = "6e28cbfd88de0c459435278b75f9982591ec0aaa3d37a195052645e1c62e89e3";
   };
 
   disabled = isPyPy;
diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix
index ef12e39f23bc2..1a20639c2dea9 100644
--- a/pkgs/development/python-modules/bootstrapped-pip/default.nix
+++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix
@@ -9,9 +9,9 @@ let
   };
   setuptools_source = fetchPypi {
     pname = "setuptools";
-    version = "38.2.3";
+    version = "38.2.5";
     format = "wheel";
-    sha256 = "0c4j3jiiwc0h1bdv4xklinp90spgvgiv5fsxp119hif9934nfxfs";
+    sha256 = "bcf0d4f3e2f7890e658db11e218b8643afffb905a0e2f2a7d5a6a3e949bb87e6";
   };
 
   # TODO: Shouldn't be necessary anymore for pip > 9.0.1!
diff --git a/pkgs/development/python-modules/boto3/default.nix b/pkgs/development/python-modules/boto3/default.nix
new file mode 100644
index 0000000000000..eaab003120559
--- /dev/null
+++ b/pkgs/development/python-modules/boto3/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, buildPythonPackage
+, fetchFromGitHub
+, botocore
+, jmespath
+, s3transfer
+, futures
+, docutils
+, nose
+, mock
+, isPy3k
+}:
+
+buildPythonPackage rec {
+  pname =  "boto3";
+  version = "1.4.8";
+
+  src = fetchFromGitHub {
+    owner = "boto";
+    repo  = "boto3";
+    rev   = version;
+    sha256 = "11ysd7a9l5y98q7b7az56phsj2m7w90abf4jabwrknp2c43sq9bi";
+  };
+
+  propagatedBuildInputs = [ botocore jmespath s3transfer ] ++ lib.optionals (!isPy3k) [ futures ];
+  checkInputs = [ docutils nose mock ];
+
+  checkPhase = ''
+    runHook preCheck
+    # This method is not in mock. It might have appeared in some versions.
+    sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \
+      tests/unit/resources/test_factory.py
+    nosetests -d tests/unit --verbose
+    runHook postCheck
+  '';
+
+  # Network access
+  doCheck = false;
+
+  meta = {
+    homepage = https://github.com/boto/boto3;
+    license = lib.licenses.asl20;
+    description = "AWS SDK for Python";
+    longDescription = ''
+      Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
+      Python, which allows Python developers to write software that makes use of
+      services like Amazon S3 and Amazon EC2.
+    '';
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/botocore/default.nix b/pkgs/development/python-modules/botocore/default.nix
index fe3fe06f4e7a2..f8dd164994910 100644
--- a/pkgs/development/python-modules/botocore/default.nix
+++ b/pkgs/development/python-modules/botocore/default.nix
@@ -12,11 +12,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "botocore";
-  version = "1.8.10";
+  version = "1.8.21";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "16dznd0mxxs8imsl228vx5s9bz9v7ggajs496jy21n5a19cadkch";
+    sha256 = "e4513a02f68e7efd7494ee56db201d87620218ca879aae361abbb71bcde3aa5f";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/brotlipy/default.nix b/pkgs/development/python-modules/brotlipy/default.nix
new file mode 100644
index 0000000000000..1dd2a070480fc
--- /dev/null
+++ b/pkgs/development/python-modules/brotlipy/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, cffi
+, enum34
+, construct
+, pytest
+, hypothesis
+}:
+
+buildPythonPackage rec {
+  pname = "brotlipy";
+  version = "0.7.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "36def0b859beaf21910157b4c33eb3b06d8ce459c942102f16988cca6ea164df";
+  };
+
+  propagatedBuildInputs = [ cffi enum34 construct ];
+
+  checkInputs = [ pytest hypothesis ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  # Missing test files
+  doCheck = false;
+
+  meta = {
+    description = "Python bindings for the reference Brotli encoder/decoder";
+    homepage = "https://github.com/python-hyper/brotlipy/";
+    license = lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/cached-property/default.nix b/pkgs/development/python-modules/cached-property/default.nix
new file mode 100644
index 0000000000000..6ab5015a1e797
--- /dev/null
+++ b/pkgs/development/python-modules/cached-property/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, freezegun
+}:
+
+buildPythonPackage rec {
+  pname = "cached-property";
+  version = "1.3.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "6562f0be134957547421dda11640e8cadfa7c23238fc4e0821ab69efdb1095f3";
+  };
+
+  checkInputs = [ freezegun ];
+
+  meta = {
+    description = "A decorator for caching properties in classes";
+    homepage = https://github.com/pydanny/cached-property;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ ericsagnes ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/credstash/default.nix b/pkgs/development/python-modules/credstash/default.nix
index 810a6a7bd8e31..6a9e1240b864e 100644
--- a/pkgs/development/python-modules/credstash/default.nix
+++ b/pkgs/development/python-modules/credstash/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname    = "credstash";
-  version = "1.13.4";
+  version = "1.14.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "676cc03a6143dec260c78aeef09d08a64faf27c411f8a94f6d9338e985879f81";
+    sha256 = "718b337f7a6fa001e014386071f05c59900525d0507009126d2fe8d75fe0761d";
   };
 
   propagatedBuildInputs = [ cryptography boto3 pyyaml docutils ];
diff --git a/pkgs/development/python-modules/csscompressor/default.nix b/pkgs/development/python-modules/csscompressor/default.nix
index a9aad8d40e5fe..8d0e7a58e76a6 100644
--- a/pkgs/development/python-modules/csscompressor/default.nix
+++ b/pkgs/development/python-modules/csscompressor/default.nix
@@ -1,12 +1,12 @@
 { stdenv, buildPythonPackage, fetchPypi }:
 buildPythonPackage rec {
   pname = "csscompressor";
-  version = "0.9.4";
+  version = "0.9.5";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0e12f125b88379d7b680636d94a3c8fa14bed1de2358f7f9a9e6749e222cff3b";
+    sha256 = "afa22badbcf3120a4f392e4d22f9fff485c044a1feda4a950ecc5eba9dd31a05";
   };
 
   doCheck = false; # No tests
diff --git a/pkgs/development/python-modules/cx_freeze/default.nix b/pkgs/development/python-modules/cx_freeze/default.nix
index 3d937debe58be..69a5e8c11d486 100644
--- a/pkgs/development/python-modules/cx_freeze/default.nix
+++ b/pkgs/development/python-modules/cx_freeze/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "cx_Freeze";
-  version = "5.0.2";
+  version = "5.1.1";
   name  = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0zbx9j5z5l06bvwvlqvvn7h9dm7zjcjgxm7agbb625nymkq6cd15";
+    sha256 = "2eadddde670f5c5f6cf88638a0ac4e5d5fe181292a31063275fa56c7bf22426b";
   };
 
   propagatedBuildInputs = [ ncurses ];
diff --git a/pkgs/development/python-modules/cytoolz/default.nix b/pkgs/development/python-modules/cytoolz/default.nix
index dcb4e9474c3bc..83b1c893719d3 100644
--- a/pkgs/development/python-modules/cytoolz/default.nix
+++ b/pkgs/development/python-modules/cytoolz/default.nix
@@ -9,12 +9,12 @@
 
 buildPythonPackage rec {
   pname = "cytoolz";
-  version = "0.8.2";
+  version = "0.9.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "476a2ad176de5eaef80499b7b43d4f72ba6d23df33d349088dae315e9b31c552";
+    sha256 = "5ebb55855a8bb7800afa58e52408763935527e0305f35600c71b43c86013dec2";
   };
 
   # Extension types
diff --git a/pkgs/development/python-modules/dask/default.nix b/pkgs/development/python-modules/dask/default.nix
index 70647b6377fca..c3b45dc3c867c 100644
--- a/pkgs/development/python-modules/dask/default.nix
+++ b/pkgs/development/python-modules/dask/default.nix
@@ -12,12 +12,12 @@
 
 buildPythonPackage rec {
   pname = "dask";
-  version = "0.15.4";
+  version = "0.16.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "cb93b8260f5f854ccf26b52bdc700600a08e6b7527085c7b7d63c04238bab9ea";
+    sha256 = "40d150b73e3366c9521e9dde206046a66906330074f87be901b1e1013ce6cb73";
   };
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/decorator/default.nix b/pkgs/development/python-modules/decorator/default.nix
new file mode 100644
index 0000000000000..e3ee3117501b0
--- /dev/null
+++ b/pkgs/development/python-modules/decorator/default.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "decorator";
+  version = "4.1.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "7cb64d38cb8002971710c8899fbdfb859a23a364b7c99dab19d1f719c2ba16b5";
+  };
+
+  meta = {
+    homepage = https://pypi.python.org/pypi/decorator;
+    description = "Better living through Python with decorators";
+    license = lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/distro/default.nix b/pkgs/development/python-modules/distro/default.nix
index 49349839331dd..36264921f64d4 100644
--- a/pkgs/development/python-modules/distro/default.nix
+++ b/pkgs/development/python-modules/distro/default.nix
@@ -3,7 +3,7 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "distro";
-  version = "1.0.4";
+  version = "1.2.0";
 
   buildInputs = [ pytest pytestcov tox];
 
@@ -14,7 +14,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "9b000b0d637bb0cbd130a7a4835681e6993e309a85564dfea9d884825fe46954";
+    sha256 = "d94370e43b676ac44fbe1ab68ca903a6147eaba3a9e8eff85b2c05556a455b76";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/django-jinja2/default.nix b/pkgs/development/python-modules/django-jinja2/default.nix
index aabfecfcacc76..b8b632e1a1821 100644
--- a/pkgs/development/python-modules/django-jinja2/default.nix
+++ b/pkgs/development/python-modules/django-jinja2/default.nix
@@ -5,7 +5,7 @@
 buildPythonPackage rec {
   pname = "django-jinja";
   name = "${pname}-${version}";
-  version = "2.2.2";
+  version = "2.4.1";
 
   meta = {
     description = "Simple and nonobstructive jinja2 integration with Django";
@@ -15,7 +15,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "099b99iprkvlsndrjmw4v3i3i60i9gm1aq5r88z15r7vgmv6sigj";
+    sha256 = "8a49d73de616a12075eee14c6d3bbab936261a463457d40348d8b8e2995cfbed";
   };
 
   buildInputs = [ django pytz tox ];
diff --git a/pkgs/development/python-modules/djangorestframework/default.nix b/pkgs/development/python-modules/djangorestframework/default.nix
index e2c8acd1a0b16..b11847beaa929 100644
--- a/pkgs/development/python-modules/djangorestframework/default.nix
+++ b/pkgs/development/python-modules/djangorestframework/default.nix
@@ -1,12 +1,12 @@
 { stdenv, buildPythonPackage, fetchurl, django }:
 buildPythonPackage rec {
-  version = "3.7.3";
+  version = "3.7.7";
   pname = "djangorestframework";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/d/djangorestframework/${name}.tar.gz";
-    sha256 = "067960e5e9e5586d3b2d53a1d626c4800dc33cd8309487d404fc63355674556f";
+    sha256 = "9f9e94e8d22b100ed3a43cee8c47a7ff7b185e778a1f2da9ec5c73fc4e081b87";
   };
 
   # Test settings are missing
diff --git a/pkgs/development/python-modules/docker/default.nix b/pkgs/development/python-modules/docker/default.nix
index 88d85dad91aa0..4ce013ac79769 100644
--- a/pkgs/development/python-modules/docker/default.nix
+++ b/pkgs/development/python-modules/docker/default.nix
@@ -3,13 +3,13 @@
 , ipaddress, backports_ssl_match_hostname, docker_pycreds
 }:
 buildPythonPackage rec {
-  version = "2.5.1";
+  version = "2.7.0";
   pname = "docker";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/d/docker/${name}.tar.gz";
-    sha256 = "b876e6909d8d2360e0540364c3a952a62847137f4674f2439320ede16d6db880";
+    sha256 = "144248308e8ea31c4863c6d74e1b55daf97cc190b61d0fe7b7313ab920d6a76c";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/docker_compose/default.nix b/pkgs/development/python-modules/docker_compose/default.nix
index 78e733c1b9d8c..e6be57c8b52d8 100644
--- a/pkgs/development/python-modules/docker_compose/default.nix
+++ b/pkgs/development/python-modules/docker_compose/default.nix
@@ -3,21 +3,20 @@
 , pyyaml, backports_ssl_match_hostname, colorama, docopt
 , dockerpty, docker, ipaddress, jsonschema, requests
 , six, texttable, websocket_client, cached-property
-, enum34, functools32
+, enum34, functools32,
 }:
 buildPythonApplication rec {
-  version = "1.15.0";
+  version = "1.18.0";
   pname = "docker-compose";
-  name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0yg58m5kk22kihbra0h40miqnbdmkirjr9y47wns613sdikrymmg";
+    sha256 = "2930cbfe2685018fbb75377600ab6288861d9955717b3f14212f63950351d379";
   };
 
   # lots of networking and other fails
   doCheck = false;
-  buildInputs = [ mock pytest nose ];
+  checkInputs = [ mock pytest nose ];
   propagatedBuildInputs = [
     pyyaml backports_ssl_match_hostname colorama dockerpty docker
     ipaddress jsonschema requests six texttable websocket_client
@@ -26,7 +25,7 @@ buildPythonApplication rec {
     stdenv.lib.optional (pythonOlder "3.4") enum34 ++
     stdenv.lib.optional (pythonOlder "3.2") functools32;
 
-  patchPhase = ''
+  postPatch = ''
     # Remove upper bound on requires, see also
     # https://github.com/docker/compose/issues/4431
     sed -i "s/, < .*',$/',/" setup.py
diff --git a/pkgs/development/python-modules/easy-thumbnails/default.nix b/pkgs/development/python-modules/easy-thumbnails/default.nix
index 38e201849c190..fbe5c02771db8 100644
--- a/pkgs/development/python-modules/easy-thumbnails/default.nix
+++ b/pkgs/development/python-modules/easy-thumbnails/default.nix
@@ -5,7 +5,7 @@
 buildPythonPackage rec {
   pname = "easy-thumbnails";
   name = "${pname}-${version}";
-  version = "2.4.2";
+  version = "2.5";
 
   meta = {
     description = "Easy thumbnails for Django";
@@ -15,7 +15,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "8cad7ea4fb2b800284e842d8a44f685cbc1968535be04c24a4bbf6e6dbc550c4";
+    sha256 = "e244d1f26027fc32c6ca60ffb0169a39099446f614b0433e907a2588ae7d9b95";
   };
 
   propagatedBuildInputs = [ django pillow ];
diff --git a/pkgs/development/python-modules/evdev/default.nix b/pkgs/development/python-modules/evdev/default.nix
new file mode 100644
index 0000000000000..250a2f5593256
--- /dev/null
+++ b/pkgs/development/python-modules/evdev/default.nix
@@ -0,0 +1,29 @@
+{ lib, buildPythonPackage, isPy34, fetchPypi, linuxHeaders }:
+
+buildPythonPackage rec {
+  pname = "evdev";
+  version = "0.7.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "188ahmqnh5y1f46m7pyjdmi9zfxswaggn6xga65za554d72azvap";
+  };
+
+  buildInputs = [ linuxHeaders ];
+
+  patchPhase = ''
+    substituteInPlace setup.py --replace /usr/include/linux ${linuxHeaders}/include/linux
+  '';
+
+  doCheck = false;
+
+  disabled = isPy34;  # see http://bugs.python.org/issue21121
+
+  meta = with lib; {
+    description = "Provides bindings to the generic input event interface in Linux";
+    homepage = http://pythonhosted.org/evdev;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/python-modules/eve/default.nix b/pkgs/development/python-modules/eve/default.nix
index 1a9b684a9f343..d77b912fe0de6 100644
--- a/pkgs/development/python-modules/eve/default.nix
+++ b/pkgs/development/python-modules/eve/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "Eve";
-  version = "0.7.4";
+  version = "0.7.5";
   name  = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0xihl5w2m4vkp0515qjibiy88pk380n5jmj8n9hh7q40b1vx1kwb";
+    sha256 = "dd4ffbc4725220ffdc8e32f8566c8870efaecdc238d0f96b18e1e83227eca55d";
   };
 
   patches = [
diff --git a/pkgs/development/python-modules/extras/default.nix b/pkgs/development/python-modules/extras/default.nix
new file mode 100644
index 0000000000000..adcc43f265096
--- /dev/null
+++ b/pkgs/development/python-modules/extras/default.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "extras";
+  version = "1.0.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "132e36de10b9c91d5d4cc620160a476e0468a88f16c9431817a6729611a81b4e";
+  };
+
+  # error: invalid command 'test'
+  doCheck = false;
+
+  meta = {
+    description = "A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges";
+    homepage = https://code.google.com/p/mimeparse/;
+    license = lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/faker/default.nix b/pkgs/development/python-modules/faker/default.nix
index 3c95a26881e8c..2d459d625d0ae 100644
--- a/pkgs/development/python-modules/faker/default.nix
+++ b/pkgs/development/python-modules/faker/default.nix
@@ -8,12 +8,12 @@ assert pythonOlder "3.3" -> ipaddress != null;
 
 buildPythonPackage rec {
   pname = "Faker";
-  version = "0.8.7";
+  version = "0.8.8";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "bf7dabcd6807c8829da28a4de491adf7998af506b8571db6a6eb58161157248a";
+    sha256 = "e928cf853ef69d7471421f2a3716a1239e43de0fa9855f4016ee0c9f1057328a";
   };
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/fastimport/default.nix b/pkgs/development/python-modules/fastimport/default.nix
index ee1048ec5fac1..44f7bcdab0688 100644
--- a/pkgs/development/python-modules/fastimport/default.nix
+++ b/pkgs/development/python-modules/fastimport/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, buildPythonPackage, python, fetchurl }:
+{ stdenv, buildPythonPackage, python, fetchPypi}:
 
 buildPythonPackage rec {
-  name = "fastimport-${version}";
+  pname = "fastimport";
   version = "0.9.6";
 
-  src = fetchurl {
-    url = "mirror://pypi/f/fastimport/${name}.tar.gz";
+  src = fetchPypi {
+    inherit pname version;
     sha256 = "1aqjsin4rmqm7ln4j0p73fzxifws6c6ikgyhav7r137m2ixsxl43";
   };
 
diff --git a/pkgs/development/python-modules/faulthandler/default.nix b/pkgs/development/python-modules/faulthandler/default.nix
index f8d877f0655b0..ee2a65e981ca1 100644
--- a/pkgs/development/python-modules/faulthandler/default.nix
+++ b/pkgs/development/python-modules/faulthandler/default.nix
@@ -3,11 +3,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "faulthandler";
-  version = "2.6";
+  version = "3.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0zywq3jaznddvqc3hnfrlv24wmpyq4xgajk9xhv6578qw1rpfj2r";
+    sha256 = "acc10e10909f0f956ba1b42b6c450ea0bdaaa27b3942899f65931396cfcdd36a";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/filelock/default.nix b/pkgs/development/python-modules/filelock/default.nix
index f1f07a99ad550..a22e1581b68d8 100644
--- a/pkgs/development/python-modules/filelock/default.nix
+++ b/pkgs/development/python-modules/filelock/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "filelock";
-  version = "2.0.13";
+  version = "2.0.14";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1n67dw7np5gsy5whynyk8c46pjlr353d6j9735p5gryaszkpjl6h";
+    sha256 = "ee355eb66e4c2e5d95689e1253515aad5b3177c274abdd00a57d5ab1aa6d071a";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/fiona/default.nix b/pkgs/development/python-modules/fiona/default.nix
index 5c150844c8454..1fc7ae5aa5821 100644
--- a/pkgs/development/python-modules/fiona/default.nix
+++ b/pkgs/development/python-modules/fiona/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "Fiona";
-  version = "1.7.10.post1";
+  version = "1.7.11";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "fc4c8996be3131f36c791d66273317d38b72b19dc24c2afc332fd734752eb7a8";
+    sha256 = "5e9c68ea71e9d79fcfb68c9a101c0b133301e233c9bcca7b7c65f33cc7636ef5";
   };
 
   buildInputs = [
diff --git a/pkgs/development/python-modules/flake8-debugger/default.nix b/pkgs/development/python-modules/flake8-debugger/default.nix
index c00bf0c855125..aab9143308809 100644
--- a/pkgs/development/python-modules/flake8-debugger/default.nix
+++ b/pkgs/development/python-modules/flake8-debugger/default.nix
@@ -3,10 +3,10 @@
 buildPythonPackage rec {
   pname = "flake8-debugger";
   name = "${pname}-${version}";
-  version = "1.4.0";
+  version = "3.0.0";
   src = fetchurl {
     url = "mirror://pypi/f/flake8-debugger/${name}.tar.gz";
-    sha256 = "0chjfa6wvnqjnx778qzahhwvjx1j0rc8ax0ipp5bn70gf47lj62r";
+    sha256 = "e5c8ac980d819db2f3fbb89fe0e43a2fe6c127edd6ce4984a3f7e0bbdac3d2d4";
   };
   buildInputs = [ nose ];
   propagatedBuildInputs = [ flake8 ];
diff --git a/pkgs/development/python-modules/flask-testing/default.nix b/pkgs/development/python-modules/flask-testing/default.nix
index 178e000a32edb..5f843138eae01 100644
--- a/pkgs/development/python-modules/flask-testing/default.nix
+++ b/pkgs/development/python-modules/flask-testing/default.nix
@@ -6,11 +6,11 @@ with stdenv.lib;
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "Flask-Testing";
-  version = "0.6.2";
+  version = "0.7.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1w0dpwvrcpffm8ychyxpm8s5blm7slik9kplh9jb3sgwcv9gyppj";
+    sha256 = "dc076623d7d850653a018cb64f500948334c8aeb6b10a5a842bf1bcfb98122bc";
   };
 
   postPatch = ''
diff --git a/pkgs/development/python-modules/flit/default.nix b/pkgs/development/python-modules/flit/default.nix
index 298da4a85bf9a..3a73b464a46f4 100644
--- a/pkgs/development/python-modules/flit/default.nix
+++ b/pkgs/development/python-modules/flit/default.nix
@@ -11,6 +11,7 @@
 , pytest
 , testpath
 , responses
+, pytoml
 }:
 
 # Flit is actually an application to build universal wheels.
@@ -20,25 +21,22 @@
 
 buildPythonPackage rec {
   pname = "flit";
-  version = "0.11.4";
-  name = "${pname}-${version}";
-
-#   format = "wheel";
+  version = "0.13";
 
   src = fetchPypi {
     inherit pname version;
-#     url = https://files.pythonhosted.org/packages/24/98/50a090112a04d9e29155c31a222637668b0a4dd778fefcd3132adc50e877/flit-0.10-py3-none-any.whl;
-    sha256 = "8ba7603cc3bf4149d81811d40fe331abc45ff37a207c63f5f712a0fdb69297bb";
+    sha256 = "8f558351bf4bb82b872d3bdbea7055cbb2e33ed2bdf809284bf927d4c78bf0ee";
   };
 
   disabled = !isPy3k;
-  propagatedBuildInputs = [ docutils requests requests_download ] ++ lib.optional (pythonOlder "3.6") zipfile36;
+  propagatedBuildInputs = [ docutils requests requests_download pytoml ] ++ lib.optional (pythonOlder "3.6") zipfile36;
 
   checkInputs = [ pytest testpath responses ];
 
   # Disable test that needs some ini file.
+  # Disable test that wants hg
   checkPhase = ''
-    py.test -k "not test_invalid_classifier"
+    py.test -k "not test_invalid_classifier and not test_build_sdist"
   '';
 
   meta = {
diff --git a/pkgs/development/python-modules/fonttools/default.nix b/pkgs/development/python-modules/fonttools/default.nix
index 1dfc22f769b45..f7dfb5a8edf5a 100644
--- a/pkgs/development/python-modules/fonttools/default.nix
+++ b/pkgs/development/python-modules/fonttools/default.nix
@@ -7,12 +7,12 @@
 
 buildPythonPackage rec {
   pname = "fonttools";
-  version = "3.17.0";
+  version = "3.21.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1c4f26bf32cd58d5881bfe1f42e5f0a1637a58452a60ae1623999f3ae7da0e24";
+    sha256 = "1whama3bm34xp9l7f543sz2h9dms77ci820sdbxi5dl9krs4xkxb";
     extension = "zip";
   };
 
diff --git a/pkgs/development/python-modules/ftfy/default.nix b/pkgs/development/python-modules/ftfy/default.nix
index b1ba77ab868cf..e54531017f4c9 100644
--- a/pkgs/development/python-modules/ftfy/default.nix
+++ b/pkgs/development/python-modules/ftfy/default.nix
@@ -11,11 +11,11 @@ buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "ftfy";
   # latest is 5.1.1, buy spaCy requires 4.4.3
-  version = "5.1.1";
+  version = "5.2.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "67a29a2fad5f72aec2d8a0a7084e4f499ed040455133ee96b1c458609fc29e78";
+    sha256 = "b9f84a1437f68ad0bb964fd9da9f6b88d090113ec9e78f290f6d6d0221468e38";
   };
 
   propagatedBuildInputs = [ html5lib wcwidth];
diff --git a/pkgs/development/python-modules/gensim/default.nix b/pkgs/development/python-modules/gensim/default.nix
index ea5fc12e4321d..4edd9ac3e5517 100644
--- a/pkgs/development/python-modules/gensim/default.nix
+++ b/pkgs/development/python-modules/gensim/default.nix
@@ -13,10 +13,10 @@
 buildPythonPackage rec {
   pname = "gensim";
   name = "${pname}-${version}";
-  version = "3.0.1";
+  version = "3.2.0";
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4827012f6f020ac4f4067c2a2a88542391917113faaa417505e1ee8a1e7e2650";
+    sha256 = "db00b68c6567ba0598d400b917c889e8801adf249170ce0a80ec38187d1b0797";
   };
 
   propagatedBuildInputs = [ smart_open numpy six scipy
diff --git a/pkgs/development/python-modules/gflags/default.nix b/pkgs/development/python-modules/gflags/default.nix
index 6fe4b7fcab874..9eb8e3b2d6ce5 100644
--- a/pkgs/development/python-modules/gflags/default.nix
+++ b/pkgs/development/python-modules/gflags/default.nix
@@ -2,16 +2,14 @@
 
 buildPythonPackage rec {
   version = "3.1.2";
-  pname = "gflags";
-  name = pname + "-" + version;
+  pname = "python-gflags";
 
   src = fetchPypi {
-    inherit version;
-    pname = "python-gflags";
+    inherit pname version;
     sha256 = "40ae131e899ef68e9e14aa53ca063839c34f6a168afe622217b5b875492a1ee2";
   };
 
-  buildInputs = [ pytest ];
+  checkInputs = [ pytest ];
 
   propagatedBuildInputs = [ six ];
 
diff --git a/pkgs/development/python-modules/google_api_core/default.nix b/pkgs/development/python-modules/google_api_core/default.nix
index 6aa43989aa300..c4275c47a4248 100644
--- a/pkgs/development/python-modules/google_api_core/default.nix
+++ b/pkgs/development/python-modules/google_api_core/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonPackage rec {
   pname = "google-api-core";
-  version = "0.1.2";
+  version = "0.1.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0qmjswj079w7q7zbnh8p4n2r3f831wymm9hfdlc7zfrini7184xv";
+    sha256 = "03bc4b1ab69c0e113af07e706edee50f583abe8219fe1e1d529dee191cb8e0bf";
   };
 
   propagatedBuildInputs = [ google_auth protobuf googleapis_common_protos requests grpcio ];
diff --git a/pkgs/development/python-modules/gpy/default.nix b/pkgs/development/python-modules/gpy/default.nix
index bc48a7490aa91..bb39746d29679 100644
--- a/pkgs/development/python-modules/gpy/default.nix
+++ b/pkgs/development/python-modules/gpy/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "GPy";
-  version = "1.8.4";
+  version = "1.8.5";
   name  = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "38c1202f1790952b88c298224139ee5b14d4518e3ddc6186c60db2ece016d8c1";
+    sha256 = "1562e34629192f209273f454e41614a127c6ef04144cd0eb5992d484721d55d3";
   };
 
   # running tests produces "ImportError: cannot import name 'linalg_cython'"
diff --git a/pkgs/development/python-modules/grpcio/default.nix b/pkgs/development/python-modules/grpcio/default.nix
index c17e1bf7bf053..eeb51fb584342 100644
--- a/pkgs/development/python-modules/grpcio/default.nix
+++ b/pkgs/development/python-modules/grpcio/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonPackage rec {
   pname = "grpcio";
-  version = "1.7.3";
+  version = "1.8.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1wkrxj1jmf2dyx207fc9ysyns9h27gls3drgg05mzdckjqr5lnl6";
+    sha256 = "1ea1336f0d1158c4e00e96a94df84b75f6bbff9816abb6cc68cbdc9442a9ac55";
   };
 
   propagatedBuildInputs = [ six protobuf ]
diff --git a/pkgs/development/python-modules/gssapi/default.nix b/pkgs/development/python-modules/gssapi/default.nix
index 3b13f8a204971..b075db5ae9873 100644
--- a/pkgs/development/python-modules/gssapi/default.nix
+++ b/pkgs/development/python-modules/gssapi/default.nix
@@ -3,12 +3,12 @@ nose, shouldbe, gss, krb5Full, which, darwin }:
 
 buildPythonPackage rec {
   pname = "gssapi";
-  version = "1.2.0";
+  version = "1.3.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1q6ccpz6anl9vggwxdq32wp6xjh2lyfbf7av6jqnmvmyqdfwh3b9";
+    sha256 = "765205082a9490c8e8be88ac16a6249d124396a671665edeec9927a7f244d712";
   };
 
   # It's used to locate headers
diff --git a/pkgs/development/python-modules/html5lib/default.nix b/pkgs/development/python-modules/html5lib/default.nix
new file mode 100644
index 0000000000000..97d2854ca226b
--- /dev/null
+++ b/pkgs/development/python-modules/html5lib/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, flake8
+, pytest
+, pytest-expect
+, mock
+, six
+, webencodings
+}:
+
+buildPythonPackage rec {
+  pname = "html5lib";
+  version = "1.0.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736";
+  };
+
+  checkInputs = [ flake8 pytest pytest-expect mock ];
+  propagatedBuildInputs = [
+    six webencodings
+  ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = {
+    homepage = https://github.com/html5lib/html5lib-python;
+    downloadPage = https://github.com/html5lib/html5lib-python/releases;
+    description = "HTML parser based on WHAT-WG HTML5 specification";
+    longDescription = ''
+      html5lib is a pure-python library for parsing HTML. It is designed to
+      conform to the WHATWG HTML specification, as is implemented by all
+      major web browsers.
+    '';
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ domenkozar prikhi ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/htmlmin/default.nix b/pkgs/development/python-modules/htmlmin/default.nix
index 2206b3559bae4..8df4b3813c41b 100644
--- a/pkgs/development/python-modules/htmlmin/default.nix
+++ b/pkgs/development/python-modules/htmlmin/default.nix
@@ -1,11 +1,11 @@
 { stdenv, buildPythonPackage, fetchPypi }:
 buildPythonPackage rec {
   pname = "htmlmin";
-  version = "0.1.11";
+  version = "0.1.12";
   name = "${pname}-${version}";
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f27fb96fdddeb1725ee077be532c7bea23288c69d0e996e7798f24fae7a14e5e";
+    sha256 = "50c1ef4630374a5d723900096a961cff426dff46b48f34d194a81bbe14eca178";
   };
 
   # Tests run fine in a normal source checkout, but not when being built by nix.
diff --git a/pkgs/development/python-modules/httpbin/default.nix b/pkgs/development/python-modules/httpbin/default.nix
index d11d6b3668f6e..2f24a1ab72bd2 100644
--- a/pkgs/development/python-modules/httpbin/default.nix
+++ b/pkgs/development/python-modules/httpbin/default.nix
@@ -10,12 +10,12 @@
 
 buildPythonPackage rec {
   pname = "httpbin";
-  version = "0.5.0";
+  version = "0.6.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6b57f563900ecfe126015223a259463848daafbdc2687442317c0992773b9054";
+    sha256 = "0afa0486a76305cac441b5cc80d5d4ccd82b20875da7c5119ecfe616cefef45f";
   };
 
   propagatedBuildInputs = [ flask markupsafe decorator itsdangerous six ];
diff --git a/pkgs/development/python-modules/idna/default.nix b/pkgs/development/python-modules/idna/default.nix
new file mode 100644
index 0000000000000..635f8b33d3c62
--- /dev/null
+++ b/pkgs/development/python-modules/idna/default.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "idna";
+  version = "2.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f";
+  };
+
+  meta = {
+    homepage = "http://github.com/kjd/idna/";
+    description = "Internationalized Domain Names in Applications (IDNA)";
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/ipykernel/default.nix b/pkgs/development/python-modules/ipykernel/default.nix
index a77f6ac9c2f11..8547a3ef99e94 100644
--- a/pkgs/development/python-modules/ipykernel/default.nix
+++ b/pkgs/development/python-modules/ipykernel/default.nix
@@ -13,12 +13,12 @@
 
 buildPythonPackage rec {
   pname = "ipykernel";
-  version = "4.6.1";
+  version = "4.7.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "2e1825aca4e2585b5adb7953ea16e53f53a62159ed49952a564b1e23507205db";
+    sha256 = "354986612a38f0555c43d5af2425e2a67506b63b313a0325e38904003b9d977b";
   };
 
   buildInputs = [ nose ] ++ lib.optional isPy27 mock;
diff --git a/pkgs/development/python-modules/ipywidgets/default.nix b/pkgs/development/python-modules/ipywidgets/default.nix
index 3d15632349104..f77c3570c02f8 100644
--- a/pkgs/development/python-modules/ipywidgets/default.nix
+++ b/pkgs/development/python-modules/ipywidgets/default.nix
@@ -14,12 +14,12 @@
 
 buildPythonPackage rec {
   pname = "ipywidgets";
-  version = "7.0.5";
+  version = "7.1.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "321be3dc48193130ba16e8080172bb5cd052eb65e3ad0ea7b5f80ff73e24bc54";
+    sha256 = "3e2be7dea4f97c9a4df71ef065cad9f2e420dd901127bf7cb690fb56d2b34ea3";
   };
 
   # Tests are not distributed
diff --git a/pkgs/development/python-modules/iso8601/default.nix b/pkgs/development/python-modules/iso8601/default.nix
new file mode 100644
index 0000000000000..4f9ff70556b44
--- /dev/null
+++ b/pkgs/development/python-modules/iso8601/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "iso8601";
+  version = "0.1.12";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "49c4b20e1f38aa5cf109ddcd39647ac419f928512c869dc01d5c7098eddede82";
+  };
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    py.test iso8601
+  '';
+
+  meta = {
+    homepage = https://bitbucket.org/micktwomey/pyiso8601/;
+    description = "Simple module to parse ISO 8601 dates";
+    maintainers = with lib.maintainers; [ phreedom ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/jdcal/default.nix b/pkgs/development/python-modules/jdcal/default.nix
new file mode 100644
index 0000000000000..d3ed32c0882f3
--- /dev/null
+++ b/pkgs/development/python-modules/jdcal/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "jdcal";
+  version = "1.3";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "b760160f8dc8cc51d17875c6b663fafe64be699e10ce34b6a95184b5aa0fdc9e";
+  };
+
+  checkInputs = [ pytest ];
+
+  checkPhase = ''
+    py.test
+  '';
+
+  meta = {
+    description = "A module containing functions for converting between Julian dates and calendar dates";
+    homepage = "https://github.com/phn/jdcal";
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ lihop ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/jedi/default.nix b/pkgs/development/python-modules/jedi/default.nix
index bf9f9f9c08239..df8a287ea0936 100644
--- a/pkgs/development/python-modules/jedi/default.nix
+++ b/pkgs/development/python-modules/jedi/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "jedi";
-  version = "0.11.0";
+  version = "0.11.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f6d5973573e76b1fd2ea75f6dcd6445d02d41ff3af5fc61b275b4e323d1dd396";
+    sha256 = "d6e799d04d1ade9459ed0f20de47c32f2285438956a677d083d3c98def59fa97";
   };
 
   postPatch = ''
diff --git a/pkgs/development/python-modules/jellyfish/default.nix b/pkgs/development/python-modules/jellyfish/default.nix
new file mode 100644
index 0000000000000..db83e6cb29911
--- /dev/null
+++ b/pkgs/development/python-modules/jellyfish/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, unicodecsv
+}:
+
+buildPythonPackage rec {
+  pname = "jellyfish";
+  version = "0.5.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "887a9a49d0caee913a883c3e7eb185f6260ebe2137562365be422d1316bd39c9";
+  };
+
+  checkInputs = [ pytest unicodecsv ];
+
+  meta = {
+    homepage = https://github.com/sunlightlabs/jellyfish;
+    description = "Approximate and phonetic matching of strings";
+    maintainers = with lib.maintainers; [ koral ];
+  };
+}
diff --git a/pkgs/development/python-modules/jinja2/default.nix b/pkgs/development/python-modules/jinja2/default.nix
index ca286ae06aab3..cb0eb130a2f24 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/python-modules/jsbeautifier/default.nix b/pkgs/development/python-modules/jsbeautifier/default.nix
index a2278566c6d74..19b1eeefa5340 100644
--- a/pkgs/development/python-modules/jsbeautifier/default.nix
+++ b/pkgs/development/python-modules/jsbeautifier/default.nix
@@ -2,7 +2,7 @@
 
 buildPythonApplication rec {
   pname = "jsbeautifier";
-  version = "1.7.4";
+  version = "1.7.5";
   name = "${pname}-${version}";
 
   propagatedBuildInputs = [ six ];
@@ -11,7 +11,7 @@ buildPythonApplication rec {
 
   src = fetchurl {
     url = "mirror://pypi/j/jsbeautifier/${name}.tar.gz";
-    sha256 = "7fc14f279117a55a5e854602f6e8c1cb178c6d83f7cf75e2e9f50678fe11079e";
+    sha256 = "78eb1e5c8535484f0d0b588aca38da3fb5e0e34de2d1ab53c077e71c55757473";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/jsondiff/default.nix b/pkgs/development/python-modules/jsondiff/default.nix
new file mode 100644
index 0000000000000..9d4331c8ea802
--- /dev/null
+++ b/pkgs/development/python-modules/jsondiff/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "jsondiff";
+  version = "1.1.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "2d0437782de9418efa34e694aa59f43d7adb1899bd9a793f063867ddba8f7893";
+  };
+
+  # No tests
+  doCheck = false;
+
+  meta = {
+    description = "Diff JSON and JSON-like structures in Python";
+    homepage = https://github.com/ZoomerAnalytics/jsondiff;
+    license = lib.licenses.mit;
+  };
+
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/jsonpatch/default.nix b/pkgs/development/python-modules/jsonpatch/default.nix
index 39f36b1d94945..8d238b4746dfa 100644
--- a/pkgs/development/python-modules/jsonpatch/default.nix
+++ b/pkgs/development/python-modules/jsonpatch/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec {
   pname = "jsonpatch";
-  version = "1.16";
+  version = "1.21";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f025c28a08ce747429ee746bb21796c3b6417ec82288f8fe6514db7398f2af8a";
+    sha256 = "11f5ffdf543a83047a2f54ac28f8caad7f34724cb1ea26b27547fd974f1a2153";
   };
 
   # test files are missing
diff --git a/pkgs/development/python-modules/jsonpickle/default.nix b/pkgs/development/python-modules/jsonpickle/default.nix
new file mode 100644
index 0000000000000..2d9f02a5affba
--- /dev/null
+++ b/pkgs/development/python-modules/jsonpickle/default.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "jsonpickle";
+  version = "0.9.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "cc25dc79571d4ad7db59d05ddb7de0d76a8d598cf6136e1dbeaa9361ebcfe749";
+  };
+
+  doCheck = false;
+
+  meta = {
+    description = "Python library for serializing any arbitrary object graph into JSON";
+    homepage = http://jsonpickle.github.io/;
+    license = lib.licenses.bsd3;
+  };
+
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/jupyter_client/default.nix b/pkgs/development/python-modules/jupyter_client/default.nix
index 3782d313df89e..e88b7f937a558 100644
--- a/pkgs/development/python-modules/jupyter_client/default.nix
+++ b/pkgs/development/python-modules/jupyter_client/default.nix
@@ -1,32 +1,38 @@
 { lib
 , buildPythonPackage
 , fetchPypi
-, nose
 , traitlets
 , jupyter_core
 , pyzmq
 , dateutil
 , isPyPy
 , py
+, ipykernel
+, ipython
+, mock
+, pytest
 }:
 
 buildPythonPackage rec {
   pname = "jupyter_client";
-  version = "5.1.0";
-  name = "${pname}-${version}";
+  version = "5.2.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "08756b021765c97bc5665390700a4255c2df31666ead8bff116b368d09912aba";
+    sha256 = "ca30cf1786047925ebacd6f6faa3a993efaa004b584f7d83bc8b807f7cd3f6bb";
   };
 
-  buildInputs = [ nose ];
+  checkInputs = [ ipykernel ipython mock pytest ];
   propagatedBuildInputs = [traitlets jupyter_core pyzmq dateutil] ++ lib.optional isPyPy py;
 
   checkPhase = ''
-    nosetests -v
+    py.test
   '';
 
+  patches = [
+    ./wheel_workaround.patch
+  ];
+
   # Circular dependency with ipykernel
   doCheck = false;
 
diff --git a/pkgs/development/python-modules/jupyter_client/wheel_workaround.patch b/pkgs/development/python-modules/jupyter_client/wheel_workaround.patch
new file mode 100644
index 0000000000000..926fcb26448bc
--- /dev/null
+++ b/pkgs/development/python-modules/jupyter_client/wheel_workaround.patch
@@ -0,0 +1,13 @@
+diff --git a/setup.py b/setup.py
+index 95d4774..ee72cbc 100644
+--- a/setup.py
++++ b/setup.py
+@@ -86,7 +86,7 @@ setup_args = dict(
+     extras_require   = {
+         'test': ['ipykernel', 'ipython', 'mock'],
+         'test:python_version == "3.3"': ['pytest<3.3.0'],
+-        'test:python_version >= "3.4" or python_version == "2.7"': ['pytest'],
++        'test:(python_version >= "3.4" or python_version == "2.7")': ['pytest'],
+     },
+     cmdclass         = {
+         'bdist_egg': bdist_egg if 'bdist_egg' in sys.argv else bdist_egg_disabled,
diff --git a/pkgs/development/python-modules/jupyter_core/default.nix b/pkgs/development/python-modules/jupyter_core/default.nix
index 4db36cf7b3745..403f7c047d561 100644
--- a/pkgs/development/python-modules/jupyter_core/default.nix
+++ b/pkgs/development/python-modules/jupyter_core/default.nix
@@ -11,15 +11,15 @@
 
 buildPythonPackage rec {
   pname = "jupyter_core";
-  version = "4.3.0";
+  version = "4.4.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "a96b129e1641425bf057c3d46f4f44adce747a7d60107e8ad771045c36514d40";
+    sha256 = "ba70754aa680300306c699790128f6fbd8c306ee5927976cbe48adacf240c0b7";
   };
 
-  buildInputs = [ pytest mock glibcLocales ];
+  checkInputs = [ pytest mock glibcLocales ];
   propagatedBuildInputs = [ ipython traitlets ];
 
   patches = [ ./tests_respect_pythonpath.patch ];
diff --git a/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch b/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch
index 61415b756abcd..7e7e9ae93a090 100644
--- a/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch
+++ b/pkgs/development/python-modules/jupyter_core/tests_respect_pythonpath.patch
@@ -1,24 +1,20 @@
---- a/jupyter_core/tests/test_command.py	2016-09-13 15:22:49.000000000 +0200
-+++ b/jupyter_core/tests/test_command.py	2017-10-23 12:49:27.489527705 +0200
-@@ -113,7 +113,10 @@
-     witness = a.join(witness_cmd)
-     witness.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")'))
-     witness.chmod(0o700)
--    out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH': ''})
-+    out = check_output(
-+        [sys.executable, str(jupyter), 'witness'],
-+        env={'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}
-+    )
-     assert b'WITNESS' in out
- 
- 
-@@ -136,5 +139,8 @@
-     witness_b.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")'))
-     witness_b.chmod(0o700)
- 
--    out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH': str(b)})
-+    out = check_output(
-+        [sys.executable, str(jupyter), 'witness'],
-+        env={'PATH': str(b), 'PYTHONPATH': os.environ['PYTHONPATH']}
-+    )
-     assert b'WITNESS A' in out
+--- a/jupyter_core/tests/test_command.py
++++ b/jupyter_core/tests/test_command.py
+@@ -131,7 +131,7 @@ def test_not_on_path(tmpdir):
+     witness_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")')
+     write_executable(witness, witness_src)
+
+-    env = {'PATH': ''}
++    env = {'PATH': '', 'PYTHONPATH': os.environ['PYTHONPATH']}
+     if 'SYSTEMROOT' in os.environ:  # Windows http://bugs.python.org/issue20614
+         env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
+     if sys.platform == 'win32':
+@@ -157,7 +157,7 @@ def test_path_priority(tmpdir):
+     witness_b_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")')
+     write_executable(witness_b, witness_b_src)
+
+-    env = {'PATH':  str(b)}
++    env = {'PATH':  str(b), 'PYTHONPATH': os.environ['PYTHONPATH']}
+     if 'SYSTEMROOT' in os.environ:  # Windows http://bugs.python.org/issue20614
+         env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
+     if sys.platform == 'win32':
diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix
index d88b6e4999b22..b6c56cc8bc687 100644
--- a/pkgs/development/python-modules/keras/default.nix
+++ b/pkgs/development/python-modules/keras/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "Keras";
-  version = "2.1.1";
+  version = "2.1.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f0ca2458c60d9711edf4291230b31795307ad3781cb6232ff4792b53c8f55123";
+    sha256 = "3ee56fc129d9d00b1916046e50056047836f97ada59df029e5661fb34442d5e8";
   };
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/keyring/default.nix b/pkgs/development/python-modules/keyring/default.nix
index ca7a518665cea..f88bdb84e0c39 100644
--- a/pkgs/development/python-modules/keyring/default.nix
+++ b/pkgs/development/python-modules/keyring/default.nix
@@ -6,11 +6,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "keyring";
-  version = "10.4.0";
+  version = "10.5.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "09iv50c14mdmdk7sjd6bb47yg7347gymh6r8c0q4gfnzs173y6lh";
+    sha256 = "f10674bb6ecbf82e2b713627c48ad0e84178e1c9d3dc1f0373261a0765402fb2";
   };
 
   buildInputs = [
diff --git a/pkgs/development/python-modules/ldap/default.nix b/pkgs/development/python-modules/ldap/default.nix
index 635308f376078..32f25eeda42cd 100644
--- a/pkgs/development/python-modules/ldap/default.nix
+++ b/pkgs/development/python-modules/ldap/default.nix
@@ -1,18 +1,18 @@
 { lib, writeText, buildPythonPackage, isPy3k, fetchPypi
-, openldap, cyrus_sasl, openssl, pytest }:
+, openldap, cyrus_sasl, openssl, pytest, pyasn1 }:
 
 buildPythonPackage rec {
   pname = "python-ldap";
-  version = "2.4.45";
+  version = "2.5.2";
   name = "${pname}-${version}";
   disabled = isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "824fde180a53772e23edc031c4dd64ac1af4a3eade78f00d9d510937d562f64e";
+    sha256 = "b8c134dfedaef0e6ff4a4b94277708dcadb758b448905a83b8946df077356ed2";
   };
 
-  buildInputs = [ pytest ];
+  checkInputs = [ pytest pyasn1 ];
 
   checkPhase = ''
     # Needed by tests to setup a mockup ldap server.
diff --git a/pkgs/development/python-modules/ldap3/default.nix b/pkgs/development/python-modules/ldap3/default.nix
index 895272f351de6..202bceafae39c 100644
--- a/pkgs/development/python-modules/ldap3/default.nix
+++ b/pkgs/development/python-modules/ldap3/default.nix
@@ -1,13 +1,12 @@
 { stdenv, fetchPypi, buildPythonPackage, gssapi, pyasn1 }:
 
 buildPythonPackage rec {
-  version = "2.3";
+  version = "2.4";
   pname = "ldap3";
-  name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1b36lwil4iflk2ay8gi663abpnfm8id7qg4n3jkmmqbnc1sv6mn0";
+    sha256 = "888015f849eb33852583bbaf382f61593b03491cdac6098fd5d4d0252e0e7e66";
   };
 
   buildInputs = [ gssapi ];
diff --git a/pkgs/development/python-modules/libusb1/default.nix b/pkgs/development/python-modules/libusb1/default.nix
index adf1bc2361831..f3b48eaa57606 100644
--- a/pkgs/development/python-modules/libusb1/default.nix
+++ b/pkgs/development/python-modules/libusb1/default.nix
@@ -12,7 +12,7 @@ buildPythonPackage rec {
   postPatch = lib.optionalString stdenv.isLinux ''
     substituteInPlace usb1/libusb1.py --replace \
       "ctypes.util.find_library(base_name)" \
-      "'${libusb1}/lib/libusb${stdenv.hostPlatform.extensions.sharedLibrary}'"
+      "'${libusb1}/lib/libusb-1.0${stdenv.hostPlatform.extensions.sharedLibrary}'"
   '';
 
   buildInputs = [ libusb1 ];
diff --git a/pkgs/development/python-modules/line_profiler/default.nix b/pkgs/development/python-modules/line_profiler/default.nix
index 570bba2a8c42f..26dfda613f75d 100644
--- a/pkgs/development/python-modules/line_profiler/default.nix
+++ b/pkgs/development/python-modules/line_profiler/default.nix
@@ -9,12 +9,12 @@
 
 buildPythonPackage rec {
   pname = "line_profiler";
-  version = "2.0";
+  version = "2.1.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "739f8ad0e4bcd0cb82e99afc09e00a0351234f6b3f0b1f7f0090a8a2fbbf8381";
+    sha256 = "efa66e9e3045aa7cb1dd4bf0106e07dec9f80bc781a993fbaf8162a36c20af5c";
   };
 
   buildInputs = [ cython ];
diff --git a/pkgs/development/python-modules/llfuse/default.nix b/pkgs/development/python-modules/llfuse/default.nix
index 4c4c89d8f196f..ef4d9fb5d020c 100644
--- a/pkgs/development/python-modules/llfuse/default.nix
+++ b/pkgs/development/python-modules/llfuse/default.nix
@@ -4,12 +4,12 @@
 
 buildPythonPackage rec {
   pname = "llfuse";
-  version = "1.0";
+  version = "1.3.2";
   name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/l/llfuse/${name}.tar.bz2";
-    sha256 = "1li7q04ljrvwharw4fblcbfhvk6s0l3lnv8yqb4c22lcgbkiqlps";
+    sha256 = "96252a286a2be25810904d969b330ef2a57c2b9c18c5b503bbfbae40feb2bb63";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/python-modules/llvmlite/default.nix b/pkgs/development/python-modules/llvmlite/default.nix
index 57deaf3caf361..d702d8f95b089 100644
--- a/pkgs/development/python-modules/llvmlite/default.nix
+++ b/pkgs/development/python-modules/llvmlite/default.nix
@@ -1,5 +1,5 @@
 { stdenv
-, fetchurl
+, fetchPypi
 , buildPythonPackage
 , python
 , llvm
@@ -10,21 +10,20 @@
 
 buildPythonPackage rec {
   pname = "llvmlite";
-  name = "${pname}-${version}";
-  version = "0.20.0";
+  version = "0.21.0";
 
   disabled = isPyPy;
 
-  src = fetchurl {
-    url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
-    sha256 = "b2f174848df16bb9195a07fec102110a06d018da736bd9b3570a54d44c797c29";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "3a5dd0695fdfb9fd47464cd71791b84935bf9642e11f4811d57aa1f2da8cdaa8";
   };
 
   propagatedBuildInputs = [ llvm ] ++ stdenv.lib.optional (pythonOlder "3.4") enum34;
 
   # Disable static linking
   # https://github.com/numba/llvmlite/issues/93
-  patchPhase = ''
+  postPatch = ''
     substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" ""
 
     substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope"
diff --git a/pkgs/development/python-modules/lxml/default.nix b/pkgs/development/python-modules/lxml/default.nix
new file mode 100644
index 0000000000000..bfd0c8227ee74
--- /dev/null
+++ b/pkgs/development/python-modules/lxml/default.nix
@@ -0,0 +1,27 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, libxml2
+, libxslt
+}:
+
+buildPythonPackage rec {
+  pname = "lxml";
+  version = "4.1.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "940caef1ec7c78e0c34b0f6b94fe42d0f2022915ffc78643d28538a5cfd0f40e";
+  };
+
+  buildInputs = [ libxml2 libxslt ];
+
+  hardeningDisable = stdenv.lib.optional stdenv.isDarwin "format";
+
+  meta = {
+    description = "Pythonic binding for the libxml2 and libxslt libraries";
+    homepage = http://lxml.de;
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ sjourdois ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/marionette-harness/default.nix b/pkgs/development/python-modules/marionette-harness/default.nix
index fbdd13a7f385f..f909974db6b34 100644
--- a/pkgs/development/python-modules/marionette-harness/default.nix
+++ b/pkgs/development/python-modules/marionette-harness/default.nix
@@ -14,13 +14,13 @@
 
 buildPythonPackage rec {
   pname = "marionette-harness";
-  version = "4.1.0";
+  version = "4.3.0";
   name = "${pname}-${version}";
   disabled = isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "20c188791e28d586c58acf86ff28cb704c4195a4da6eb10db7b8c6771e3f2983";
+    sha256 = "a98bb65a0c63f60d9e3d7ef21dabc9c29676917dc2ec0d46851a3ed694c820cc";
   };
 
   propagatedBuildInputs = [ mozprofile mozversion browsermob-proxy moztest 
diff --git a/pkgs/development/python-modules/markdown/default.nix b/pkgs/development/python-modules/markdown/default.nix
new file mode 100644
index 0000000000000..515dee0e7662e
--- /dev/null
+++ b/pkgs/development/python-modules/markdown/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, nose
+, pyyaml
+}:
+
+buildPythonPackage rec {
+  pname = "Markdown";
+  version = "2.6.10";
+
+  src = fetchPypi {
+    extension = "zip";
+    inherit pname version;
+    sha256 = "cfa536d1ee8984007fcecc5a38a493ff05c174cb74cb2341dafd175e6bc30851";
+  };
+
+  # error: invalid command 'test'
+#   doCheck = false;
+
+  checkInputs = [ nose pyyaml ];
+
+  meta = {
+    description = "A Python implementation of John Gruber’s Markdown with Extension support";
+    homepage = https://github.com/Python-Markdown/markdown;
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/marshmallow/default.nix b/pkgs/development/python-modules/marshmallow/default.nix
index afb60801dc943..a9db6ef1e84c0 100644
--- a/pkgs/development/python-modules/marshmallow/default.nix
+++ b/pkgs/development/python-modules/marshmallow/default.nix
@@ -5,7 +5,7 @@
 buildPythonPackage rec {
   pname = "marshmallow";
   name = "${pname}-${version}";
-  version = "2.14.0";
+  version = "2.15.0";
 
   meta = {
     homepage = "https://github.com/marshmallow-code/marshmallow";
@@ -18,7 +18,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "09943a460026b9a61c3f4cedd0e5ccfed7cfce3271debd19e3f97df561088718";
+    sha256 = "d3f31fe7be2106b1d783cbd0765ef4e1c6615505514695f33082805f929dd584";
   };
 
   propagatedBuildInputs = [ dateutil simplejson ];
diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix
index 345a21ecddfe5..33505b5f61870 100644
--- a/pkgs/development/python-modules/matplotlib/default.nix
+++ b/pkgs/development/python-modules/matplotlib/default.nix
@@ -20,13 +20,13 @@ assert enableTk -> (tcl != null)
 assert enableQt -> pyqt4 != null;
 
 buildPythonPackage rec {
-  version = "2.1.0";
+  version = "2.1.1";
   pname = "matplotlib";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/m/matplotlib/${name}.tar.gz";
-    sha256 = "4b5f16c9cefde553ea79975305dcaa67c8e13d927b6e55aa14b4a8d867e25387";
+    sha256 = "659f5e1aa0e0f01488c61eff47560c43b8be511c6a29293d7f3896ae17bd8b23";
   };
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1";
diff --git a/pkgs/development/python-modules/mistune/default.nix b/pkgs/development/python-modules/mistune/default.nix
index 14aef5b00d121..7ab4a18426342 100644
--- a/pkgs/development/python-modules/mistune/default.nix
+++ b/pkgs/development/python-modules/mistune/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec {
   pname = "mistune";
-  version = "0.7.4";
+  version = "0.8.3";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0byj9jg9ly7karf5sb1aqcw7avaim9sxl8ws7yw7p1fibjgsy5w5";
+    sha256 = "bc10c33bfdcaa4e749b779f62f60d6e12f8215c46a292d05e486b869ae306619";
   };
 
   buildInputs = [ nose ];
diff --git a/pkgs/development/python-modules/moto/default.nix b/pkgs/development/python-modules/moto/default.nix
index cf74e1dc1342b..d5c40c67b36b2 100644
--- a/pkgs/development/python-modules/moto/default.nix
+++ b/pkgs/development/python-modules/moto/default.nix
@@ -1,17 +1,20 @@
-{ stdenv, buildPythonPackage, fetchPypi, jinja2, werkzeug, flask, requests, pytz
-, six, boto, httpretty, xmltodict, nose, sure, boto3, freezegun, dateutil }:
+{ stdenv, buildPythonPackage, fetchPypi, jinja2, werkzeug, flask
+, requests, pytz, backports_tempfile, cookies, jsondiff, botocore, aws-xray-sdk, docker
+, six, boto, httpretty, xmltodict, nose, sure, boto3, freezegun, dateutil, mock, pyaml }:
 
 buildPythonPackage rec {
   pname = "moto";
-  version = "0.4.31";
-  name    = "moto-${version}";
+  version = "1.1.25";
+
   src = fetchPypi {
     inherit pname version;
-    sha256 = "19s8hfz4mzzzdksa0ddlvrga5mxdaqahk89p5l29a5id8127shr8";
+    sha256 = "d427d6e1a81e926c2b6a071453807b05f4736d65068493e1f3055ac7ee24ea21";
   };
 
   propagatedBuildInputs = [
+    aws-xray-sdk
     boto
+    boto3
     dateutil
     flask
     httpretty
@@ -21,6 +24,13 @@ buildPythonPackage rec {
     requests
     six
     xmltodict
+    mock
+    pyaml
+    backports_tempfile
+    cookies
+    jsondiff
+    botocore
+    docker
   ];
 
   checkInputs = [ boto3 nose sure freezegun ];
diff --git a/pkgs/development/python-modules/mygpoclient/default.nix b/pkgs/development/python-modules/mygpoclient/default.nix
index 14819b0b66e48..097898a2d84f7 100644
--- a/pkgs/development/python-modules/mygpoclient/default.nix
+++ b/pkgs/development/python-modules/mygpoclient/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, buildPythonPackage, nose, minimock }:
 
 buildPythonPackage rec {
-  name = "mygpoclient-${version}";
+  pname = "mypgoclient";
   version = "1.8";
 
   src = fetchFromGitHub {
@@ -11,7 +11,7 @@ buildPythonPackage rec {
     sha256 = "0aa28wc55x3rxa7clwfv5v5500ffyaq0vkxaa3v01y1r93dxkdvp";
   };
 
-  buildInputs = [ nose minimock ];
+  checkInputs = [ nose minimock ];
 
   checkPhase = ''
     nosetests
@@ -25,7 +25,6 @@ buildPythonPackage rec {
     '';
     homepage = https://github.com/gpodder/mygpoclient;
     license = with licenses; [ gpl3 ];
-    platforms = with platforms; linux ++ darwin;
     maintainers = with maintainers; [ skeidel ];
   };
 }
diff --git a/pkgs/development/python-modules/nbxmpp/default.nix b/pkgs/development/python-modules/nbxmpp/default.nix
index 964b42fe4eeef..26525adb1c966 100644
--- a/pkgs/development/python-modules/nbxmpp/default.nix
+++ b/pkgs/development/python-modules/nbxmpp/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   pname = "nbxmpp";
-  version = "0.6.0";
+  version = "0.6.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0x495yb0abkdspyziw7dyyjwxx6ivnv5zznk92wa3mcind5s9757";
+    sha256 = "10bfb12b083a7509779298c31b4b61e2ed7e78d1960cbcfb3de8d38f3b830991";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/networkx/default.nix b/pkgs/development/python-modules/networkx/default.nix
new file mode 100644
index 0000000000000..f6fc4139c858c
--- /dev/null
+++ b/pkgs/development/python-modules/networkx/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, nose
+, decorator
+, isPy36
+, isPyPy
+}:
+
+buildPythonPackage rec {
+  pname = "networkx";
+  version = "1.11";
+
+  # Currently broken on PyPy.
+  # https://github.com/networkx/networkx/pull/1361
+  disabled = isPyPy;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1f74s56xb4ggixiq0vxyfxsfk8p20c7a099lpcf60izv1php03hd";
+  };
+
+  checkInputs = [ nose ];
+  propagatedBuildInputs = [ decorator ];
+
+  # 17 failures with 3.6 https://github.com/networkx/networkx/issues/2396#issuecomment-304437299
+  doCheck = !(isPy36);
+
+  meta = {
+    homepage = "https://networkx.github.io/";
+    description = "Library for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks";
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/nilearn/default.nix b/pkgs/development/python-modules/nilearn/default.nix
index 16036a6917910..6133abac70529 100644
--- a/pkgs/development/python-modules/nilearn/default.nix
+++ b/pkgs/development/python-modules/nilearn/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "nilearn";
-  version = "0.3.1";
+  version = "0.4.0";
   name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0kkarh5cdcd2czs0bf0s1g51qas84mfxfq0dzd7k5h5l0qr4zy06";
+    sha256 = "bb692254bde35d7e1d3d1534d9b3117810b35a744724625f150fbbc64d519c02";
   };
 
   checkPhase = "nosetests --exclude with_expand_user nilearn/tests";
diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix
index 2a23ff4de78ce..71261fb1f4060 100644
--- a/pkgs/development/python-modules/notebook/default.nix
+++ b/pkgs/development/python-modules/notebook/default.nix
@@ -22,12 +22,12 @@
 
 buildPythonPackage rec {
   pname = "notebook";
-  version = "5.2.1";
+  version = "5.2.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "4ae5b81dd39b37cdd99dcffe83a5182c849947b92d46ac4d2b5093af2bb9f224";
+    sha256 = "7bb54fb61b9c5426bc116f840541b973431198e00ea2896122d05fc122dbbd67";
   };
 
   LC_ALL = "en_US.utf8";
diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix
index b0d7ae72c95bc..97aad8c092853 100644
--- a/pkgs/development/python-modules/numba/default.nix
+++ b/pkgs/development/python-modules/numba/default.nix
@@ -1,5 +1,5 @@
 { stdenv
-, fetchurl
+, fetchPypi
 , python
 , buildPythonPackage
 , isPy27
@@ -14,13 +14,12 @@
 }:
 
 buildPythonPackage rec {
-  version = "0.35.0";
+  version = "0.36.2";
   pname = "numba";
-  name = "${pname}-${version}";
 
-  src = fetchurl {
-    url = "mirror://pypi/n/numba/${name}.tar.gz";
-    sha256 = "11564937757605bee590c5758c73cfe9fd6d569726b56d970316a6228971ecc3";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "d61597808ce511e81b64e32da664f52beb7d947bf834dde8b8b60b29d205e5c2";
   };
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1";
@@ -29,7 +28,7 @@ buildPythonPackage rec {
 
   # Copy test script into $out and run the test suite.
   checkPhase = ''
-    python -m numba.runtests
+    ${python.interpreter} -m numba.runtests
   '';
   # ImportError: cannot import name '_typeconv'
   doCheck = false;
diff --git a/pkgs/development/python-modules/odfpy/default.nix b/pkgs/development/python-modules/odfpy/default.nix
index a80cd827c6d1c..37790b6eaf8a6 100644
--- a/pkgs/development/python-modules/odfpy/default.nix
+++ b/pkgs/development/python-modules/odfpy/default.nix
@@ -1,24 +1,24 @@
 { lib
 , buildPythonPackage
 , fetchPypi
+, python
+, isPy27
 }:
 
 buildPythonPackage rec {
   pname = "odfpy";
-  version = "1.3.5";
+  version = "1.3.6";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6f8163f8464868cff9421a058f25566e41d73c8f7e849c021b86630941b44366";
+    sha256 = "6bcaf3b23aa9e49ed8c8c177266539b211add4e02402748a994451482a10cb1b";
   };
 
-  checkPhase = ''
-    pushd tests
-    rm runtests
-    for file in test*.py; do
-        python  $file
-    done
+  # Python 2.7 uses a different ordering for xml namespaces.
+  # The testAttributeForeign test expects "ns44", but fails since it gets "ns43"
+  checkPhase = " " + lib.optionalString (!isPy27) ''
+    ${python.interpreter} -m unittest discover -s tests
   '';
 
   meta = {
diff --git a/pkgs/development/python-modules/pandas/default.nix b/pkgs/development/python-modules/pandas/default.nix
index e589e777f0dfe..3f9188a6322a1 100644
--- a/pkgs/development/python-modules/pandas/default.nix
+++ b/pkgs/development/python-modules/pandas/default.nix
@@ -28,12 +28,12 @@ let
   inherit (stdenv) isDarwin;
 in buildPythonPackage rec {
   pname = "pandas";
-  version = "0.21.1";
+  version = "0.22.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "c5f5cba88bf0659554c41c909e1f78139f6fce8fa9315a29a23692b38ff9788a";
+    sha256 = "44a94091dd71f05922eec661638ec1a35f26d573c119aa2fad964f10a2880e6c";
   };
 
   LC_ALL = "en_US.UTF-8";
diff --git a/pkgs/development/python-modules/parse-type/default.nix b/pkgs/development/python-modules/parse-type/default.nix
index 69a02c42b74ef..8c927e4aed03a 100644
--- a/pkgs/development/python-modules/parse-type/default.nix
+++ b/pkgs/development/python-modules/parse-type/default.nix
@@ -3,14 +3,13 @@
 , pytest, pytestrunner
 , parse, six, enum34
 }:
+
 buildPythonPackage rec {
-  pname = "parse-type";
+  pname = "parse_type";
   version = "0.3.4";
-  name = "${pname}-${version}";
 
   src = fetchPypi {
-    inherit version;
-    pname = "parse_type";
+    inherit pname version;
     sha256 = "3dd0b323bafcb8c25e000ce5589042a1c99cba9c3bec77b9f591e46bc9606147";
   };
 
diff --git a/pkgs/development/python-modules/partd/default.nix b/pkgs/development/python-modules/partd/default.nix
new file mode 100644
index 0000000000000..1098c55083985
--- /dev/null
+++ b/pkgs/development/python-modules/partd/default.nix
@@ -0,0 +1,35 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, locket
+, numpy
+, pandas
+, pyzmq
+, toolz
+}:
+
+buildPythonPackage rec {
+  pname = "partd";
+  version = "0.3.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "67291f1c4827cde3e0148b3be5d69af64b6d6169feb9ba88f0a6cfe77089400f";
+  };
+
+  checkInputs = [ pytest ];
+
+  propagatedBuildInputs = [ locket numpy pandas pyzmq toolz ];
+
+  checkPhase = ''
+    rm partd/tests/test_zmq.py # requires network & fails
+    py.test
+  '';
+
+  meta = {
+    description = "Appendable key-value storage";
+    license = with lib.licenses; [ bsd3 ];
+    homepage = https://github.com/dask/partd/;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/path.py/default.nix b/pkgs/development/python-modules/path.py/default.nix
index 6b4af3ffcd486..2830477d3cf19 100644
--- a/pkgs/development/python-modules/path.py/default.nix
+++ b/pkgs/development/python-modules/path.py/default.nix
@@ -9,12 +9,12 @@
 
 buildPythonPackage rec {
   pname = "path.py";
-  version = "10.4";
+  version = "10.5";
   name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "c63c75777c8a01f7b273c0065a8ea1e3ba0c9b369fa4a2601831e412b2c4881a";
+    sha256 = "63a7af08676668fd51750f111affbd38c1a13c61aba15c6665b16681771c79a8";
   };
 
   checkInputs = [ pytest pytestrunner ];
diff --git a/pkgs/development/python-modules/pathlib2/default.nix b/pkgs/development/python-modules/pathlib2/default.nix
index 62d5c43a4b3b3..18c083298e680 100644
--- a/pkgs/development/python-modules/pathlib2/default.nix
+++ b/pkgs/development/python-modules/pathlib2/default.nix
@@ -5,19 +5,20 @@
 , pythonOlder
 , scandir
 , glibcLocales
+, mock
 }:
 
 if !(pythonOlder "3.4") then null else buildPythonPackage rec {
   pname = "pathlib2";
-  version = "2.2.1";
+  version = "2.3.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ce9007df617ef6b7bd8a31cd2089ed0c1fed1f7c23cf2bf1ba140b3dd563175d";
+    sha256 = "d32550b75a818b289bd4c1f96b60c89957811da205afcceab75bc8b4857ea5b3";
   };
 
   propagatedBuildInputs = [ six ] ++ lib.optional (pythonOlder "3.5") scandir;
-  checkInputs = [ glibcLocales ];
+  checkInputs = [ glibcLocales ] ++ lib.optional (pythonOlder "3.3") mock;
 
   preCheck = ''
     export LC_ALL="en_US.UTF-8"
diff --git a/pkgs/development/python-modules/pexpect/default.nix b/pkgs/development/python-modules/pexpect/default.nix
index c5d1e8ef3c44a..da8d5db359b05 100644
--- a/pkgs/development/python-modules/pexpect/default.nix
+++ b/pkgs/development/python-modules/pexpect/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec {
   pname = "pexpect";
-  version = "4.3.0";
+  version = "4.3.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1nfjmz81gsixv22dywidakm7pff3ly1i4yly950bfp8gz1r0iaq0";
+    sha256 = "8e287b171dbaf249d0b06b5f2e88cb7e694651d2d0b8c15bccb83170d3c55575";
   };
 
   # Wants to run pythonin a subprocess
diff --git a/pkgs/development/python-modules/phonenumbers/default.nix b/pkgs/development/python-modules/phonenumbers/default.nix
index d5c4eaa781bdf..69808a7bff3b8 100644
--- a/pkgs/development/python-modules/phonenumbers/default.nix
+++ b/pkgs/development/python-modules/phonenumbers/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "phonenumbers";
-  version = "8.8.6";
+  version = "8.8.8";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ab1fa853350dde91be672192b427169b29e3348c236e46ad7a757e4ac8163c8c";
+    sha256 = "ff2f492e49c212bb7185954efe09e68583a67daec586c02c49bc728c343d4eb0";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix
index d2b91eb435c61..752047d04f7e7 100644
--- a/pkgs/development/python-modules/pip-tools/default.nix
+++ b/pkgs/development/python-modules/pip-tools/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "pip-tools";
-  version = "1.10.2";
+  version = "1.11.0";
   name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pip-tools/${name}.tar.gz";
-    sha256 = "d381c7249eb48350cc49447cc106df3d90e9e806b13caaede602c1cd38f61b37";
+    sha256 = "ba427b68443466c389e3b0b0ef55f537ab39344190ea980dfebb333d0e6a50a3";
   };
 
   LC_ALL = "en_US.UTF-8";
@@ -21,9 +21,11 @@ buildPythonPackage rec {
     "test_generate_hashes_all_platforms"
     "test_generate_hashes_without_interfering_with_each_other"
     "test_realistic_complex_sub_dependencies"
+    "test_generate_hashes_with_editable"
     # Expect specific version of "six":
     "test_editable_package"
     "test_input_file_without_extension"
+    "test_locally_available_editable_package_is_not_archived_in_cache_dir"
   ];
 
   checkPhase = ''
diff --git a/pkgs/development/python-modules/plone-testing/default.nix b/pkgs/development/python-modules/plone-testing/default.nix
new file mode 100644
index 0000000000000..910fc034e365f
--- /dev/null
+++ b/pkgs/development/python-modules/plone-testing/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, zope_testing
+, setuptools
+}:
+
+buildPythonPackage rec {
+  pname = "plone.testing";
+  version = "5.1.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "2ca558a910b93355b760535b233518be3a06c58e46160487bf802b6f7cb1e511";
+  };
+
+  propagatedBuildInputs = [ setuptools zope_testing ];
+
+  # Huge amount of testing dependencies (including Zope2)
+  doCheck = false;
+
+  meta = {
+    description = "Testing infrastructure for Zope and Plone projects";
+    homepage = https://github.com/plone/plone.testing;
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/plotly/default.nix b/pkgs/development/python-modules/plotly/default.nix
index 2744805a5042f..75f1b0600778e 100644
--- a/pkgs/development/python-modules/plotly/default.nix
+++ b/pkgs/development/python-modules/plotly/default.nix
@@ -10,12 +10,12 @@
 
 buildPythonPackage rec {
   pname = "plotly";
-  version = "2.1.0";
+  version = "2.2.3";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ff6899dc11907b1efb944f79f9583b2e30ba2964bb009145f3580bf30b4d9ee4";
+    sha256 = "dadd2263f1c0449b248fd3742a077d9594935921a9597529be76d6a841237ab0";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/development/python-modules/pluggy/default.nix b/pkgs/development/python-modules/pluggy/default.nix
new file mode 100644
index 0000000000000..0fbfa5108c1b5
--- /dev/null
+++ b/pkgs/development/python-modules/pluggy/default.nix
@@ -0,0 +1,29 @@
+{ buildPythonPackage
+, lib
+, fetchPypi
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "pluggy";
+  version = "0.6.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff";
+  };
+
+  checkPhase = ''
+    py.test
+  '';
+
+  # To prevent infinite recursion with pytest
+  doCheck = false;
+
+  meta = {
+    description = "Plugin and hook calling mechanisms for Python";
+    homepage = "https://pypi.python.org/pypi/pluggy";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ jgeerds ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/plumbum/default.nix b/pkgs/development/python-modules/plumbum/default.nix
index 216c163bc9d21..a5881bb2e7cf3 100644
--- a/pkgs/development/python-modules/plumbum/default.nix
+++ b/pkgs/development/python-modules/plumbum/default.nix
@@ -6,7 +6,7 @@
 
 buildPythonPackage rec {
   pname = "plumbum";
-  version = "1.6.3";
+  version = "1.6.5";
   name = "${pname}-${version}";
 
   checkInputs = [ pytest ];
@@ -16,6 +16,6 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0249e708459f1b05627a7ca8787622c234e4db495a532acbbd1f1f17f28c7320";
+    sha256 = "d8abb059bb62beb6c99db08d3598167abaeeab53eaf218f91e74bae471a24bee";
   };
 }
\ No newline at end of file
diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix
index cf9b3ea267f58..b9d07a3fa9b9b 100644
--- a/pkgs/development/python-modules/psutil/default.nix
+++ b/pkgs/development/python-modules/psutil/default.nix
@@ -7,12 +7,12 @@
 
 buildPythonPackage rec {
   pname = "psutil";
-  version = "5.4.1";
+  version = "5.4.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "42e2de159e3c987435cb3b47d6f37035db190a1499f3af714ba7af5c379b6ba2";
+    sha256 = "00a1f9ff8d1e035fba7bfdd6977fa8ea7937afdb4477339e5df3dba78194fe11";
   };
 
   # No tests in archive
diff --git a/pkgs/development/python-modules/py/default.nix b/pkgs/development/python-modules/py/default.nix
index 0dc3b6793281e..cd945f7bfc611 100644
--- a/pkgs/development/python-modules/py/default.nix
+++ b/pkgs/development/python-modules/py/default.nix
@@ -1,12 +1,12 @@
 { stdenv, buildPythonPackage, fetchPypi }:
 buildPythonPackage rec {
   pname = "py";
-  version = "1.4.34";
+  version = "1.5.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1qyd5z0hv8ymxy84v5vig3vps2fvhcf4bdlksb3r03h549fmhb8g";
+    sha256 = "ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d";
   };
 
   # Circular dependency on pytest
diff --git a/pkgs/development/python-modules/pyaml/default.nix b/pkgs/development/python-modules/pyaml/default.nix
new file mode 100644
index 0000000000000..5fd1be7c15cc2
--- /dev/null
+++ b/pkgs/development/python-modules/pyaml/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pyyaml
+, unidecode
+, python
+}:
+
+buildPythonPackage rec {
+  pname = "pyaml";
+  version = "17.12.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "66623c52f34d83a2c0fc963e08e8b9d0c13d88404e3b43b1852ef71eda19afa3";
+  };
+
+  propagatedBuildInputs = [ pyyaml ];
+
+  checkInputs = [ unidecode ];
+
+  meta = {
+    description = "PyYAML-based module to produce pretty and readable YAML-serialized data";
+    homepage = https://github.com/mk-fg/pretty-yaml;
+    license = lib.licenses.wtfpl;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/pyasn1-modules/default.nix b/pkgs/development/python-modules/pyasn1-modules/default.nix
index a7ee15d6a1811..b8dcae16da858 100644
--- a/pkgs/development/python-modules/pyasn1-modules/default.nix
+++ b/pkgs/development/python-modules/pyasn1-modules/default.nix
@@ -3,12 +3,12 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pyasn1-modules";
-  version = "0.1.5";
+  version = "0.2.1";
   disabled = isPyPy;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1239h6h67vg0wazg2qgv6m3hdim2gs66pl89lbnayk55bbnkwc0x";
+    sha256 = "af00ea8f2022b6287dc375b2c70f31ab5af83989fc6fe9eacd4976ce26cd7ccc";
   };
 
   propagatedBuildInputs = [ pyasn1 ];
diff --git a/pkgs/development/python-modules/pyasn1/default.nix b/pkgs/development/python-modules/pyasn1/default.nix
index d0122a5b7e403..8037796713ec2 100644
--- a/pkgs/development/python-modules/pyasn1/default.nix
+++ b/pkgs/development/python-modules/pyasn1/default.nix
@@ -3,11 +3,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pyasn1";
-  version = "0.3.4";
+  version = "0.4.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "06hhy38jhwh95gpn8f03cr439273fsfsh4vhd5024r86nh5gyiir";
+    sha256 = "d258b0a71994f7770599835249cece1caef3c70def868c4915e6e5ca49b67d15";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/pyblake2/default.nix b/pkgs/development/python-modules/pyblake2/default.nix
index 4e166dcb18373..c2f4e7db43fcc 100644
--- a/pkgs/development/python-modules/pyblake2/default.nix
+++ b/pkgs/development/python-modules/pyblake2/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "pyblake2";
-  version = "0.9.3";
+  version = "1.1.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "626448e1fe1cc01d2197118954bec9f158378577e12686d5b01979f7f0fa2212";
+    sha256 = "3a850036bf42053c74bfc52c063323ca78e40ba1f326b01777da5750a143631a";
   };
 
   # requires setting up sphinx doctest
diff --git a/pkgs/development/python-modules/pycangjie/default.nix b/pkgs/development/python-modules/pycangjie/default.nix
index 4995a71469310..80b17034aa03c 100644
--- a/pkgs/development/python-modules/pycangjie/default.nix
+++ b/pkgs/development/python-modules/pycangjie/default.nix
@@ -1,21 +1,22 @@
 { stdenv, fetchurl, bash, autoconf, automake, libtool, pkgconfig, libcangjie
-, sqlite, python, cython
+, sqlite, buildPythonPackage, cython
 }:
 
-stdenv.mkDerivation rec {
-  name = "${python.libPrefix}-pycangjie-${version}";
-  version = "1.3_rev_${rev}";
+let
   rev = "361bb413203fd43bab624d98edf6f7d20ce6bfd3";
+in buildPythonPackage rec {
+  pname = "pycangjie";
+  version = "1.3_rev_${rev}";
+  format = "other";
 
   src = fetchurl {
-    name = "${name}.tar.gz";
     url = "https://github.com/Cangjians/pycangjie/archive/${rev}.tar.gz";
     sha256 = "12yi09nyffmn4va7lzk4irw349qzlbxgsnb89dh15cnw0xmrin05";
   };
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [
-    autoconf automake libtool libcangjie sqlite python cython
+    autoconf automake libtool libcangjie sqlite cython
   ];
 
   preConfigure = ''
diff --git a/pkgs/development/python-modules/pychromecast/default.nix b/pkgs/development/python-modules/pychromecast/default.nix
index 01014170dc7d1..46d3272807eb5 100644
--- a/pkgs/development/python-modules/pychromecast/default.nix
+++ b/pkgs/development/python-modules/pychromecast/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "PyChromecast";
-  version = "0.8.1";
+  version = "1.0.3";
   name = pname + "-" + version;
 
   src = fetchurl {
     url    = "mirror://pypi/p/pychromecast/${name}.tar.gz";
-    sha256 = "05rlr2hjng0xg2a9k9vwmrlvd7vy9sjhxxfl96kx25xynlkq6yq6";
+    sha256 = "714a9e03e6a258081e3b6296ed15592e015facbe38bbe60819cca6f04c599f25";
   };
 
   propagatedBuildInputs = [ requests six zeroconf protobuf ];
diff --git a/pkgs/development/python-modules/pycollada/default.nix b/pkgs/development/python-modules/pycollada/default.nix
index 948d9741bd8bc..35b10421f2c09 100644
--- a/pkgs/development/python-modules/pycollada/default.nix
+++ b/pkgs/development/python-modules/pycollada/default.nix
@@ -2,15 +2,14 @@
 
 buildPythonPackage rec {
   pname = "pycollada";
-  version = "0.5";
-  name = "${pname}-${version}";
+  version = "0.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1g96maw2c25l4i3ks51784h33zf7s18vrn6iyz4ca34iy4sl7yq9";
+    sha256 = "fcd6f38fd981e350f9ec754d9671834017accd600e967d6d299a6cfdae5ba4f4";
   };
 
-  buildInputs = [ numpy ] ++ (if isPy3k then [dateutil] else [dateutil_1_5]);
+  propagatedBuildInputs = [ numpy dateutil ];
 
   # Some tests fail because they refer to test data files that don't exist
   # (upstream packaging issue)
diff --git a/pkgs/development/python-modules/pydot/default.nix b/pkgs/development/python-modules/pydot/default.nix
index be0b4eabfa8a2..98d4b33939a2c 100644
--- a/pkgs/development/python-modules/pydot/default.nix
+++ b/pkgs/development/python-modules/pydot/default.nix
@@ -8,12 +8,12 @@
 
 buildPythonPackage rec {
   pname = "pydot";
-  version = "1.2.3";
+  version = "1.2.4";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "edb5d3f249f97fbd9c4bb16959e61bc32ecf40eee1a9f6d27abe8d01c0a73502";
+    sha256 = "92d2e2d15531d00710f2d6fb5540d2acabc5399d464f2f20d5d21073af241eb6";
   };
   checkInputs = [ chardet ];
   # No tests in archive
diff --git a/pkgs/development/python-modules/pygit2/default.nix b/pkgs/development/python-modules/pygit2/default.nix
index 90bfe97839188..d8eb05cf34857 100644
--- a/pkgs/development/python-modules/pygit2/default.nix
+++ b/pkgs/development/python-modules/pygit2/default.nix
@@ -3,11 +3,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pygit2";
-  version = "0.26.0";
+  version = "0.26.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1cbc488ra3kg7r3qky17ms0szi3cda2d96qfkv1l9djsy9hnvw57";
+    sha256 = "29baa530d6fcbf7cca6a75cf9c78fb88613ca81afb39c62fe492f226f6b61800";
   };
 
   preConfigure = lib.optionalString stdenv.isDarwin ''
diff --git a/pkgs/development/python-modules/pyglet/default.nix b/pkgs/development/python-modules/pyglet/default.nix
index 8d5dd53f80ac8..51243154b1a25 100644
--- a/pkgs/development/python-modules/pyglet/default.nix
+++ b/pkgs/development/python-modules/pyglet/default.nix
@@ -1,23 +1,24 @@
 { stdenv, buildPythonPackage, fetchPypi
-, mesa, xorg, freetype, fontconfig}:
+, mesa, xorg, freetype, fontconfig, future}:
 
 buildPythonPackage rec {
-  version = "1.2.4";
+  version = "1.3.0";
   pname = "pyglet";
-  name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "9f62ffbbcf2b202d084bf158685e77d28b8f4f5f2738f4c5e63a947a07503445";
+    sha256 = "640a8f8e3d7bf8dbb551fa707f14021f619932990ab1401c48ba9dbcc6c2242c";
   };
 
-  patchPhase = let
+  postPatch = let
     libs = [ mesa xorg.libX11 freetype fontconfig ];
     paths = builtins.concatStringsSep "," (map (l: "\"${l}/lib\"") libs);
   in "sed -i -e 's|directories\.extend.*lib[^]]*|&,${paths}|' pyglet/lib.py";
 
   doCheck = false;
 
+  propagatedBuildInputs = [ future ];
+
   meta = with stdenv.lib; {
     homepage = "http://www.pyglet.org/";
     description = "A cross-platform windowing and multimedia library";
diff --git a/pkgs/development/python-modules/pylast/default.nix b/pkgs/development/python-modules/pylast/default.nix
index 99bcb9357dc8f..1fcc721150498 100644
--- a/pkgs/development/python-modules/pylast/default.nix
+++ b/pkgs/development/python-modules/pylast/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "pylast";
-  version = "1.9.0";
+  version = "2.0.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ae1c4105cbe704d9ac10ba57ac4c26bc576cc33978f1b578101b20c6a2360ca4";
+    sha256 = "8e4d4962aa12d67bd357e1aa596a146b2e97afd943b5c9257e555014d13b3065";
   };
 
   propagatedBuildInputs = [ certifi six ];
diff --git a/pkgs/development/python-modules/pylint/default.nix b/pkgs/development/python-modules/pylint/default.nix
index afe3bf8e503d0..79337663c627a 100644
--- a/pkgs/development/python-modules/pylint/default.nix
+++ b/pkgs/development/python-modules/pylint/default.nix
@@ -4,11 +4,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pylint";
-  version = "1.7.4";
+  version = "1.8.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1f65b3815c3bf7524b845711d54c4242e4057dd93826586620239ecdfe591fb1";
+    sha256 = "3035e44e37cd09919e9edad5573af01d7c6b9c52a0ebb4781185ae7ab690458b";
   };
 
   buildInputs = [ pytest pytestrunner mccabe configparser backports_functools_lru_cache ];
diff --git a/pkgs/development/python-modules/pymongo/default.nix b/pkgs/development/python-modules/pymongo/default.nix
index 5b400e1521e0a..577cd9142f95a 100644
--- a/pkgs/development/python-modules/pymongo/default.nix
+++ b/pkgs/development/python-modules/pymongo/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "pymongo";
-  version = "3.5.1";
+  version = "3.6.0";
   name  = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0939bl3brrklvccicck62gs3zd7i9aysz13c8pxc3gpk2hsdj878";
+    sha256 = "c6de26d1e171cdc449745b82f1addbc873d105b8e7335097da991c0fc664a4a8";
   };
 
   doCheck = false;
diff --git a/pkgs/development/python-modules/pyobjc/default.nix b/pkgs/development/python-modules/pyobjc/default.nix
index 0cf0831964518..874e0d47fc9e5 100644
--- a/pkgs/development/python-modules/pyobjc/default.nix
+++ b/pkgs/development/python-modules/pyobjc/default.nix
@@ -3,7 +3,7 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pyobjc";
-  version = "4.0b1";
+  version = "4.1";
 
   # Gives "No matching distribution found for
   # pyobjc-framework-Collaboration==4.0b1 (from pyobjc==4.0b1)"
@@ -11,7 +11,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "16bng6960c1m57nnh1l09ycnyimrqzw9mx9pnyjxn5zzm5kalr37";
+    sha256 = "287db11f912ac7d05c4907dbf6e74abaa475e36368f7c92e05aca2886a94562c";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/pyopencl/default.nix b/pkgs/development/python-modules/pyopencl/default.nix
index 9d5661f4d589a..07ff8735b52fb 100644
--- a/pkgs/development/python-modules/pyopencl/default.nix
+++ b/pkgs/development/python-modules/pyopencl/default.nix
@@ -15,18 +15,23 @@
 
 buildPythonPackage rec {
   pname = "pyopencl";
-  version = "2017.2";
-  name = "${pname}-${version}";
+  version = "2017.2.2";
 
-  buildInputs = [ pytest opencl-headers ocl-icd ];
+  checkInputs = [ pytest ];
+  buildInputs = [ opencl-headers ocl-icd ];
 
   propagatedBuildInputs = [ numpy cffi pytools decorator appdirs six Mako ];
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "039b689a58eb98e27a577ac086210deae959f40d657487f3199d2d217c270ff9";
+    sha256 = "d2f7b04d2e819c6e90d6366b7712a7452a39fba218e51b11b02c85ab07fd2983";
   };
 
+  # py.test is not needed during runtime, so remove it from `install_requires`
+  postPatch = ''
+    substituteInPlace setup.py --replace "pytest>=2" ""
+  '';
+
   # gcc: error: pygpu_language_opencl.cpp: No such file or directory
   doCheck = false;
 
diff --git a/pkgs/development/python-modules/pysc2/default.nix b/pkgs/development/python-modules/pysc2/default.nix
index a2dfd53b79512..89799988fa1f1 100644
--- a/pkgs/development/python-modules/pysc2/default.nix
+++ b/pkgs/development/python-modules/pysc2/default.nix
@@ -18,8 +18,8 @@
 }:
 
 buildPythonPackage rec {
+  pname = "PySC2";
   version = "1.2";
-  name = "PySC2-${version}";
 
   src = fetchFromGitHub {
     owner = "deepmind";
diff --git a/pkgs/development/python-modules/pysoundfile/default.nix b/pkgs/development/python-modules/pysoundfile/default.nix
index ef67ed85cc038..aa7d23c5fcb55 100644
--- a/pkgs/development/python-modules/pysoundfile/default.nix
+++ b/pkgs/development/python-modules/pysoundfile/default.nix
@@ -11,12 +11,12 @@
 
 buildPythonPackage rec {
   pname = "PySoundFile";
-  version = "0.8.1";
+  version = "0.9.0.post1";
   name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "72c3e23b7c9998460ec78176084ea101e3439596ab29df476bc8508708df84df";
+    sha256 = "43dd46a2afc0484c26930a7e59eef9365cee81bce7a4aadc5699f788f60d32c3";
   };
 
     checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/pytest-localserver/default.nix b/pkgs/development/python-modules/pytest-localserver/default.nix
index fdd1986c04fc6..c98370ed9389f 100644
--- a/pkgs/development/python-modules/pytest-localserver/default.nix
+++ b/pkgs/development/python-modules/pytest-localserver/default.nix
@@ -10,11 +10,11 @@
 buildPythonPackage rec {
   pname = "pytest-localserver";
   name = "${pname}-${version}";
-  version = "0.3.7";
+  version = "0.4.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1c11hn61n06ms0wmw6536vs5k4k9hlndxsb3p170nva56a9dfa6q";
+    sha256 = "a72af60a1ec8f73668a7884c86baf1fbe48394573cb4fa36709887217736c021";
   };
 
   propagatedBuildInputs = [ werkzeug ];
diff --git a/pkgs/development/python-modules/pytest-xdist/default.nix b/pkgs/development/python-modules/pytest-xdist/default.nix
index e993a67c49f12..2e2975e65968a 100644
--- a/pkgs/development/python-modules/pytest-xdist/default.nix
+++ b/pkgs/development/python-modules/pytest-xdist/default.nix
@@ -3,11 +3,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "pytest-xdist";
-  version = "1.20.1";
+  version = "1.21.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "433e82f9b34986a4e4b2be38c60e82cca3ac64b7e1b38f4d8e3e118292939712";
+    sha256 = "0b8622435e3c0650a8d5a07b73a7f9c4f79b52d7ed060536a6041f0da423ba8e";
   };
 
   buildInputs = [ pytest setuptools_scm pytest-forked];
diff --git a/pkgs/development/python-modules/pytest/3_2.nix b/pkgs/development/python-modules/pytest/3_2.nix
new file mode 100644
index 0000000000000..d7a0b1bdad34e
--- /dev/null
+++ b/pkgs/development/python-modules/pytest/3_2.nix
@@ -0,0 +1,27 @@
+{ stdenv, buildPythonPackage, fetchPypi, isPy26, argparse, hypothesis, py
+, setuptools_scm, setuptools
+}:
+buildPythonPackage rec {
+  version = "3.2.5";
+  pname = "pytest";
+
+  preCheck = ''
+    # don't test bash builtins
+    rm testing/test_argcomplete.py
+  '';
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81";
+  };
+
+  checkInputs = [ hypothesis ];
+  buildInputs = [ setuptools_scm ];
+  propagatedBuildInputs = [ py setuptools ]
+    ++ (stdenv.lib.optional isPy26 argparse);
+
+  meta = with stdenv.lib; {
+    maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
+    platforms = platforms.unix;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index 8e280b8fd0d6c..d45fe7deb124b 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildPythonPackage, fetchPypi, isPy26, argparse, hypothesis, py
-, setuptools_scm, setuptools
+{ stdenv, buildPythonPackage, fetchPypi, isPy26, argparse, attrs, hypothesis, py
+, setuptools_scm, setuptools, six, pluggy, funcsigs, isPy3k
 }:
 buildPythonPackage rec {
-  version = "3.2.5";
+  version = "3.3.1";
   pname = "pytest";
 
   preCheck = ''
@@ -12,16 +12,18 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81";
+    sha256 = "cf8436dc59d8695346fcd3ab296de46425ecab00d64096cebe79fb51ecb2eb93";
   };
 
   checkInputs = [ hypothesis ];
   buildInputs = [ setuptools_scm ];
-  propagatedBuildInputs = [ py setuptools ]
+  propagatedBuildInputs = [ attrs py setuptools six pluggy ]
+    ++ (stdenv.lib.optional (!isPy3k) funcsigs)
     ++ (stdenv.lib.optional isPy26 argparse);
 
   meta = with stdenv.lib; {
     maintainers = with maintainers; [ domenkozar lovek323 madjar lsix ];
     platforms = platforms.unix;
+    description = "Framework for writing tests";
   };
 }
diff --git a/pkgs/development/python-modules/python-fuse/default.nix b/pkgs/development/python-modules/python-fuse/default.nix
index d9debce6aecb9..02b86b3b33a38 100644
--- a/pkgs/development/python-modules/python-fuse/default.nix
+++ b/pkgs/development/python-modules/python-fuse/default.nix
@@ -7,21 +7,21 @@
 }:
 
 buildPythonPackage rec {
-    baseName = "fuse";
-    version = "0.2.1";
-    name = "${baseName}-${version}";
-    disabled = isPy3k;
+  pname = "fuse";
+  version = "0.2.1";
 
-    src = fetchurl {
-      url = "mirror://sourceforge/fuse/fuse-python-${version}.tar.gz";
-      sha256 = "06rmp1ap6flh64m81j0n3a357ij2vj9zwcvvw0p31y6hz1id9shi";
-    };
+  disabled = isPy3k;
 
-    nativeBuildInputs = [ pkgconfig ];
-    buildInputs = [ fuse ];
+  src = fetchurl {
+    url = "mirror://sourceforge/fuse/fuse-python-${version}.tar.gz";
+    sha256 = "06rmp1ap6flh64m81j0n3a357ij2vj9zwcvvw0p31y6hz1id9shi";
+  };
 
-    meta = {
-      description = "Python bindings for FUSE";
-      license = lib.licenses.lgpl21;
-    };
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ fuse ];
+
+  meta = {
+    description = "Python bindings for FUSE";
+    license = lib.licenses.lgpl21;
+  };
 }
diff --git a/pkgs/development/python-modules/pytoml/default.nix b/pkgs/development/python-modules/pytoml/default.nix
index 55479e76dafd4..91661a1fb5101 100644
--- a/pkgs/development/python-modules/pytoml/default.nix
+++ b/pkgs/development/python-modules/pytoml/default.nix
@@ -1,18 +1,22 @@
-{ stdenv, buildPythonPackage, fetchgit
-, python }:
+{ stdenv
+, buildPythonPackage
+, fetchgit
+, python
+}:
 
 buildPythonPackage rec {
   pname = "pytoml";
-  version = "0.1.11";
-  name = "${pname}-${version}";
+  version = "0.1.14";
 
-  checkPhase = "${python.interpreter} test/test.py";
+  checkPhase = ''
+    ${python.interpreter} test/test.py
+  '';
 
   # fetchgit used to ensure test submodule is available
   src = fetchgit {
     url = "${meta.homepage}.git";
     rev = "refs/tags/v${version}";
-    sha256 = "1jiw04zk9ccynr8kb1vqh9r1p2kh0al7g7b1f94911iazg7dgs9j";
+    sha256 = "1ip71yqxnyi4jhw5x1q7a0za61ndhpfh0vbx08jfv0w4ayng6rgv";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/pytools/default.nix b/pkgs/development/python-modules/pytools/default.nix
new file mode 100644
index 0000000000000..2bf7413c60059
--- /dev/null
+++ b/pkgs/development/python-modules/pytools/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, decorator
+, appdirs
+, six
+, numpy
+, pytest
+}:
+
+buildPythonPackage rec {
+  pname = "pytools";
+  version = "2017.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "80f1bba4469d473c1b3969bc8e188c03bcc94d35807a889ceebbfc78e3208115";
+  };
+
+  checkInputs = [ pytest ];
+
+  propagatedBuildInputs = [
+    decorator
+    appdirs
+    six
+    numpy
+  ];
+
+  checkPhase = ''
+    py.test -k 'not test_persistent_dict'
+  '';
+
+  meta = {
+    homepage = https://github.com/inducer/pytools/;
+    description = "Miscellaneous Python lifesavers.";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ artuuge ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/pywbem/default.nix b/pkgs/development/python-modules/pywbem/default.nix
index 8e10fbb22581f..d09a9bbd6d80d 100644
--- a/pkgs/development/python-modules/pywbem/default.nix
+++ b/pkgs/development/python-modules/pywbem/default.nix
@@ -4,7 +4,7 @@
 }:
 
 buildPythonPackage rec {
-  name  = "pywbem-${version}";
+  pname = "pywbem";
   version = "0.10.0";
 
   src = fetchFromGitHub {
diff --git a/pkgs/development/python-modules/pywinrm/default.nix b/pkgs/development/python-modules/pywinrm/default.nix
index ecd46bb1ff57c..10150259ef5c1 100644
--- a/pkgs/development/python-modules/pywinrm/default.nix
+++ b/pkgs/development/python-modules/pywinrm/default.nix
@@ -11,12 +11,12 @@
 
 buildPythonPackage rec {
   pname = "pywinrm";
-  version = "0.2.2";
+  version = "0.3.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "06xc0mbqf718vmsp0fq0rb64nql66l5w2x23bmqnzl6nzc0gfc1h";
+    sha256 = "799fc3e33fec8684443adf5778860388289102ea4fa1458f1bf307d167855573";
   };
 
   checkInputs = [ mock pytest ];
diff --git a/pkgs/development/python-modules/regex/default.nix b/pkgs/development/python-modules/regex/default.nix
new file mode 100644
index 0000000000000..a1349ae5c36d2
--- /dev/null
+++ b/pkgs/development/python-modules/regex/default.nix
@@ -0,0 +1,23 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+
+buildPythonPackage rec {
+  pname = "regex";
+  version = "2017.12.12";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "ee069308c2757e565cc2b6f417ba5288e76cfe4c1764b6826063f4fbd53219d7";
+  };
+
+  meta = {
+    description = "Alternative regular expression module, to replace re";
+    homepage = "https://bitbucket.org/mrabarnett/mrab-regex";
+    license = lib.licenses.psfl;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ abbradar ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/relatorio/default.nix b/pkgs/development/python-modules/relatorio/default.nix
index 5e1ea8b464242..5c5f2578fbf1a 100644
--- a/pkgs/development/python-modules/relatorio/default.nix
+++ b/pkgs/development/python-modules/relatorio/default.nix
@@ -3,10 +3,10 @@
 buildPythonPackage rec {
   pname = "relatorio";
   name = "${pname}-${version}";
-  version = "0.7.1";
+  version = "0.8.0";
   src = fetchurl {
     url = "mirror://pypi/r/relatorio/${name}.tar.gz";
-    sha256 = "744f1e39313f037a0ab52a154338ece151d83e5442a9278db1f8ce450ce6c2cd";
+    sha256 = "bddf85d029c5c85a0f976d73907e14e4c3093065fe8527170c91abf0218546d9";
   };
   propagatedBuildInputs = [
     genshi
diff --git a/pkgs/development/python-modules/restview/default.nix b/pkgs/development/python-modules/restview/default.nix
index 0f2ce45c885c1..3c61ea4ded249 100644
--- a/pkgs/development/python-modules/restview/default.nix
+++ b/pkgs/development/python-modules/restview/default.nix
@@ -10,11 +10,11 @@
 buildPythonPackage rec {
   pname = "restview";
   name = "${pname}-${version}";
-  version = "2.7.0";
+  version = "2.8.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "e7842100f3de179c68cfe7c2cf56c61509cd6068bc6dd58ab42c0ade5d5f97ec";
+    sha256 = "5f6f1523228eab3269f59dd03ac560f7d370cd81df6fdbcb4914b5e6bd896a11";
   };
 
   propagatedBuildInputs = [ docutils readme_renderer pygments ];
diff --git a/pkgs/development/python-modules/robomachine/default.nix b/pkgs/development/python-modules/robomachine/default.nix
index 8f71bab9c2501..72407131cb15c 100644
--- a/pkgs/development/python-modules/robomachine/default.nix
+++ b/pkgs/development/python-modules/robomachine/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "robomachine";
-  version = "0.6";
+  version = "0.8.0";
   name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/R/RoboMachine/RoboMachine-0.6.tar.gz";
-    sha256 = "6c9a9bae7bffa272b2a09b05df06c29a3a776542c70cae8041a8975a061d2e54";
+    sha256 = "242cfd9be0f7591138eaeba03c9c190f894ce045e1767ab7b90eca330259fc45";
   };
 
   propagatedBuildInputs = [ pyparsing argparse robotframework ];
diff --git a/pkgs/development/python-modules/ropper/default.nix b/pkgs/development/python-modules/ropper/default.nix
index f7ef16b02bbd7..62ef3f8db19e7 100644
--- a/pkgs/development/python-modules/ropper/default.nix
+++ b/pkgs/development/python-modules/ropper/default.nix
@@ -3,23 +3,25 @@
 , fetchPypi
 , capstone
 , filebytes
-, pytest }:
+, pytest
+}:
 
 buildPythonApplication rec {
-  name = "${pname}-${version}";
   pname = "ropper";
-  version = "1.10.10";
+  version = "1.11.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1676e07947a19df9d17002307a7555c2647a4224d6f2869949e8fc4bd18f2e87";
+    sha256 = "2183feedfe8b01a27301eee07383b481ece01b2319bdba3afebe33e19ca14aa3";
   };
   # XXX tests rely on user-writeable /dev/shm to obtain process locks and return PermissionError otherwise
   # workaround: sudo chmod 777 /dev/shm
   checkPhase = ''
     py.test testcases
   '';
-  buildInputs = [pytest];
+  doCheck = false; # Tests not included in archive
+
+  checkInputs = [pytest];
   propagatedBuildInputs = [ capstone filebytes ];
   meta = with stdenv.lib; {
     homepage = https://scoding.de/ropper/;
diff --git a/pkgs/development/python-modules/scrapy/default.nix b/pkgs/development/python-modules/scrapy/default.nix
index 5b40c74a18196..005d02e60472a 100644
--- a/pkgs/development/python-modules/scrapy/default.nix
+++ b/pkgs/development/python-modules/scrapy/default.nix
@@ -2,7 +2,7 @@
   testfixtures, pillow, six, twisted, w3lib, lxml, queuelib, pyopenssl,
   service-identity, parsel, pydispatcher, cssselect, lib }:
 buildPythonPackage rec {
-    version = "1.4.0";
+    version = "1.5.0";
     pname = "Scrapy";
     name = "${pname}-${version}";
 
@@ -26,7 +26,7 @@ buildPythonPackage rec {
 
     src = fetchurl {
       url = "mirror://pypi/S/Scrapy/${name}.tar.gz";
-      sha256 = "04a08f027eef5d271342a016439533c81ba46f14bfcf230fecf602e99beaf233";
+      sha256 = "31a0bf05d43198afaf3acfb9b4fb0c09c1d7d7ff641e58c66e36117f26c4b755";
     };
 
     meta = with lib; {
diff --git a/pkgs/development/python-modules/seaborn/default.nix b/pkgs/development/python-modules/seaborn/default.nix
index 1647e6cfc143d..20ad32b326130 100644
--- a/pkgs/development/python-modules/seaborn/default.nix
+++ b/pkgs/development/python-modules/seaborn/default.nix
@@ -8,11 +8,11 @@
 
 buildPythonPackage rec {
   pname = "seaborn";
-  version = "0.7.1";
+  version = "0.8.1";
   name = "${pname}-${version}";
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0pawrqc3mxpwd5g9pvi9gba02637bh5c8ldpp8izfwpfn52469zs";
+    sha256 = "6702978b903d0284446e935916b980dfebae4063c18ad8eb6e8f9e76d0257eae";
   };
 
   checkInputs = [ nose ];
diff --git a/pkgs/development/python-modules/serpy/default.nix b/pkgs/development/python-modules/serpy/default.nix
index 2414b97e94aba..610a75fa3176c 100644
--- a/pkgs/development/python-modules/serpy/default.nix
+++ b/pkgs/development/python-modules/serpy/default.nix
@@ -5,7 +5,7 @@
 buildPythonPackage rec {
   pname = "serpy";
   name = "${pname}-${version}";
-  version = "0.2.0";
+  version = "0.3.1";
 
   meta = {
     description = "ridiculously fast object serialization";
@@ -15,7 +15,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "7e62e242321b208362966d5ab32b45df93b1cb88da4ce6260277da060b4f7475";
+    sha256 = "3772b2a9923fbf674000ff51abebf6ea8f0fca0a2cfcbfa0d63ff118193d1ec5";
   };
 
   buildInputs = [ flake8 py pyflakes tox ];
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index 1c53f3cd43729..b185be62a693b 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -8,13 +8,13 @@
 # Should use buildPythonPackage here somehow
 stdenv.mkDerivation rec {
   pname = "setuptools";
-  version = "38.2.3";
+  version = "38.2.5";
   name = "${python.libPrefix}-${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "124jlg72bbk2xxv5wqbwcl4h5cdslslzk92rxjxiplg79l499hv3";
+    sha256 = "b080f276cc868670540b2c03cee06cc14d2faf9da7bec0f15058d1b402c94507";
   };
 
   buildInputs = [ python wrapPython unzip ];
diff --git a/pkgs/development/python-modules/shapely/default.nix b/pkgs/development/python-modules/shapely/default.nix
index e8e92818ecf54..dab3542b809e4 100644
--- a/pkgs/development/python-modules/shapely/default.nix
+++ b/pkgs/development/python-modules/shapely/default.nix
@@ -6,11 +6,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "Shapely";
-  version = "1.6.2.post1";
+  version = "1.6.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "07fba518e76b3276558f62a5829bdfa476f790cdef752383ccdc8c66b04b0899";
+    sha256 = "14152f111c7711fc6756fd538ec12fc8cdde7419f869b244922f71f61b2a6c6b";
   };
 
   buildInputs = [ geos glibcLocales cython ];
diff --git a/pkgs/development/python-modules/simplejson/default.nix b/pkgs/development/python-modules/simplejson/default.nix
index 846e8dc21a16b..25dbecac9497c 100644
--- a/pkgs/development/python-modules/simplejson/default.nix
+++ b/pkgs/development/python-modules/simplejson/default.nix
@@ -6,13 +6,13 @@
 
 buildPythonPackage rec {
   pname = "simplejson";
-  version = "3.11.1";
+  version = "3.13.2";
   name = "${pname}-${version}";
   doCheck = !stdenv.isDarwin;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "01a22d49ddd9a168b136f26cac87d9a335660ce07aa5c630b8e3607d6f4325e7";
+    sha256 = "4c4ecf20e054716cc1e5a81cadc44d3f4027108d8dd0861d8b1e3bd7a32d4f0a";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/six/default.nix b/pkgs/development/python-modules/six/default.nix
index 00fbbbc01eb84..6921b3590e4eb 100644
--- a/pkgs/development/python-modules/six/default.nix
+++ b/pkgs/development/python-modules/six/default.nix
@@ -19,6 +19,9 @@ buildPythonPackage rec {
     py.test test_six.py
   '';
 
+  # To prevent infinite recursion with pytest
+  doCheck = false;
+
   meta = {
     description = "A Python 2 and 3 compatibility library";
     homepage = https://pypi.python.org/pypi/six/;
diff --git a/pkgs/development/python-modules/smart_open/default.nix b/pkgs/development/python-modules/smart_open/default.nix
index 436d85102d81d..2e2020f61f090 100644
--- a/pkgs/development/python-modules/smart_open/default.nix
+++ b/pkgs/development/python-modules/smart_open/default.nix
@@ -12,11 +12,11 @@
 buildPythonPackage rec {
   pname = "smart_open";
   name = "${pname}-${version}";
-  version = "1.5.3";
+  version = "1.5.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0m5j71f7f36s17v4mwv0bxg4azknvcy82rbjp28b4vifrjd6dm7s";
+    sha256 = "8fd2de1c359bd0074bd6d334a5b9820ae1c5b6ba563970b95052bace4b71baeb";
   };
 
   propagatedBuildInputs = [ boto bz2file requests responses moto ];
diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix
index 40df45616e936..6c7c3c8400c1b 100644
--- a/pkgs/development/python-modules/spacy/default.nix
+++ b/pkgs/development/python-modules/spacy/default.nix
@@ -19,23 +19,12 @@
 , ftfy
 , thinc
 , pip
+, regex
 }:
-let
-  enableDebugging = true;
-  regexLocked = buildPythonPackage rec {
-    name = "${pname}-${version}";
-    pname = "regex";
-    version = "2017.04.05";
 
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "0c95gf3jzz8mv52lkgq0h7sbasjwvdhghm4s0phmy5k9sr78f4fq";
-    };
-  };
-in buildPythonPackage rec {
+buildPythonPackage rec {
   pname = "spacy";
   version = "1.8.2";
-  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "explosion";
@@ -56,7 +45,7 @@ in buildPythonPackage rec {
    ujson
    dill
    requests
-   regexLocked
+   regex
    ftfy
    thinc
    pytest
diff --git a/pkgs/development/python-modules/splinter/default.nix b/pkgs/development/python-modules/splinter/default.nix
new file mode 100644
index 0000000000000..abd9bd230d403
--- /dev/null
+++ b/pkgs/development/python-modules/splinter/default.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, selenium
+, flask
+, coverage
+}:
+
+buildPythonPackage rec {
+  pname = "splinter";
+  version = "0.7.7";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "f97119f84d339067169451d56043f37f6b0a504a17a7ac6e48c91c012be72af6";
+  };
+
+  propagatedBuildInputs = [ selenium ];
+
+  checkInputs = [ flask coverage ];
+
+  # No tests included
+  doCheck = false;
+
+  meta = {
+    description = "Browser abstraction for web acceptance testing";
+    homepage = https://github.com/cobrateam/splinter;
+    license = lib.licenses.bsd3;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/sqlalchemy/default.nix b/pkgs/development/python-modules/sqlalchemy/default.nix
index 9b3a5fa203964..488e78cb4ee44 100644
--- a/pkgs/development/python-modules/sqlalchemy/default.nix
+++ b/pkgs/development/python-modules/sqlalchemy/default.nix
@@ -11,11 +11,11 @@
 buildPythonPackage rec {
   pname = "SQLAlchemy";
   name = "${pname}-${version}";
-  version = "1.1.15";
+  version = "1.2.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "8b79a5ed91cdcb5abe97b0045664c55c140aec09e5dd5c01303e23de5fe7a95a";
+    sha256 = "7dda3e0b1b12215e3bb05368d1abbf7d747112a43738e0a4e6deb466b83fd88e";
   };
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/sqlmap/default.nix b/pkgs/development/python-modules/sqlmap/default.nix
index 2c85bdbe3d1ca..e89abbd595a9a 100644
--- a/pkgs/development/python-modules/sqlmap/default.nix
+++ b/pkgs/development/python-modules/sqlmap/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "sqlmap";
-  version = "1.1.11";
+  version = "1.1.12";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "bb5297df9cd97316b3c7ca64f8e31cae5cc6b94c015afd84c546877f1f77d6e4";
+    sha256 = "86a1078ceb1e79f891633c7e4c7b07949fd9135a0e4c0738abd5111e2e6b96c0";
   };
 
   # No tests in archive
diff --git a/pkgs/development/python-modules/stevedore/default.nix b/pkgs/development/python-modules/stevedore/default.nix
index 326282a39c3da..9639ce9619480 100644
--- a/pkgs/development/python-modules/stevedore/default.nix
+++ b/pkgs/development/python-modules/stevedore/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "stevedore";
-  version = "1.27.1";
+  version = "1.28.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "236468dae36707069e8b3bdb455e9f1be090b1e6b937f4ac0c56a538d6f50be0";
+    sha256 = "f1c7518e7b160336040fee272174f1f7b29a46febb3632502a8f2055f973d60b";
   };
 
   doCheck = false;
diff --git a/pkgs/development/python-modules/stripe/default.nix b/pkgs/development/python-modules/stripe/default.nix
index 7edfb9c4f0e6e..e2a88a9f10b5b 100644
--- a/pkgs/development/python-modules/stripe/default.nix
+++ b/pkgs/development/python-modules/stripe/default.nix
@@ -3,7 +3,7 @@
 
 buildPythonPackage rec {
   pname = "stripe";
-  version = "1.70.0";
+  version = "1.77.0";
   name = "${pname}-${version}";
 
   # Tests require network connectivity and there's no easy way to disable
@@ -12,7 +12,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "ee77103d2d18fe6369f23c40c93067425c5ed67e08b1a7678e681217e8fa8062";
+    sha256 = "6503851d2309dd9c1307e3f0a1cb33ac1427fee25d38ecba1f8bf73a0d74defc";
   };
 
   buildInputs = [ unittest2 mock ];
diff --git a/pkgs/development/python-modules/structlog/default.nix b/pkgs/development/python-modules/structlog/default.nix
new file mode 100644
index 0000000000000..2aab5b16aefab
--- /dev/null
+++ b/pkgs/development/python-modules/structlog/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, pytest
+, pretend
+, freezegun
+, simplejson
+}:
+
+buildPythonPackage rec {
+  pname = "structlog";
+  version = "17.2.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "6980001045abd235fa12582222627c19b89109e58b85eb77d5a5abc778df6e20";
+  };
+
+  checkInputs = [ pytest pretend freezegun ];
+  propagatedBuildInputs = [ simplejson ];
+
+  checkPhase = ''
+    rm tests/test_twisted.py*
+    py.test
+  '';
+
+  meta = {
+    description = "Painless structural logging";
+    homepage = http://www.structlog.org/;
+    license = lib.licenses.asl20;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/supervise_api/default.nix b/pkgs/development/python-modules/supervise_api/default.nix
index 5b98aa3415b2e..85f0106db65de 100644
--- a/pkgs/development/python-modules/supervise_api/default.nix
+++ b/pkgs/development/python-modules/supervise_api/default.nix
@@ -6,13 +6,13 @@
 
 buildPythonPackage rec {
   pname = "supervise_api";
-  version = "0.1.5";
+  version = "0.2.0";
 
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1pqqlw80cjdgrlpvdmydkyhsrr4s531mn6bfkshm68j9gk4kq6px";
+    sha256 = "e6982633a924cb5192d2291d25b366ff311876a31b0f5961471b39d87397ef5b";
   };
 
   propagatedBuildInputs = [ supervise ];
diff --git a/pkgs/development/python-modules/sybil/default.nix b/pkgs/development/python-modules/sybil/default.nix
index b1fe22df47676..1370c59ace844 100644
--- a/pkgs/development/python-modules/sybil/default.nix
+++ b/pkgs/development/python-modules/sybil/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonApplication rec {
   pname   = "sybil";
-  version = "1.0.5";
+  version = "1.0.6";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0x8qd5p5qliv8wmdglda2iy3f70i4jg8zqyk8yhklm5hrxm8jdl6";
+    sha256 = "5bd7dd09eff68cbec9062e6950124fadfaaccbc0f50b23c1037f4d70ae86f0f1";
   };
 
   checkInputs = [ pytest nose ];
diff --git a/pkgs/development/python-modules/tabulate/default.nix b/pkgs/development/python-modules/tabulate/default.nix
index 9ddc2a0e08b34..db7f43c1ea467 100644
--- a/pkgs/development/python-modules/tabulate/default.nix
+++ b/pkgs/development/python-modules/tabulate/default.nix
@@ -5,13 +5,13 @@
 }:
 
 buildPythonPackage rec {
-  version = "0.7.7";
+  version = "0.8.2";
   pname = "tabulate";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "83a0b8e17c09f012090a50e1e97ae897300a72b35e0c86c0b53d3bd2ae86d8c6";
+    sha256 = "e4ca13f26d0a6be2a2915428dc21e732f1e44dad7f76d7030b2ef1ec251cf7f2";
   };
 
   checkInputs = [ nose ];
diff --git a/pkgs/development/python-modules/testtools/default.nix b/pkgs/development/python-modules/testtools/default.nix
index e786cb8432962..eb6a6694b05c2 100644
--- a/pkgs/development/python-modules/testtools/default.nix
+++ b/pkgs/development/python-modules/testtools/default.nix
@@ -12,19 +12,18 @@
 , pyrsistent
 }:
 
-# testtools 2.0.0 and up has a circular run-time dependency on futures
+
 
 buildPythonPackage rec {
   pname = "testtools";
-  version = "1.9.0";
-  name = "${pname}-${version}";
+  version = "2.3.0";
 
   # Python 2 only judging from SyntaxError
 #   disabled = isPy3k;
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "b46eec2ad3da6e83d53f2b0eca9a8debb687b4f71343a074f83a16bbdb3c0644";
+    sha256 = "5827ec6cf8233e0f29f51025addd713ca010061204fdea77484a2934690a0559";
   };
 
   propagatedBuildInputs = [ pbr python_mimeparse extras lxml unittest2 pyrsistent ];
@@ -33,6 +32,11 @@ buildPythonPackage rec {
   # No tests in archive
   doCheck = false;
 
+  # testtools 2.0.0 and up has a circular run-time dependency on futures
+  postPatch = ''
+    substituteInPlace requirements.txt --replace "fixtures>=1.3.0" ""
+  '';
+
   meta = {
     description = "A set of extensions to the Python standard library's unit testing framework";
     homepage = https://pypi.python.org/pypi/testtools;
diff --git a/pkgs/development/python-modules/textacy/default.nix b/pkgs/development/python-modules/textacy/default.nix
index 1647b837d9760..333c4825f0f90 100644
--- a/pkgs/development/python-modules/textacy/default.nix
+++ b/pkgs/development/python-modules/textacy/default.nix
@@ -25,11 +25,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "textacy";
-  version = "0.4.1";
+  version = "0.5.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "04wf3a7zgzz83nmgkh488wkl50zm9yfdpv3sl12sm2zj685plqcz";
+    sha256 = "6fc4603fd52c386081b063ef7aa15ca77e5e937a3064b197359659fccfdeb406";
   };
 
   disabled = isPy27; # 2.7 requires backports.csv
diff --git a/pkgs/development/python-modules/texttable/default.nix b/pkgs/development/python-modules/texttable/default.nix
new file mode 100644
index 0000000000000..38cffcee29639
--- /dev/null
+++ b/pkgs/development/python-modules/texttable/default.nix
@@ -0,0 +1,20 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+}:
+
+buildPythonPackage rec {
+  pname = "texttable";
+  version = "1.1.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "44674d1d470a9fc264c4d1eba44b74463ca0066d7b954453dd5a4f8057779c9c";
+  };
+
+  meta = {
+    description = "A module to generate a formatted text table, using ASCII characters";
+    homepage = http://foutaise.org/code/;
+    license = lib.licenses.lgpl2;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/thespian/default.nix b/pkgs/development/python-modules/thespian/default.nix
index 7a6ff3cc53d1f..df118470e9200 100644
--- a/pkgs/development/python-modules/thespian/default.nix
+++ b/pkgs/development/python-modules/thespian/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchPypi, buildPythonPackage, lib }:
 
 buildPythonPackage rec {
-  version = "3.8.3";
+  version = "3.9.0";
   pname = "thespian";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "0vvwsh3waxd5ldrayr86kdcshv07bp361fl7p16g9i044vklwly4";
+    sha256 = "e698e3c5369d7b06de5c4ce7b877ea65991c99f7b0fabd09f29e91bc981c7d22";
   };
 
   # Do not run the test suite: it takes a long type and uses
diff --git a/pkgs/development/python-modules/toolz/default.nix b/pkgs/development/python-modules/toolz/default.nix
index 36b85bce3acd5..0fc14024903e9 100644
--- a/pkgs/development/python-modules/toolz/default.nix
+++ b/pkgs/development/python-modules/toolz/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec{
   pname = "toolz";
-  version = "0.8.2";
+  version = "0.9.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0l3czks4xy37i8099waxk2fdz5g0k1dwys2mkhlxc0b0886cj4sa";
+    sha256 = "929f0a7ea7f61c178bd951bdae93920515d3fbdbafc8e6caf82d752b9b3b31c9";
   };
 
   checkInputs = [ nose ];
diff --git a/pkgs/development/python-modules/tox/default.nix b/pkgs/development/python-modules/tox/default.nix
new file mode 100644
index 0000000000000..bc70d65cc1f83
--- /dev/null
+++ b/pkgs/development/python-modules/tox/default.nix
@@ -0,0 +1,24 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, py
+, virtualenv
+, pluggy
+, setuptools_scm
+, six
+}:
+
+buildPythonPackage rec {
+  pname = "tox";
+  version = "2.9.1";
+
+  buildInputs = [ setuptools_scm ];
+  propagatedBuildInputs = [ py virtualenv pluggy six ];
+
+  doCheck = false;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "752f5ec561c6c08c5ecb167d3b20f4f4ffc158c0ab78855701a75f5cef05f4b8";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/python-modules/tqdm/default.nix b/pkgs/development/python-modules/tqdm/default.nix
index 2392a4a9968c7..209ee8ccd6bb7 100644
--- a/pkgs/development/python-modules/tqdm/default.nix
+++ b/pkgs/development/python-modules/tqdm/default.nix
@@ -11,12 +11,12 @@
 
 buildPythonPackage rec {
   pname = "tqdm";
-  version = "4.19.4";
+  version = "4.19.5";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "7ca803c2ea268c6bdb541e2dac74a3af23cf4bf7b4132a6a78926d255f8c8df1";
+    sha256 = "df32e6f127dc0ccbc675eadb33f749abbcb8f174c5cb9ec49c0cdb73aa737377";
   };
 
   buildInputs = [ nose coverage glibcLocales flake8 ];
diff --git a/pkgs/development/python-modules/tzlocal/default.nix b/pkgs/development/python-modules/tzlocal/default.nix
index 2277cb7c4ca48..1c61d0afab3b8 100644
--- a/pkgs/development/python-modules/tzlocal/default.nix
+++ b/pkgs/development/python-modules/tzlocal/default.nix
@@ -4,13 +4,13 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "tzlocal";
-  version = "1.4";
+  version = "1.5.1";
 
   propagatedBuildInputs = [ pytz ];
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0n9hw4kqblyc0avzwi26rqmvyk9impb608rvy11qifmigy7r18h5";
+    sha256 = "4ebeb848845ac898da6519b9b31879cf13b6626f7184c496037b818e238f2c4e";
   };
 
   # test fail (timezone test fail)
diff --git a/pkgs/development/python-modules/vowpalwabbit/default.nix b/pkgs/development/python-modules/vowpalwabbit/default.nix
index 8c980cf2b2cf7..f2b5e06baaa2c 100644
--- a/pkgs/development/python-modules/vowpalwabbit/default.nix
+++ b/pkgs/development/python-modules/vowpalwabbit/default.nix
@@ -3,11 +3,11 @@
 pythonPackages.buildPythonPackage rec {
   pname = "vowpalwabbit";
   name = "${pname}-${version}";
-  version = "8.3.2";
+  version = "8.4.0";
 
   src = fetchurl{
     url = "mirror://pypi/v/vowpalwabbit/${name}.tar.gz";
-    sha256 = "0qm8rlrs2gfgamqnpx4lapxakpzgh0yh3kp1lbd7lhb0r748m3k7";
+    sha256 = "abd22bfae99fb102cf8a6aec49e8c278cb7317d3a7eb60f70cd102be9c336fd5";
   };
   # vw tries to write some explicit things to home
   # python installed: The directory '/homeless-shelter/.cache/pip/http'
diff --git a/pkgs/development/python-modules/websockets/default.nix b/pkgs/development/python-modules/websockets/default.nix
index 488036552583f..f24f10675f809 100644
--- a/pkgs/development/python-modules/websockets/default.nix
+++ b/pkgs/development/python-modules/websockets/default.nix
@@ -6,13 +6,13 @@
 
 let
   pname = "websockets";
-  version = "3.4";
+  version = "4.0.1";
 in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
-    sha256 = "43e5b9f51dd0000a4c6f646e2ade0c886bd14a784ffac08b9e079bd17a63bcc5";
+    sha256 = "da4d4fbe059b0453e726d6d993760065d69b823a27efc3040402a6fcfe6a1ed9";
   };
 
   disabled = pythonOlder "3.3";
diff --git a/pkgs/development/python-modules/werkzeug/default.nix b/pkgs/development/python-modules/werkzeug/default.nix
index 5979d895a7475..78380900416da 100644
--- a/pkgs/development/python-modules/werkzeug/default.nix
+++ b/pkgs/development/python-modules/werkzeug/default.nix
@@ -1,21 +1,23 @@
 { stdenv, buildPythonPackage, fetchPypi
-, itsdangerous
+, itsdangerous, hypothesis
 , pytest, requests, glibcLocales }:
 
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "Werkzeug";
-  version = "0.12.2";
+  version = "0.14.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "09mv4cya3lywkn4mi3qrqmjgwiw99kdk03dk912j8da6ny3pnflh";
+    sha256 = "c3fd7a7d41976d9f44db327260e263132466836cef6f91512889ed60ad26557c";
   };
 
-  LC_ALL = "en_US.UTF-8";
-
   propagatedBuildInputs = [ itsdangerous ];
-  buildInputs = [ pytest requests glibcLocales ];
+  checkInputs = [ pytest requests glibcLocales hypothesis ];
+
+  checkPhase = ''
+    LC_ALL="en_US.UTF-8" py.test
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://werkzeug.pocoo.org/;
diff --git a/pkgs/development/python-modules/widgetsnbextension/default.nix b/pkgs/development/python-modules/widgetsnbextension/default.nix
index b9ab1dfbc1d24..ab63b444af6d4 100644
--- a/pkgs/development/python-modules/widgetsnbextension/default.nix
+++ b/pkgs/development/python-modules/widgetsnbextension/default.nix
@@ -8,11 +8,11 @@
 buildPythonPackage rec {
   pname = "widgetsnbextension";
   name = "${pname}-${version}";
-  version = "3.0.8";
+  version = "3.1.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "a57e29e733b989e68fdd0f3d6927a3691763b39792591d573b95a89a5a12ec15";
+    sha256 = "67fc28c3b9fede955d69bccbd92784e3f0c6d0dee3a71532cd3367c257feb178";
   };
 
   propagatedBuildInputs = [ notebook ];
diff --git a/pkgs/development/python-modules/ws4py/default.nix b/pkgs/development/python-modules/ws4py/default.nix
index 648ab1cff0838..5e65940e84681 100644
--- a/pkgs/development/python-modules/ws4py/default.nix
+++ b/pkgs/development/python-modules/ws4py/default.nix
@@ -4,11 +4,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "ws4py";
-  version = "0.4.2";
+  version = "0.4.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0zr3254ky6r7q15l3dhdczfa8i723055zdkqssjifsgcwvirriks";
+    sha256 = "ee12b58384bab8bfdcd1c76dcd6852047aec163af17175fc0f73e255d107dd7a";
   };
 
   checkInputs = [ pytest mock git ];
diff --git a/pkgs/development/python-modules/xarray/default.nix b/pkgs/development/python-modules/xarray/default.nix
index 1215e613f6fac..afde3f3b45b00 100644
--- a/pkgs/development/python-modules/xarray/default.nix
+++ b/pkgs/development/python-modules/xarray/default.nix
@@ -10,30 +10,23 @@
 
 buildPythonPackage rec {
   pname = "xarray";
-  version = "0.9.6";
-  name = "${pname}-${version}";
+  version = "0.10.0";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f649a41d43b5a6c64bdcbd57e994932656b689f9593a86dd0be95778a2b47494";
+    sha256 = "af1449e8df84a6eb09eb1d56c1dc5ac7f24a9563d4f2b9391ff364dc0c62344c";
   };
 
-  # Temporary patch until next release (later than 0.9.6) to fix
-  # a broken test case.
-  patches = [
-    (fetchurl {
-      url = "https://github.com/pydata/xarray/commit/726c6a3638ecf95889c541d84e892a106c2f2f92.patch";
-      sha256 = "1i2hsj5v5qlvqfj48vyn9931yndsf4k4wrk3qpqpywh32s7r007b";
-    })
-  ];
-
-  buildInputs = [ pytest ];
+  checkInputs = [ pytest ];
   propagatedBuildInputs = [numpy pandas];
 
   checkPhase = ''
     py.test $out/${python.sitePackages}
   '';
 
+  # There always seem to be broken tests...
+  doCheck = false;
+
   meta = {
     description = "N-D labeled arrays and datasets in Python";
     homepage = https://github.com/pydata/xarray;
diff --git a/pkgs/development/python-modules/yapf/default.nix b/pkgs/development/python-modules/yapf/default.nix
index 2ded73d5250a0..d7617ae1551be 100644
--- a/pkgs/development/python-modules/yapf/default.nix
+++ b/pkgs/development/python-modules/yapf/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "yapf";
-  version = "0.19.0";
+  version = "0.20.0";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "701b076a4916e3cfbba345e0297dcd54a02fd0fdcae1f43346f8a043c3bbd052";
+    sha256 = "ff28f8839a9a105854a099026a33f4cbec8bd933554bfed658aec359bfc88ae8";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/yarl/default.nix b/pkgs/development/python-modules/yarl/default.nix
index 1275178d5d0ba..cf95803d5af40 100644
--- a/pkgs/development/python-modules/yarl/default.nix
+++ b/pkgs/development/python-modules/yarl/default.nix
@@ -1,24 +1,23 @@
 { lib
-, fetchurl
+, fetchPypi
 , buildPythonPackage
 , multidict
 , pytestrunner
 , pytest
+, idna
 }:
 
-let
+buildPythonPackage rec {
   pname = "yarl";
-  version = "0.13.0";
-in buildPythonPackage rec {
+  version = "0.17.0";
   name = "${pname}-${version}";
-  src = fetchurl {
-    url = "mirror://pypi/${builtins.substring 0 1 pname}/${pname}/${name}.tar.gz";
-    sha256 = "25fe681a982f2cec567df8abac7cbd2ac27016e4aec89193945cab0643bfdb42";
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "2e4e1aec650ad80e73e7063941cd8aadb48e72487ec680a093ad364cc61efe64";
   };
 
-  buildInputs = [ pytest pytestrunner ];
-  propagatedBuildInputs = [ multidict ];
-
+  checkInputs = [ pytest pytestrunner ];
+  propagatedBuildInputs = [ multidict idna ];
 
   meta = {
     description = "Yet another URL library";
diff --git a/pkgs/development/python-modules/zope_copy/default.nix b/pkgs/development/python-modules/zope_copy/default.nix
new file mode 100644
index 0000000000000..305928c1846db
--- /dev/null
+++ b/pkgs/development/python-modules/zope_copy/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, zope_interface
+, zope_location
+, zope_schema
+}:
+
+
+buildPythonPackage rec {
+  pname = "zope_copy";
+  version = "4.0.2";
+
+  src = fetchPypi {
+    inherit pname version;
+    extension = "zip";
+    sha256 = "eb2a95866df1377741876a3ee62d8600e80089e6246e1a235e86791b29534457";
+  };
+
+  propagatedBuildInputs = [ zope_interface ];
+
+  checkInputs = [ zope_location zope_schema ];
+
+  meta = {
+    maintainers = with lib.maintainers; [ domenkozar ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix
index 76c0e52277731..a435ee65e52cc 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/bundled-common/default.nix b/pkgs/development/ruby-modules/bundled-common/default.nix
index 64a88d8f7b83f..1f31aec886a64 100644
--- a/pkgs/development/ruby-modules/bundled-common/default.nix
+++ b/pkgs/development/ruby-modules/bundled-common/default.nix
@@ -29,7 +29,9 @@ with  import ./functions.nix { inherit lib gemConfig; };
 let
   gemFiles = bundlerFiles args;
 
-  importedGemset = import gemFiles.gemset;
+  importedGemset = if builtins.typeOf gemFiles.gemset == "path"
+    then import gemFiles.gemset
+    else gemFiles.gemset;
 
   filteredGemset = filterGemset { inherit ruby groups; } importedGemset;
 
diff --git a/pkgs/development/ruby-modules/bundled-common/functions.nix b/pkgs/development/ruby-modules/bundled-common/functions.nix
index b17a4639e7791..85e93959e4b5f 100644
--- a/pkgs/development/ruby-modules/bundled-common/functions.nix
+++ b/pkgs/development/ruby-modules/bundled-common/functions.nix
@@ -67,8 +67,10 @@ rec {
         };
     in res;
 
-  composeGemAttrs = ruby: gems: name: attrs: ((removeAttrs attrs ["source" "platforms"]) // attrs.source // {
+  composeGemAttrs = ruby: gems: name: attrs: ((removeAttrs attrs ["platforms"]) // {
     inherit ruby;
+    inherit (attrs.source) type;
+    source = removeAttrs attrs.source ["type"];
     gemName = name;
     gemPath = map (gemName: gems."${gemName}") (attrs.dependencies or []);
   });
diff --git a/pkgs/development/ruby-modules/bundler-env/default.nix b/pkgs/development/ruby-modules/bundler-env/default.nix
index 2e2653621a767..5d1489ba20054 100644
--- a/pkgs/development/ruby-modules/bundler-env/default.nix
+++ b/pkgs/development/ruby-modules/bundler-env/default.nix
@@ -1,7 +1,4 @@
-{ stdenv, runCommand, writeText, writeScript, writeScriptBin, ruby, lib
-, callPackage, defaultGemConfig, fetchurl, fetchgit, buildRubyGem, buildEnv
-, linkFarm, git, makeWrapper, bundler, tree
-}@defs:
+{ ruby, lib, callPackage, defaultGemConfig, buildEnv, bundler }@defs:
 
 { name ? null
 , pname ? null
diff --git a/pkgs/development/ruby-modules/bundler/default.nix b/pkgs/development/ruby-modules/bundler/default.nix
index 9251c4d2a4151..6ba1d5f10ec1c 100644
--- a/pkgs/development/ruby-modules/bundler/default.nix
+++ b/pkgs/development/ruby-modules/bundler/default.nix
@@ -5,7 +5,7 @@ buildRubyGem rec {
   name = "${gemName}-${version}";
   gemName = "bundler";
   version = "1.14.6";
-  sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
+  source.sha256 = "0h3x2csvlz99v2ryj1w72vn6kixf7rl35lhdryvh7s49brnj0cgl";
   dontPatchShebangs = true;
 
   postFixup = ''
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 05415b8896808..5361c3ce65ebf 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -31,8 +31,7 @@ let
   rainbow_rake = buildRubyGem {
     name = "rake";
     gemName = "rake";
-    remotes = ["https://rubygems.org"];
-    sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
+    source.sha256 = "01j8fc9bqjnrsxbppncai05h43315vmz9fwg28qdsgcjw9ck1d7n";
     type = "gem";
     version = "12.0.0";
   };
@@ -109,7 +108,7 @@ in
 
   gio2 = attrs: {
     nativeBuildInputs = [ pkgconfig ];
-    buildInputs = [ gtk2 pcre ];
+    buildInputs = [ gtk2 pcre gobjectIntrospection ];
   };
 
   gitlab-markup = attrs: { meta.priority = 1; };
@@ -167,11 +166,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/ruby-modules/gem/default.nix b/pkgs/development/ruby-modules/gem/default.nix
index 62a9d60686f38..eba0dc2c4a7c6 100644
--- a/pkgs/development/ruby-modules/gem/default.nix
+++ b/pkgs/development/ruby-modules/gem/default.nix
@@ -41,7 +41,6 @@ lib.makeOverridable (
 , patches ? []
 , gemPath ? []
 , dontStrip ? true
-, remotes ? ["https://rubygems.org"]
 # Assume we don't have to build unless strictly necessary (e.g. the source is a
 # git checkout).
 # If you need to apply patches, make sure to set `dontBuild = false`;
@@ -56,12 +55,14 @@ let
   src = attrs.src or (
     if type == "gem" then
       fetchurl {
-        urls = map (remote: "${remote}/gems/${gemName}-${version}.gem") remotes;
-        inherit (attrs) sha256;
+        urls = map (
+          remote: "${remote}/gems/${gemName}-${version}.gem"
+        ) (attrs.source.remotes or [ "https://rubygems.org" ]);
+        inherit (attrs.source) sha256;
       }
     else if type == "git" then
       fetchgit {
-        inherit (attrs) url rev sha256 fetchSubmodules;
+        inherit (attrs.source) url rev sha256 fetchSubmodules;
         leaveDotGit = true;
       }
     else
@@ -74,7 +75,7 @@ let
 
 in
 
-stdenv.mkDerivation (attrs // {
+stdenv.mkDerivation ((builtins.removeAttrs attrs ["source"]) // {
   inherit ruby;
   inherit doCheck;
   inherit dontBuild;
@@ -161,9 +162,9 @@ stdenv.mkDerivation (attrs // {
     ${lib.optionalString (type == "git") ''
     ruby ${./nix-bundle-install.rb} \
       ${gemName} \
-      ${attrs.url} \
+      ${attrs.source.url} \
       ${src} \
-      ${attrs.rev} \
+      ${attrs.source.rev} \
       ${version} \
       ${lib.escapeShellArgs buildFlags}
     ''}
diff --git a/pkgs/development/tools/build-managers/bazel/default.nix b/pkgs/development/tools/build-managers/bazel/default.nix
index 41861a6142e57..67d186c5a2574 100644
--- a/pkgs/development/tools/build-managers/bazel/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/default.nix
@@ -6,7 +6,7 @@
 
 stdenv.mkDerivation rec {
 
-  version = "0.8.0";
+  version = "0.9.0";
 
   meta = with stdenv.lib; {
     homepage = "https://github.com/bazelbuild/bazel/";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://github.com/bazelbuild/bazel/releases/download/${version}/bazel-${version}-dist.zip";
-    sha256 = "0y50fhwh135fim39ra4szwzzgyb4ibls3i0hpv3d7asns0hh715a";
+    sha256 = "0aiifrp6g1d3ilhg8111wdhsrjy41x8gcmq67rjyxypw9znqzcpg";
   };
 
   sourceRoot = ".";
diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
index 614e00314212c..a92d54b3f1440 100755
--- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
@@ -72,11 +72,7 @@ if [ -z "$dontUseCmakeConfigure" -a -z "$configurePhase" ]; then
     configurePhase=cmakeConfigurePhase
 fi
 
-if [ -n "$crossConfig" ]; then
-    crossEnvHooks+=(addCMakeParams)
-else
-    envHooks+=(addCMakeParams)
-fi
+addEnvHooks "$targetOffset" addCMakeParams
 
 makeCmakeFindLibs(){
   isystem_seen=
diff --git a/pkgs/development/tools/coursier/default.nix b/pkgs/development/tools/coursier/default.nix
index 2f2200010709d..79a077f4a7518 100644
--- a/pkgs/development/tools/coursier/default.nix
+++ b/pkgs/development/tools/coursier/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "coursier-${version}";
-  version = "1.0.0-RC13";
+  version = "1.0.0";
 
   src = fetchurl {
     url = "https://github.com/coursier/coursier/raw/v${version}/coursier";
-    sha256 = "18i7imd6lqkvpzhx1m72g6jwsqq7h6aisfny5aiccgnyg6jpag6i";
+    sha256 = "0167cgp3kqx336p8dmlxx57bi3lhzyp6ncly28v1s7r2sjxj9krj";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/development/tools/database/shmig/default.nix b/pkgs/development/tools/database/shmig/default.nix
index a397ba696977b..49e90ce64c87d 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/database/sqldeveloper/default.nix b/pkgs/development/tools/database/sqldeveloper/default.nix
index d5acd487e6b38..a7a8640a94ed4 100644
--- a/pkgs/development/tools/database/sqldeveloper/default.nix
+++ b/pkgs/development/tools/database/sqldeveloper/default.nix
@@ -1,7 +1,7 @@
 { stdenv, makeWrapper, requireFile, unzip, openjdk }:
 
 stdenv.mkDerivation rec {
-  version = "17.3.0.271.2323";
+  version = "17.3.1.279.0537";
   name = "sqldeveloper-${version}";
 
   src = requireFile rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
       obtain it you need to
 
       - navigate to ${url}
-      - make sure that it says "Version ${version}" above the list of downloads 
+      - make sure that it says "Version ${version}" above the list of downloads
         - if it does not, click on the "Previous Version" link below the downloads
           and repeat until the version is correct. This is necessarry because as the
           time of this writing there exists no permanent link for the current version
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
         nix-prefetch-url --type sha256 file:///path/to/${name}
     '';
     # obtained by `sha256sum sqldeveloper-${version}-no-jre.zip`
-    sha256 = "06ba5920544bacbea83425548b1b8f69ab3e9bb279076321aece2c0c6d415dad";
+    sha256 = "d9c3c61b12a57d6b0fd6e172bf5716d6e829306d44815bf68ae42eab8a51bea3";
   };
 
   buildInputs = [ makeWrapper unzip ];
diff --git a/pkgs/development/tools/misc/automake/setup-hook.sh b/pkgs/development/tools/misc/automake/setup-hook.sh
index 5cd8c6229f68b..292632b7cbce8 100644
--- a/pkgs/development/tools/misc/automake/setup-hook.sh
+++ b/pkgs/development/tools/misc/automake/setup-hook.sh
@@ -2,4 +2,4 @@ addAclocals () {
     addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal
 }
 
-envHooks+=(addAclocals)
+addEnvHooks "$hostOffset" addAclocals
diff --git a/pkgs/development/tools/misc/binutils/always-search-rpath.patch b/pkgs/development/tools/misc/binutils/always-search-rpath.patch
new file mode 100644
index 0000000000000..2e9956e6b6e45
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/always-search-rpath.patch
@@ -0,0 +1,14 @@
+diff --git a/ld/genscripts.sh b/ld/genscripts.sh
+index b6940d376d..0feb1adfd0 100755
+--- a/ld/genscripts.sh
++++ b/ld/genscripts.sh
+@@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then
+   USE_LIBPATH=yes
+ fi
+ 
++# TODO: why is this needed?
++USE_LIBPATH=yes
++
+ # Set the library search path, for libraries named by -lfoo.
+ # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used.
+ # Otherwise, the default is set here.
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 7628e37ae1cdb..31c86c785c2df 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -53,11 +53,20 @@ stdenv.mkDerivation rec {
     # elf32-littlearm-vxworks in favor of the first.
     # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
     ./disambiguate-arm-targets.patch
+
+    # For some reason bfd ld doesn't search DT_RPATH when cross-compiling. It's
+    # not clear why this behavior was decided upon but it has the unfortunate
+    # consequence that the linker will fail to find transitive dependencies of
+    # shared objects when cross-compiling. Consequently, we are forced to
+    # override this behavior, forcing ld to search DT_RPATH even when
+    # cross-compiling.
+    ./always-search-rpath.patch
   ];
 
   outputs = [ "out" "info" "man" ];
 
-  nativeBuildInputs = [ bison buildPackages.stdenv.cc ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ bison ];
   buildInputs = [ zlib ];
 
   inherit noSysDirs;
@@ -82,11 +91,7 @@ stdenv.mkDerivation rec {
     else "-static-libgcc";
 
   # TODO(@Ericson2314): Always pass "--target" and always targetPrefix.
-  configurePlatforms =
-    # TODO(@Ericson2314): Figure out what's going wrong with Arm
-    if hostPlatform == targetPlatform && targetPlatform.isArm
-    then []
-    else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = [
     "--enable-targets=all" "--enable-64-bit-bfd"
diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix
index 6006c83c0cd9f..b20f63e262535 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/pkgconfig/setup-hook.sh b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh
index 1c153976a3432..34a9b9f1173b8 100644
--- a/pkgs/development/tools/misc/pkgconfig/setup-hook.sh
+++ b/pkgs/development/tools/misc/pkgconfig/setup-hook.sh
@@ -3,8 +3,4 @@ addPkgConfigPath () {
     addToSearchPath PKG_CONFIG_PATH $1/share/pkgconfig
 }
 
-if test -n "$crossConfig"; then
-    crossEnvHooks+=(addPkgConfigPath)
-else
-    envHooks+=(addPkgConfigPath)
-fi
+addEnvHooks "$targetOffset" addPkgConfigPath
diff --git a/pkgs/development/tools/misc/sysbench/default.nix b/pkgs/development/tools/misc/sysbench/default.nix
index 45a31ad66f205..612df55471ba9 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/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix
index 846546ae7699e..186b78ce3f36d 100644
--- a/pkgs/development/tools/ocaml/findlib/default.nix
+++ b/pkgs/development/tools/ocaml/findlib/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
         fi
     }
 
-    envHooks+=(addOCamlPath)
+    addEnvHooks "$targetOffset" addOCamlPath
   '';
 
   meta = {
diff --git a/pkgs/development/tools/scalafmt/default.nix b/pkgs/development/tools/scalafmt/default.nix
index 6c30768d900c7..d50b1435b7332 100644
--- a/pkgs/development/tools/scalafmt/default.nix
+++ b/pkgs/development/tools/scalafmt/default.nix
@@ -2,7 +2,7 @@
 
 let
   baseName = "scalafmt";
-  version = "1.3.0";
+  version = "1.4.0";
   deps = stdenv.mkDerivation {
     name = "${baseName}-deps-${version}";
     buildCommand = ''
@@ -13,7 +13,7 @@ let
     '';
     outputHashMode = "recursive";
     outputHashAlgo = "sha256";
-    outputHash     = "0q1vw6drpdrfifbm3266igpml0phdk6pl0gd3b5amysigx83m251";
+    outputHash     = "12hsix3b7qnyr9x2v7i6jgqljdqxpfj4bfvhjdl99ijr793g3lnp";
   };
 in
 stdenv.mkDerivation rec {
diff --git a/pkgs/development/tools/tora/default.nix b/pkgs/development/tools/tora/default.nix
index 578e759548a10..5b46b975cf7f1 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/development/web/nodejs/setup-hook.sh b/pkgs/development/web/nodejs/setup-hook.sh
index e1f4d9089f38b..18368588c2afc 100644
--- a/pkgs/development/web/nodejs/setup-hook.sh
+++ b/pkgs/development/web/nodejs/setup-hook.sh
@@ -2,4 +2,4 @@ addNodePath () {
     addToSearchPath NODE_PATH $1/lib/node_modules
 }
 
-envHooks+=(addNodePath)
+addEnvHooks "$hostOffset" addNodePath
diff --git a/pkgs/development/web/nodejs/v4.nix b/pkgs/development/web/nodejs/v4.nix
index 08fd91aaf8ded..64674066b2956 100644
--- a/pkgs/development/web/nodejs/v4.nix
+++ b/pkgs/development/web/nodejs/v4.nix
@@ -5,7 +5,7 @@ let
 in
   buildNodejs {
     inherit enableNpm;
-    version = "4.8.5";
-    sha256 = "0lqdnnihmc2wpl1v1shj60i49wka2354b00a86k0xbjg5gyfx2m4";
+    version = "4.8.7";
+    sha256 = "1y21wq092d3gmccm2zldbflbbbx7a71wi9l0bpkxvzmgws69liq3";
     patches = lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
   }
diff --git a/pkgs/development/web/nodejs/v6.nix b/pkgs/development/web/nodejs/v6.nix
index c703377d5a046..3688ee0b7ef05 100644
--- a/pkgs/development/web/nodejs/v6.nix
+++ b/pkgs/development/web/nodejs/v6.nix
@@ -5,7 +5,7 @@ let
 in
   buildNodejs {
     inherit enableNpm;
-    version = "6.11.5";
-    sha256 = "1bwakrvy0if5spbymwpb05qwrb47xwzlnc42rapgp6b744ay8v8w";
+    version = "6.12.2";
+    sha256 = "1z6sn4b973sxw0h9hd38rjq6cqdkzl5gsd48f793abvarwgpqrrk";
     patches = lib.optionals stdenv.isDarwin [ ./no-xcode.patch ];
   }
diff --git a/pkgs/development/web/nodejs/v8.nix b/pkgs/development/web/nodejs/v8.nix
index 14dfb8164f43c..e34ba8da92547 100644
--- a/pkgs/development/web/nodejs/v8.nix
+++ b/pkgs/development/web/nodejs/v8.nix
@@ -5,7 +5,7 @@ let
 in
   buildNodejs {
     inherit enableNpm;
-    version = "8.9.1";
-    sha256 = "1q0p9zl260pd8038yvn13lw5whs480dy11ar2ijcm2hgyqhhq5pg";
+    version = "8.9.3";
+    sha256 = "1nmjwsdql92jh6y94jpqa8cmirw6cl3cvaiqdsjyd1bbm8xxp3bl";
     patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ];
   }
diff --git a/pkgs/games/linux-steam-integration/default.nix b/pkgs/games/linux-steam-integration/default.nix
new file mode 100644
index 0000000000000..161f4691c8f9a
--- /dev/null
+++ b/pkgs/games/linux-steam-integration/default.nix
@@ -0,0 +1,80 @@
+{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, git, gtk, pkgs, gettext,
+  gcc_multi, libressl }:
+
+let
+  version = "0.7.2";
+  steamBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ steam ])}/steam";
+  zenityBinPath = "${stdenv.lib.makeBinPath (with pkgs; [ gnome3.zenity ])}/zenity";
+
+in stdenv.mkDerivation rec {
+  name = "linux-steam-integration-${version}";
+
+  nativeBuildInputs = [ meson ninja pkgconfig git gettext gcc_multi ];
+  buildInputs = [ gtk libressl ];
+
+  src = fetchFromGitHub {
+    owner = "solus-project";
+    repo = "linux-steam-integration";
+    rev = "v${version}";
+    sha256 = "0yn71fvjqi63dxk04jsndb26pgipl0nla10sy94bi7q95pk3sdf6";
+    fetchSubmodules = true;
+  };
+
+  # Patch lib paths (AUDIT_PATH and REDIRECT_PATH) in shim.c
+  # Patch path to lsi-steam in lsi-steam.desktop
+  # Patch path to zenity in lsi.c
+  postPatch = ''
+    sed -i -e "s|/usr/|$out/|g" src/shim/shim.c
+    sed -i -e "s|/usr/|$out/|g" data/lsi-steam.desktop
+    sed -i -e "s|zenity|${zenityBinPath}|g" src/lsi/lsi.c
+  '';
+
+  configurePhase = ''
+    # Configure 64bit things
+    meson build                           \
+      -Dwith-shim=co-exist                \
+      -Dwith-frontend=true                \
+      -Dwith-steam-binary=${steamBinPath} \
+      -Dwith-new-libcxx-abi=true          \
+      -Dwith-libressl-mode=native         \
+      --prefix /                          \
+      --libexecdir lib                    \
+      --libdir lib                        \
+      --bindir bin
+
+    # Configure 32bit things
+    CC="gcc -m32" CXX="g++ -m32" meson build32 \
+      -Dwith-shim=none                         \
+      -Dwith-libressl-mode=native              \
+      --prefix /                               \
+      --libexecdir lib32                       \
+      --libdir lib32
+  '';
+
+  buildPhase = ''
+    # Build 64bit things
+    ninja -C build
+
+    # Build 32bit things
+    ninja -C build32
+  '';
+
+  installPhase = ''
+    DESTDIR="$out" ninja -C build install
+    DESTDIR="$out" ninja -C build32 install
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Steam wrapper to improve compability and performance";
+    longDescription = ''
+      Linux Steam Integration is a helper system to make the Steam Client and
+      Steam games run better on Linux. In a nutshell, LSI automatically applies
+      various workarounds to get games working, and fixes long standing bugs in
+      both games and the client
+    '';
+    homepage = https://github.com/solus-project/linux-steam-integration;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.etu ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index a7392bbc34e92..49d786284da6f 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -69,6 +69,9 @@ in buildFHSUserEnv rec {
     xlibs.libX11
     xlibs.libXfixes
 
+    # Needed to properly check for libGL.so.1 in steam-wrapper.sh
+    pkgsi686Linux.glxinfo
+
     # Not formally in runtime but needed by some games
     gst_all_1.gstreamer
     gst_all_1.gst-plugins-ugly
@@ -103,7 +106,26 @@ in buildFHSUserEnv rec {
     export TZDIR=/etc/zoneinfo
   '';
 
-  runScript = "steam";
+  runScript = writeScript "steam-wrapper.sh" ''
+    #!${stdenv.shell}
+    if [ -f /host/etc/NIXOS ]; then   # Check only useful on NixOS
+      glxinfo >/dev/null 2>&1
+      # If there was an error running glxinfo, we know something is wrong with the configuration
+      if [ $? -ne 0 ]; then
+        cat <<EOF > /dev/stderr
+    **
+    WARNING: Steam is not set up. Add the following options to /etc/nixos/configuration.nix
+    and then run \`sudo nixos-rebuild switch\`:
+    { 
+      hardware.opengl.driSupport32Bit = true;
+      hardware.pulseaudio.support32Bit = true;
+    }
+    **
+    EOF
+      fi
+    fi
+    steam
+  '';
 
   passthru.run = buildFHSUserEnv {
     name = "steam-run";
diff --git a/pkgs/games/zod/default.nix b/pkgs/games/zod/default.nix
index f795a2ea3a257..da2f256aeb718 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/misc/drivers/sc-controller/default.nix b/pkgs/misc/drivers/sc-controller/default.nix
new file mode 100644
index 0000000000000..bbb0d1523dfee
--- /dev/null
+++ b/pkgs/misc/drivers/sc-controller/default.nix
@@ -0,0 +1,62 @@
+{ lib, buildPythonApplication, fetchFromGitHub, wrapGAppsHook
+, gtk3, gobjectIntrospection, libappindicator-gtk3, librsvg
+, evdev, pygobject3, pylibacl, pytest
+, linuxHeaders
+, libX11, libXext, libXfixes, libusb1
+}:
+
+buildPythonApplication rec {
+  pname = "sc-controller";
+  version = "0.4.0.1";
+
+  src = fetchFromGitHub {
+    owner = "kozec";
+    repo = "sc-controller";
+    rev = "v${version}";
+    sha256 = "0vhgiqg4r4bnn004ql80rvi23y05wlax80sj8qsr91pvqsxwv3yl";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook ];
+
+  buildInputs = [ gtk3 gobjectIntrospection libappindicator-gtk3 librsvg ];
+
+  propagatedBuildInputs = [ evdev pygobject3 pylibacl ];
+
+  checkInputs = [ pytest ];
+
+  postPatch = ''
+    substituteInPlace scc/paths.py --replace sys.prefix "'$out'"
+    substituteInPlace scc/uinput.py --replace /usr/include ${linuxHeaders}/include
+  '';
+
+  LD_LIBRARY_PATH = lib.makeLibraryPath [ libX11 libXext libXfixes libusb1 ];
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH")
+    # gdk-pixbuf setup hook can not choose between propagated librsvg
+    # and our librsvg with GObject introspection.
+    GDK_PIXBUF_MODULE_FILE=$(echo ${librsvg}/lib/gdk-pixbuf-2.0/*/loaders.cache)
+  '';
+
+  postFixup = ''
+    (
+      # scc runs these scripts as programs. (See find_binary() in scc/tools.py.)
+      cd $out/lib/python*/site-packages/scc/x11
+      patchPythonScript scc-autoswitch-daemon.py
+      patchPythonScript scc-osd-daemon.py
+    )
+  '';
+
+  checkPhase = ''
+    PYTHONPATH=. py.test
+  '';
+
+  meta = with lib; {
+    homepage = https://github.com/kozec/sc-controller;
+    # donations: https://www.patreon.com/kozec
+    description = "User-mode driver and GUI for Steam Controller and other controllers";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.orivej ];
+  };
+}
diff --git a/pkgs/misc/themes/deepin/default.nix b/pkgs/misc/themes/deepin/default.nix
index 670a02c85d987..bdddc28cc4407 100644
--- a/pkgs/misc/themes/deepin/default.nix
+++ b/pkgs/misc/themes/deepin/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "deepin-gtk-theme-${version}";
-  version = "17.10.4";
+  version = "17.10.5";
 
   src = fetchFromGitHub {
     owner = "linuxdeepin";
     repo = "deepin-gtk-theme";
     rev = version;
-    sha256 = "1hb0y72fzmcj2yl6q7mbc0c7yxkd1qgnyw4vixdqxnxk2c82sxzw";
+    sha256 = "0ff1yg4gz4p7nd0qg3dcbsiw8yqlvqccm55kxi998w8j1wrg6pq3";
   };
 
   propagatedUserEnvPkgs = [ gtk-engine-murrine ];
diff --git a/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
index 04d8e878f4f76..b0d5915fc1fcf 100644
--- a/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
+++ b/pkgs/os-specific/darwin/apple-sdk/framework-setup-hook.sh
@@ -39,4 +39,4 @@ useSystemCoreFoundationFramework () {
   export NIX_COREFOUNDATION_RPATH=/System/Library/Frameworks
 }
 
-envHooks+=(useSystemCoreFoundationFramework)
+addEnvHooks "$hostOffset" useSystemCoreFoundationFramework
diff --git a/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh b/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh
index f31adaa0d7441..ed9bdbd912db1 100644
--- a/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh
+++ b/pkgs/os-specific/darwin/apple-sdk/security-setup-hook.sh
@@ -7,4 +7,4 @@ noDeprecatedDeclarations() {
   fi
 }
 
-envHooks+=(noDeprecatedDeclarations)
+addEnvHooks "$hostOffset" noDeprecatedDeclarations
diff --git a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix
index a74198e8ddd78..a565971a6fa41 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/libresolv/default.nix
@@ -33,7 +33,7 @@ appleDerivation {
     cc -I. -c res_send.c
     cc -I. -c res_sendsigned.c
     cc -I. -c res_update.c
-    cc -dynamiclib -install_name $out/lib/libresolv.9.dylib -o libresolv.9.dylib *.o
+    cc -dynamiclib -install_name $out/lib/libresolv.9.dylib -current_version 1.0.0 -compatibility_version 1.0.0 -o libresolv.9.dylib *.o
   '';
 
   installPhase = ''
diff --git a/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix b/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix
index d23328d362e0a..46ba682818688 100644
--- a/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix
+++ b/pkgs/os-specific/darwin/ghc-standalone-archive/default.nix
@@ -2,8 +2,7 @@
 { haskellPackages, src, deps ? p : [], name }: let
   inherit (haskellPackages) ghc ghcWithPackages;
   with-env = ghcWithPackages deps;
-  crossPrefix = if (ghc.cross or null) != null then "${ghc.cross.config}-" else "";
-  ghcName = "${crossPrefix}ghc";
+  ghcName = "${ghc.targetPrefix}ghc";
 in runCommand name { buildInputs = [ with-env cctools ]; } ''
   mkdir -p $out/lib
   mkdir -p $out/include
diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix
index bcb24d127ccde..73c945fa0baf1 100644
--- a/pkgs/os-specific/linux/busybox/default.nix
+++ b/pkgs/os-specific/linux/busybox/default.nix
@@ -95,7 +95,7 @@ stdenv.mkDerivation rec {
     makeFlagsArray+=("CC=${stdenv.cc.targetPrefix}gcc -isystem ${musl}/include -B${musl}/lib -L${musl}/lib")
   '';
 
-  nativeBuildInputs = lib.optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   buildInputs = lib.optionals (enableStatic && !useMusl) [ stdenv.cc.libc stdenv.cc.libc.static ];
 
diff --git a/pkgs/os-specific/linux/hyperv-daemons/default.nix b/pkgs/os-specific/linux/hyperv-daemons/default.nix
new file mode 100644
index 0000000000000..f89747dc200d6
--- /dev/null
+++ b/pkgs/os-specific/linux/hyperv-daemons/default.nix
@@ -0,0 +1,109 @@
+{ stdenv, lib, python, kernel, makeWrapper, writeText }:
+
+let
+  daemons = stdenv.mkDerivation rec {
+    name = "hyperv-daemons-bin-${version}";
+    inherit (kernel) src version;
+
+    nativeBuildInputs = [ makeWrapper ];
+
+    # as of 4.9 compilation will fail due to -Werror=format-security
+    hardeningDisable = [ "format" ];
+
+    preConfigure = ''
+      cd tools/hv
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      for f in fcopy kvp vss ; do
+        install -Dm755 hv_''${f}_daemon -t $out/bin
+      done
+
+      install -Dm755 hv_get_dns_info.sh lsvmbus -t $out/bin
+
+      # I don't know why this isn't being handled automatically by fixupPhase
+      substituteInPlace $out/bin/lsvmbus \
+        --replace '/usr/bin/env python' ${python.interpreter}
+
+      runHook postInstall
+    '';
+
+    postFixup = ''
+      # kvp needs to be able to find the script(s)
+      wrapProgram $out/bin/hv_kvp_daemon --prefix PATH : $out/bin
+    '';
+  };
+
+  service = bin: title: check:
+    writeText "hv-${bin}.service" ''
+      [Unit]
+      Description=Hyper-V ${title} daemon
+      ConditionVirtualization=microsoft
+      ${lib.optionalString (check != "") ''
+        ConditionPathExists=/dev/vmbus/${check}
+      ''}
+      [Service]
+      ExecStart=@out@/hv_${bin}_daemon -n
+      Restart=on-failure
+      PrivateTmp=true
+      Slice=hyperv.slice
+
+      [Install]
+      WantedBy=hyperv-daemons.target
+    '';
+
+in stdenv.mkDerivation rec {
+  name    = "hyperv-daemons-${version}";
+
+  inherit (kernel) version;
+
+  # we just stick the bins into out as well as it requires "out"
+  outputs = [ "bin" "lib" "out" ];
+
+  phases = [ "installPhase" ];
+
+  buildInputs = [ daemons ];
+
+  installPhase = ''
+    system=$lib/lib/systemd/system
+
+    mkdir -p $system
+
+    cp ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service
+    cp ${service "kvp"   "key-value pair (KVP)"     ""  } $system/hv-kvp.service
+    cp ${service "vss"   "volume shadow copy (VSS)" ""  } $system/hv-vss.service
+
+    cat > $system/hyperv-daemons.target <<EOF
+    [Unit]
+    Description=Hyper-V Daemons
+    Wants=hv-fcopy.service hv-kvp.service hv-vss.service
+    EOF
+
+    for f in $lib/lib/systemd/system/* ; do
+      substituteInPlace $f --replace @out@ ${daemons}/bin
+    done
+
+    # we need to do both $out and $bin as $out is required
+    for d in $out/bin $bin/bin ; do
+      # make user binaries available
+      mkdir -p $d
+      ln -s ${daemons}/bin/lsvmbus $d/lsvmbus
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Integration Services for running NixOS under HyperV";
+    longDescription = ''
+      This packages contains the daemons that are used by the Hyper-V hypervisor
+      on the host.
+
+      Microsoft calls their guest agents "Integration Services" which is why
+      we use that name here.
+    '';
+    homepage = https://kernel.org;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms = kernel.meta.platforms;
+  };
+}
diff --git a/pkgs/os-specific/linux/kernel-headers/4.4.nix b/pkgs/os-specific/linux/kernel-headers/4.4.nix
index 0ef5280d13b62..e8e041f48ebaa 100644
--- a/pkgs/os-specific/linux/kernel-headers/4.4.nix
+++ b/pkgs/os-specific/linux/kernel-headers/4.4.nix
@@ -24,7 +24,8 @@ stdenvNoCC.mkDerivation {
 
   # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
   # We do this so we have a build->build, not build->host, C compiler.
-  nativeBuildInputs = [ buildPackages.stdenv.cc perl ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ perl ];
 
   extraIncludeDirs = lib.optional hostPlatform.isPowerPC ["ppc"];
 
diff --git a/pkgs/os-specific/linux/kernel/hardened-config.nix b/pkgs/os-specific/linux/kernel/hardened-config.nix
index a859a3cefbd48..b7959f9d35992 100644
--- a/pkgs/os-specific/linux/kernel/hardened-config.nix
+++ b/pkgs/os-specific/linux/kernel/hardened-config.nix
@@ -97,6 +97,9 @@ PANIC_TIMEOUT -1
 
 GCC_PLUGINS y # Enable gcc plugin options
 
+# Gather additional entropy at boot time for systems that may not have appropriate entropy sources.
+GCC_PLUGIN_LATENT_ENTROPY y
+
 ${optionalString (versionAtLeast version "4.11") ''
   GCC_PLUGIN_STRUCTLEAK y # A port of the PaX structleak plugin
 ''}
diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 0fe68fb693b0d..4fc15a9219bb2 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.14.nix
@@ -3,7 +3,7 @@
 with stdenv.lib;
 
 import ./generic.nix (args // rec {
-  version = "4.14.10";
+  version = "4.14.11";
 
   # modDirVersion needs to be x.y.z, will automatically add .0 if needed
   modDirVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
@@ -13,6 +13,6 @@ import ./generic.nix (args // rec {
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "046i3vcnhavblid71hrqdid4aay0rrcpzbiwlkcvs0x09hvz3fl6";
+    sha256 = "02kdp2k27gqqfxjv78wqlvqn1niin72masxs97mlw79za5m9as3p";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.4.nix b/pkgs/os-specific/linux/kernel/linux-4.4.nix
index e27c3dd4b4286..ec3f81b815c96 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.4.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.4.108";
+  version = "4.4.109";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "06m5bcvz1s6c28j5629mxzhmka5f6gh46jqyxyqggsawcac1202s";
+    sha256 = "1i73xn85p6c62rafipmf9ja9ya149aaz6lbgnhl989fyyyh2bjd2";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.9.nix b/pkgs/os-specific/linux/kernel/linux-4.9.nix
index 68d2fb47aff36..1c7cc7b2f15bc 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.9.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.9.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.9.73";
+  version = "4.9.74";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0avfq79fn8rfjbn24wfr9pz438qvwm8vdm3si4fl4v3d7z2nb2sm";
+    sha256 = "1ivhzmsa8n5ns8igryzb9dyaakq2p51j23f6j9kpqyby7842i1y8";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
index f7bedc311fce7..f08f2cb17b916 100644
--- a/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
+++ b/pkgs/os-specific/linux/kernel/linux-hardened-copperhead.nix
@@ -3,9 +3,9 @@
 with stdenv.lib;
 
 let
-  version = "4.14.10";
+  version = "4.14.11";
   revision = "a";
-  sha256 = "1dz1kgg8jvw2xzbv1r867r1c29gpiyhgac7pwpaps609v563a154";
+  sha256 = "05180jqxama1n0bi650sm9ing222gs2ks13cnpwamr415f01ws9c";
 
   # modVersion needs to be x.y.z, will automatically add .0 if needed
   modVersion = concatStrings (intersperse "." (take 3 (splitString "." "${version}.0")));
diff --git a/pkgs/os-specific/linux/nftables/default.nix b/pkgs/os-specific/linux/nftables/default.nix
index c06de7ea6f2c6..9d645fb1d8489 100644
--- a/pkgs/os-specific/linux/nftables/default.nix
+++ b/pkgs/os-specific/linux/nftables/default.nix
@@ -2,11 +2,11 @@
 , flex, bison, libmnl, libnftnl, gmp, readline }:
 
 stdenv.mkDerivation rec {
-  name = "nftables-0.7";
+  name = "nftables-0.8";
 
   src = fetchurl {
     url = "http://netfilter.org/projects/nftables/files/${name}.tar.bz2";
-    sha256 = "0hzdqigdx4i6jbpxbdyq4zy4p4waqn8l6vvz7685ikh1v0wr4qzy";
+    sha256 = "16iq9x0qxikdhp1nan500rk33ycqddl1k57876m4dfv3n7kqhnrz";
   };
 
   configureFlags = [
diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix
index 71d7e9e1b7856..919ddc1c3df00 100644
--- a/pkgs/os-specific/linux/sysdig/default.nix
+++ b/pkgs/os-specific/linux/sysdig/default.nix
@@ -3,13 +3,13 @@
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "sysdig-${version}";
-  version = "0.18.0";
+  version = "0.19.1";
 
   src = fetchFromGitHub {
     owner = "draios";
     repo = "sysdig";
     rev = version;
-    sha256 = "1hmkjvfg3371hp873mnkjq9cirqszw2ji4p7mb6jcn9ihwxil2z2";
+    sha256 = "04bsb7g6mh6dwk023v1rbdcjwp898y6ixdvrd7nxzm186qpycpnn";
   };
 
   buildInputs = [
diff --git a/pkgs/os-specific/linux/thunderbolt/default.nix b/pkgs/os-specific/linux/thunderbolt/default.nix
new file mode 100644
index 0000000000000..3189872ca3bca
--- /dev/null
+++ b/pkgs/os-specific/linux/thunderbolt/default.nix
@@ -0,0 +1,39 @@
+{ stdenv
+, boost
+, cmake
+, fetchFromGitHub
+, pkgconfig
+, txt2tags
+}:
+
+stdenv.mkDerivation rec {
+  name = "thunderbolt-${version}";
+  version = "0.9.2";
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = "thunderbolt-software-user-space";
+    rev = "1ae06410180320a5d0e7408a8d1a6ae2aa443c23";
+    sha256 = "03yk419gj0767lpk6zvla4jx3nx56zsg4x4adl4nd50xhn409rcc";
+  };
+
+  buildInputs = [
+    boost
+    cmake
+    pkgconfig
+    txt2tags
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE='Release'"
+    "-DUDEV_BIN_DIR=$out/bin"
+    "-DUDEV_RULES_DIR=$out/udev"
+  ];
+
+  meta = {
+    description = "Thunderbolt(TM) user-space components";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.ryantrinkle ];
+    homepage = https://01.org/thunderbolt-sw;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/windows/mingw-w64/pthreads.nix b/pkgs/os-specific/windows/mingw-w64/pthreads.nix
index c585ab54ff89b..1a33e8db07e81 100644
--- a/pkgs/os-specific/windows/mingw-w64/pthreads.nix
+++ b/pkgs/os-specific/windows/mingw-w64/pthreads.nix
@@ -1,9 +1,9 @@
-{ stdenvNoCC, callPackage }:
+{ stdenv, callPackage }:
 
 let
   inherit (callPackage ./common.nix {}) name src;
 
-in stdenvNoCC.mkDerivation {
+in stdenv.mkDerivation {
   name = name + "-pthreads";
   inherit src;
 
diff --git a/pkgs/servers/clickhouse/default.nix b/pkgs/servers/clickhouse/default.nix
index f9b7a24273ff2..f4a6b47a45a4b 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 3b695c46e7773..59d6279011318 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 d7556a39ee923..79fff80b0b8ce 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/emby/default.nix b/pkgs/servers/emby/default.nix
index 745ed18c00f8a..05d53d4446275 100644
--- a/pkgs/servers/emby/default.nix
+++ b/pkgs/servers/emby/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "emby-${version}";
-  version = "3.2.36.0";
+  version = "3.2.60.0";
 
   src = fetchurl {
     url = "https://github.com/MediaBrowser/Emby/releases/download/${version}/Emby.Mono.zip";
-    sha256 = "0b75v6g7qm03jqm5za70z4x5lqks3a4cd84vblqr35zrla9vs83b";
+    sha256 = "0yrbwq5dzzq5047vdpar4vkwzcgd9dj2v9basaw413hzncf2q8gj";
   };
 
   buildInputs = with pkgs; [
diff --git a/pkgs/servers/freeradius/default.nix b/pkgs/servers/freeradius/default.nix
index db9d112199234..bf74ca81ced8b 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 63a716339237d..0000000000000
--- 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 05722f141edd5..181e3bf134fb8 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/irker/default.nix b/pkgs/servers/irker/default.nix
index 6ad233593a3b1..002760ff0fd3b 100644
--- a/pkgs/servers/irker/default.nix
+++ b/pkgs/servers/irker/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1hslwqa0gqsnl3l6hd5hxpn0wlachxd51infifhlwhyhd6iwgx8p";
   };
 
-  nativeBuildInputs = [ pkgconfig xmlto docbook2x ];
+  nativeBuildInputs = [ pkgconfig xmlto docbook2x docbook_xsl docbook_xml_dtd_412 ];
 
   buildInputs = [
     python
@@ -21,10 +21,6 @@ stdenv.mkDerivation rec {
     # python.pkgs.pysocks
   ];
 
-  preBuild = ''
-    export XML_CATALOG_FILES='${docbook_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xml_dtd_412}/xml/dtd/docbook/catalog.xml'
-  '';
-
   postPatch = ''
     substituteInPlace Makefile \
       --replace '-o 0 -g 0' ""
diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix
index ab1808c064770..e2d1f448b321d 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 623f0a2b0e22d..b63390bb2474a 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 5e5170afbc79c..5e87a1fb09952 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 c92507b4167d5..bf1a1e782a5a0 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/memcached/default.nix b/pkgs/servers/memcached/default.nix
index fabd5b83724b4..c625ce575f2e9 100644
--- a/pkgs/servers/memcached/default.nix
+++ b/pkgs/servers/memcached/default.nix
@@ -1,11 +1,12 @@
 {stdenv, fetchurl, cyrus_sasl, libevent}:
 
 stdenv.mkDerivation rec {
-  name = "memcached-1.4.39";
+  version = "1.5.4";
+  name = "memcached-${version}";
 
   src = fetchurl {
     url = "http://memcached.org/files/${name}.tar.gz";
-    sha256 = "0dfpmx0fqgp55j4vl06cz63fwx5kzhzipdm7n2kxjkvyg1ybzi13";
+    sha256 = "1m03fhzq1f9byk2agccsr0x458niqqjpips5mbcgzhm4kylczhz0";
   };
 
   buildInputs = [cyrus_sasl libevent];
diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix
index 9ef0987d9b96f..354b4d5796016 100644
--- a/pkgs/servers/nosql/redis/default.nix
+++ b/pkgs/servers/nosql/redis/default.nix
@@ -1,22 +1,14 @@
-{ stdenv, fetchurl, fetchpatch, lua }:
+{ stdenv, fetchurl, lua }:
 
 stdenv.mkDerivation rec {
-  version = "4.0.2";
+  version = "4.0.6";
   name = "redis-${version}";
 
   src = fetchurl {
     url = "http://download.redis.io/releases/${name}.tar.gz";
-    sha256 = "04s8cgvwjj1979s3hg8zkwc9pyn3jkjpz5zidp87kfcipifr385i";
+    sha256 = "1ypnwmxwm49l0b8i9swcbjdxnc6f0r9zyqm2h423wz13xilmv6vn";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "CVE-2017-15047.patch";
-      url = https://github.com/antirez/redis/commit/ffcf7d5ab1e98d84c28af9bea7be76c6737820ad.patch;
-      sha256 = "0cgx3lm0n7jxhsly8v9hdvy6vlamj3ck2jsid4fwyapz6907h64l";
-    })
-  ];
-
   buildInputs = [ lua ];
   makeFlags = "PREFIX=$(out)";
 
diff --git a/pkgs/servers/osrm-backend/default.nix b/pkgs/servers/osrm-backend/default.nix
index 7ade52b2ee79e..fa8e7d087cca6 100644
--- a/pkgs/servers/osrm-backend/default.nix
+++ b/pkgs/servers/osrm-backend/default.nix
@@ -2,16 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "osrm-backend-${version}";
-  version = "5.14.1";
+  version = "5.14.3";
 
   src = fetchFromGitHub {
     rev = "v${version}";
     owner  = "Project-OSRM";
     repo   = "osrm-backend";
-    sha256 = "0n7fpm8m5r93dxciagp2n8ij1wg483yb9srbzdzjqf1zzyh637sz";
+    sha256 = "1ajgybjx7g6qzddavab8bj7il7wn5wy24nivjj5rk84mfbi71s5v";
   };
 
-  buildInputs = [ cmake pkgconfig bzip2 libxml2 libzip boost lua luabind tbb expat];
+  nativeBuildInputs = [ cmake pkgconfig ];
+  buildInputs = [ bzip2 libxml2 libzip boost lua luabind tbb expat ];
 
   postInstall = "mkdir -p $out/share/osrm-backend && cp -r ../profiles $out/share/osrm-backend/profiles";
 
diff --git a/pkgs/servers/sql/mariadb/cmake-includedir.patch b/pkgs/servers/sql/mariadb/cmake-includedir.patch
new file mode 100644
index 0000000000000..0c4fe7d321e22
--- /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 d6731a5b7dc39..66125b3537836 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 28e7824cd4235..8f6ccd8c0d5bb 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 687993e0dc577..0b27782187601 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/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
index cf3349dc1660a..cffdbb9692808 100644
--- a/pkgs/servers/sql/postgresql/default.nix
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -91,33 +91,33 @@ let
 in {
 
   postgresql93 = common {
-    version = "9.3.19";
+    version = "9.3.20";
     psqlSchema = "9.3";
-    sha256 = "1d9gmi1psg4aa6h6ylvsrdm5jnnb7p36pn4h2qrvl9z9v4n8g7pv";
+    sha256 = "1jp6lac4b0q6hb28yrdsl0ymzn75gg59hvp5zasarf3mf3b8l4zb";
   };
 
   postgresql94 = common {
-    version = "9.4.14";
+    version = "9.4.15";
     psqlSchema = "9.4";
-    sha256 = "0szc0navrcjnpyafw2sai8cmwr3znsy0w6031lv7n1ab20xg4zcf";
+    sha256 = "1i5c67gg4fj38hk07h6w6m4mqak84bhnblqsjbpiamg4x33v7gqj";
   };
 
   postgresql95 = common {
-    version = "9.5.9";
+    version = "9.5.10";
     psqlSchema = "9.5";
-    sha256 = "1m6d4y3m3ir20dzl6q3s3yvmr0a7hq3si2v1hg5hanmbck3db379";
+    sha256 = "10gjfn16bhzkmlqfsn384w49db0j39bg3n4majwxdpjd17g7lpcl";
   };
 
   postgresql96 = common {
-    version = "9.6.5";
+    version = "9.6.6";
     psqlSchema = "9.6";
-    sha256 = "0k3ls2x182jz6djjiqj9kycddabdl2gk1y1ajq1vipnxwfki5nh6";
+    sha256 = "0m417h30s18rwa7yzkqqcdb22ifpcda2fpg2cyx8bxvjp3ydz71r";
   };
 
   postgresql100 = common {
-    version = "10.0";
+    version = "10.1";
     psqlSchema = "10.0";
-    sha256 = "1lbzwpmdxmk5bh0ix0rn72qbd52dq5cb55nzajscb0bvwa95abvi";
+    sha256 = "04z7lm4h94625vbncwv98svycqr942n3q47ailqaczkszqjlxjrw";
   };
 
 }
diff --git a/pkgs/servers/traefik/default.nix b/pkgs/servers/traefik/default.nix
index d0d0efa9aa6de..ebc08b745c637 100644
--- a/pkgs/servers/traefik/default.nix
+++ b/pkgs/servers/traefik/default.nix
@@ -2,7 +2,7 @@
 
 buildGoPackage rec {
   name = "traefik-${version}";
-  version = "1.4.4";
+  version = "1.4.6";
 
   goPackagePath = "github.com/containous/traefik";
 
@@ -10,7 +10,7 @@ buildGoPackage rec {
     owner = "containous";
     repo = "traefik";
     rev = "v${version}";
-    sha256 = "114861v8kg77zwnf742n25h7c4fly3i52inqx1kcpqs074rqm1wn";
+    sha256 = "1sd7wfp1hvq505lgybbaiq9d1hyygzf5jgl0qidn103xnf1yqaw0";
   };
 
   buildInputs = [ go-bindata bash ];
diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix
index 921708f2fd3f3..4614a9768b054 100644
--- a/pkgs/servers/uwsgi/default.nix
+++ b/pkgs/servers/uwsgi/default.nix
@@ -4,7 +4,7 @@
 , pam, withPAM ? false
 , systemd, withSystemd ? false
 , python2, python3, ncurses
-, ruby, php-embed
+, ruby, php-embed, mysql
 }:
 
 let pythonPlugin = pkg : lib.nameValuePair "python${if pkg ? isPy2 then "2" else "3"}" {
@@ -34,6 +34,7 @@ let pythonPlugin = pkg : lib.nameValuePair "python${if pkg ? isPy2 then "2" else
                     # usage: https://uwsgi-docs.readthedocs.io/en/latest/PHP.html#running-php-apps-with-nginx
                     path = "plugins/php";
                     inputs = [ php-embed ] ++ php-embed.buildInputs;
+                    NIX_CFLAGS_LINK = [ "-L${mysql.connector-c}/lib/mysql" ];
                   })
                 ];
 
@@ -88,7 +89,7 @@ stdenv.mkDerivation rec {
     ${lib.concatMapStringsSep "\n" (x: x.install or "") needed}
   '';
 
-  NIX_CFLAGS_LINK = [ "-lsystemd" ];
+  NIX_CFLAGS_LINK = [ "-lsystemd" ] ++ lib.concatMap (x: x.NIX_CFLAGS_LINK or []) needed;
 
   meta = with stdenv.lib; {
     homepage = http://uwsgi-docs.readthedocs.org/en/latest/;
diff --git a/pkgs/servers/web-apps/frab/Gemfile.lock b/pkgs/servers/web-apps/frab/Gemfile.lock
index 530c54ebd898c..06502ef59ad51 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 9f881579f42de..449fbf1a5b6b3 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/web-apps/searx/default.nix b/pkgs/servers/web-apps/searx/default.nix
index 1c5f52d4938ec..28eeeb1125910 100644
--- a/pkgs/servers/web-apps/searx/default.nix
+++ b/pkgs/servers/web-apps/searx/default.nix
@@ -1,34 +1,43 @@
 { lib, pythonPackages, fetchFromGitHub }:
 
-pythonPackages.buildPythonApplication rec {
-  name = "searx-${version}";
-  version = "0.12.0";
-  namePrefix = "";
+with pythonPackages;
 
+buildPythonApplication rec {
+  pname = "searx";
+  version = "0.13.1";
+
+  # Can not use PyPI because certain test files are missing.
   src = fetchFromGitHub {
     owner = "asciimoo";
     repo = "searx";
     rev = "v${version}";
-    sha256 = "196lk8dpv8fsjgmwlqik6j6rabvfid41fir6lzqy03hv7ydcw1k0";
+    sha256 = "0nizxq9ggf9g8f8pxn2hfm0kn20356v65h4cj9s73n742nkv6ani";
   };
 
   postPatch = ''
     substituteInPlace requirements.txt \
-      --replace 'certifi==2017.1.23' 'certifi' \
-      --replace 'lxml==3.7.3' 'lxml' \
-      --replace 'pyopenssl==16.2.0' 'pyopenssl' \
+      --replace 'certifi==2017.11.5' 'certifi' \
+      --replace 'flask==0.12.2' 'flask==0.12.*' \
+      --replace 'flask-babel==0.11.2' 'flask-babel==0.11.*' \
+      --replace 'lxml==4.1.1' 'lxml==4.1.*' \
+      --replace 'idna==2.5' 'idna' \
       --replace 'pygments==2.1.3' 'pygments>=2.1,<3.0' \
-      --replace 'flask==0.12' 'flask==0.12.*' \
-      --replace 'requests[socks]==2.13.0' 'requests[socks]==2.*' \
-      --replace 'python-dateutil==2.6.0' 'python-dateutil==2.6.*'
+      --replace 'pyopenssl==17.4.0' 'pyopenssl' \
+      --replace 'python-dateutil==2.6.1' 'python-dateutil==2.6.*'
   '';
 
-  propagatedBuildInputs = with pythonPackages; [
+  propagatedBuildInputs = [
     pyyaml lxml grequests flaskbabel flask requests
     gevent speaklater Babel pytz dateutil pygments
     pyasn1 pyasn1-modules ndg-httpsclient certifi pysocks
   ];
 
+  checkInputs = [ splinter mock plone-testing robotsuite unittest2 ];
+
+  preCheck = ''
+    rm tests/test_robot.py # A variable that is imported is commented out
+  '';
+
   meta = with lib; {
     homepage = https://github.com/asciimoo/searx;
     description = "A privacy-respecting, hackable metasearch engine";
diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh
index bb3e5ac428328..5a832cb14d539 100644
--- a/pkgs/servers/x11/xorg/builder.sh
+++ b/pkgs/servers/x11/xorg/builder.sh
@@ -16,13 +16,8 @@ postInstall() {
 
     echo "propagating requisites $requires"
 
-    if test -n "$crossConfig"; then
-        local pkgs=("${crossPkgs[@]}")
-    else
-        local pkgs=("${nativePkgs[@]}")
-    fi
     for r in $requires; do
-        for p in "${pkgs[@]}"; do
+        for p in "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}"; do
             if test -e $p/lib/pkgconfig/$r.pc; then
                 echo "  found requisite $r in $p"
                 propagatedBuildInputs+=" $p"
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index d1c7c81c101ef..cc2cade8ba135 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 4ea77fee44310..dd48748dceb3c 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/shells/bash/4.4.nix b/pkgs/shells/bash/4.4.nix
index b4a2ba5538816..5635c6a73bedf 100644
--- a/pkgs/shells/bash/4.4.nix
+++ b/pkgs/shells/bash/4.4.nix
@@ -68,10 +68,10 @@ stdenv.mkDerivation rec {
   ];
 
   # Note: Bison is needed because the patches above modify parse.y.
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [bison]
     ++ optional (texinfo != null) texinfo
-    ++ optional hostPlatform.isDarwin binutils
-    ++ optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc;
+    ++ optional hostPlatform.isDarwin binutils;
 
   buildInputs = optional interactive readline70;
 
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 1a55b06ef3674..f7d2c49a66d68 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -74,8 +74,7 @@ rec {
     };
   in stdenv // {
     mkDerivation =
-      { buildInputs ? [], nativeBuildInputs ? []
-      , propagatedBuildInputs ? [], propagatedNativeBuildInputs ? []
+      { nativeBuildInputs ? []
       , selfNativeBuildInput ? args.crossAttrs.selfNativeBuildInput or false
       , ...
       } @ args:
@@ -98,14 +97,6 @@ rec {
             ++ stdenv.lib.optional hostPlatform.isAarch64 pkgs.updateAutotoolsGnuConfigScriptsHook
             ;
 
-          # Cross-linking dynamic libraries, every buildInput should
-          # be propagated because ld needs the -rpath-link to find
-          # any library needed to link the program dynamically at
-          # loader time. ld(1) explains it.
-          buildInputs = [];
-          propagatedBuildInputs = propagatedBuildInputs ++ buildInputs;
-          propagatedNativeBuildInputs = propagatedNativeBuildInputs;
-
           crossConfig = hostPlatform.config;
         } // args.crossAttrs or {});
   };
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index d202186c29b24..2542d2428859f 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/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index eb8545c6999e9..2d702ab389e62 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -14,11 +14,27 @@ rec {
   mkDerivation =
     { name ? ""
 
-    , nativeBuildInputs ? []
-    , buildInputs ? []
+    # These types of dependencies are all exhaustively documented in
+    # the "Specifying Dependencies" section of the "Standard
+    # Environment" chapter of the Nixpkgs manual.
 
-    , propagatedNativeBuildInputs ? []
-    , propagatedBuildInputs ? []
+    # TODO(@Ericson2314): Stop using legacy dep attribute names
+
+    #                           host offset -> target offset
+    , depsBuildBuild              ? [] # -1 -> -1
+    , depsBuildBuildPropagated    ? [] # -1 -> -1
+    , nativeBuildInputs           ? [] # -1 ->  0  N.B. Legacy name
+    , propagatedNativeBuildInputs ? [] # -1 ->  0  N.B. Legacy name
+    , depsBuildTarget             ? [] # -1 ->  1
+    , depsBuildTargetPropagated   ? [] # -1 ->  1
+
+    , depsHostHost                ? [] #  0 ->  0
+    , depsHostHostPropagated      ? [] #  0 ->  0
+    , buildInputs                 ? [] #  0 ->  1  N.B. Legacy name
+    , propagatedBuildInputs       ? [] #  0 ->  1  N.B. Legacy name
+
+    , depsTargetTarget            ? [] #  1 ->  1
+    , depsTargetTargetPropagated  ? [] #  1 ->  1
 
     , configureFlags ? []
     , # Target is not included by default because most programs don't care.
@@ -56,15 +72,35 @@ rec {
       inherit erroneousHardeningFlags hardeningDisable hardeningEnable supportedHardeningFlags;
     })
     else let
-      dependencies = map lib.chooseDevOutputs [
-        (map (drv: drv.nativeDrv or drv) nativeBuildInputs
-           ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh
-           ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh)
-        (map (drv: drv.crossDrv or drv) buildInputs)
+      dependencies = map (map lib.chooseDevOutputs) [
+        [
+          (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuild)
+          (map (drv: drv.nativeDrv or drv) nativeBuildInputs
+             ++ lib.optional separateDebugInfo ../../build-support/setup-hooks/separate-debug-info.sh
+             ++ lib.optional stdenv.hostPlatform.isWindows ../../build-support/setup-hooks/win-dll-link.sh)
+          (map (drv: drv.__spliced.buildTarget or drv) depsBuildTarget)
+        ]
+        [
+          (map (drv: drv.__spliced.hostHost or drv) depsHostHost)
+          (map (drv: drv.crossDrv or drv) buildInputs)
+        ]
+        [
+          (map (drv: drv.__spliced.targetTarget or drv) depsTargetTarget)
+        ]
       ];
-      propagatedDependencies = map lib.chooseDevOutputs [
-        (map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs)
-        (map (drv: drv.crossDrv or drv) propagatedBuildInputs)
+      propagatedDependencies = map (map lib.chooseDevOutputs) [
+        [
+          (map (drv: drv.__spliced.buildBuild or drv) depsBuildBuildPropagated)
+          (map (drv: drv.nativeDrv or drv) propagatedNativeBuildInputs)
+          (map (drv: drv.__spliced.buildTarget or drv) depsBuildTargetPropagated)
+        ]
+        [
+          (map (drv: drv.__spliced.hostHost or drv) depsHostHostPropagated)
+          (map (drv: drv.crossDrv or drv) propagatedBuildInputs)
+        ]
+        [
+          (map (drv: drv.__spliced.targetTarget or drv) depsTargetTargetPropagated)
+        ]
       ];
 
       outputs' =
@@ -105,11 +141,19 @@ rec {
           userHook = config.stdenv.userHook or null;
           __ignoreNulls = true;
 
-          nativeBuildInputs = lib.elemAt dependencies 0;
-          buildInputs = lib.elemAt dependencies 1;
+          depsBuildBuild              = lib.elemAt (lib.elemAt dependencies 0) 0;
+          nativeBuildInputs           = lib.elemAt (lib.elemAt dependencies 0) 1;
+          depsBuildTarget             = lib.elemAt (lib.elemAt dependencies 0) 2;
+          depsHostBuild               = lib.elemAt (lib.elemAt dependencies 1) 0;
+          buildInputs                 = lib.elemAt (lib.elemAt dependencies 1) 1;
+          depsTargetTarget            = lib.elemAt (lib.elemAt dependencies 2) 0;
 
-          propagatedNativeBuildInputs = lib.elemAt propagatedDependencies 0;
-          propagatedBuildInputs = lib.elemAt propagatedDependencies 1;
+          depsBuildBuildPropagated    = lib.elemAt (lib.elemAt propagatedDependencies 0) 0;
+          propagatedNativeBuildInputs = lib.elemAt (lib.elemAt propagatedDependencies 0) 1;
+          depsBuildTargetPropagated   = lib.elemAt (lib.elemAt propagatedDependencies 0) 2;
+          depsHostBuildPropagated     = lib.elemAt (lib.elemAt propagatedDependencies 1) 0;
+          propagatedBuildInputs       = lib.elemAt (lib.elemAt propagatedDependencies 1) 1;
+          depsTargetTargetPropagated  = lib.elemAt (lib.elemAt propagatedDependencies 2) 0;
 
           # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
           configureFlags = let inherit (lib) optional elem; in
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 686ed68cedebd..d2c67cce81a29 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -300,11 +300,83 @@ runHook preHook
 runHook addInputsHook
 
 
-# Recursively find all build inputs.
+# Package accumulators
+
+# shellcheck disable=SC2034
+declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
+declare -a pkgsHostHost pkgsHostTarget
+declare -a pkgsTargetTarget
+
+declare -ra pkgBuildAccumVars=(pkgsBuildBuild pkgsBuildHost pkgsBuildTarget)
+declare -ra pkgHostAccumVars=(pkgsHostHost pkgsHostTarget)
+declare -ra pkgTargetAccumVars=(pkgsTargetTarget)
+
+declare -ra pkgAccumVarVars=(pkgBuildAccumVars pkgHostAccumVars pkgTargetAccumVars)
+
+
+# Hooks
+
+declare -a envBuildBuildHooks envBuildHostHooks envBuildTargetHooks
+declare -a envHostHostHooks envHostTargetHooks
+declare -a envTargetTargetHooks
+
+declare -ra pkgBuildHookVars=(envBuildBuildHook envBuildHostHook envBuildTargetHook)
+declare -ra pkgHostHookVars=(envHostHostHook envHostTargetHook)
+declare -ra pkgTargetHookVars=(envTargetTargetHook)
+
+declare -ra pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)
+
+# Add env hooks for all sorts of deps with the specified host offset.
+addEnvHooks() {
+    local depHostOffset="$1"
+    shift
+    local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"
+    local pkgHookVar
+    for pkgHookVar in "${!pkgHookVarsSlice}"; do
+        eval "${pkgHookVar}s"'+=("$@")'
+    done
+}
+
+
+# Propagated dep files
+
+declare -ra propagatedBuildDepFiles=(
+    propagated-build-build-deps
+    propagated-native-build-inputs # Legacy name for back-compat
+    propagated-build-target-deps
+)
+declare -ra propagatedHostDepFiles=(
+    propagated-host-host-deps
+    propagated-build-inputs # Legacy name for back-compat
+)
+declare -ra propagatedTargetDepFiles=(
+    propagated-target-target-deps
+)
+declare -ra propagatedDepFilesVars=(
+    propagatedBuildDepFiles
+    propagatedHostDepFiles
+    propagatedTargetDepFiles
+)
+
+# Platform offsets: build = -1, host = 0, target = 1
+declare -ra allPlatOffsets=(-1 0 1)
+
+
+# Mutually-recursively find all build inputs. See the dependency section of the
+# stdenv chapter of the Nixpkgs manual for the specification this algorithm
+# implements.
 findInputs() {
-    local pkg="$1"; shift
-    local var="$1"; shift
-    local propagatedBuildInputsFiles=("$@")
+    local -r pkg="$1"
+    local -ri hostOffset="$2"
+    local -ri targetOffset="$3"
+
+    # Sanity check
+    (( "$hostOffset" <= "$targetOffset" )) || exit -1
+
+    local varVar="${pkgAccumVarVars[$hostOffset + 1]}"
+    local varRef="$varVar[\$targetOffset - \$hostOffset]"
+    local var="${!varRef}"
+    unset -v varVar varRef
 
     # TODO(@Ericson2314): Restore using associative array once Darwin
     # nix-shell doesn't use impure bash. This should replace the O(n)
@@ -324,21 +396,106 @@ findInputs() {
         exit 1
     fi
 
-    local file
-    for file in "${propagatedBuildInputsFiles[@]}"; do
-        file="$pkg/nix-support/$file"
-        [[ -f "$file" ]] || continue
-
-        local pkgNext
-        for pkgNext in $(< "$file"); do
-            findInputs "$pkgNext" "$var" "${propagatedBuildInputsFiles[@]}"
+    # The current package's host and target offset together
+    # provide a <=-preserving homomorphism from the relative
+    # offsets to current offset
+    function mapOffset() {
+        local -ri inputOffset="$1"
+        if (( "$inputOffset" <= 0 )); then
+            local -ri outputOffset="$inputOffset + $hostOffset"
+        else
+            local -ri outputOffset="$inputOffset - 1 + $targetOffset"
+        fi
+        echo "$outputOffset"
+    }
+
+    # Host offset relative to that of the package whose immediate
+    # dependencies we are currently exploring.
+    local -i relHostOffset
+    for relHostOffset in "${allPlatOffsets[@]}"; do
+        # `+ 1` so we start at 0 for valid index
+        local files="${propagatedDepFilesVars[$relHostOffset + 1]}"
+
+        # Host offset relative to the package currently being
+        # built---as absolute an offset as will be used.
+        local -i hostOffsetNext
+        hostOffsetNext="$(mapOffset relHostOffset)"
+
+        # Ensure we're in bounds relative to the package currently
+        # being built.
+        [[ "${allPlatOffsets[*]}" = *"$hostOffsetNext"*  ]] || continue
+
+        # Target offset relative to the *host* offset of the package
+        # whose immediate dependencies we are currently exploring.
+        local -i relTargetOffset
+        for relTargetOffset in "${allPlatOffsets[@]}"; do
+            (( "$relHostOffset" <= "$relTargetOffset" )) || continue
+
+            local fileRef="${files}[$relTargetOffset - $relHostOffset]"
+            local file="${!fileRef}"
+            unset -v fileRef
+
+            # Target offset relative to the package currently being
+            # built.
+            local -i targetOffsetNext
+            targetOffsetNext="$(mapOffset relTargetOffset)"
+
+            # Once again, ensure we're in bounds relative to the
+            # package currently being built.
+            [[ "${allPlatOffsets[*]}" = *"$targetOffsetNext"* ]] || continue
+
+            [[ -f "$pkg/nix-support/$file" ]] || continue
+
+            local pkgNext
+            for pkgNext in $(< "$pkg/nix-support/$file"); do
+                findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"
+            done
         done
     done
 }
 
+# Make sure all are at least defined as empty
+: ${depsBuildBuild=} ${depsBuildBuildPropagated=}
+: ${nativeBuildInputs=} ${propagatedNativeBuildInputs=} ${defaultNativeBuildInputs=}
+: ${depsBuildTarget=} ${depsBuildTargetPropagated=}
+: ${depsHostHost=} ${depsHostHostPropagated=}
+: ${buildInputs=} ${propagatedBuildInputs=} ${defaultBuildInputs=}
+: ${depsTargetTarget=} ${depsTargetTargetPropagated=}
+
+for pkg in $depsBuildBuild $depsBuildBuildPropagated; do
+    findInputs "$pkg" -1 -1
+done
+for pkg in $nativeBuildInputs $propagatedNativeBuildInputs; do
+    findInputs "$pkg" -1  0
+done
+for pkg in $depsBuildTarget $depsBuildTargetPropagated; do
+    findInputs "$pkg" -1  1
+done
+for pkg in $depsHostHost $depsHostHostPropagated; do
+    findInputs "$pkg"  0  0
+done
+for pkg in $buildInputs $propagatedBuildInputs ; do
+    findInputs "$pkg"  0  1
+done
+for pkg in $depsTargetTarget $depsTargetTargetPropagated; do
+    findInputs "$pkg"  1  1
+done
+# Default inputs must be processed last
+for pkg in $defaultNativeBuildInputs; do
+    findInputs "$pkg" -1  0
+done
+for pkg in $defaultBuildInputs; do
+    findInputs "$pkg"  0  1
+done
+
 # Add package to the future PATH and run setup hooks
 activatePackage() {
     local pkg="$1"
+    local -ri hostOffset="$2"
+    local -ri targetOffset="$3"
+
+    # Sanity check
+    (( "$hostOffset" <= "$targetOffset" )) || exit -1
 
     if [ -f "$pkg" ]; then
         local oldOpts="$(shopt -po nounset)"
@@ -347,11 +504,18 @@ activatePackage() {
         eval "$oldOpts"
     fi
 
-    if [ -d "$pkg/bin" ]; then
+    # Only dependencies whose host platform is guaranteed to match the
+    # build platform are included here. That would be `depsBuild*`,
+    # and legacy `nativeBuildInputs`, in general. If we aren't cross
+    # compiling, however, everything can be put on the PATH. To ease
+    # the transition, we do include everything in thatcase.
+    #
+    # TODO(@Ericson2314): Don't special-case native compilation
+    if [[ ( -z "${crossConfig-}" ||  "$hostOffset" -le -1 ) && -d "$pkg/bin" ]]; then
         addToSearchPath _PATH "$pkg/bin"
     fi
 
-    if [ -f "$pkg/nix-support/setup-hook" ]; then
+    if [[ -f "$pkg/nix-support/setup-hook" ]]; then
         local oldOpts="$(shopt -po nounset)"
         set +u
         source "$pkg/nix-support/setup-hook"
@@ -359,67 +523,72 @@ activatePackage() {
     fi
 }
 
-declare -a nativePkgs crossPkgs
-if [ -z "${crossConfig:-}" ]; then
-    # Not cross-compiling - both buildInputs (and variants like propagatedBuildInputs)
-    # are handled identically to nativeBuildInputs
-    for i in ${nativeBuildInputs:-} ${buildInputs:-} \
-             ${defaultNativeBuildInputs:-} ${defaultBuildInputs:-} \
-             ${propagatedNativeBuildInputs:-} ${propagatedBuildInputs:-}; do
-        findInputs "$i" nativePkgs propagated-native-build-inputs propagated-build-inputs
-    done
-else
-    for i in ${nativeBuildInputs:-} ${defaultNativeBuildInputs:-} ${propagatedNativeBuildInputs:-}; do
-        findInputs "$i" nativePkgs propagated-native-build-inputs
-    done
-    for i in ${buildInputs:-} ${defaultBuildInputs:-} ${propagatedBuildInputs:-}; do
-        findInputs "$i" crossPkgs propagated-build-inputs
+_activatePkgs() {
+    local -i hostOffset targetOffset
+    local pkg
+
+    for hostOffset in "${allPlatOffsets[@]}"; do
+        local pkgsVar="${pkgAccumVarVars[$hostOffset + 1]}"
+        for targetOffset in "${allPlatOffsets[@]}"; do
+            (( "$hostOffset" <= "$targetOffset" )) || continue
+            local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"
+            local pkgsSlice="${!pkgsRef}[@]"
+            for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
+                activatePackage "$pkg" "$hostOffset" "$targetOffset"
+            done
+        done
     done
-fi
-
-for i in ${nativePkgs+"${nativePkgs[@]}"} ${crossPkgs+"${crossPkgs[@]}"}; do
-    activatePackage "$i"
-done
+}
 
+# Run the package setup hooks and build _PATH
+_activatePkgs
 
 # Set the relevant environment variables to point to the build inputs
 # found above.
 #
-# These `depOffset`s tell the env hook what sort of dependency
-# (ignoring propagatedness) is being passed to the env hook. In a real
-# language, we'd append a closure with this information to the
-# relevant env hook array, but bash doesn't have closures, so it's
-# easier to just pass this in.
-
-_addToNativeEnv() {
-    local pkg="$1"
-    if [[ -n "${crossConfig:-}" ]]; then
-        local -i depOffset=-1
-    else
-        local -i depOffset=0
-    fi
-
-    # Run the package-specific hooks set by the setup-hook scripts.
-    runHook envHook "$pkg"
-}
-
-# Old bash empty array hack
-for i in ${nativePkgs+"${nativePkgs[@]}"}; do
-    _addToNativeEnv "$i"
-done
-
-_addToCrossEnv() {
-    local pkg="$1"
-    local -i depOffset=0
-
-    # Run the package-specific hooks set by the setup-hook scripts.
-    runHook crossEnvHook "$pkg"
+# These `depOffset`s, beyond indexing the arrays, also tell the env
+# hook what sort of dependency (ignoring propagatedness) is being
+# passed to the env hook. In a real language, we'd append a closure
+# with this information to the relevant env hook array, but bash
+# doesn't have closures, so it's easier to just pass this in.
+_addToEnv() {
+    local -i depHostOffset depTargetOffset
+    local pkg
+
+    for depHostOffset in "${allPlatOffsets[@]}"; do
+        local hookVar="${pkgHookVarVars[$depHostOffset + 1]}"
+        local pkgsVar="${pkgAccumVarVars[$depHostOffset + 1]}"
+        for depTargetOffset in "${allPlatOffsets[@]}"; do
+            (( "$depHostOffset" <= "$depTargetOffset" )) || continue
+            local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
+            if [[ -z "${crossConfig-}" ]]; then
+                # Apply environment hooks to all packages during native
+                # compilation to ease the transition.
+                #
+                # TODO(@Ericson2314): Don't special-case native compilation
+                for pkg in \
+                    ${pkgsBuildBuild+"${pkgsBuildBuild[@]}"} \
+                    ${pkgsBuildHost+"${pkgsBuildHost[@]}"} \
+                    ${pkgsBuildTarget+"${pkgsBuildTarget[@]}"} \
+                    ${pkgsHostHost+"${pkgsHostHost[@]}"} \
+                    ${pkgsHostTarget+"${pkgsHostTarget[@]}"} \
+                    ${pkgsTargetTarget+"${pkgsTargetTarget[@]}"}
+                do
+                    runHook "${!hookRef}" "$pkg"
+                done
+            else
+                local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"
+                local pkgsSlice="${!pkgsRef}[@]"
+                for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
+                    runHook "${!hookRef}" "$pkg"
+                done
+            fi
+        done
+    done
 }
 
-# Old bash empty array hack
-for i in ${crossPkgs+"${crossPkgs[@]}"}; do
-    _addToCrossEnv "$i"
-done
+# Run the package-specific hooks set by the setup-hook scripts.
+_addToEnv
 
 
 _addRpathPrefix "$out"
@@ -882,6 +1051,7 @@ installPhase() {
 # propagated-build-inputs.
 fixupPhase() {
     # Make sure everything is writable so "strip" et al. work.
+    local output
     for output in $outputs; do
         if [ -e "${!output}" ]; then chmod -R u+w "${!output}"; fi
     done
@@ -895,19 +1065,35 @@ fixupPhase() {
     done
 
 
-    # Propagate build inputs and setup hook into the development output.
+    # Propagate dependencies & setup hook into the development output.
+    declare -ra flatVars=(
+        # Build
+        depsBuildBuildPropagated
+        propagatedNativeBuildInputs
+        depsBuildTargetPropagated
+        # Host
+        depsHostHostPropagated
+        propagatedBuildInputs
+        # Target
+        depsTargetTargetPropagated
+    )
+    declare -ra flatFiles=(
+        "${propagatedBuildDepFiles[@]}"
+        "${propagatedHostDepFiles[@]}"
+        "${propagatedTargetDepFiles[@]}"
+    )
 
-    if [ -n "${propagatedBuildInputs:-}" ]; then
-        mkdir -p "${!outputDev}/nix-support"
-        # shellcheck disable=SC2086
-        printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
-    fi
+    local propagatedInputsIndex
+    for propagatedInputsIndex in "${!flatVars[@]}"; do
+        local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"
+        local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"
+
+        [[ "${!propagatedInputsSlice}" ]] || continue
 
-    if [ -n "${propagatedNativeBuildInputs:-}" ]; then
         mkdir -p "${!outputDev}/nix-support"
         # shellcheck disable=SC2086
-        printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
-    fi
+        printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"
+    done
 
 
     if [ -n "${setupHook:-}" ]; then
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
index 8aaf4993108b4..ac1d57a227520 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
@@ -1,232 +1,16 @@
 {system ? builtins.currentSystem}:
 
-let buildFor = toolsArch: (
-
 let
-  lib = import ../../../lib;
-  pkgsFun = import ../../..;
-
-  inherit (lib.systems.examples)
-    sheevaplug raspberryPi armv7l-hf-multiplatform
-    aarch64-multiplatform scaleway-c1 pogoplug4;
-
-  selectedCrossSystem =
-    if toolsArch == "armv5tel" then sheevaplug else
-    if toolsArch == "scaleway" then scaleway-c1 else
-    if toolsArch == "pogoplug4" then pogoplug4 else
-    if toolsArch == "armv6l" then raspberryPi else
-    if toolsArch == "armv7l" then armv7l-hf-multiplatform else
-    if toolsArch == "aarch64" then aarch64-multiplatform else null;
-
-  pkgs = pkgsFun ({ inherit system; crossSystem = selectedCrossSystem; });
-
-  glibc = pkgs.libcCross;
-  bash = pkgs.bash;
-  findutils = pkgs.findutils;
-  diffutils = pkgs.diffutils;
-  gnused = pkgs.gnused;
-  gnugrep = pkgs.gnugrep;
-  gawk = pkgs.gawk;
-  gzip = pkgs.gzip;
-  bzip2 = pkgs.bzip2;
-  gnumake = pkgs.gnumake;
-  patch = pkgs.patch;
-  patchelf = pkgs.patchelf;
-  gcc = pkgs.gcc.cc;
-  gmpxx = pkgs.gmpxx;
-  mpfr = pkgs.mpfr;
-  zlib = pkgs.zlib;
-  libmpc = pkgs.libmpc;
-  binutils = pkgs.binutils;
-  libelf = pkgs.libelf;
-
-  # Keep these versions in sync with the versions used in the current GCC!
-  isl = pkgs.isl_0_14;
-in
-
-rec {
-
-
-  coreutilsMinimal = pkgs.coreutils.override (args: {
-    # We want coreutils without ACL/attr support.
-    aclSupport = false;
-    attrSupport = false;
-    # Our tooling currently can't handle scripts in bin/, only ELFs and symlinks.
-    singleBinary = "symlinks";
-  });
-
-  tarMinimal = pkgs.gnutar.override { acl = null; };
-
-  busyboxMinimal = pkgs.busybox.override {
-    useMusl = true;
-    enableStatic = true;
-    enableMinimal = true;
-    extraConfig = ''
-      CONFIG_ASH y
-      CONFIG_ASH_BUILTIN_ECHO y
-      CONFIG_ASH_BUILTIN_TEST y
-      CONFIG_ASH_OPTIMIZE_FOR_SIZE y
-      CONFIG_MKDIR y
-      CONFIG_TAR y
-      CONFIG_UNXZ y
-    '';
+  make = crossSystem: import ./make-bootstrap-tools.nix {
+    localSystem = { inherit system; };
+    inherit crossSystem;
   };
 
-  build =
-
-    pkgs.stdenv.mkDerivation {
-      name = "stdenv-bootstrap-tools-cross";
-      crossConfig = pkgs.hostPlatform.config;
-
-      nativeBuildInputs = [
-        pkgs.buildPackages.nukeReferences
-        pkgs.buildPackages.cpio
-      ];
-
-      buildCommand = ''
-        set -x
-        mkdir -p $out/bin $out/lib $out/libexec
-
-        # Copy what we need of Glibc.
-        cp -d ${glibc.out}/lib/ld-*.so* $out/lib
-        cp -d ${glibc.out}/lib/libc*.so* $out/lib
-        cp -d ${glibc.out}/lib/libc_nonshared.a $out/lib
-        cp -d ${glibc.out}/lib/libm*.so* $out/lib
-        cp -d ${glibc.out}/lib/libdl*.so* $out/lib
-        cp -d ${glibc.out}/lib/librt*.so*  $out/lib
-        cp -d ${glibc.out}/lib/libpthread*.so* $out/lib
-        cp -d ${glibc.out}/lib/libnsl*.so* $out/lib
-        cp -d ${glibc.out}/lib/libutil*.so* $out/lib
-        cp -d ${glibc.out}/lib/libnss*.so* $out/lib
-        cp -d ${glibc.out}/lib/libresolv*.so* $out/lib
-        cp -d ${glibc.out}/lib/crt?.o $out/lib
-
-        cp -rL ${glibc.dev}/include $out
-        chmod -R u+w "$out"
-
-        # glibc can contain linker scripts: find them, copy their deps,
-        # and get rid of absolute paths (nuke-refs would make them useless)
-        local lScripts=$(grep --files-with-matches --max-count=1 'GNU ld script' -R "$out/lib")
-        cp -d -t "$out/lib/" $(cat $lScripts | tr " " "\n" | grep -F '${glibc.out}' | sort -u)
-        for f in $lScripts; do
-          substituteInPlace "$f" --replace '${glibc.out}/lib/' ""
-        done
-
-        # Hopefully we won't need these.
-        rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
-        find $out/include -name .install -exec rm {} \;
-        find $out/include -name ..install.cmd -exec rm {} \;
-        mv $out/include $out/include-glibc
-
-        # Copy coreutils, bash, etc.
-        cp ${coreutilsMinimal}/bin/* $out/bin
-        (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
-
-        cp ${bash}/bin/bash $out/bin
-        cp ${findutils}/bin/find $out/bin
-        cp ${findutils}/bin/xargs $out/bin
-        cp -d ${diffutils}/bin/* $out/bin
-        cp -d ${gnused}/bin/* $out/bin
-        cp -d ${gnugrep}/bin/grep $out/bin
-        cp ${gawk}/bin/gawk $out/bin
-        cp -d ${gawk}/bin/awk $out/bin
-        cp ${tarMinimal}/bin/tar $out/bin
-        cp ${gzip}/bin/gzip $out/bin
-        cp ${bzip2.bin}/bin/bzip2 $out/bin
-        cp -d ${gnumake}/bin/* $out/bin
-        cp -d ${patch}/bin/* $out/bin
-        cp ${patchelf}/bin/* $out/bin
-
-        cp -d ${gnugrep.pcre.out}/lib/libpcre*.so* $out/lib # needed by grep
-
-        # Copy what we need of GCC.
-        cp -d ${gcc.out}/bin/gcc $out/bin
-        cp -d ${gcc.out}/bin/cpp $out/bin
-        cp -d ${gcc.out}/bin/g++ $out/bin
-        cp -d ${gcc.lib}/lib*/libgcc_s.so* $out/lib
-        cp -d ${gcc.lib}/lib*/libstdc++.so* $out/lib
-        cp -rd ${gcc.out}/lib/gcc $out/lib
-        chmod -R u+w $out/lib
-        rm -f $out/lib/gcc/*/*/include*/linux
-        rm -f $out/lib/gcc/*/*/include*/sound
-        rm -rf $out/lib/gcc/*/*/include*/root
-        rm -f $out/lib/gcc/*/*/include-fixed/asm
-        rm -rf $out/lib/gcc/*/*/plugin
-        #rm -f $out/lib/gcc/*/*/*.a
-        cp -rd ${gcc.out}/libexec/* $out/libexec
-        chmod -R u+w $out/libexec
-        rm -rf $out/libexec/gcc/*/*/plugin
-        mkdir $out/include
-        cp -rd ${gcc.out}/include/c++ $out/include
-        chmod -R u+w $out/include
-        rm -rf $out/include/c++/*/ext/pb_ds
-        rm -rf $out/include/c++/*/ext/parallel
-
-        cp -d ${gmpxx.out}/lib/libgmp*.so* $out/lib
-        cp -d ${mpfr.out}/lib/libmpfr*.so* $out/lib
-        cp -d ${libmpc.out}/lib/libmpc*.so* $out/lib
-        cp -d ${zlib.out}/lib/libz.so* $out/lib
-        cp -d ${libelf}/lib/libelf.so* $out/lib
-
-        # These needed for cross but not native tools because the stdenv
-        # GCC has certain things built in statically. See
-        # pkgs/stdenv/linux/default.nix for the details.
-        cp -d ${isl}/lib/libisl*.so* $out/lib
-
-        cp -d ${bzip2.out}/lib/libbz2.so* $out/lib
-
-        # Copy binutils.
-        for i in as ld ar ranlib nm strip readelf objdump; do
-          cp ${binutils.bintools.out}/bin/$i $out/bin
-        done
-
-        chmod -R u+w $out
-
-        # Strip executables even further.
-        for i in $out/bin/* $out/libexec/gcc/*/*/*; do
-            if test -x $i -a ! -L $i; then
-                chmod +w $i
-                $crossConfig-strip -s $i || true
-            fi
-        done
-
-        nuke-refs $out/bin/*
-        nuke-refs $out/lib/*
-        nuke-refs $out/libexec/gcc/*/*/*
-
-        mkdir $out/.pack
-        mv $out/* $out/.pack
-        mv $out/.pack $out/pack
-
-        mkdir $out/on-server
-        tar cvfJ $out/on-server/bootstrap-tools.tar.xz --hard-dereference --sort=name --numeric-owner --owner=0 --group=0 --mtime=@1 -C $out/pack .
-        cp ${busyboxMinimal}/bin/busybox $out/on-server
-        chmod u+w $out/on-server/busybox
-        nuke-refs $out/on-server/busybox
-      ''; # */
-
-      # The result should not contain any references (store paths) so
-      # that we can safely copy them out of the store and to other
-      # locations in the store.
-      allowedReferences = [];
-    };
-
-  dist = pkgs.stdenv.mkDerivation {
-    name = "stdenv-bootstrap-tools-cross";
-
-    buildCommand = ''
-      mkdir -p $out/nix-support
-      echo "file tarball ${build}/on-server/bootstrap-tools.tar.xz" >> $out/nix-support/hydra-build-products
-      echo "file busybox ${build}/on-server/busybox" >> $out/nix-support/hydra-build-products
-    '';
-  };
-}
-
-); in {
-    armv5tel = buildFor "armv5tel";
-    armv6l = buildFor "armv6l";
-    armv7l = buildFor "armv7l";
-    aarch64 = buildFor "aarch64";
-    scaleway = buildFor "scaleway";
-    pogoplug4 = buildFor "pogoplug4";
+in with (import ../../../lib).systems.examples; {
+  armv5tel  = make sheevaplug;
+  scaleway  = make scaleway-c1;
+  pogoplug4 = make pogoplug4;
+  armv6l    = make raspberryPi;
+  armv7l    = make armv7l-hf-multiplatform;
+  aarch64   = make aarch64-multiplatform;
 }
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index 15be64a22a925..f51a39d5820d3 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -1,8 +1,13 @@
-{ system ? builtins.currentSystem }:
+{ localSystem ? { system = builtins.currentSystem; }
+, crossSystem ? null
+}:
 
-with import ../../.. {inherit system;};
-
-rec {
+let
+  pkgs = import ../../.. { inherit localSystem crossSystem; };
+  glibc = if pkgs.hostPlatform != pkgs.buildPlatform
+          then pkgs.glibcCross
+          else pkgs.glibc;
+in with pkgs; rec {
 
 
   coreutilsMinimal = coreutils.override (args: {
@@ -35,7 +40,7 @@ rec {
     stdenv.mkDerivation {
       name = "stdenv-bootstrap-tools";
 
-      buildInputs = [nukeReferences cpio];
+      nativeBuildInputs = [ buildPackages.nukeReferences buildPackages.cpio ];
 
       buildCommand = ''
         set -x
@@ -118,10 +123,17 @@ rec {
 
         cp -d ${gmpxx.out}/lib/libgmp*.so* $out/lib
         cp -d ${mpfr.out}/lib/libmpfr*.so* $out/lib
-        cp -d ${libmpc}/lib/libmpc*.so* $out/lib
+        cp -d ${libmpc.out}/lib/libmpc*.so* $out/lib
         cp -d ${zlib.out}/lib/libz.so* $out/lib
         cp -d ${libelf}/lib/libelf.so* $out/lib
 
+      '' + lib.optionalString (hostPlatform != buildPlatform) ''
+        # These needed for cross but not native tools because the stdenv
+        # GCC has certain things built in statically. See
+        # pkgs/stdenv/linux/default.nix for the details.
+        cp -d ${isl_0_14.out}/lib/libisl*.so* $out/lib
+
+      '' + ''
         cp -d ${bzip2.out}/lib/libbz2.so* $out/lib
 
         # Copy binutils.
@@ -135,13 +147,14 @@ rec {
         for i in $out/bin/* $out/libexec/gcc/*/*/*; do
             if test -x $i -a ! -L $i; then
                 chmod +w $i
-                strip -s $i || true
+                $STRIP -s $i || true
             fi
         done
 
         nuke-refs $out/bin/*
         nuke-refs $out/lib/*
         nuke-refs $out/libexec/gcc/*/*/*
+        nuke-refs $out/lib/gcc/*/*/*
 
         mkdir $out/.pack
         mv $out/* $out/.pack
@@ -176,11 +189,14 @@ rec {
     bootstrapTools = runCommand "bootstrap-tools.tar.xz" {} "cp ${build}/on-server/bootstrap-tools.tar.xz $out";
   };
 
-  bootstrapTools = import ./bootstrap-tools { inherit system bootstrapFiles; };
+  bootstrapTools = import ./bootstrap-tools {
+    inherit (hostPlatform) system;
+    inherit bootstrapFiles;
+  };
 
   test = derivation {
     name = "test-bootstrap-tools";
-    inherit system;
+    inherit (hostPlatform) system;
     builder = bootstrapFiles.busybox;
     args = [ "ash" "-e" "-c" "eval \"$buildCommand\"" ];
 
diff --git a/pkgs/tools/admin/ansible/2.1.nix b/pkgs/tools/admin/ansible/2.1.nix
index d4a349c5e47d9..b8b335bd6186f 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 4ef35fa5d9ebe..ccca64b86b640 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/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix
index b0e142a6d1d0c..b6c7270a42505 100644
--- a/pkgs/tools/admin/awscli/default.nix
+++ b/pkgs/tools/admin/awscli/default.nix
@@ -25,14 +25,13 @@ let
   });
 
 in buildPythonPackage rec {
-  name = "${pname}-${version}";
   pname = "awscli";
-  version = "1.14.6";
+  version = "1.14.17";
   namePrefix = "";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1lhv8vb3bkjfjg4jm3hgfjssxgqy50gb6vbkh4lxiy8cn3y2dxp1";
+    sha256 = "456499acc41ab67671062a08e218a22aa1a1ff64ae531e694163d0371e8a1dd0";
   };
 
   # No tests included
diff --git a/pkgs/tools/audio/pnmixer/default.nix b/pkgs/tools/audio/pnmixer/default.nix
index 385021b7354a9..9906fa449dda3 100644
--- a/pkgs/tools/audio/pnmixer/default.nix
+++ b/pkgs/tools/audio/pnmixer/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, gettext, alsaLib, gtk3, glib, libnotify, libX11 }:
+{ stdenv, fetchFromGitHub, cmake, pkgconfig, gettext, alsaLib, gtk3, glib, libnotify, libX11, pcre }:
 
 stdenv.mkDerivation rec {
   name = "pnmixer-${version}";
-  version = "0.7.1";
+  version = "0.7.2";
 
   src = fetchFromGitHub {
     owner = "nicklan";
     repo = "pnmixer";
     rev = "v${version}";
-    sha256 = "0mmrq4m2rk0wmkfmqs3fk2rnw5g5lvd7ill2s3d7ggf9vba1pcn2";
+    sha256 = "0416pa933ddf4b7ph9zxhk5jppkk7ppcq1aqph6xsrfnka4yb148";
   };
 
   nativeBuildInputs = [ cmake pkgconfig gettext ];
 
-  buildInputs = [ alsaLib gtk3 glib libnotify libX11 ];
+  buildInputs = [ alsaLib gtk3 glib libnotify libX11 pcre ];
 
   meta = with stdenv.lib; {
     homepage = https://github.com/nicklan/pnmixer;
diff --git a/pkgs/tools/backup/bareos/default.nix b/pkgs/tools/backup/bareos/default.nix
index c325671383224..4af20f76449a6 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 5b1f8f3fd5cbf..da8805bc226e7 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/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix
index 87bb4923b8ad6..b8bf73fda648b 100644
--- a/pkgs/tools/graphics/zbar/default.nix
+++ b/pkgs/tools/graphics/zbar/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, imagemagickBig, pkgconfig, python2Packages, perl
 , libX11, libv4l, qt4, lzma, gtk2, fetchpatch, autoreconfHook
+, enableVideo ? stdenv.isLinux
 }:
 
 let
@@ -38,7 +39,12 @@ in stdenv.mkDerivation rec {
 
   buildInputs =
     [ imagemagickBig pkgconfig python pygtk perl libX11
-      libv4l qt4 lzma gtk2 autoreconfHook ];
+      lzma autoreconfHook ] ++
+    stdenv.lib.optionals enableVideo [ libv4l gtk2 qt4 ];
+
+  configureFlags = stdenv.lib.optionals (!enableVideo) [
+    "--disable-video" "--without-gtk" "--without-qt"
+  ];
 
   hardeningDisable = [ "fortify" ];
 
@@ -52,7 +58,7 @@ in stdenv.mkDerivation rec {
       Code.
     '';
     maintainers = with maintainers; [ raskin ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     license = licenses.lgpl21;
     homepage = http://zbar.sourceforge.net/;
   };
diff --git a/pkgs/tools/inputmethods/ibus/default.nix b/pkgs/tools/inputmethods/ibus/default.nix
index 3fd29d65f369f..f71a21b914f30 100644
--- a/pkgs/tools/inputmethods/ibus/default.nix
+++ b/pkgs/tools/inputmethods/ibus/default.nix
@@ -1,129 +1,138 @@
-{ stdenv, fetchurl, wrapGAppsHook
-, intltool, isocodes, pkgconfig
-, python3
-, gtk2, gtk3, atk, dconf, glib, json_glib
-, dbus, libnotify, gobjectIntrospection, wayland
-}:
+{ stdenv, fetchurl, fetchFromGitHub, autoreconfHook, gconf, intltool, makeWrapper, pkgconfig
+, vala, wrapGAppsHook, atk, dbus, dconf ? null, glib, gdk_pixbuf, gobjectIntrospection, gtk2
+, gtk3, gtk_doc, isocodes, python3, json_glib, libnotify ? null, enablePythonLibrary ? true
+, enableUI ? true, withWayland ? false, libxkbcommon ? null, wayland ? null }:
+
+assert withWayland -> wayland != null && libxkbcommon != null;
+
+with stdenv.lib;
 
 let
-  emojiData = let
-    srcs = {
-      data = fetchurl {
-        url = "http://unicode.org/Public/emoji/5.0/emoji-data.txt";
-        sha256 = "11jfz5rrvyc2ixliqfcjgmch4cn9mfy0x96qnpfcyz5fy1jvfyxf";
-      };
-      sequences = fetchurl {
-        url = "http://unicode.org/Public/emoji/5.0/emoji-sequences.txt";
-        sha256 = "09bii7f5mmladg0kl3n80fa9qaix6bv5ylm92x52j7wygzv0szb1";
-      };
-      variation-sequences = fetchurl {
-        url = "http://unicode.org/Public/emoji/5.0/emoji-variation-sequences.txt";
-        sha256 = "1wlg4gbq7spmpppjfy5zdl82sj0hc836p8gljgfrjmwsjgybq286";
-      };
-      zwj-sequences = fetchurl {
-        url = "http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt";
-        sha256 = "16gvzv76mjv9g81lm1m6cr3rpfqyn2k4hb9a62xd329252dhl25q";
-      };
-      test = fetchurl {
-        url = "http://unicode.org/Public/emoji/5.0/emoji-test.txt";
-        sha256 = "031qk2v8xdnba7hfinmgrmpglc9l8ll2hds6mw885p0hngdb3dgw";
-      };
+  emojiSrcs = {
+    data = fetchurl {
+      url = "http://unicode.org/Public/emoji/5.0/emoji-data.txt";
+      sha256 = "11jfz5rrvyc2ixliqfcjgmch4cn9mfy0x96qnpfcyz5fy1jvfyxf";
+    };
+    sequences = fetchurl {
+      url = "http://unicode.org/Public/emoji/5.0/emoji-sequences.txt";
+      sha256 = "09bii7f5mmladg0kl3n80fa9qaix6bv5ylm92x52j7wygzv0szb1";
+    };
+    variation-sequences = fetchurl {
+      url = "http://unicode.org/Public/emoji/5.0/emoji-variation-sequences.txt";
+      sha256 = "1wlg4gbq7spmpppjfy5zdl82sj0hc836p8gljgfrjmwsjgybq286";
+    };
+    zwj-sequences = fetchurl {
+      url = "http://unicode.org/Public/emoji/5.0/emoji-zwj-sequences.txt";
+      sha256 = "16gvzv76mjv9g81lm1m6cr3rpfqyn2k4hb9a62xd329252dhl25q";
+    };
+    test = fetchurl {
+      url = "http://unicode.org/Public/emoji/5.0/emoji-test.txt";
+      sha256 = "031qk2v8xdnba7hfinmgrmpglc9l8ll2hds6mw885p0hngdb3dgw";
     };
-  in stdenv.mkDerivation {
+  };
+  emojiData = stdenv.mkDerivation {
     name = "emoji-data-5.0";
     unpackPhase = ":";
-    dontBuild = true;
-    installPhase = with stdenv.lib; ''
+    installPhase = ''
       mkdir $out
-      ${builtins.toString (flip mapAttrsToList srcs (k: v: ''
-        cp ${v} $out/emoji-${k}.txt
-      ''))}
+      ${builtins.toString (flip mapAttrsToList emojiSrcs (k: v: "cp ${v} $out/emoji-${k}.txt;"))}
     '';
   };
   cldrEmojiAnnotation = stdenv.mkDerivation rec {
     name = "cldr-emoji-annotation-${version}";
-    version = "31.0.1_1";
-    src = fetchurl {
-      url = "https://github.com/fujiwarat/cldr-emoji-annotation/releases/download/${version}/${name}.tar.gz";
-      sha256 = "1a3qzsab7vzjqpdialp1g8ppr21x05v0ph8ngyq9pyjkx4vzcdi7";
+    version = "31.90.0_1";
+    src = fetchFromGitHub {
+      owner = "fujiwarat";
+      repo = "cldr-emoji-annotation";
+      rev = version;
+      sha256 = "1vsj32bg8ab4d80rz0fxy6sj2lv31inzyjnddjm079bnvlaf2kih";
     };
+    nativeBuildInputs = [ autoreconfHook ];
   };
-  pyEnv = python3.buildEnv.override {
-    extraLibs = [ python3.pkgs.pygobject3 ];
-
+  python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
+  python3BuildEnv = python3.buildEnv.override {
     # ImportError: No module named site
     postBuild = ''
-      makeWrapper '${glib.dev}/bin/glib-genmarshal' "$out"/bin/glib-genmarshal \
-        --unset PYTHONPATH
+      makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH
+      makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH
+      makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
     '';
   };
-in stdenv.mkDerivation rec {
+in
+
+stdenv.mkDerivation rec {
   name = "ibus-${version}";
-  version = "1.5.16";
+  version = "1.5.17";
 
-  src = fetchurl {
-    url = "https://github.com/ibus/ibus/releases/download/${version}/${name}.tar.gz";
-    sha256 = "07py16jb81kd7vkqhcia9cb2avsbg5jswp2kzf0k4bprwkxppd9n";
+  src = fetchFromGitHub {
+    owner = "ibus";
+    repo = "ibus";
+    rev = version;
+    sha256 = "09mrj9d8qpl9cbylg1zx8c3ymc5gdy4jrf6zs125wjz0b574g5av";
   };
 
   postPatch = ''
-    # These paths will be set in the wrapper.
-    sed -e "/export IBUS_DATAROOTDIR/ s/^.*$//" \
-        -e "/export IBUS_LIBEXECDIR/ s/^.*$//" \
-        -e "/export IBUS_LOCALEDIR/ s/^.*$//" \
-        -e "/export IBUS_PREFIX/ s/^.*$//" \
-        -i "setup/ibus-setup.in"
+    substituteInPlace setup/ibus-setup.in --subst-var-by PYTHON ${python3Runtime.interpreter}
+    substituteInPlace data/dconf/Makefile.am --replace "dconf update" true
+    substituteInPlace configure.ac --replace '$python2dir/ibus' $out/${python3.sitePackages}/ibus
+    echo \#!${stdenv.shell} > data/dconf/make-dconf-override-db.sh
+    cp ${gtk_doc}/share/gtk-doc/data/gtk-doc.make .
   '';
 
+  preAutoreconf = "touch ChangeLog";
+  preConfigure = "intltoolize";
+
   configureFlags = [
     "--disable-gconf"
-    "--enable-dconf"
     "--disable-memconf"
-    "--enable-ui"
-    "--enable-python-library"
+    (enableFeature (dconf != null) "dconf")
+    (enableFeature (libnotify != null) "libnotify")
+    (enableFeature withWayland "wayland")
+    (enableFeature enablePythonLibrary "python-library")
+    (enableFeature enableUI "ui")
     "--with-unicode-emoji-dir=${emojiData}"
     "--with-emoji-annotation-dir=${cldrEmojiAnnotation}/share/unicode/cldr/common/annotations"
   ];
 
-  buildInputs = [
-    pyEnv
-    intltool isocodes pkgconfig
-    gtk2 gtk3 dconf
-    json_glib
-    dbus libnotify gobjectIntrospection wayland
+  nativeBuildInputs = [
+    autoreconfHook
+    gconf
+    gtk_doc
+    intltool
+    makeWrapper
+    pkgconfig
+    python3BuildEnv
+    vala
+    wrapGAppsHook
   ];
 
   propagatedBuildInputs = [ glib ];
 
-  nativeBuildInputs = [ wrapGAppsHook ];
-
-  outputs = [ "out" "dev" ];
+  buildInputs = [
+    dbus
+    dconf
+    gdk_pixbuf
+    gobjectIntrospection
+    gtk2
+    gtk3
+    isocodes
+    json_glib
+    libnotify
+  ] ++ optionals withWayland [
+    libxkbcommon
+    wayland
+  ];
 
   enableParallelBuilding = true;
 
-  preConfigure = ''
-    # Fix hard-coded installation paths, so make does not try to overwrite our
-    # Python installation.
-    sed -e "/py2overridesdir=/ s|=.*$|=$out/lib/${python3.libPrefix}|" \
-        -e "/pyoverridesdir=/ s|=.*$|=$out/lib/${python3.libPrefix}|" \
-        -e "/PYTHON2_LIBDIR/ s|=.*|=$out/lib/${python3.libPrefix}|" \
-        -i configure
-
-    # Don't try to generate a system-wide dconf database; it wouldn't work.
-    substituteInPlace data/dconf/Makefile.in --replace "dconf update" "echo"
-  '';
-
   doInstallCheck = true;
   installCheckPhase = "$out/bin/ibus version";
 
-  postInstall = ''
-    moveToOutput "bin/ibus-setup" "$dev"
-  '';
-
-  meta = with stdenv.lib; {
+  meta = {
     homepage = https://github.com/ibus/ibus;
-    description = "Intelligent Input Bus for Linux / Unix OS";
+    description = "Intelligent Input Bus, input method framework";
+    license = licenses.lgpl21Plus;
     platforms = platforms.linux;
-    maintainers = [ maintainers.ttuegel ];
+    maintainers = with maintainers; [ ttuegel yegortimoshenko ];
   };
 }
diff --git a/pkgs/tools/misc/colord-kde/default.nix b/pkgs/tools/misc/colord-kde/default.nix
index a91cd627bdae8..12821cf864c2e 100644
--- a/pkgs/tools/misc/colord-kde/default.nix
+++ b/pkgs/tools/misc/colord-kde/default.nix
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
     sha256 = "0brdnpflm95vf4l41clrqxwvjrdwhs859n7401wxcykkmw4m0m3c";
   };
 
-  nativeBuildInputs = [ extra-cmake-modules ki18n ];
+  nativeBuildInputs = [ extra-cmake-modules ];
 
   buildInputs = [
     kconfig kconfigwidgets kcoreaddons kdbusaddons kiconthemes
-    kcmutils kio knotifications plasma-framework kwidgetsaddons
+    kcmutils ki18n kio knotifications plasma-framework kwidgetsaddons
     kwindowsystem kitemviews lcms2 libXrandr qtx11extras
   ];
 
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 9a422a96d703c..589c58d0acc02 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/misc/fd/default.nix b/pkgs/tools/misc/fd/default.nix
index 6a7c2cc095d85..2681d14665cbc 100644
--- a/pkgs/tools/misc/fd/default.nix
+++ b/pkgs/tools/misc/fd/default.nix
@@ -2,16 +2,16 @@
 
 rustPlatform.buildRustPackage rec {
   name = "fd-${version}";
-  version = "6.1.0";
+  version = "6.2.0";
 
   src = fetchFromGitHub {
     owner = "sharkdp";
     repo = "fd";
     rev = "v${version}";
-    sha256 = "1md6k531ymsg99zc6y8lni4cpfz4rcklwgibq1i5xdam3hs1n2jg";
+    sha256 = "1l1p7jlrryd54jwwrwgvs4njr3r59m8xsh31z7db0bzpw3dk7n5k";
   };
 
-  cargoSha256 = "00n2j0mjmd4lrfygnv90mixv3hfv1z56zyqcm957cwq08qavqzf1";
+  cargoSha256 = "1dikix9d46f0ydi81ray2vdvsy6y326w8ql6c89zx0p9cjm8m83r";
 
   preFixup = ''
     mkdir -p "$out/man/man1"
diff --git a/pkgs/tools/misc/tmuxinator/default.nix b/pkgs/tools/misc/tmuxinator/default.nix
index b41f38905380a..35bdcf1b82316 100644
--- a/pkgs/tools/misc/tmuxinator/default.nix
+++ b/pkgs/tools/misc/tmuxinator/default.nix
@@ -9,14 +9,14 @@ buildRubyGem rec {
   name = "${gemName}-${version}";
   gemName = "tmuxinator";
   version = "0.10.0";
-  sha256 = "199pq15qknpcafw8ryb9kk1jsrwnncg6k5l9d4n0nmms4knxlqlf";
+  source.sha256 = "199pq15qknpcafw8ryb9kk1jsrwnncg6k5l9d4n0nmms4knxlqlf";
 
   erubis = buildRubyGem rec {
     inherit ruby;
     name = "ruby${ruby.version}-${gemName}-${version}";
     gemName = "erubis";
     version = "2.7.0";
-    sha256 = "1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3";
+    source.sha256 = "1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3";
   };
 
   thor = buildRubyGem rec {
@@ -24,7 +24,7 @@ buildRubyGem rec {
     name = "ruby${ruby.version}-${gemName}-${version}";
     gemName = "thor";
     version = "0.19.1";
-    sha256 = "08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z";
+    source.sha256 = "08p5gx18yrbnwc6xc0mxvsfaxzgy2y9i78xq7ds0qmdm67q39y4z";
   };
 
   xdg = buildRubyGem rec {
@@ -32,7 +32,7 @@ buildRubyGem rec {
     name = "ruby${ruby.version}-${gemName}-${version}";
     gemName = "xdg";
     version = "2.2.3";
-    sha256 = "1bn47fdbwxqbdvjcfg86i32hmwm36k0xl876kb85f5da5v84lzmq";
+    source.sha256 = "1bn47fdbwxqbdvjcfg86i32hmwm36k0xl876kb85f5da5v84lzmq";
   };
 
   propagatedBuildInputs = [ erubis thor xdg ];
diff --git a/pkgs/tools/networking/hss/default.nix b/pkgs/tools/networking/hss/default.nix
index cfc9986b0db8e..913e76c0f4bae 100644
--- a/pkgs/tools/networking/hss/default.nix
+++ b/pkgs/tools/networking/hss/default.nix
@@ -13,7 +13,7 @@ buildRubyGem rec {
   inherit ruby;
   gemName = "hss";
   version = "1.0.1";
-  sha256 = "0hdfpxxqsh6gisn8mm0knsl1aig9fir0h2x9sirk3gr36qbz5xa4";
+  source.sha256 = "0hdfpxxqsh6gisn8mm0knsl1aig9fir0h2x9sirk3gr36qbz5xa4";
 
   postInstall = ''
    substituteInPlace $GEM_HOME/gems/${gemName}-${version}/bin/hss \
diff --git a/pkgs/tools/networking/kea/default.nix b/pkgs/tools/networking/kea/default.nix
index 68fb72ff7d9e8..f33fe7a7105c8 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 aee5302405a55..6f47b4b557664 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/mitmproxy/default.nix b/pkgs/tools/networking/mitmproxy/default.nix
index f96987a1300b7..36874a812812b 100644
--- a/pkgs/tools/networking/mitmproxy/default.nix
+++ b/pkgs/tools/networking/mitmproxy/default.nix
@@ -1,6 +1,28 @@
 { stdenv, fetchpatch, fetchFromGitHub, fetchurl, python3, glibcLocales }:
 
-python3.pkgs.buildPythonPackage rec {
+let
+  # When overrides are not needed, then only remove the contents of this set.
+  packageOverrides = self: super: {
+    ldap3 = super.ldap3.overridePythonAttrs (oldAttrs: rec {
+      version = "2.3";
+      src = oldAttrs.src.override {
+        inherit version;
+        sha256 = "c056b3756076e15aa71c963c7c5a44d5d9bbd430263ee49598d4454223a766ac";
+      };
+    });
+    pyasn1 = super.pyasn1.overridePythonAttrs (oldAttrs: rec {
+      version = "0.3.7";
+      src = oldAttrs.src.override {
+        inherit version;
+        sha256 = "187f2a66d617683f8e82d5c00033b7c8a0287e1da88a9d577aebec321cad4965";
+      };
+    });
+  };
+
+  pythonPackages = (python3.override {inherit packageOverrides; }).pkgs;
+in with pythonPackages;
+
+buildPythonPackage rec {
   baseName = "mitmproxy";
   name = "${baseName}-unstable-2017-10-31";
 
@@ -17,7 +39,7 @@ python3.pkgs.buildPythonPackage rec {
     LC_CTYPE=en_US.UTF-8 pytest -k 'not test_echo and not test_find_unclaimed_URLs '
   '';
 
-  propagatedBuildInputs = with python3.pkgs; [
+  propagatedBuildInputs = [
     blinker click certifi cryptography
     h2 hyperframe
     kaitaistruct passlib pyasn1 pyopenssl
@@ -25,7 +47,7 @@ python3.pkgs.buildPythonPackage rec {
     urwid brotlipy sortedcontainers ldap3
   ];
 
-  buildInputs = with python3.pkgs; [
+  buildInputs = [
     beautifulsoup4 flask pytest pytestrunner glibcLocales
   ];
 
diff --git a/pkgs/tools/networking/ncftp/default.nix b/pkgs/tools/networking/ncftp/default.nix
index c83bc61bbcd07..4c632899ac2e8 100644
--- a/pkgs/tools/networking/ncftp/default.nix
+++ b/pkgs/tools/networking/ncftp/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ncurses, coreutils }:
 
-let version = "3.2.5"; in
+let version = "3.2.6"; in
 stdenv.mkDerivation {
   name = "ncftp-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.ncftp.com/ncftp/ncftp-${version}-src.tar.bz2";
-    sha256 = "0hlx12i0lwi99qsrx7nccf4nvwjj2gych4yks5y179b1ax0y5sxl";
+    url = "ftp://ftp.ncftp.com/ncftp/ncftp-${version}-src.tar.xz";
+    sha256 = "1389657cwgw5a3kljnqmhvfh4vr2gcr71dwz1mlhf22xq23hc82z";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix
index c167851086e68..4295151516d8c 100644
--- a/pkgs/tools/networking/offlineimap/default.nix
+++ b/pkgs/tools/networking/offlineimap/default.nix
@@ -2,7 +2,7 @@
   asciidoc, libxml2, libxslt, docbook_xml_xslt }:
 
 pythonPackages.buildPythonApplication rec {
-  version = "7.1.2";
+  version = "7.1.4";
   name = "offlineimap-${version}";
   namePrefix = "";
 
@@ -10,7 +10,7 @@ pythonPackages.buildPythonApplication rec {
     owner = "OfflineIMAP";
     repo = "offlineimap";
     rev = "v${version}";
-    sha256 = "1bvlbw3bsx3qs8np1qdqbhpdr9qykzsql9684gm7gg84gw51i667";
+    sha256 = "04y2bsgmxykkhcjh3540y2a43xrwfkzd7wks1wvl6av0vjaqa5gm";
   };
 
   postPatch = ''
diff --git a/pkgs/tools/networking/snabb/default.nix b/pkgs/tools/networking/snabb/default.nix
index f3baddd2653ce..46580c0b802c7 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/networking/stunnel/default.nix b/pkgs/tools/networking/stunnel/default.nix
index fbebba21dbd6f..deac37468360a 100644
--- a/pkgs/tools/networking/stunnel/default.nix
+++ b/pkgs/tools/networking/stunnel/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name    = "stunnel-${version}";
-  version = "5.41";
+  version = "5.44";
 
   src = fetchurl {
     url    = "http://www.stunnel.org/downloads/${name}.tar.gz";
-    sha256 = "13qld0b8w2yfs2kfwnqvhcg98warh8hcyk13rjxdwv8zxqhn6p7h";
+    sha256 = "1692y69wl7j6yjgnrrzclgzb34bxsaxjzl1dfy47vms7pdfk42lr";
   };
 
   buildInputs = [ openssl ];
diff --git a/pkgs/tools/security/apg/default.nix b/pkgs/tools/security/apg/default.nix
index 24d88517b6a48..04b29bcf8f7c0 100644
--- a/pkgs/tools/security/apg/default.nix
+++ b/pkgs/tools/security/apg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, openssl }:
 stdenv.mkDerivation rec {
   name = "apg-2.3.0b";
   src = fetchurl {
@@ -8,9 +8,14 @@ stdenv.mkDerivation rec {
   configurePhase = ''
     substituteInPlace Makefile --replace /usr/local "$out"
   '';
+  makeFlags = stdenv.lib.optionals stdenv.isDarwin ["CC=cc"];
 
   patches = [ ./apg.patch ];
 
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i -e 's|APG_CLIBS += -lcrypt|APG_CLIBS += -L${openssl.out}/lib -lcrypto|' Makefile
+  '';
+
   meta = {
     description = "Tools for random password generation";
     longDescription = ''
diff --git a/pkgs/tools/security/fail2ban/default.nix b/pkgs/tools/security/fail2ban/default.nix
index 31f2262cd9ffc..ca9cdcc8d6c0e 100644
--- a/pkgs/tools/security/fail2ban/default.nix
+++ b/pkgs/tools/security/fail2ban/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub, python, pythonPackages, gamin }:
 
-let version = "0.9.7"; in
+let version = "0.10.1"; in
 
 pythonPackages.buildPythonApplication {
   name = "fail2ban-${version}";
@@ -9,7 +9,7 @@ pythonPackages.buildPythonApplication {
     owner  = "fail2ban";
     repo   = "fail2ban";
     rev    = version;
-    sha256 = "07l5pz93mz1r3g59xiyyznlpjfpv2zgvh3h9w0cbn79v7njim8kb";
+    sha256 = "05ngnjxrwvfdd233s5n2wd8w4ndkpgrgymlfzn6i2fjlwf4hdikj";
   };
 
   propagatedBuildInputs = [ gamin ]
diff --git a/pkgs/tools/security/gnupg/22.nix b/pkgs/tools/security/gnupg/22.nix
index 0519902308aff..89fee90364e84 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/gopass/default.nix b/pkgs/tools/security/gopass/default.nix
index d03c08211c2b4..abe7aa1fc7cfa 100644
--- a/pkgs/tools/security/gopass/default.nix
+++ b/pkgs/tools/security/gopass/default.nix
@@ -1,7 +1,7 @@
 { stdenv, buildGoPackage, fetchFromGitHub, git, gnupg, makeWrapper }:
 
 buildGoPackage rec {
-  version = "1.6.6";
+  version = "1.6.7";
   name = "gopass-${version}";
 
   goPackagePath = "github.com/justwatchcom/gopass";
@@ -12,7 +12,7 @@ buildGoPackage rec {
     owner = "justwatchcom";
     repo = "gopass";
     rev = "v${version}";
-    sha256 = "0n3isjrjpn2cnlwfdkjdcz5j8n16dhyaw4zyjpmis51nl0bqd3jw";
+    sha256 = "0al2avdvmnnz7h21hnvlacr20k50my5l67plgf4cphy52p9461vp";
   };
 
   wrapperPath = with stdenv.lib; makeBinPath ([
diff --git a/pkgs/tools/security/john/default.nix b/pkgs/tools/security/john/default.nix
index 37946b940cf11..7552b21ed3331 100644
--- a/pkgs/tools/security/john/default.nix
+++ b/pkgs/tools/security/john/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2
-, writeText, gcc
+, writeText, gcc, pythonPackages, perl, perlPackages, makeWrapper
 }:
 
 with stdenv.lib;
@@ -35,7 +35,11 @@ stdenv.mkDerivation rec {
   '';
   configureFlags = [ "--disable-native-macro" ];
 
-  buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc ];
+  buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc pythonPackages.wrapPython perl makeWrapper ];
+  propagatedBuildInputs = (with pythonPackages; [ dpkt scapy lxml ]) ++ # For pcap2john.py
+                          (with perlPackages; [ DigestMD4 DigestMD5 DigestSHA1 GetoptLong MIMEBase64 # For pass_gen.pl
+                                                NetLDAP ]); # For sha-dump.pl
+                          # TODO: Get dependencies for radius2john.pl and lion2john-alt.pl
 
   # gcc -DAC_BUILT -Wall vncpcap2john.o memdbg.o -g    -lpcap -fopenmp -o ../run/vncpcap2john
   # gcc: error: memdbg.o: No such file or directory
@@ -43,18 +47,23 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = [ "-DJOHN_SYSTEMWIDE=1" ];
 
-  installPhase = ''
-    mkdir -p "$out/etc/john" "$out/share/john" "$out/share/doc/john"
-    find ../run -mindepth 1 -maxdepth 1 -type f -executable \
-      -exec "${stdenv.shell}" "${writeText "john-binary-install.sh" ''
-        filename="$(basename "$1")"
-        install -vD "$1" "$out/bin/''${filename%.*}"
-      ''}" {} \;
+  postInstall = ''
+    mkdir -p "$out/bin" "$out/etc/john" "$out/share/john" "$out/share/doc/john"
+    find -L ../run -mindepth 1 -maxdepth 1 -type f -executable \
+      -exec cp -d {} "$out/bin" \;
     cp -vt "$out/etc/john" ../run/*.conf
     cp -vt "$out/share/john" ../run/*.chr ../run/password.lst
     cp -vrt "$out/share/doc/john" ../doc/*
   '';
 
+  postFixup = ''
+    wrapPythonPrograms
+
+    for i in $out/bin/*.pl; do
+      wrapProgram "$i" --prefix PERL5LIB : $PERL5LIB
+    done
+  '';
+
   meta = {
     description = "John the Ripper password cracker";
     license = licenses.gpl2;
diff --git a/pkgs/tools/security/pass-otp/default.nix b/pkgs/tools/security/pass-otp/default.nix
new file mode 100644
index 0000000000000..327a9680f9809
--- /dev/null
+++ b/pkgs/tools/security/pass-otp/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, pass, fetchFromGitHub, oathToolkit }:
+stdenv.mkDerivation {
+  name = "pass-otp";
+
+  src = fetchFromGitHub {
+    owner = "tadfisher";
+    repo = "pass-otp";
+    rev = "f2feb3082324a91089782af9b7fbb71d34aa213d";
+    sha256 = "0iklvcfgw1320dggdr02lq3bc7xvnd2934l1w9kkjpbsfmhs955c";
+  };
+
+  buildInputs = [ pass oathToolkit ];
+
+  patchPhase = ''
+    sed -i -e 's|OATH=\$(which oathtool)|OATH=${oathToolkit}/bin/oathtool|' otp.bash
+  '';
+
+  installPhase = ''
+    make PREFIX=$out install
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A pass extension for managing one-time-password (OTP) tokens";
+    homepage = https://github.com/tadfisher/pass-otp;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ jwiegley ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix
index 74bb5cc58197b..5d9c808944158 100644
--- a/pkgs/tools/security/pcsclite/default.nix
+++ b/pkgs/tools/security/pcsclite/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "pcsclite-${version}";
-  version = "1.8.22";
+  version = "1.8.23";
 
   src = fetchurl {
     # This URL changes in unpredictable ways, so it is not sensible
     # to put a version variable in there.
-    url = "https://alioth.debian.org/frs/download.php/file/4225/pcsc-lite-1.8.22.tar.bz2";
-    sha256 = "01flkdyqs7kr6c63dv2qg8dwir3v9jlr9rzlw7vafrivxmhqydba";
+    url = "https://alioth.debian.org/frs/download.php/file/4235/pcsc-lite-1.8.23.tar.bz2";
+    sha256 = "1jc9ws5ra6v3plwraqixin0w0wfxj64drahrbkyrrwzghqjjc9ss";
   };
 
   patches = [ ./no-dropdir-literals.patch ];
diff --git a/pkgs/tools/security/thc-hydra/default.nix b/pkgs/tools/security/thc-hydra/default.nix
index e8eb3aacd3e98..9a7a245b81346 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 b1c5778ed4c5b..e9ce2913a6cbc 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
@@ -53,9 +53,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
     riemann_c_client mosquitto rdkafka mongoc
+  ] ++ stdenv.lib.optionals (mysql != null) [ mysql.connector-c
   ] ++ stdenv.lib.optionals stdenv.isLinux [
     iptables libatasmart libcredis libmodbus libsigrok
     lm_sensors lvm2 rabbitmq-c udev net_snmp libmnl
diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix
index e642b91c3d960..a6999942e0c6c 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/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index cd64bd1566b5a..60628e2139cef 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -17,7 +17,8 @@ stdenv.mkDerivation rec {
   configureFlags =
     # "pr" need not be on the PATH as a run-time dep, so we need to tell
     # configure where it is. Covers the cross and native case alike.
-    stdenv.lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr";
+    stdenv.lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
+    ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes";
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;
diff --git a/pkgs/tools/text/dos2unix/default.nix b/pkgs/tools/text/dos2unix/default.nix
index 338967e5b9a08..59697891b6a3d 100644
--- a/pkgs/tools/text/dos2unix/default.nix
+++ b/pkgs/tools/text/dos2unix/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "dos2unix-${version}";
-  version = "7.3.4";
+  version = "7.4.0";
 
   src = fetchurl {
-    url = "http://waterlan.home.xs4all.nl/dos2unix/${name}.tar.gz";
-    sha256 = "1i9hbxn0br7xa18z4bjpkdv7mrzmbfxhm44mzpd07yd2qnxsgkcc";
+    url = "https://waterlan.home.xs4all.nl/dos2unix/${name}.tar.gz";
+    sha256 = "12h4c61g376bhq03y5g2xszkrkrj5hwd928rly3xsp6rvfmnbixs";
   };
 
   configurePhase = ''
@@ -21,6 +21,6 @@ stdenv.mkDerivation rec {
     description = "Tools to transform text files from dos to unix formats and vicervesa";
     license = licenses.bsd2;
     maintainers = with maintainers; [viric ndowens ];
-    
+
   };
 }
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index 65d0a1e4c00ac..6783158ca77ec 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -41,6 +41,8 @@ stdenv.mkDerivation rec {
     (if interactive then "--with-readline=${readline.dev}" else "--without-readline")
   ];
 
+  makeFlags = "AR=${stdenv.cc.targetPrefix}ar";
+
   inherit doCheck;
 
   postInstall = ''
diff --git a/pkgs/tools/text/gist/default.nix b/pkgs/tools/text/gist/default.nix
index 11fcae8552817..cf4b90643d7d4 100644
--- a/pkgs/tools/text/gist/default.nix
+++ b/pkgs/tools/text/gist/default.nix
@@ -5,7 +5,7 @@ buildRubyGem rec {
   name = "${gemName}-${version}";
   gemName = "gist";
   version = "4.6.1";
-  sha256 = "16qvmn7syvcf4lnblngzvq8xynvb62h1xhfc7xfb0c1sjh166hff";
+  source.sha256 = "16qvmn7syvcf4lnblngzvq8xynvb62h1xhfc7xfb0c1sjh166hff";
 
   buildInputs = [ makeWrapper ];
 
diff --git a/pkgs/tools/text/sgml/opensp/setup-hook.sh b/pkgs/tools/text/sgml/opensp/setup-hook.sh
index 52da517a8cbe8..753a3ea642875 100644
--- a/pkgs/tools/text/sgml/opensp/setup-hook.sh
+++ b/pkgs/tools/text/sgml/opensp/setup-hook.sh
@@ -18,5 +18,5 @@ if test -z "$sgmlHookDone"; then
     export ftp_proxy=http://nodtd.invalid/
 
     export SGML_CATALOG_FILES
-    envHooks+=(addSGMLCatalogs)
+    addEnvHooks "$targetOffset" addSGMLCatalogs
 fi
diff --git a/pkgs/tools/typesetting/tex/dblatex/default.nix b/pkgs/tools/typesetting/tex/dblatex/default.nix
index 7ffccde2c0352..c4eaf4e1df46a 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/tools/typesetting/tex/tetex/setup-hook.sh b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh
index 9c5424e881e32..5faef7fe5df5e 100644
--- a/pkgs/tools/typesetting/tex/tetex/setup-hook.sh
+++ b/pkgs/tools/typesetting/tex/tetex/setup-hook.sh
@@ -4,4 +4,4 @@ addTeXMFPath () {
     fi
 }
 
-envHooks+=(addTeXMFPath)
+addEnvHooks "$targetOffset" addTeXMFPath
diff --git a/pkgs/tools/typesetting/tex/texlive/setup-hook.sh b/pkgs/tools/typesetting/tex/texlive/setup-hook.sh
index 9c5424e881e32..5faef7fe5df5e 100644
--- a/pkgs/tools/typesetting/tex/texlive/setup-hook.sh
+++ b/pkgs/tools/typesetting/tex/texlive/setup-hook.sh
@@ -4,4 +4,4 @@ addTeXMFPath () {
     fi
 }
 
-envHooks+=(addTeXMFPath)
+addEnvHooks "$targetOffset" addTeXMFPath
diff --git a/pkgs/tools/video/flvtool2/default.nix b/pkgs/tools/video/flvtool2/default.nix
index 65bc240af001d..9a60ebf17be8b 100644
--- a/pkgs/tools/video/flvtool2/default.nix
+++ b/pkgs/tools/video/flvtool2/default.nix
@@ -5,7 +5,7 @@ buildRubyGem rec {
   name = "${gemName}-${version}";
   gemName = "flvtool2";
   version = "1.0.6";
-  sha256 = "0xsla1061pi4ryh3jbvwsbs8qchprchbqjy7652g2g64v37i74qj";
+  source.sha256 = "0xsla1061pi4ryh3jbvwsbs8qchprchbqjy7652g2g64v37i74qj";
 
   meta = {
     homepage = https://github.com/unnu/flvtool2;
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 6eb826c073f63..2c249f73d6c4a 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 0d6ddf6ad6093..45fde304663b7 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -626,6 +626,7 @@ with pkgs;
   lastpass-cli = callPackage ../tools/security/lastpass-cli { };
 
   pass = callPackage ../tools/security/pass { };
+  pass-otp = callPackage ../tools/security/pass-otp { };
 
   gopass = callPackage ../tools/security/gopass { };
 
@@ -1256,7 +1257,7 @@ with pkgs;
     libkrb5 = null;
     systemd = null;
     jemalloc = null;
-    libmysql = null;
+    mysql = null;
     postgresql = null;
     libdbi = null;
     net_snmp = null;
@@ -1514,7 +1515,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
   };
 
@@ -1553,7 +1553,7 @@ with pkgs;
   skk-dicts = callPackage ../tools/inputmethods/skk/skk-dicts { };
 
   ibus = callPackage ../tools/inputmethods/ibus {
-    inherit (gnome3) dconf glib;
+    inherit (gnome3) dconf gconf glib;
   };
 
   ibus-qt = callPackage ../tools/inputmethods/ibus/ibus-qt.nix { };
@@ -3897,7 +3897,7 @@ with pkgs;
 
   pandoc = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.pandoc) (drv: {
     configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
-    buildTools = drv.buildTools or [] ++ [haskellPackages.file-embed];
+    buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
   });
 
   pamtester = callPackage ../tools/security/pamtester { };
@@ -6500,6 +6500,7 @@ with pkgs;
     vala_0_28
     vala_0_32
     vala_0_34
+    vala_0_36
     vala_0_38
     vala;
 
@@ -8065,7 +8066,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 { };
@@ -9216,12 +9218,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 { };
@@ -9833,8 +9835,6 @@ with pkgs;
 
   libtorrentRasterbar = callPackage ../development/libraries/libtorrent-rasterbar { };
 
-  libtorrentRasterbar_1_0 = callPackage ../development/libraries/libtorrent-rasterbar/1.0.nix { };
-
   libtoxcore-new = callPackage ../development/libraries/libtoxcore/new-api.nix { };
 
   libtoxcore = callPackage ../development/libraries/libtoxcore { };
@@ -11298,8 +11298,8 @@ with pkgs;
   x265 = callPackage ../development/libraries/x265 { };
 
   inherit (callPackages ../development/libraries/xapian { })
-    xapian_1_2_22 xapian_1_4_4;
-  xapian = xapian_1_4_4;
+    xapian_1_2_22 xapian_1_4;
+  xapian = xapian_1_4;
 
   xapian-omega = callPackage ../development/libraries/xapian/tools/omega {
     libmagic = file;
@@ -12038,7 +12038,6 @@ with pkgs;
   };
 
   mysql = mariadb;
-  libmysql = mysql.client; # `libmysql` is a slight misnomer ATM
 
   mysql_jdbc = callPackage ../servers/sql/mysql/jdbc { };
 
@@ -12862,6 +12861,8 @@ with pkgs;
 
     pktgen = callPackage ../os-specific/linux/pktgen { };
 
+    hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { };
+
     odp-dpdk = callPackage ../os-specific/linux/odp-dpdk { };
 
     ofp = callPackage ../os-specific/linux/ofp { };
@@ -14486,11 +14487,10 @@ with pkgs;
   };
 
   inherit (callPackage ../applications/virtualization/docker { })
-    docker_17_09
-    docker_17_11;
+    docker_17_12;
 
-  docker = docker_17_09;
-  docker-edge = docker_17_11;
+  docker = docker_17_12;
+  docker-edge = docker_17_12;
 
   docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { };
 
@@ -15250,11 +15250,11 @@ with pkgs;
     inherit (darwin) IOKit;
   };
 
+  gmtk = callPackage ../development/libraries/gmtk { };
+
   gmu = callPackage ../applications/audio/gmu { };
 
-  gnome_mplayer = callPackage ../applications/video/gnome-mplayer {
-    inherit (gnome2) GConf;
-  };
+  gnome_mplayer = callPackage ../applications/video/gnome-mplayer { };
 
   gnumeric = callPackage ../applications/office/gnumeric { };
 
@@ -15406,9 +15406,7 @@ with pkgs;
   hyper = callPackage ../applications/misc/hyper { inherit (gnome2) GConf; };
   hyperterm = self.hyper;
 
-  jackline = callPackage ../applications/networking/instant-messengers/jackline {
-    ocamlPackages = ocaml-ng.ocamlPackages_4_02;
-  };
+  jackline = callPackage ../applications/networking/instant-messengers/jackline { };
 
   slack = callPackage ../applications/networking/instant-messengers/slack { };
 
@@ -16543,9 +16541,7 @@ with pkgs;
 
   pythonmagick = callPackage ../applications/graphics/PythonMagick { };
 
-  qbittorrent = libsForQt5.callPackage ../applications/networking/p2p/qbittorrent {
-    libtorrentRasterbar = libtorrentRasterbar_1_0;
-  };
+  qbittorrent = libsForQt5.callPackage ../applications/networking/p2p/qbittorrent { };
 
   eiskaltdcpp = callPackage ../applications/networking/p2p/eiskaltdcpp {
     lua5 = lua5_1;
@@ -17150,6 +17146,8 @@ with pkgs;
     enableGTK3 = true;
   };
 
+  thunderbolt = callPackage ../os-specific/linux/thunderbolt {};
+
   thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin {
     gconf = pkgs.gnome2.GConf;
     inherit (pkgs.gnome2) libgnome libgnomeui;
@@ -17732,6 +17730,8 @@ with pkgs;
 
   xkbset = callPackage ../tools/X11/xkbset { };
 
+  xkbmon = callPackage ../applications/misc/xkbmon { };
+
   win-spice = callPackage ../applications/virtualization/driver/win-spice { };
   win-virtio = callPackage ../applications/virtualization/driver/win-virtio { };
   win-qemu = callPackage ../applications/virtualization/driver/win-qemu { };
@@ -18137,8 +18137,6 @@ with pkgs;
 
   gemrb = callPackage ../games/gemrb { };
 
-  ghostOne = callPackage ../servers/games/ghost-one { };
-
   gl117 = callPackage ../games/gl-117 {};
 
   globulation2 = callPackage ../games/globulation {
@@ -18432,6 +18430,10 @@ with pkgs;
     nativeOnly = true;
   }).run;
 
+  linux-steam-integration = callPackage ../games/linux-steam-integration {
+    gtk = pkgs.gtk3;
+  };
+
   stepmania = callPackage ../games/stepmania {
     ffmpeg = ffmpeg_2;
   };
@@ -19756,6 +19758,11 @@ with pkgs;
 
   sane-frontends = callPackage ../applications/graphics/sane/frontends.nix { };
 
+  sc-controller = pythonPackages.callPackage ../misc/drivers/sc-controller {
+    inherit libusb1; # Shadow python.pkgs.libusb1.
+    librsvg = librsvg.override { enableIntrospection = true; };
+  };
+
   sct = callPackage ../tools/X11/sct {};
 
   seafile-shared = callPackage ../misc/seafile-shared { };
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index fc4074dd8cd9e..cba1f9a54a247 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -72,7 +72,7 @@ in rec {
       sphinx = pkgs.python27Packages.sphinx;
     };
     ghc822 = callPackage ../development/compilers/ghc/8.2.2.nix rec {
-      bootPkgs = packages.ghc7103Binary;
+      bootPkgs = packages.ghc821Binary;
       inherit (bootPkgs) hscolour alex happy;
       inherit buildPlatform targetPlatform;
       sphinx = pkgs.python3Packages.sphinx;
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index c83e62fd89a58..4c05f96caf7a4 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 e723518b12afc..d9588e9f9f248 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -173,6 +173,8 @@ in {
 
   automat = callPackage ../development/python-modules/automat { };
 
+  aws-xray-sdk = callPackage ../development/python-modules/aws-xray-sdk { };
+
   # packages defined elsewhere
 
   backports_csv = callPackage ../development/python-modules/backports_csv {};
@@ -482,25 +484,6 @@ in {
     };
   };
 
-  amqp_1 = buildPythonPackage rec {
-    name = "amqp-${version}";
-    version = "1.4.9";
-    disabled = pythonOlder "2.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/a/amqp/${name}.tar.gz";
-      sha256 = "06n6q0kxhjnbfz3vn8x9yz09lwmn1xi9d6wxp31h5jbks0b4vsid";
-    };
-
-    buildInputs = with self; [ mock coverage nose-cover3 unittest2 ];
-
-    meta = {
-      homepage = https://github.com/celery/py-amqp;
-      description = "Python client for the Advanced Message Queuing Procotol (AMQP). This is a fork of amqplib which is maintained by the Celery project";
-      license = licenses.lgpl21;
-    };
-  };
-
   amqp = buildPythonPackage rec {
     name = "amqp-${version}";
     version = "2.1.4";
@@ -1020,44 +1003,9 @@ in {
     };
   };
 
-  backports_abc = buildPythonPackage rec {
-    name = "backports_abc-${version}";
-    version = "0.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/backports_abc/${name}.tar.gz";
-      sha256 = "8b3e4092ba3d541c7a2f9b7d0d9c0275b21c6a01c53a61c731eba6686939d0a5";
-    };
+  backports_abc = callPackage ../development/python-modules/backports_abc { };
 
-    checkPhase = ''
-      ${python.interpreter} -m unittest discover
-    '';
-
-    meta = {
-      homepage = https://github.com/cython/backports_abc;
-      license = licenses.psfl;
-      description = "A backport of recent additions to the 'collections.abc' module";
-    };
-  };
-
-  backports_functools_lru_cache = buildPythonPackage rec {
-    name = "backports.functools_lru_cache-${version}";
-    version = "1.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/backports_functools_lru_cache/${name}.tar.gz";
-      sha256 = "444a21bcec4ae177da554321f81a78dc879eaa8f6ea9920cb904830585d31e95";
-    };
-
-    buildInputs = with self; [ setuptools_scm ];
-    doCheck = false; # No proper test
-
-    meta = {
-      description = "Backport of functools.lru_cache";
-      homepage = https://github.com/jaraco/backports.functools_lru_cache;
-      license = licenses.mit;
-    };
-  };
+  backports_functools_lru_cache = callPackage ../development/python-modules/backports_functools_lru_cache { };
 
   backports_shutil_get_terminal_size = callPackage ../development/python-modules/backports_shutil_get_terminal_size { };
 
@@ -1090,23 +1038,7 @@ in {
     };
   };
 
-  backports_lzma = self.buildPythonPackage rec {
-    name = "backports.lzma-0.0.3";
-    disabled = isPy3k;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/backports.lzma/${name}.tar.gz";
-      sha256 = "bac58aec8d39ac3d22250840fb24830d0e4a0ef05ad8f3f09172dc0cc80cdbca";
-    };
-
-    buildInputs = [ pkgs.lzma ];
-
-    meta = {
-      description = "Backport of Python 3.3's 'lzma' module for XZ/LZMA compressed files";
-      homepage = https://github.com/peterjc/backports.lzma;
-      license = licenses.bsd3;
-    };
-  };
+  backports_lzma = callPackage ../development/python-modules/backports_lzma { };
 
   backports_tempfile = callPackage ../development/python-modules/backports_tempfile { };
 
@@ -1307,33 +1239,7 @@ in {
     };
   };
 
-  biopython = buildPythonPackage rec {
-    name = "biopython-${version}";
-    version = "1.68";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/biopython/${name}.tar.gz";
-      sha256 = "07qc7nz0k77y8hf8s18rscvibvm91zw0kkq7ylrhisf8vp8hkp6i";
-    };
-
-    propagatedBuildInputs = with self; [ numpy ];
-    # Checks try to write to $HOME, which does not work with nix
-    doCheck = false;
-    meta = {
-      description = "Python library for bioinformatics";
-
-      longDescription = ''
-        Biopython is a set of freely available tools for biological computation
-        written in Python by an international team of developers. It is a
-        distributed collaborative effort to develop Python libraries and
-        applications which address the needs of current and future work in
-        bioinformatics.
-      '';
-
-      homepage = http://biopython.org/wiki/Documentation;
-      maintainers = with maintainers; [ luispedro ];
-    };
-  };
+  biopython = callPackage ../development/python-modules/biopython { };
 
   bedup = buildPythonPackage rec {
     version = "0.10.1";
@@ -1406,25 +1312,7 @@ in {
     propagatedBuildInputs = with self; [ boto crcmod psutil ];
   };
 
-  cached-property = buildPythonPackage rec {
-    version = "1.3.0";
-    name = "cached-property-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/c/cached-property/${name}.tar.gz";
-      sha256 = "10dwi3s6f154ag9dvqy5jiwp31fs57lbxjcjgn4cwvi8qyqpi3j5";
-    };
-
-    buildInputs = with self; [ freezegun ];
-
-    meta = {
-      description = "A decorator for caching properties in classes";
-      homepage = https://github.com/pydanny/cached-property;
-      license = licenses.bsd3;
-      platforms = platforms.unix;
-      maintainers = with maintainers; [ ericsagnes ];
-    };
-  };
+  cached-property = callPackage ../development/python-modules/cached-property { };
 
   caffe = pkgs.caffe.override {
     python = self.python;
@@ -1994,43 +1882,7 @@ in {
     };
   };
 
-  boto3 = buildPythonPackage rec {
-    name = "boto3-${version}";
-    version = "1.4.8";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "boto";
-      repo  = "boto3";
-      rev   = version;
-      sha256 = "11ysd7a9l5y98q7b7az56phsj2m7w90abf4jabwrknp2c43sq9bi";
-    };
-
-    propagatedBuildInputs = [ self.botocore self.jmespath self.s3transfer ] ++
-                            (if isPy3k then [] else [self.futures]);
-    buildInputs = [ self.docutils self.nose self.mock ];
-    checkPhase = ''
-      runHook preCheck
-      # This method is not in mock. It might have appeared in some versions.
-      sed -i 's/action.assert_called_once()/self.assertEqual(action.call_count, 1)/' \
-        tests/unit/resources/test_factory.py
-      nosetests -d tests/unit --verbose
-      runHook postCheck
-    '';
-
-    # Network access
-    doCheck = false;
-
-    meta = {
-      homepage = https://github.com/boto/boto3;
-      license = stdenv.lib.licenses.asl20;
-      description = "AWS SDK for Python";
-      longDescription = ''
-        Boto3 is the Amazon Web Services (AWS) Software Development Kit (SDK) for
-        Python, which allows Python developers to write software that makes use of
-        services like Amazon S3 and Amazon EC2.
-      '';
-    };
-  };
+  boto3 = callPackage ../development/python-modules/boto3 { };
 
   botocore = callPackage ../development/python-modules/botocore { };
 
@@ -3125,22 +2977,7 @@ in {
   openidc-client = callPackage ../development/python-modules/openidc-client/default.nix {};
 
 
-  idna = buildPythonPackage rec {
-    pname = "idna";
-    version = "2.5";
-    name = "${pname}-${version}";
-
-    src = fetchPypi {
-      inherit pname version;
-      sha256 = "3cb5ce08046c4e3a560fc02f138d0ac63e00f8ce5901a56b32ec8b7994082aab";
-    };
-
-    meta = {
-      homepage = "http://github.com/kjd/idna/";
-      description = "Internationalized Domain Names in Applications (IDNA)";
-      license = "licenses.bsd3";
-    };
-  };
+  idna = callPackage ../development/python-modules/idna { };
 
   mahotas = buildPythonPackage rec {
     name = "python-mahotas-${version}";
@@ -3437,7 +3274,7 @@ in {
     };
   };
 
-  pytest = self.pytest_32;
+  pytest = self.pytest_33;
 
   pytest_27 = callPackage ../development/python-modules/pytest/2_7.nix {};
 
@@ -3452,7 +3289,16 @@ in {
       pytest = null;
     };
   };
-  pytest_32 = callPackage ../development/python-modules/pytest{
+
+  pytest_32 = callPackage ../development/python-modules/pytest/3_2.nix{
+    hypothesis = self.hypothesis.override {
+      # hypothesis requires pytest that causes dependency cycle
+      doCheck = false;
+      pytest = null;
+    };
+  };
+
+  pytest_33 = callPackage ../development/python-modules/pytest/default.nix{
     hypothesis = self.hypothesis.override {
       # hypothesis requires pytest that causes dependency cycle
       doCheck = false;
@@ -4256,21 +4102,7 @@ in {
     };
   };
 
-  decorator = buildPythonPackage rec {
-    name = "decorator-${version}";
-    version = "4.0.11";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/d/decorator/${name}.tar.gz";
-      sha256 = "953d6bf082b100f43229cf547f4f97f97e970f5ad645ee7601d55ff87afdfe76";
-    };
-
-    meta = {
-      homepage = https://pypi.python.org/pypi/decorator;
-      description = "Better living through Python with decorators";
-      license = licenses.mit;
-    };
-  };
+  decorator = callPackage ../development/python-modules/decorator { };
 
   deform = buildPythonPackage rec {
     name = "deform-2.0a2";
@@ -4714,30 +4546,7 @@ in {
     };
   };
 
-  evdev = buildPythonPackage rec {
-    version = "0.6.4";
-    name = "evdev-${version}";
-    disabled = isPy34;  # see http://bugs.python.org/issue21121
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/evdev/${name}.tar.gz";
-      sha256 = "1wkag91s8j0f45jx5n619z354n8pz8in9krn81hp7hlkhi6p8s2j";
-    };
-
-    buildInputs = with self; [ pkgs.linuxHeaders ];
-
-    patchPhase = "sed -e 's#/usr/include/linux/#${pkgs.linuxHeaders}/include/linux/#g' -i setup.py";
-
-    doCheck = false;
-
-    meta = {
-      description = "Provides bindings to the generic input event interface in Linux";
-      homepage = http://pythonhosted.org/evdev;
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ goibhniu ];
-      platforms = platforms.linux;
-    };
-  };
+  evdev = callPackage ../development/python-modules/evdev {};
 
   eve = callPackage ../development/python-modules/eve {};
 
@@ -5710,25 +5519,7 @@ in {
     };
   };
 
-  jdcal = buildPythonPackage rec {
-    version = "1.0";
-    name = "jdcal-${version}";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "phn";
-      repo = "jdcal";
-      rev = "v${version}";
-      sha256 = "0jjgrrylraqzk3n97hay4gj00ky6vlvkfaapfgqlbcxyq30j24vq";
-    };
-
-    meta = {
-      description = "A module containing functions for converting between Julian dates and calendar dates";
-      homepage = "https://github.com/phn/jdcal";
-      license = licenses.bsd2;
-      maintainers = with maintainers; [ lihop ];
-      platforms = platforms.all;
-    };
-  };
+  jdcal = callPackage ../development/python-modules/jdcal { };
 
   internetarchive = callPackage ../development/python-modules/internetarchive {};
 
@@ -5740,6 +5531,8 @@ in {
 
   jsonpatch = callPackage ../development/python-modules/jsonpatch { };
 
+  jsonpickle = callPackage ../development/python-modules/jsonpickle { };
+
   jsonpointer = buildPythonPackage rec {
     name = "jsonpointer-1.9";
 
@@ -6845,37 +6638,7 @@ in {
 
   pysrt = callPackage ../development/python-modules/pysrt { };
 
-  pytools = buildPythonPackage rec {
-    name = "pytools-${version}";
-    version = "2017.4";
-
-    src = pkgs.fetchFromGitHub {
-      owner = "inducer";
-      repo = "pytools";
-      rev = "8078e74265bb5a3c9676c698595ab5450cd2bfe7";
-      sha256 = "17q61l79fcxkj5jxg3fnymi652sdjp5s6kpsabgxp22kma9crr28";
-    };
-
-    buildInputs = with self; [
-      decorator
-      appdirs
-      six
-      numpy
-      pytest
-    ];
-
-    checkPhase = ''
-      py.test -k 'not test_persistent_dict'
-    '';
-
-    meta = {
-      homepage = https://github.com/inducer/pytools/;
-      description = "Miscellaneous Python lifesavers.";
-      license = licenses.mit;
-      maintainers = with maintainers; [ artuuge ];
-    };
-
-  };
+  pytools = callPackage ../development/python-modules/pytools { };
 
   pytun = buildPythonPackage rec {
     name = "pytun-${version}";
@@ -7029,21 +6792,7 @@ in {
 
   hyperlink = callPackage ../development/python-modules/hyperlink {};
 
-  zope_copy = buildPythonPackage rec {
-    name = "zope.copy-4.0.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/z/zope.copy/${name}.zip";
-      sha256 = "eb2a95866df1377741876a3ee62d8600e80089e6246e1a235e86791b29534457";
-    };
-
-    buildInputs = with self; [ zope_interface zope_location zope_schema ];
-
-    meta = {
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
-
+  zope_copy = callPackage ../development/python-modules/zope_copy {};
 
   ssdeep = buildPythonPackage rec {
     name = "ssdeep-3.1.1";
@@ -7229,23 +6978,7 @@ in {
     };
   };
 
-  regex = buildPythonPackage rec {
-    name = "regex-${version}";
-    version = "2016.11.18";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/r/regex/${name}.tar.gz";
-      sha256 = "126ds2b355n3pgl7brshhscpxn14ycs0yznzl8k4akj4sps1i6c6";
-    };
-
-    meta = {
-      description = "Alternative regular expression module, to replace re";
-      homepage = "https://bitbucket.org/mrabarnett/mrab-regex";
-      license = licenses.psfl;
-      platforms = platforms.linux;
-      maintainers = with maintainers; [ abbradar ];
-    };
-  };
+  regex = callPackage ../development/python-modules/regex { };
 
   repoze_lru = buildPythonPackage rec {
     name = "repoze.lru-0.6";
@@ -7261,8 +6994,6 @@ in {
     };
   };
 
-
-
   repoze_sphinx_autointerface = buildPythonPackage rec {
     name = "repoze.sphinx.autointerface-0.7.1";
 
@@ -9282,37 +9013,7 @@ in {
   };
 
 
-  html5lib = buildPythonPackage (rec {
-    version = "0.999999999";
-    name = "html5lib-${version}";
-
-    src = pkgs.fetchurl {
-      url = "http://github.com/html5lib/html5lib-python/archive/${version}.tar.gz";
-      sha256 = "09j6194f5mlnd5xwbavwvnndwl1x91jw74shxl6hcxjp4fxg3h05";
-    };
-
-    buildInputs = with self; [ flake8 pytest pytest-expect mock ];
-    propagatedBuildInputs = with self; [
-      six webencodings
-    ] ++ optionals isPy26 [ ordereddict ];
-
-    checkPhase = ''
-      py.test
-    '';
-
-    meta = {
-      homepage = https://github.com/html5lib/html5lib-python;
-      downloadPage = https://github.com/html5lib/html5lib-python/releases;
-      description = "HTML parser based on WHAT-WG HTML5 specification";
-      longDescription = ''
-        html5lib is a pure-python library for parsing HTML. It is designed to
-        conform to the WHATWG HTML specification, as is implemented by all
-        major web browsers.
-      '';
-      license = licenses.mit;
-      maintainers = with maintainers; [ domenkozar prikhi ];
-    };
-  });
+  html5lib = callPackage ../development/python-modules/html5lib { };
 
   http_signature = buildPythonPackage (rec {
     name = "http_signature-0.1.4";
@@ -9751,26 +9452,7 @@ in {
 
   iso3166 = callPackage ../development/python-modules/iso3166 {};
 
-  iso8601 = buildPythonPackage rec {
-    name = "iso8601-${version}";
-    version = "0.1.11";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/i/iso8601/${name}.tar.gz";
-      sha256 = "e8fb52f78880ae063336c94eb5b87b181e6a0cc33a6c008511bac9a6e980ef30";
-    };
-
-    buildInputs = [ self.pytest ];
-
-    checkPhase = ''
-      py.test iso8601
-    '';
-
-    meta = {
-      homepage = https://bitbucket.org/micktwomey/pyiso8601/;
-      description = "Simple module to parse ISO 8601 dates";
-      maintainers = with maintainers; [ phreedom ];
-    };
-  };
+  iso8601 = callPackage ../development/python-modules/iso8601 { };
 
   isort = buildPythonPackage rec {
     name = "${pname}-${version}";
@@ -9795,23 +9477,7 @@ in {
 
   jedi = callPackage ../development/python-modules/jedi { };
 
-  jellyfish = buildPythonPackage rec {
-    version = "0.5.2";
-    name = "jellyfish-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/j/jellyfish/${name}.tar.gz";
-      sha256 = "15xk0kbr1gig9r1mp22lk9mk3jyi886h8ywn9diixhnyl4q6dacn";
-    };
-
-    buildInputs = with self; [ pytest unicodecsv ];
-
-    meta = {
-      homepage = https://github.com/sunlightlabs/jellyfish;
-      description = "Approximate and phonetic matching of strings";
-      maintainers = with maintainers; [ koral ];
-    };
-  };
+  jellyfish = callPackage ../development/python-modules/jellyfish { };
 
   j2cli = buildPythonPackage rec {
     name = "j2cli-${version}";
@@ -9885,6 +9551,8 @@ in {
 
   jsondate = callPackage ../development/python-modules/jsondate { };
 
+  jsondiff = callPackage ../development/python-modules/jsondiff { };
+
   jsonnet = buildPythonPackage {
     inherit (pkgs.jsonnet) name src;
   };
@@ -9981,33 +9649,6 @@ in {
 
   koji = callPackage ../development/python-modules/koji { };
 
-  kombu_3 = buildPythonPackage rec {
-    name = "kombu-${version}";
-    version = "3.0.35";
-
-    disabled = pythonOlder "2.6";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/k/kombu/${name}.tar.gz";
-      sha256 = "09xpxpjz9nk8d14dj361dqdwyjwda3jlf1a7v6jif9wn2xm37ar2";
-    };
-
-    # most of these are simply to allow the test suite to do its job
-    buildInputs = with self; optionals isPy27 [ mock unittest2 nose redis qpid-python pymongo sqlalchemy pyyaml msgpack boto ];
-
-    propagatedBuildInputs = with self; [ amqp_1 anyjson ] ++
-      (optionals (pythonOlder "2.7") [ importlib ordereddict ]);
-
-    # tests broken on python 2.6? https://github.com/nose-devs/nose/issues/806
-    doCheck = isPy27;
-
-    meta = {
-      description = "Messaging library for Python";
-      homepage    = "http://github.com/celery/kombu";
-      license     = licenses.bsd3;
-    };
-  };
-
   kombu = buildPythonPackage rec {
     name = "kombu-${version}";
     version = "4.0.2";
@@ -10294,7 +9935,7 @@ in {
 
   locustio = callPackage ../development/python-modules/locustio { };
 
-  llvmlite = callPackage ../development/python-modules/llvmlite {llvm=pkgs.llvm_4;};
+  llvmlite = callPackage ../development/python-modules/llvmlite {llvm=pkgs.llvm_5;};
 
   lockfile = buildPythonPackage rec {
     pname = "lockfile";
@@ -10324,25 +9965,7 @@ in {
 
   logilab-constraint = callPackage ../development/python-modules/logilab/constraint.nix {};
 
-  lxml = buildPythonPackage ( rec {
-    name = "lxml-3.8.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/lxml/${name}.tar.gz";
-      sha256 = "15nvf6n285n282682qyw3wihsncb0x5amdhyi4b83bfa2nz74vvk";
-    };
-
-    buildInputs = with self; [ pkgs.libxml2 pkgs.libxslt ];
-
-    hardeningDisable = stdenv.lib.optional stdenv.isDarwin "format";
-
-    meta = {
-      description = "Pythonic binding for the libxml2 and libxslt libraries";
-      homepage = http://lxml.de;
-      license = licenses.bsd3;
-      maintainers = with maintainers; [ sjourdois ];
-    };
-  });
+  lxml = callPackage ../development/python-modules/lxml {inherit (pkgs) libxml2 libxslt;};
 
   lxc = buildPythonPackage (rec {
     name = "python-lxc-unstable-2016-08-25";
@@ -10439,28 +10062,7 @@ in {
     };
   };
 
-
-  Mako = buildPythonPackage rec {
-    name = "Mako-1.0.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/Mako/${name}.tar.gz";
-      sha256 = "0nchpw6akfcsg8w6irjlx0gyzadc123hv4g47sijgnqd9nz9vngy";
-    };
-
-    buildInputs = with self; [ markupsafe nose mock pytest ];
-    propagatedBuildInputs = with self; [ markupsafe ];
-
-    doCheck = !isPyPy;  # https://bitbucket.org/zzzeek/mako/issue/238/2-tests-failed-on-pypy-24-25
-
-    meta = {
-      description = "Super-fast templating language";
-      homepage = http://www.makotemplates.org;
-      license = licenses.mit;
-      platforms = platforms.unix;
-      maintainers = with maintainers; [ domenkozar ];
-    };
-  };
+  Mako = callPackage ../development/python-modules/Mako { };
 
   manifestparser = callPackage ../development/python-modules/marionette-harness/manifestparser.nix {};
   marionette_driver = callPackage ../development/python-modules/marionette-harness/marionette_driver.nix {};
@@ -10517,22 +10119,7 @@ in {
     };
   };
 
-  markdown = buildPythonPackage rec {
-    version = "2.6.8";
-    name = "markdown-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/M/Markdown/Markdown-${version}.tar.gz";
-      sha256 = "0cqfhr1km2s5d8jm6hbwgkrrj9hvkjf2gab3s2axlrw1clgaij0a";
-    };
-
-    # error: invalid command 'test'
-    doCheck = false;
-
-    meta = {
-      homepage = http://www.freewisdom.org/projects/python-markdown;
-    };
-  };
+  markdown = callPackage ../development/python-modules/markdown { };
 
   markdownsuperscript = callPackage ../development/python-modules/markdownsuperscript {};
 
@@ -10890,23 +10477,7 @@ in {
 
   mistune = callPackage ../development/python-modules/mistune { };
 
-  brotlipy = buildPythonPackage rec {
-    name = "brotlipy-${version}";
-    version = "0.6.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/b/brotlipy/${name}.tar.gz";
-      sha256 = "10s2y19zywfkf3sksrw81czhva759aki0clld2pnnlgf64sz7016";
-    };
-
-    propagatedBuildInputs = with self; [ cffi enum34 construct ];
-
-    meta = {
-      description = "Python bindings for the reference Brotli encoder/decoder";
-      homepage = "https://github.com/python-hyper/brotlipy/";
-      license = licenses.mit;
-    };
-  };
+  brotlipy = callPackage ../development/python-modules/brotlipy { };
 
   sortedcontainers = buildPythonPackage rec {
     name = "sortedcontainers-${version}";
@@ -11545,9 +11116,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";
@@ -12446,6 +12017,8 @@ in {
     };
   };
 
+  plone-testing = callPackage ../development/python-modules/plone-testing { };
+
   ply = buildPythonPackage (rec {
     name = "ply-3.8";
 
@@ -13043,30 +12616,7 @@ in {
 
   parso = callPackage ../development/python-modules/parso { };
 
-  partd = buildPythonPackage rec {
-    name = "partd-${version}";
-    version = "0.3.7";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/partd/${name}.tar.gz";
-      sha256 = "066d254d2dh9xcanffgkjgwxpz5v0059b063bij10fvzl2y49hzx";
-    };
-
-    buildInputs = with self; [ pytest ];
-
-    propagatedBuildInputs = with self; [ locket numpy pandas pyzmq toolz ];
-
-    checkPhase = ''
-      rm partd/tests/test_zmq.py # requires network & fails
-      py.test
-    '';
-
-    meta = {
-      description = "Appendable key-value storage";
-      license = with licenses; [ bsd3 ];
-      homepage = https://github.com/dask/partd/;
-    };
-  };
+  partd = callPackage ../development/python-modules/partd { };
 
   patch = buildPythonPackage rec {
     name = "${pname}-${version}";
@@ -15675,23 +15225,7 @@ in {
 
   pyxattr = callPackage ../development/python-modules/pyxattr { };
 
-  pyaml = buildPythonPackage (rec {
-    name = "pyaml-15.02.1";
-    disabled = !isPy27;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pyaml/${name}.tar.gz";
-      sha256 = "8dfe1b295116115695752acc84d15ecf5c1c469975fbed7672bf41a6bc6d6d51";
-    };
-
-    buildInputs = with self; [ pyyaml ];
-
-    meta = {
-      description = "PyYAML-based module to produce pretty and readable YAML-serialized data";
-      homepage = https://github.com/mk-fg/pretty-yaml;
-    };
-  });
-
+  pyaml = callPackage ../development/python-modules/pyaml { };
 
   pyyaml = buildPythonPackage (rec {
     name = "PyYAML-3.12";
@@ -17759,6 +17293,8 @@ in {
     };
   });
 
+  splinter = callPackage ../development/python-modules/splinter { };
+
   spotipy = callPackage ../development/python-modules/spotipy { };
 
   Pweave = buildPythonPackage (rec {
@@ -17991,28 +17527,7 @@ in {
     };
   };
 
-  structlog = buildPythonPackage rec {
-    name = "structlog-16.1.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/s/structlog/${name}.tar.gz";
-      sha256 = "00dywyg3bqlkrmbrfrql21hpjjjkc4zjd6xxjyxyd15brfnzlkdl";
-    };
-
-    buildInputs = with self; [ pytest pretend freezegun ];
-    propagatedBuildInputs = with self; [ simplejson ];
-
-    checkPhase = ''
-      rm tests/test_twisted.py*
-      py.test
-    '';
-
-    meta = {
-      description = "Painless structural logging";
-      homepage = http://www.structlog.org/;
-      license = licenses.asl20;
-    };
-  };
+  structlog = callPackage ../development/python-modules/structlog { };
 
   svgwrite = buildPythonPackage rec {
     name = "svgwrite-${version}";
@@ -18296,39 +17811,9 @@ in {
   };
 
 
-  extras = buildPythonPackage rec {
-    name = "extras-${version}";
-    version = "0.0.3";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/e/extras/extras-${version}.tar.gz";
-      sha256 = "1h7zx4dfyclalg0fqnfjijpn0f793a9mx8sy3b27gd31nr6dhq3s";
-    };
-
-    # error: invalid command 'test'
-    doCheck = false;
-
-    meta = {
-      description = "A module provides basic functions for parsing mime-type names and matching them against a list of media-ranges";
-      homepage = https://code.google.com/p/mimeparse/;
-      license = licenses.mit;
-    };
-  };
-
-  texttable = self.buildPythonPackage rec {
-    name = "texttable-0.8.4";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/t/texttable/${name}.tar.gz";
-      sha256 = "0bkhs4dx9s6g7fpb969hygq56hyz4ncfamlynw72s0n6nqfbd1w5";
-    };
+  extras = callPackage ../development/python-modules/extras { };
 
-    meta = {
-      description = "A module to generate a formatted text table, using ASCII characters";
-      homepage = http://foutaise.org/code/;
-      license = licenses.lgpl2;
-    };
-  };
+  texttable = callPackage ../development/python-modules/texttable { };
 
   tiros = callPackage ../development/python-modules/tiros { };
 
@@ -18411,19 +17896,7 @@ in {
 
   toolz = callPackage ../development/python-modules/toolz { };
 
-  tox = buildPythonPackage rec {
-    name = "tox-${version}";
-    version = "2.4.1";
-
-    propagatedBuildInputs = with self; [ py virtualenv pluggy ];
-
-    doCheck = false;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/t/tox/${name}.tar.gz";
-      sha256 = "1nwn4jz8ns53n17bm1xkzlz4zyyxbgjwrcg2cjsn25ab7hd5fwv6";
-    };
-  };
+  tox = callPackage ../development/python-modules/tox { };
 
   tqdm = callPackage ../development/python-modules/tqdm { };
 
@@ -21385,31 +20858,7 @@ EOF
     };
   };
 
-  networkx = buildPythonPackage rec {
-    version = "1.11";
-    name = "networkx-${version}";
-
-    # Currently broken on PyPy.
-    # https://github.com/networkx/networkx/pull/1361
-    disabled = isPyPy;
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/n/networkx/${name}.tar.gz";
-      sha256 = "1f74s56xb4ggixiq0vxyfxsfk8p20c7a099lpcf60izv1php03hd";
-    };
-
-    buildInputs = with self; [ nose ];
-    propagatedBuildInputs = with self; [ decorator ];
-
-    # 17 failures with 3.6 https://github.com/networkx/networkx/issues/2396#issuecomment-304437299
-    doCheck = !(isPy36);
-
-    meta = {
-      homepage = "https://networkx.github.io/";
-      description = "Library for the creation, manipulation, and study of the structure, dynamics, and functions of complex networks";
-      license = licenses.bsd3;
-    };
-  };
+  networkx = callPackage ../development/python-modules/networkx { };
 
   ofxclient = callPackage ../development/python-modules/ofxclient {};
 
@@ -21886,22 +21335,7 @@ EOF
     };
   };
 
-  pluggy = buildPythonPackage rec {
-    name = "pluggy-${version}";
-    version = "0.3.1";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pluggy/${name}.tar.gz";
-      sha256 = "18qfzfm40bgx672lkg8q9x5hdh76n7vax99aank7vh2nw21wg70m";
-    };
-
-    meta = {
-      description = "Plugin and hook calling mechanisms for Python";
-      homepage = "https://pypi.python.org/pypi/pluggy";
-      license = licenses.mit;
-      maintainers = with maintainers; [ jgeerds ];
-    };
-  };
+  pluggy = callPackage ../development/python-modules/pluggy {};
 
   xcffib = buildPythonPackage rec {
     version = "0.3.2";
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index 62f7134616bf4..ce6fba9c40f3b 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -41,6 +41,7 @@ let
     libtool = nativePlatforms;
     libunistring = nativePlatforms;
     windows.wxMSW = nativePlatforms;
+    windows.mingw_w64_pthreads = nativePlatforms;
   };
 
   darwinCommon = {
@@ -123,6 +124,8 @@ in
   bootstrapTools = let
     tools = import ../stdenv/linux/make-bootstrap-tools-cross.nix { system = "x86_64-linux"; };
     maintainers = [ lib.maintainers.dezgeg ];
-    mkBootstrapToolsJob = drv: hydraJob' (lib.addMetaAttrs { inherit maintainers; } drv);
+    mkBootstrapToolsJob = drv:
+      assert lib.elem drv.system (supportedSystems ++ [ "aarch64-linux" ]);
+      hydraJob' (lib.addMetaAttrs { inherit maintainers; } drv);
   in lib.mapAttrsRecursiveCond (as: !lib.isDerivation as) (name: mkBootstrapToolsJob) tools;
 }
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 201c3a38cf8b4..5358738acb661 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -123,7 +123,10 @@ let
       stdenvBootstrapTools = with lib;
         genAttrs systemsWithAnySupport
           (system: {
-            inherit (import ../stdenv/linux/make-bootstrap-tools.nix { inherit system; })
+            inherit
+              (import ../stdenv/linux/make-bootstrap-tools.nix {
+                localSystem = { inherit system; };
+              })
               dist test;
           })
         # darwin is special in this
diff --git a/pkgs/top-level/splice.nix b/pkgs/top-level/splice.nix
index ea81b110080d8..1fde08d1d48b4 100644
--- a/pkgs/top-level/splice.nix
+++ b/pkgs/top-level/splice.nix
@@ -24,25 +24,52 @@
 lib: pkgs: actuallySplice:
 
 let
-  defaultBuildScope = pkgs.buildPackages // pkgs.buildPackages.xorg;
+  defaultBuildBuildScope = pkgs.buildPackages.buildPackages // pkgs.buildPackages.buildPackages.xorg;
+  defaultBuildHostScope = pkgs.buildPackages // pkgs.buildPackages.xorg;
+  defaultBuildTargetScope =
+    if pkgs.targetPlatform == pkgs.hostPlatform
+    then defaultBuildHostScope
+    else assert pkgs.hostPlatform == pkgs.buildPlatform; defaultHostTargetScope;
+  defaultHostHostScope = {}; # unimplemented
   # TODO(@Ericson2314): we shouldn't preclude run-time fetching by removing
   # these attributes. We should have a more general solution for selecting
   # whether `nativeDrv` or `crossDrv` is the default in `defaultScope`.
   pkgsWithoutFetchers = lib.filterAttrs (n: _: !lib.hasPrefix "fetch" n) pkgs;
-  defaultRunScope = pkgsWithoutFetchers // pkgs.xorg;
+  targetPkgsWithoutFetchers = lib.filterAttrs (n: _: !lib.hasPrefix "fetch" n) pkgs.targetPackages;
+  defaultHostTargetScope = pkgsWithoutFetchers // pkgs.xorg;
+  defaultTargetTargetScope = targetPkgsWithoutFetchers // targetPkgsWithoutFetchers.xorg or {};
 
-  splicer = buildPkgs: runPkgs: let
-    mash = buildPkgs // runPkgs;
+  splicer = pkgsBuildBuild: pkgsBuildHost: pkgsBuildTarget:
+            pkgsHostHost: pkgsHostTarget:
+            pkgsTargetTarget: let
+    mash =
+      # Other pkgs sets
+      pkgsBuildBuild // pkgsBuildTarget // pkgsHostHost // pkgsTargetTarget
+      # The same pkgs sets one probably intends
+      // pkgsBuildHost // pkgsHostTarget;
     merge = name: {
       inherit name;
       value = let
         defaultValue = mash.${name};
         # `or {}` is for the non-derivation attsert splicing case, where `{}` is the identity.
-        buildValue = buildPkgs.${name} or {};
-        runValue = runPkgs.${name} or {};
+        valueBuildBuild = pkgsBuildBuild.${name} or {};
+        valueBuildHost = pkgsBuildHost.${name} or {};
+        valueBuildTarget = pkgsBuildTarget.${name} or {};
+        valueHostHost = throw "`valueHostHost` unimplemented: pass manually rather than relying on splicer.";
+        valueHostTarget = pkgsHostTarget.${name} or {};
+        valueTargetTarget = pkgsTargetTarget.${name} or {};
         augmentedValue = defaultValue
-          // (lib.optionalAttrs (buildPkgs ? ${name}) { nativeDrv = buildValue; })
-          // (lib.optionalAttrs (runPkgs ? ${name}) { crossDrv = runValue; });
+          # TODO(@Ericson2314): Stop using old names after transition period
+          // (lib.optionalAttrs (pkgsBuildHost ? ${name}) { nativeDrv = valueBuildHost; })
+          // (lib.optionalAttrs (pkgsHostTarget ? ${name}) { crossDrv = valueHostTarget; })
+          // {
+            __spliced =
+                 (lib.optionalAttrs (pkgsBuildBuild ? ${name}) { buildBuild = valueBuildBuild; })
+              // (lib.optionalAttrs (pkgsBuildTarget ? ${name}) { buildTarget = valueBuildTarget; })
+              // { hostHost = valueHostHost; }
+              // (lib.optionalAttrs (pkgsTargetTarget ? ${name}) { targetTarget = valueTargetTarget;
+          });
+        };
         # Get the set of outputs of a derivation. If one derivation fails to
         # evaluate we don't want to diverge the entire splice, so we fall back
         # on {}
@@ -55,10 +82,15 @@ let
       in
         # The derivation along with its outputs, which we recur
         # on to splice them together.
-        if lib.isDerivation defaultValue then augmentedValue
-          // splicer (tryGetOutputs buildValue) (getOutputs runValue)
+        if lib.isDerivation defaultValue then augmentedValue // splicer
+          (tryGetOutputs valueBuildBuild) (tryGetOutputs valueBuildHost) (tryGetOutputs valueBuildTarget)
+          (tryGetOutputs valueHostHost) (getOutputs valueHostTarget)
+          (tryGetOutputs valueTargetTarget)
         # Just recur on plain attrsets
-        else if lib.isAttrs defaultValue then splicer buildValue runValue
+        else if lib.isAttrs defaultValue then splicer
+          valueBuildBuild valueBuildHost valueBuildTarget
+          {} valueHostTarget
+          valueTargetTarget
         # Don't be fancy about non-derivations. But we could have used used
         # `__functor__` for functions instead.
         else defaultValue;
@@ -67,11 +99,16 @@ let
 
   splicedPackages =
     if actuallySplice
-    then splicer defaultBuildScope defaultRunScope // {
-      # These should never be spliced under any circumstances
-      inherit (pkgs) pkgs buildPackages targetPackages
-        buildPlatform targetPlatform hostPlatform;
-    }
+    then
+      splicer
+        defaultBuildBuildScope defaultBuildHostScope defaultBuildTargetScope
+        defaultHostHostScope defaultHostTargetScope
+        defaultTargetTargetScope
+      // {
+        # These should never be spliced under any circumstances
+        inherit (pkgs) pkgs buildPackages targetPackages
+          buildPlatform targetPlatform hostPlatform;
+      }
     else pkgs // pkgs.xorg;
 
 in