about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/altcoins/go-ethereum.nix4
-rw-r--r--pkgs/applications/altcoins/zcash/default.nix2
-rw-r--r--pkgs/applications/audio/schismtracker/default.nix7
-rw-r--r--pkgs/applications/backup/deja-dup/default.nix32
-rw-r--r--pkgs/applications/editors/jetbrains/default.nix26
-rw-r--r--pkgs/applications/editors/vscode/default.nix8
-rw-r--r--pkgs/applications/misc/oneko/default.nix34
-rw-r--r--pkgs/applications/networking/cluster/kompose/default.nix23
-rw-r--r--pkgs/applications/networking/cluster/mesos/default.nix2
-rw-r--r--pkgs/applications/networking/cluster/terraform/default.nix11
-rw-r--r--pkgs/applications/networking/cluster/terraform/providers/data.nix102
-rw-r--r--pkgs/applications/networking/instant-messengers/coyim/default.nix5
-rw-r--r--pkgs/applications/networking/instant-messengers/hipchat/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/riot/riot-web.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix474
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix5
-rw-r--r--pkgs/applications/office/abiword/default.nix6
-rw-r--r--pkgs/applications/office/abiword/patches/fix-13791.patch161
-rw-r--r--pkgs/applications/office/paperwork/backend.nix2
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix9
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix1
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch47
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix8
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix4
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch18
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch6
-rw-r--r--pkgs/applications/window-managers/qtile/default.nix6
-rw-r--r--pkgs/applications/window-managers/weston/default.nix4
-rw-r--r--pkgs/build-support/setup-hooks/make-wrapper.sh18
-rw-r--r--pkgs/build-support/setup-hooks/multiple-outputs.sh12
-rw-r--r--pkgs/build-support/trivial-builders.nix2
-rw-r--r--pkgs/data/misc/tzdata/default.nix3
-rw-r--r--pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix6
-rw-r--r--pkgs/desktops/plasma-5/default.nix6
-rw-r--r--pkgs/development/compilers/chicken/eggDerivation.nix2
-rw-r--r--pkgs/development/compilers/dmd/2.067.1.nix2
-rw-r--r--pkgs/development/compilers/dmd/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix239
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix373
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix377
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix372
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix372
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix373
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix373
-rw-r--r--pkgs/development/compilers/go/1.4.nix3
-rw-r--r--pkgs/development/compilers/jsonnet/default.nix1
-rw-r--r--pkgs/development/compilers/llvm/3.4/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.5/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.7/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.8/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.9/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/4/llvm.nix4
-rw-r--r--pkgs/development/compilers/llvm/5/llvm.nix4
-rw-r--r--pkgs/development/compilers/mono/llvm.nix4
-rw-r--r--pkgs/development/compilers/openjdk-darwin/8.nix2
-rw-r--r--pkgs/development/compilers/openjdk-darwin/default.nix2
-rw-r--r--pkgs/development/compilers/openjdk/7.nix4
-rw-r--r--pkgs/development/compilers/openjdk/8.nix4
-rw-r--r--pkgs/development/compilers/openjdk/9.nix4
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk-linux-base.nix2
-rw-r--r--pkgs/development/compilers/oraclejdk/jdk9-linux.nix2
-rw-r--r--pkgs/development/compilers/rust/binaryBuild.nix5
-rw-r--r--pkgs/development/compilers/rust/rustc.nix10
-rw-r--r--pkgs/development/compilers/zulu/8.nix2
-rw-r--r--pkgs/development/compilers/zulu/default.nix2
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix2
-rw-r--r--pkgs/development/haskell-modules/configuration-ghc-8.0.x.nix2
-rw-r--r--pkgs/development/haskell-modules/hackage-packages.nix1230
-rw-r--r--pkgs/development/interpreters/lush/default.nix4
-rw-r--r--pkgs/development/interpreters/perl/default.nix1
-rw-r--r--pkgs/development/interpreters/python/build-python-package.nix16
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix2
-rw-r--r--pkgs/development/interpreters/python/cpython/3.4/default.nix2
-rw-r--r--pkgs/development/interpreters/python/cpython/3.5/default.nix2
-rw-r--r--pkgs/development/interpreters/python/cpython/3.6/default.nix2
-rw-r--r--pkgs/development/interpreters/python/mk-python-derivation.nix34
-rw-r--r--pkgs/development/interpreters/python/pypy/2.7/default.nix2
-rw-r--r--pkgs/development/interpreters/python/wrap.sh4
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix7
-rw-r--r--pkgs/development/libraries/SDL2/default.nix5
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix2
-rw-r--r--pkgs/development/libraries/boost/generic.nix2
-rw-r--r--pkgs/development/libraries/czmq/3.x.nix2
-rw-r--r--pkgs/development/libraries/czmq/4.x.nix9
-rw-r--r--pkgs/development/libraries/czmq/czmq3-gcc7.patch26
-rw-r--r--pkgs/development/libraries/eccodes/default.nix6
-rw-r--r--pkgs/development/libraries/glibc/common.nix1
-rw-r--r--pkgs/development/libraries/grantlee/5/setup-hook.sh18
-rw-r--r--pkgs/development/libraries/grib-api/default.nix4
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix15
-rw-r--r--pkgs/development/libraries/kde-frameworks/default.nix6
-rw-r--r--pkgs/development/libraries/kmsxx/default.nix4
-rw-r--r--pkgs/development/libraries/libbfd/default.nix47
-rw-r--r--pkgs/development/libraries/libiberty/default.nix11
-rw-r--r--pkgs/development/libraries/libinput/default.nix4
-rw-r--r--pkgs/development/libraries/libopcodes/default.nix43
-rw-r--r--pkgs/development/libraries/libusb1/default.nix4
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libxml2/default.nix4
-rw-r--r--pkgs/development/libraries/libxslt/default.nix6
-rw-r--r--pkgs/development/libraries/lightning/default.nix5
-rw-r--r--pkgs/development/libraries/physics/rivet/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.sh21
-rw-r--r--pkgs/development/libraries/science/math/atlas/default.nix4
-rw-r--r--pkgs/development/libraries/wayland/default.nix4
-rw-r--r--pkgs/development/libraries/wayland/protocols.nix4
-rw-r--r--pkgs/development/perl-modules/generic/builder.sh4
-rw-r--r--pkgs/development/python-modules/absl-py/default.nix4
-rw-r--r--pkgs/development/python-modules/aiohttp/default.nix4
-rw-r--r--pkgs/development/python-modules/arelle/default.nix3
-rw-r--r--pkgs/development/python-modules/argcomplete/default.nix4
-rw-r--r--pkgs/development/python-modules/asn1ate/default.nix3
-rw-r--r--pkgs/development/python-modules/augeas/default.nix3
-rw-r--r--pkgs/development/python-modules/bash_kernel/default.nix47
-rw-r--r--pkgs/development/python-modules/blockdiag/default.nix3
-rw-r--r--pkgs/development/python-modules/bokeh/default.nix1
-rw-r--r--pkgs/development/python-modules/bootstrapped-pip/default.nix4
-rw-r--r--pkgs/development/python-modules/bottleneck/default.nix5
-rw-r--r--pkgs/development/python-modules/cffi/default.nix14
-rw-r--r--pkgs/development/python-modules/cgroup-utils/default.nix3
-rw-r--r--pkgs/development/python-modules/construct/default.nix3
-rw-r--r--pkgs/development/python-modules/coverage/default.nix4
-rw-r--r--pkgs/development/python-modules/cufflinks/default.nix4
-rw-r--r--pkgs/development/python-modules/cymem/default.nix9
-rw-r--r--pkgs/development/python-modules/django-hijack/default.nix5
-rw-r--r--pkgs/development/python-modules/djangorestframework/default.nix4
-rw-r--r--pkgs/development/python-modules/dkimpy/default.nix3
-rw-r--r--pkgs/development/python-modules/dulwich/default.nix4
-rw-r--r--pkgs/development/python-modules/ecpy/default.nix4
-rw-r--r--pkgs/development/python-modules/faker/default.nix4
-rw-r--r--pkgs/development/python-modules/first/default.nix7
-rw-r--r--pkgs/development/python-modules/geopandas/default.nix3
-rw-r--r--pkgs/development/python-modules/gevent/default.nix13
-rw-r--r--pkgs/development/python-modules/gflags/default.nix3
-rw-r--r--pkgs/development/python-modules/hmmlearn/default.nix3
-rw-r--r--pkgs/development/python-modules/hyperlink/default.nix8
-rw-r--r--pkgs/development/python-modules/ipywidgets/default.nix4
-rw-r--r--pkgs/development/python-modules/jedi/default.nix4
-rw-r--r--pkgs/development/python-modules/keras/default.nix4
-rw-r--r--pkgs/development/python-modules/keystoneclient/default.nix3
-rw-r--r--pkgs/development/python-modules/keyutils/default.nix3
-rw-r--r--pkgs/development/python-modules/libgpuarray/default.nix21
-rw-r--r--pkgs/development/python-modules/libtmux/default.nix4
-rw-r--r--pkgs/development/python-modules/llfuse/default.nix4
-rw-r--r--pkgs/development/python-modules/locustio/default.nix32
-rw-r--r--pkgs/development/python-modules/markdown2/default.nix4
-rw-r--r--pkgs/development/python-modules/murmurhash/default.nix11
-rw-r--r--pkgs/development/python-modules/natsort/default.nix4
-rw-r--r--pkgs/development/python-modules/nilearn/default.nix2
-rw-r--r--pkgs/development/python-modules/nwdiag/default.nix6
-rw-r--r--pkgs/development/python-modules/parso/default.nix4
-rw-r--r--pkgs/development/python-modules/path.py/default.nix4
-rw-r--r--pkgs/development/python-modules/pexpect/default.nix44
-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/plaster-pastedeploy/default.nix4
-rw-r--r--pkgs/development/python-modules/powerline/default.nix8
-rw-r--r--pkgs/development/python-modules/protobuf/default.nix2
-rw-r--r--pkgs/development/python-modules/psutil/default.nix28
-rw-r--r--pkgs/development/python-modules/pwntools/default.nix2
-rw-r--r--pkgs/development/python-modules/pyGithub/default.nix3
-rw-r--r--pkgs/development/python-modules/pybfd/default.nix20
-rw-r--r--pkgs/development/python-modules/pychromecast/default.nix3
-rw-r--r--pkgs/development/python-modules/pycrypto/default.nix3
-rw-r--r--pkgs/development/python-modules/pycuda/compyte.nix9
-rw-r--r--pkgs/development/python-modules/pyev/default.nix4
-rw-r--r--pkgs/development/python-modules/pyftgl/default.nix8
-rw-r--r--pkgs/development/python-modules/pygame/git.nix3
-rw-r--r--pkgs/development/python-modules/pygobject/3.nix4
-rw-r--r--pkgs/development/python-modules/pygobject/default.nix3
-rw-r--r--pkgs/development/python-modules/pygtk/default.nix4
-rw-r--r--pkgs/development/python-modules/pygtksourceview/default.nix8
-rw-r--r--pkgs/development/python-modules/pyocr/default.nix3
-rw-r--r--pkgs/development/python-modules/pyqt/4.x.nix6
-rw-r--r--pkgs/development/python-modules/pyqt/5.x.nix6
-rw-r--r--pkgs/development/python-modules/pyro/default.nix5
-rw-r--r--pkgs/development/python-modules/pyslurm/default.nix4
-rw-r--r--pkgs/development/python-modules/pysoundfile/default.nix4
-rw-r--r--pkgs/development/python-modules/pytest-expect/default.nix5
-rw-r--r--pkgs/development/python-modules/pytest/2_7.nix4
-rw-r--r--pkgs/development/python-modules/pytest/2_8.nix4
-rw-r--r--pkgs/development/python-modules/pytest/2_9.nix4
-rw-r--r--pkgs/development/python-modules/pytest/default.nix12
-rw-r--r--pkgs/development/python-modules/python-utils/default.nix3
-rw-r--r--pkgs/development/python-modules/python_fedora/default.nix2
-rw-r--r--pkgs/development/python-modules/rackspace-novaclient/default.nix33
-rw-r--r--pkgs/development/python-modules/raven/default.nix4
-rw-r--r--pkgs/development/python-modules/recursive-pth-loader/default.nix4
-rw-r--r--pkgs/development/python-modules/restructuredtext_lint/default.nix4
-rw-r--r--pkgs/development/python-modules/robomachine/default.nix4
-rw-r--r--pkgs/development/python-modules/robotframework-ride/default.nix3
-rw-r--r--pkgs/development/python-modules/robotframework/default.nix3
-rw-r--r--pkgs/development/python-modules/scapy/default.nix4
-rw-r--r--pkgs/development/python-modules/selenium/default.nix7
-rw-r--r--pkgs/development/python-modules/seqdiag/default.nix6
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix4
-rw-r--r--pkgs/development/python-modules/spacy/default.nix15
-rw-r--r--pkgs/development/python-modules/sphfile/default.nix3
-rw-r--r--pkgs/development/python-modules/spotipy/default.nix2
-rw-r--r--pkgs/development/python-modules/sybase/default.nix3
-rw-r--r--pkgs/development/python-modules/systemd/default.nix3
-rw-r--r--pkgs/development/python-modules/tensorflow/default.nix2
-rw-r--r--pkgs/development/python-modules/testfixtures/default.nix4
-rw-r--r--pkgs/development/python-modules/thespian/default.nix26
-rw-r--r--pkgs/development/python-modules/thinc/default.nix11
-rw-r--r--pkgs/development/python-modules/tiros/default.nix4
-rw-r--r--pkgs/development/python-modules/tqdm/default.nix6
-rw-r--r--pkgs/development/python-modules/trollius/default.nix2
-rw-r--r--pkgs/development/python-modules/u-msgpack-python/default.nix3
-rw-r--r--pkgs/development/python-modules/umemcache/default.nix3
-rw-r--r--pkgs/development/python-modules/uritools/default.nix2
-rw-r--r--pkgs/development/python-modules/urwid/default.nix5
-rw-r--r--pkgs/development/python-modules/usbtmc/default.nix3
-rw-r--r--pkgs/development/python-modules/waitress-django/default.nix8
-rw-r--r--pkgs/development/python-modules/webencodings/default.nix5
-rw-r--r--pkgs/development/python-modules/widgetsnbextension/default.nix4
-rw-r--r--pkgs/development/python-modules/wxPython/3.0.nix3
-rw-r--r--pkgs/development/r-modules/generic-builder.nix4
-rw-r--r--pkgs/development/tools/analysis/garcosim/tracefilegen/builder.sh17
-rw-r--r--pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix25
-rw-r--r--pkgs/development/tools/analysis/garcosim/tracefilegen/gcc7.patch13
-rw-r--r--pkgs/development/tools/analysis/kcov/default.nix7
-rw-r--r--pkgs/development/tools/build-managers/gradle/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/ninja/default.nix31
-rw-r--r--pkgs/development/tools/build-managers/redo-sh/default.nix2
-rw-r--r--pkgs/development/tools/continuous-integration/gitlab-runner/default.nix8
-rw-r--r--pkgs/development/tools/misc/binutils/build-components-separately.patch178
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix31
-rw-r--r--pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch23
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix27
-rw-r--r--pkgs/development/tools/profiling/EZTrace/default.nix13
-rw-r--r--pkgs/development/tools/profiling/oprofile/default.nix13
-rw-r--r--pkgs/development/tools/profiling/sysprof/default.nix8
-rw-r--r--pkgs/development/tools/wp-cli/default.nix4
-rw-r--r--pkgs/development/web/nodejs/v9.nix4
-rw-r--r--pkgs/games/freedink/default.nix7
-rw-r--r--pkgs/games/freesweep/default.nix35
-rw-r--r--pkgs/games/macopix/default.nix7
-rw-r--r--pkgs/games/mudlet/default.nix2
-rw-r--r--pkgs/games/pysolfc/default.nix39
-rw-r--r--pkgs/games/pysolfc/pysolfc-datadir.patch19
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix150
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch62
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch87
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch10
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch45
-rw-r--r--pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch11
-rw-r--r--pkgs/misc/emulators/openmsx/custom-nixos.mk9
-rw-r--r--pkgs/misc/emulators/openmsx/default.nix48
-rw-r--r--pkgs/misc/emulators/retroarch/cores.nix2
-rw-r--r--pkgs/misc/emulators/retrofe/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-sdk/default.nix26
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix28
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix2
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/configd/default.nix4
-rw-r--r--pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix4
-rw-r--r--pkgs/os-specific/darwin/binutils/default.nix9
-rw-r--r--pkgs/os-specific/darwin/cctools/port.nix8
-rw-r--r--pkgs/os-specific/linux/alsa-lib/default.nix4
-rw-r--r--pkgs/os-specific/linux/alsa-plugins/default.nix4
-rw-r--r--pkgs/os-specific/linux/alsa-tools/default.nix4
-rw-r--r--pkgs/os-specific/linux/alsa-utils/default.nix4
-rw-r--r--pkgs/os-specific/linux/conky/default.nix12
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/default.nix83
-rw-r--r--pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch176
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix4
-rw-r--r--pkgs/os-specific/linux/ipset/default.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.13.nix4
-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/lvm2/default.nix4
-rw-r--r--pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch41
-rw-r--r--pkgs/servers/monitoring/munin/default.nix11
-rw-r--r--pkgs/servers/monitoring/munin/preserve_environment.patch41
-rw-r--r--pkgs/servers/nosql/apache-jena/fuseki-binary.nix2
-rw-r--r--pkgs/servers/nosql/influxdb/default.nix4
-rw-r--r--pkgs/servers/openafs-client/default.nix12
-rw-r--r--pkgs/servers/sql/oracle-xe/default.nix2
-rw-r--r--pkgs/servers/traefik/default.nix19
-rw-r--r--pkgs/servers/web-apps/wordpress/default.nix4
-rw-r--r--pkgs/servers/x11/xorg/builder.sh26
-rw-r--r--pkgs/stdenv/darwin/default.nix43
-rw-r--r--pkgs/stdenv/darwin/standard-sandbox.sb72
-rw-r--r--pkgs/stdenv/generic/setup.sh79
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-cross.nix1
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools.nix1
-rw-r--r--pkgs/tools/X11/go-sct/default.nix2
-rw-r--r--pkgs/tools/filesystems/ceph/generic.nix4
-rw-r--r--pkgs/tools/filesystems/grive/default.nix8
-rw-r--r--pkgs/tools/filesystems/grive2/default.nix4
-rw-r--r--pkgs/tools/graphics/povray/default.nix6
-rw-r--r--pkgs/tools/inputmethods/skk/skk-dicts/default.nix73
-rw-r--r--pkgs/tools/misc/ckb/ckb-animations-location.patch4
-rw-r--r--pkgs/tools/misc/ckb/default.nix12
-rw-r--r--pkgs/tools/misc/diffoscope/default.nix4
-rw-r--r--pkgs/tools/misc/hdf5/1_8.nix76
-rw-r--r--pkgs/tools/misc/hdf5/default.nix13
-rw-r--r--pkgs/tools/misc/man-db/default.nix4
-rw-r--r--pkgs/tools/misc/system-config-printer/default.nix67
-rw-r--r--pkgs/tools/package-management/rpm/default.nix7
-rw-r--r--pkgs/tools/security/pius/default.nix32
-rw-r--r--pkgs/tools/security/sbsigntool/default.nix10
-rw-r--r--pkgs/tools/system/lr/default.nix4
-rw-r--r--pkgs/tools/system/minijail/default.nix39
-rw-r--r--pkgs/tools/system/pciutils/default.nix4
-rw-r--r--pkgs/tools/text/groff/default.nix45
-rw-r--r--pkgs/tools/text/popfile/default.nix4
-rw-r--r--pkgs/tools/typesetting/pdf2djvu/default.nix5
-rw-r--r--pkgs/top-level/aliases.nix1
-rw-r--r--pkgs/top-level/all-packages.nix39
-rw-r--r--pkgs/top-level/lua-packages.nix4
-rw-r--r--pkgs/top-level/metrics.nix11
-rw-r--r--pkgs/top-level/perl-packages.nix39
-rw-r--r--pkgs/top-level/python-packages.nix240
316 files changed, 5283 insertions, 3098 deletions
diff --git a/pkgs/applications/altcoins/go-ethereum.nix b/pkgs/applications/altcoins/go-ethereum.nix
index 04e68b1f12824..ca28dfb76b80a 100644
--- a/pkgs/applications/altcoins/go-ethereum.nix
+++ b/pkgs/applications/altcoins/go-ethereum.nix
@@ -2,7 +2,7 @@
 
 buildGoPackage rec {
   name = "go-ethereum-${version}";
-  version = "1.7.2";
+  version = "1.7.3";
   goPackagePath = "github.com/ethereum/go-ethereum";
 
   # Fix for usb-related segmentation faults on darwin
@@ -16,7 +16,7 @@ buildGoPackage rec {
     owner = "ethereum";
     repo = "go-ethereum";
     rev = "v${version}";
-    sha256 = "11n77zlf8qixhx26sqf33v911716msi6h0z4ng8gxhzhznrn2nrd";
+    sha256 = "1w6rbq2qpjyf2v9mr18yiv2af1h2sgyvgrdk4bd8ixgl3qcd5b11";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/altcoins/zcash/default.nix b/pkgs/applications/altcoins/zcash/default.nix
index aa912f04efb5d..c1aad8e570c31 100644
--- a/pkgs/applications/altcoins/zcash/default.nix
+++ b/pkgs/applications/altcoins/zcash/default.nix
@@ -45,6 +45,6 @@ stdenv.mkDerivation rec {
     homepage = https://z.cash/;
     maintainers = with maintainers; [ rht ];
     license = licenses.mit;
-    platforms = platforms.unix;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/schismtracker/default.nix b/pkgs/applications/audio/schismtracker/default.nix
index 2b2fd161ede32..22786304faa9b 100644
--- a/pkgs/applications/audio/schismtracker/default.nix
+++ b/pkgs/applications/audio/schismtracker/default.nix
@@ -9,10 +9,17 @@ stdenv.mkDerivation rec {
     sha256 = "1ny7wv2wxm1av299wvpskall6438wjjpadphmqc7c0h6d0zg5kii";
   };
 
+  preConfigure = ''
+    # Build fails on Linux with windres.
+    export ac_cv_prog_ac_ct_WINDRES=
+  '';
+
   configureFlags = "--enable-dependency-tracking";
 
   buildInputs = [ alsaLib python SDL ];
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Music tracker application, free reimplementation of Impulse Tracker";
     homepage = http://schismtracker.org/;
diff --git a/pkgs/applications/backup/deja-dup/default.nix b/pkgs/applications/backup/deja-dup/default.nix
index c330aeb0092c2..7382e84fa0739 100644
--- a/pkgs/applications/backup/deja-dup/default.nix
+++ b/pkgs/applications/backup/deja-dup/default.nix
@@ -2,7 +2,7 @@
 , gnome3, libnotify, intltool, itstool, glib, gtk3, libxml2
 , coreutils, libsecret, pcre, libxkbcommon, wrapGAppsHook
 , libpthreadstubs, libXdmcp, epoxy, at_spi2_core, dbus, libgpgerror
-, appstream-glib, desktop_file_utils, atk, pango, duplicity
+, appstream-glib, desktop_file_utils, duplicity
 }:
 
 stdenv.mkDerivation rec {
@@ -44,29 +44,15 @@ stdenv.mkDerivation rec {
     glib-compile-schemas $out/share/glib-2.0/schemas
   '';
 
-  # Manual rpath definition until https://github.com/mesonbuild/meson/issues/314 is fixed
-  postFixup =
-    let
-      rpath = stdenv.lib.makeLibraryPath [
-        glib
-        gtk3
-        gnome3.gnome_online_accounts
-        gnome3.libpeas
-        gnome3.nautilus
-        libgpgerror
-        libsecret
-        # Transitive
-        atk
-        pango
-      ];
-    in ''
-      # Unwrap accidentally wrapped library
-      mv $out/libexec/deja-dup/tools/.libduplicity.so-wrapped $out/libexec/deja-dup/tools/libduplicity.so
+  postFixup = ''
+    # Unwrap accidentally wrapped library
+    mv $out/libexec/deja-dup/tools/.libduplicity.so-wrapped $out/libexec/deja-dup/tools/libduplicity.so
 
-      for elf in "$out"/bin/.*-wrapped "$out"/libexec/deja-dup/.deja-dup-monitor-wrapped "$out"/libexec/deja-dup/tools/*.so "$out"/lib/deja-dup/*.so "$out"/lib/nautilus/extensions-3.0/*.so; do
-        patchelf --set-rpath '${rpath}':"$out/lib/deja-dup" "$elf"
-      done
-    '';
+    # Patched meson does not add internal libraries to rpath
+    for elf in "$out/bin/.deja-dup-wrapped" "$out/libexec/deja-dup/.deja-dup-monitor-wrapped" "$out/libexec/deja-dup/tools/libduplicity.so"; do
+      patchelf --set-rpath "$(patchelf --print-rpath "$elf"):$out/lib/deja-dup" "$elf"
+    done
+  '';
 
   meta = with stdenv.lib; {
     description = "A simple backup tool";
diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index 746da7534e681..fabb0982d4653 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -77,15 +77,15 @@ let
       };
     });
 
-  buildGogland = { name, version, src, license, description, wmClass, update-channel }:
+  buildGoland = { name, version, src, license, description, wmClass, update-channel }:
     lib.overrideDerivation (mkJetBrainsProduct {
       inherit name version src wmClass jdk;
-      product = "Gogland";
+      product = "Goland";
       meta = with stdenv.lib; {
         homepage = https://www.jetbrains.com/go/;
         inherit description license;
         longDescription = ''
-          Gogland is the codename for a new commercial IDE by JetBrains
+          Goland is the codename for a new commercial IDE by JetBrains
           aimed at providing an ergonomic environment for Go development.
           The new IDE extends the IntelliJ platform with the coding assistance
           and tool integrations specific for the Go language
@@ -96,9 +96,9 @@ let
     }) (attrs: {
       postFixup = (attrs.postFixup or "") + ''
         interp="$(cat $NIX_CC/nix-support/dynamic-linker)"
-        patchelf --set-interpreter $interp $out/gogland*/plugins/intellij-go-plugin/lib/dlv/linux/dlv
+        patchelf --set-interpreter $interp $out/goland*/plugins/intellij-go-plugin/lib/dlv/linux/dlv
 
-        chmod +x $out/gogland*/plugins/intellij-go-plugin/lib/dlv/linux/dlv
+        chmod +x $out/goland*/plugins/intellij-go-plugin/lib/dlv/linux/dlv
       '';
     });
 
@@ -239,28 +239,28 @@ in
 
   datagrip = buildDataGrip rec {
     name = "datagrip-${version}";
-    version = "2017.2.2"; /* updated by script */
+    version = "2017.2.3"; /* updated by script */
     description = "Your Swiss Army Knife for Databases and SQL";
     license = stdenv.lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
-      sha256 = "1l8y65fw9g5ckzwpcgigm2qwy8fhpw2hil576rphsnx6qvnh4swn"; /* updated by script */
+      sha256 = "0yp5h8ps5hfi07gsz14pp61skibfx48klg8qmc4f6q6xzcfdqxsf"; /* updated by script */
     };
     wmClass = "jetbrains-datagrip";
     update-channel = "datagrip_2017_2";
   };
 
-  gogland = buildGogland rec {
-    name = "gogland-${version}";
-    version = "173.2696.28"; /* updated by script */
+  goland = buildGoland rec {
+    name = "goland-${version}";
+    version = "173.3727.79"; /* updated by script */
     description = "Up and Coming Go IDE";
     license = stdenv.lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/go/${name}.tar.gz";
-      sha256 = "07nz2pf7fnjxsvc82vihk2i880cji349czxzshr1dk50ixlydq7n"; /* updated by script */
+      sha256 = "0bmd7r3h76pg0s9m3i5qv7zfkcj3gannj0c12cw087b831ga7ccz"; /* updated by script */
     };
-    wmClass = "jetbrains-gogland";
-    update-channel = "gogland_1.0_EAP";
+    wmClass = "jetbrains-goland";
+    update-channel = "goland_1.0_EAP";
   };
 
   idea-community = buildIdea rec {
diff --git a/pkgs/applications/editors/vscode/default.nix b/pkgs/applications/editors/vscode/default.nix
index 66ff8b5a91c81..c87563293bab9 100644
--- a/pkgs/applications/editors/vscode/default.nix
+++ b/pkgs/applications/editors/vscode/default.nix
@@ -2,7 +2,7 @@
   makeWrapper, libXScrnSaver, libxkbfile, libsecret }:
 
 let
-  version = "1.18.0";
+  version = "1.18.1";
   channel = "stable";
 
   plat = {
@@ -12,9 +12,9 @@ let
   }.${stdenv.system};
 
   sha256 = {
-    "i686-linux" = "0xwfnw15792lxr5npc71yyw5yyaqi3nifqgv6vpi8ibl6c8zs97d";
-    "x86_64-linux" = "0qzj2qrzbdk27mggh0f9fs3s99bffvnrnbsparbzdag5jjmry2py";
-    "x86_64-darwin" = "1g5rf6g9q9hh4gzg6nb37pyq9dpjj0wapivv5dsvmn0j3cp69cv4";
+    "i686-linux" = "13gs0spqkbxw4i3a0b060v5bi68zfkp3i8vqk41i0fkbshnc7c7i";
+    "x86_64-linux" = "0h7nfyrn4ybm9p1czjb48p3cd3970hpyn6pj8l4ir1hqygcq6dwi";
+    "x86_64-darwin" = "093k8s2msi0xz11wy2yf1rppwkx6kv5psgii4w44l59ji8qgpamk";
   }.${stdenv.system};
 
   archive_fmt = if stdenv.system == "x86_64-darwin" then "zip" else "tar.gz";
diff --git a/pkgs/applications/misc/oneko/default.nix b/pkgs/applications/misc/oneko/default.nix
new file mode 100644
index 0000000000000..39c9cc0afc4a3
--- /dev/null
+++ b/pkgs/applications/misc/oneko/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, xorg, x11 }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.sakura.5";
+  vname = "1.2.5";
+  name = "oneko-${vname}";
+  src = fetchurl {
+    url = "http://www.daidouji.com/oneko/distfiles/oneko-${version}.tar.gz";
+    sha256 = "2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f";
+  };
+  buildInputs = [ xorg.imake xorg.gccmakedep x11 ];
+  
+  configurePhase = "xmkmf";
+
+  installPhase = ''
+    make install BINDIR=$out/bin
+    make install.man MANPATH=$out/share/man
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Creates a cute cat chasing around your mouse cursor";
+    longDescription = ''
+    Oneko changes your mouse cursor into a mouse
+    and creates a little cute cat, which starts
+    chasing around your mouse cursor.
+    When the cat is done catching the mouse, it starts sleeping.
+    '';
+    homepage = "http://www.daidouji.com/oneko/";
+    license = licenses.publicDomain;
+    maintainers = [ maintainers.xaverdh ];
+    meta.platforms = platforms.unix;
+  };
+}
+
diff --git a/pkgs/applications/networking/cluster/kompose/default.nix b/pkgs/applications/networking/cluster/kompose/default.nix
new file mode 100644
index 0000000000000..b2c97d1ea396e
--- /dev/null
+++ b/pkgs/applications/networking/cluster/kompose/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, buildGoPackage, fetchFromGitHub }:
+
+buildGoPackage rec {
+  name = "kompose-${version}";
+  version = "1.5.0";
+
+  goPackagePath = "github.com/kubernetes/kompose";
+
+  src = fetchFromGitHub {
+    rev = "v${version}";
+    owner = "kubernetes";
+    repo = "kompose";
+    sha256 = "1r5f8jbr2c1xxb5fpfgy23w4m30zahhmrw23jlk1hpx2w1pi1iyh";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A tool to help users who are familiar with docker-compose move to Kubernetes";
+    homepage = https://github.com/kubernetes/kompose;
+    license = licenses.asl20;
+    maintainers = with maintainers; [thpham];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix
index 9092422739301..6654ee89c8068 100644
--- a/pkgs/applications/networking/cluster/mesos/default.nix
+++ b/pkgs/applications/networking/cluster/mesos/default.nix
@@ -14,6 +14,8 @@ let
   #   src/common/command_utils.cpp
   # https://github.com/NixOS/nixpkgs/issues/13783
   tarWithGzip = lib.overrideDerivation gnutar (oldAttrs: {
+    # Original builder is bash 4.3.42 from bootstrap tools, too old for makeWrapper.
+    builder = "${bash}/bin/bash";
     buildInputs = (oldAttrs.buildInputs or []) ++ [ makeWrapper ];
     postInstall = (oldAttrs.postInstall or "") + ''
       wrapProgram $out/bin/tar --prefix PATH ":" "${gzip}/bin"
diff --git a/pkgs/applications/networking/cluster/terraform/default.nix b/pkgs/applications/networking/cluster/terraform/default.nix
index e6e3585a4d13b..1fce0695bfd44 100644
--- a/pkgs/applications/networking/cluster/terraform/default.nix
+++ b/pkgs/applications/networking/cluster/terraform/default.nix
@@ -91,8 +91,15 @@ in {
   };
 
   terraform_0_10 = pluggable (generic {
-    version = "0.10.7";
-    sha256 = "0gjvrra255m973nzi7rpqp5dn5npnd79cnv8vjcs7wmkdj1hli0l";
+    version = "0.10.8";
+    sha256 = "11hhij0hq99xhwlg5dx5nv7y074x79wkr8hr3wc6ln0kwdk5scdf";
+    patches = [ ./provider-path.patch ];
+    passthru = { inherit plugins; };
+  });
+
+  terraform_0_11 = pluggable (generic {
+    version = "0.11.0";
+    sha256 = "0qsydg6bn7k6d68pd1y4j5iys9i66c690yq21axcpnjfibxgqyff";
     patches = [ ./provider-path.patch ];
     passthru = { inherit plugins; };
   });
diff --git a/pkgs/applications/networking/cluster/terraform/providers/data.nix b/pkgs/applications/networking/cluster/terraform/providers/data.nix
index d29bd96486097..675e3f768ebf4 100644
--- a/pkgs/applications/networking/cluster/terraform/providers/data.nix
+++ b/pkgs/applications/networking/cluster/terraform/providers/data.nix
@@ -32,8 +32,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-aws";
-      version = "1.0.0";
-      sha256  = "1x3ldlx2iryxwfaws8ng9n0k06p7n8xqc6sjyxw73jdasxbh8wgi";
+      version = "1.3.1";
+      sha256  = "0vsvvw1qdjb69jilhjl5g8h7dn82n0n23k2v67dqywhinilafcmv";
     };
   azure =
     {
@@ -46,8 +46,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-azurerm";
-      version = "0.2.2";
-      sha256  = "1jdkj1zylrlcd2qkfkl81i0ybdpmvbvvsk0f4ahafiqp550srf2d";
+      version = "0.3.3";
+      sha256  = "0qq10gjwka0268ylzx5r7qhj0xpjh8fxrjr1fwbiq8sp6i1jb7sa";
     };
   bitbucket =
     {
@@ -84,6 +84,13 @@
       version = "0.1.0";
       sha256  = "073j0kqkccj7yrqz6j4vx722vmy6mmvmgidamkjnhhjcwm6g1jbq";
     };
+  cloudscale =
+    {
+      owner   = "terraform-providers";
+      repo    = "terraform-provider-cloudscale";
+      version = "1.0.0";
+      sha256  = "0yqiz4xywbd3568hl6va8da81fbc1hnynlz4z0vqxgi3bs8hhdhz";
+    };
   cloudstack =
     {
       owner   = "terraform-providers";
@@ -95,8 +102,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-cobbler";
-      version = "0.1.0";
-      sha256  = "1867aqlz1v7scybaia9yakaxw76lh6y2whhajv5pqy1ng58rcgiz";
+      version = "1.0.0";
+      sha256  = "0v7j9r2ic3ks2hy80mx5xay05m6r52vclsbbbf9vb0srnrvz21gy";
     };
   consul =
     {
@@ -109,8 +116,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-datadog";
-      version = "0.1.1";
-      sha256  = "0nyqybi3fl9qlhpx2n0vjz7kn3bqhf4wy93zhq3j3853zxpcjpzc";
+      version = "1.0.0";
+      sha256  = "1kabjhq7xl2mhh0gvg87a9zh8y2k0h5ghcmb86xzvx25j3jdqfg6";
     };
   digitalocean =
     {
@@ -144,15 +151,15 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-docker";
-      version = "0.1.0";
-      sha256  = "1nacxkyy12w4rj1bdf5ayqmmm47nwh362pcksr227rkwmsjlmg1m";
+      version = "0.1.1";
+      sha256  = "02lhbl34dq7lsby3g32969i4g9l3z6xw1v00shljd3amgyz2l2r2";
     };
   dyn =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-dyn";
-      version = "1.0.0";
-      sha256  = "0ph3516syca8f1zxmz66mh6y5kd8sc74kl0n8zixcgd6rvq0dysr";
+      version = "1.1.0";
+      sha256  = "0sx4h3drb230m69lsmafyfd2cfvwnb9gld8s6ky54115kd3nckml";
     };
   external =
     {
@@ -179,29 +186,29 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-gitlab";
-      version = "0.1.0";
-      sha256  = "1xjhpaq2agdshrl5jbq9ak2nxdy86iay5bw16zww2qc5ah21sdg2";
+      version = "1.0.0";
+      sha256  = "1kxmzdzdb6fc64i2bzch6020zfk0ygms9gh5mm1bypsyqmj4qc6r";
     };
   google =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-google";
-      version = "1.0.1";
-      sha256  = "0l0bpcfjnzlgf3g60iyfr3axw0244w99cf04z7y3bcszk5njipri";
+      version = "1.2.0";
+      sha256  = "1q3ypacsjc8779v1k81z0vs3kx6i340fa4mz26gscf85rx8bghim";
     };
   grafana =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-grafana";
-      version = "0.1.0";
-      sha256  = "1m2anc5cyn2p3yh4zn0y6wvzb0s2fz3sfdqm9psvx53266c2c81q";
+      version = "1.0.0";
+      sha256  = "0fsdin1rd7hah6pp3x568db2mmk66q0fhiplsri7vyj03n3z55v2";
     };
   heroku =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-heroku";
-      version = "0.1.0";
-      sha256  = "1f72lm95bnkhaf2accypdn7xsxcgkqri5fq5mriya4n34c61z3l6";
+      version = "0.1.1";
+      sha256  = "0i5pdb05qkd6h9zyr88ppsiii6g6zjc5096xblizvmiww7mp81gn";
     };
   http =
     {
@@ -235,8 +242,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-kubernetes";
-      version = "1.0.0";
-      sha256  = "1kh7a83f98v6b4v3zj84ddhrg2hya4nmvrw0mjc26q12g4z2d5g6";
+      version = "1.0.1";
+      sha256  = "0s8h8nxsl07bhvynmgps07giqr2xmxizk1rcx4xivfc3q5mkvnhb";
     };
   librato =
     {
@@ -259,6 +266,13 @@
       version = "0.1.0";
       sha256  = "11fkb84gqcq59wk5kqn3h428jrc2gkl659zxmkdldad6jdll9ypa";
     };
+  logicmonitor =
+    {
+      owner   = "terraform-providers";
+      repo    = "terraform-provider-logicmonitor";
+      version = "1.0.0";
+      sha256  = "106y74w9nhqs65h26ipyjg636zcrnpn5s8r49sg4kh4ynvnrkv8v";
+    };
   mailgun =
     {
       owner   = "terraform-providers";
@@ -270,8 +284,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-mysql";
-      version = "0.1.0";
-      sha256  = "0vjr97xf15va9qypjb9318h1nxr0sd6ydcy7ijnqb8538v3581mv";
+      version = "1.0.0";
+      sha256  = "1vkr1gg9adrkzlbdy0w0wn1ap5zla1k54kxfmd5jndw4hzgysi82";
     };
   newrelic =
     {
@@ -319,8 +333,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-openstack";
-      version = "0.2.2";
-      sha256  = "1027pqv1cvyvakn4kgivd720g9na38nam5bb5fjyd4d04xpq9v90";
+      version = "1.0.0";
+      sha256  = "0ddy62psapajbgnf7f998cnwiyak3lnk43vj0rl230dhnma9crpm";
     };
   opsgenie =
     {
@@ -340,8 +354,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-packet";
-      version = "1.0.0";
-      sha256  = "0ibz9k1yfqkfsmqmv1pl2jwzbld0l6f7zd8y80iw0v5wswclswya";
+      version = "1.1.0";
+      sha256  = "0848y78jri1kzd70xcgv0p62yww46d0kr9zpqwh32m866xx5isfi";
     };
   pagerduty =
     {
@@ -368,8 +382,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-profitbricks";
-      version = "0.1.2";
-      sha256  = "105l0rijqmp7kmd7wygnhnj02q7y1rz0r8pj2mjzncb5pr48m3qp";
+      version = "1.0.0";
+      sha256  = "15j66mm7mkwblwncb5s0xbcz7jz99mzswhppzxchwkbk3325syyx";
     };
   rabbitmq =
     {
@@ -382,8 +396,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-rancher";
-      version = "1.0.0";
-      sha256  = "1fs8p0l8f79b1s2g0p5zlq1has9i7w3bmv76vrm79076v7w2v0d6";
+      version = "1.1.1";
+      sha256  = "1gs62yd31kywg2yhnikli1khai1n0lwy8pb3g7k5ad8ibffjskmz";
     };
   random =
     {
@@ -403,8 +417,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-scaleway";
-      version = "0.1.1";
-      sha256  = "145wfcr5zjjk8vgx5xjf1hqh6h8jqxkhxbvv9x1w34i5bv809ch6";
+      version = "1.0.0";
+      sha256  = "0zp9hhvlcn6cpnblwrr03icbagzk745b0lrm5bs23crbnddal905";
     };
   softlayer =
     {
@@ -438,22 +452,22 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-terraform";
-      version = "1.0.0";
-      sha256  = "0icyyi4h48yh5235p5svm4p0jzbqqm1f3846dqy37czhjfcrn3gh";
+      version = "1.0.2";
+      sha256  = "1aj6g6l68n9kqmxfjlkwwxnac7fhha6wrmvsw4yylf0qyssww75v";
     };
   tls =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-tls";
-      version = "1.0.0";
-      sha256  = "063ai5zipmkwq0nr5c25gqsr970r8aba12ynxg9x8cnay0zn9s95";
+      version = "1.0.1";
+      sha256  = "0mzm1pkqgcslz3j4an1vpx92hnqa53ly0kp3zix8kp2kfnn17qky";
     };
   triton =
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-triton";
-      version = "0.2.1";
-      sha256  = "0ds2anr65xx9kdjv6x68lcxgl3js6l0m2cbx3kwx5465m01m3gxz";
+      version = "0.3.0";
+      sha256  = "0x8cws41mpxcwd4hf380gizhdnnfs2df5pwcc417sbp2706cai1h";
     };
   ultradns =
     {
@@ -466,8 +480,8 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-vault";
-      version = "0.1.0";
-      sha256  = "1rr4gaqfr6panjjdb5xx9vbq7701zjps0l75zi526kij1pph98p1";
+      version = "1.0.0";
+      sha256  = "1v4b8zs0s48gqgsh719hwi69i4h8i5vvp2g5m881z5yzv7n7haqw";
     };
   vcd =
     {
@@ -480,7 +494,7 @@
     {
       owner   = "terraform-providers";
       repo    = "terraform-provider-vsphere";
-      version = "0.4.1";
-      sha256  = "0afxvjx9zb9ym0cs8j15s6nfp20rmmifjdc098wcfjmgnw6p7f01";
+      version = "0.4.2";
+      sha256  = "0k9mndxfiq5drcz2qhqasc7cqra0mfdwwwblb1m6lyg7flg7dli0";
     };
 }
diff --git a/pkgs/applications/networking/instant-messengers/coyim/default.nix b/pkgs/applications/networking/instant-messengers/coyim/default.nix
index 5f868fc985848..5b70d74792691 100644
--- a/pkgs/applications/networking/instant-messengers/coyim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/coyim/default.nix
@@ -16,9 +16,10 @@ buildGoPackage rec {
 
   nativeBuildInputs = [ pkgconfig wrapGAppsHook glib cairo gdk_pixbuf gnome3.gtk gnome3.defaultIconTheme ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "a safe and secure chat client";
     homepage = https://coy.im/;
-    license = stdenv.lib.licenses.gpl3;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
index 4e116e685c607..4d4b32453a4f7 100644
--- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
@@ -78,8 +78,8 @@ stdenv.mkDerivation {
       --replace /opt/HipChat4/bin/HipChat4 $out/bin/hipchat
 
     makeWrapper $d/HipChat.bin $out/bin/hipchat \
-      --set HIPCHAT_LD_LIBRARY_PATH '"$LD_LIBRARY_PATH"' \
-      --set HIPCHAT_QT_PLUGIN_PATH '"$QT_PLUGIN_PATH"' \
+      --run 'export HIPCHAT_LD_LIBRARY_PATH=$LD_LIBRARY_PATH' \
+      --run 'export HIPCHAT_QT_PLUGIN_PATH=$QT_PLUGIN_PATH' \
       --set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb \
       --set QTWEBENGINEPROCESS_PATH $d/QtWebEngineProcess
 
diff --git a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
index db0d874c5897b..2965ce86cc9fa 100644
--- a/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
+++ b/pkgs/applications/networking/instant-messengers/riot/riot-web.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name= "riot-web-${version}";
-  version = "0.12.6";
+  version = "0.13.1";
 
   src = fetchurl {
     url = "https://github.com/vector-im/riot-web/releases/download/v${version}/riot-v${version}.tar.gz";
-    sha256 = "00hxjhnsm4622hv46xm7lc81kbnzi2iz77qppwma14cbh63jbilv";
+    sha256 = "19g0d3wqmz4vj9flf7pfgfvm2qf2w3jhxp9qdyfbiwd670h5wjlv";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix
index 7ac8091e1c11f..1df72dbe5fcf8 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix
@@ -1,595 +1,595 @@
 {
-  version = "52.4.0";
+  version = "52.5.0";
   sources = [
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ar/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ar/thunderbird-52.5.0.tar.bz2";
       locale = "ar";
       arch = "linux-x86_64";
-      sha512 = "28a0114c665250f419d77f1f3898af6533e1b8b82b546ecd3ca9baf801751fd189239093eaecdabab9a9318fd47020b647086a31676158a21656ff7c477dbbf8";
+      sha512 = "e848c7a44222be7bc637dc2d0356028e67c4093f48e4eb9c66e0c02731f41b2e1f2d09cd7765ee984137fcef4d498aac8cfee39b31c0fe5187347107b2cd12a3";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ast/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ast/thunderbird-52.5.0.tar.bz2";
       locale = "ast";
       arch = "linux-x86_64";
-      sha512 = "f7b9d53202597ef666ca87eb1f8cbb439af386eb78460558e8bef33502a7eac591d43751beb52319d046d780fb38a78e685fa8cb3baaa6abfef439bed6ab3d1a";
+      sha512 = "a9f8888ab021e696c8460d75ba1f843f8b31555f3f6f95e9af7f9c6d910ea1c3d68bab3d5adc6c0f70e6d8d9227db4176a7db762d28c1ff19addc95e0a756826";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/be/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/be/thunderbird-52.5.0.tar.bz2";
       locale = "be";
       arch = "linux-x86_64";
-      sha512 = "a9a39cf4477e469774f2ce7b7012948911009ff2ab26948a177f3efa9e8ccbcb7d7f3d3ab609742fe1d177253dcdeacb78f7b4a9874f3156f6f54203d0ed42ef";
+      sha512 = "4d903b23dcaf17d41c6b9f3d7a3ec936ecc01f19b93ecba88a5fe826f715b606064a6e2737611697c072e887f3776cf10ddba7e26a66dc4b91c3658129171580";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/bg/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/bg/thunderbird-52.5.0.tar.bz2";
       locale = "bg";
       arch = "linux-x86_64";
-      sha512 = "38fc89a687344467f98cb2e31967aa53f3c502a8f288b5d65e6aa91a578b250c17750ea998d32d58511920a0a5a1224e77e2691a381b7526585e341712d82cbd";
+      sha512 = "6d34b3c3e907a16125f26f5f6365b5c3f2127ccf725753e94495b5dafedf3c506e71017d2b4699b755f8940ad0ea4241d6cfc00e958d4642c928c68a7e278fdb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/bn-BD/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/bn-BD/thunderbird-52.5.0.tar.bz2";
       locale = "bn-BD";
       arch = "linux-x86_64";
-      sha512 = "437d943339c4955b5264f95bdd4aaa2a91d448a393e6561bbb41c078a960100962c1d51bad73172c5f5cd691f713ab34c218ff5c3e3cde3641d8a6ad604f6d75";
+      sha512 = "74106efb92c5ba792a3f10dc0ea19d2fc38012f1f761c0e9b9753f8b067e2771a9c4691df55197a9b5e23024f73688bbc26d24357f0eef95b8b305bccad5d9f1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/br/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/br/thunderbird-52.5.0.tar.bz2";
       locale = "br";
       arch = "linux-x86_64";
-      sha512 = "5c43e3cc4366792b7c7a44ae36fe2bd9e6b459f540868dcee767193826648b03a4e4a447f83f5787036e48c96e75639a305304e050a91f0925d9ee4db97e5b75";
+      sha512 = "2477afe645f7c0e0005a4817a42d24075dfabfce2724446bcd4fce50b72b7408895261544537be0e3dbdf8323e1af07215ca277c9e69261d575cdf4fc1f242ca";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ca/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ca/thunderbird-52.5.0.tar.bz2";
       locale = "ca";
       arch = "linux-x86_64";
-      sha512 = "c2243ee5f160f786ebced364432b4a3b489699a3f024a8da327cfaa3c5e2d0d58884870311416fcb019723d5bfec8294440c701c6c453c15346f5f765c4449c0";
+      sha512 = "810c5295bcde18217b77e2f147a70a5e94798b92c40d659c47f3f113624f049b788ba9fdcdc22608cc57719e8236372636e6ca46ce7fde309b70fc05e3036f47";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/cs/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/cs/thunderbird-52.5.0.tar.bz2";
       locale = "cs";
       arch = "linux-x86_64";
-      sha512 = "332faf549d1d988defdce1531fb4cc81e5f1565423f3e24ebfe16581275224539ed50857dec04c8aa66cc55372a76b676816831d08842bbafd227ca3058f9b5b";
+      sha512 = "f8e033ed566d6b076213e33c489fcfcab520a0e1c3ce5c89c78c7443b360e55136e90b518428527a682854a24cb9b303a6c3475a59950d9546c1becd5db2a46a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/cy/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/cy/thunderbird-52.5.0.tar.bz2";
       locale = "cy";
       arch = "linux-x86_64";
-      sha512 = "bfe220ed1e1d8d156f0c1cf7ea11b0778bc0b23f7335b90c65bf581c9e2cd22db9a7f5d48d7a6a95f1d21693714a216d2a24249f36aed7ce097f205d4d05d6f3";
+      sha512 = "27ade0c53cee3fe125420eb7fdeb5b013771d34af735bacd59af6681836d81acddda3b3b9cefe3f8a05b70703c040d6692732c427db13e5dd971848c078ae7ab";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/da/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/da/thunderbird-52.5.0.tar.bz2";
       locale = "da";
       arch = "linux-x86_64";
-      sha512 = "dcff4359821cb6b24ba129671a1716394afd642a5c4b887a1905baf82cf5d2a94512a547780cd42b1478f443f59db5a3363a52d719824af050dd69af54f97a02";
+      sha512 = "11de17a749643d35bcee49ebb1aa62caeb6806fd0025125363f228593979e873fbf8a927bc451c2e4a5332f431937c00601ff380d74e48bed60cfea5399b891b";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/de/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/de/thunderbird-52.5.0.tar.bz2";
       locale = "de";
       arch = "linux-x86_64";
-      sha512 = "f5071c052814eab801f3d2c98751c05486b211f23b511b27a1ad5810634b763ada3bd890288e4934c16a28742ef023ef089de9d84a188f6e19d07f471b289583";
+      sha512 = "3d2408f523d55471f0bcdcb3a05e66381d390f56987b448a40118b1f0e3fb66cba8ed64cb3178694873f5ee0c7f5a74303ffa288eddf7192a4f519d537ecb65d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/dsb/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/dsb/thunderbird-52.5.0.tar.bz2";
       locale = "dsb";
       arch = "linux-x86_64";
-      sha512 = "522d365f32b28620a7936cf5a8fb230db6fee8c1ae055a27e6649cff8559811684168eacf019ec16d6268e405607a576d46e1d5ba4759c1e3fd10736d7560370";
+      sha512 = "d1f560111bd8d8eac360ed39b0ac741ca10c480ec528cad48e9bf6544d17e12fe2f41d4abe4caa3549b448fd1fb55416ed84fa864dd60fe0cabd91766e754992";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/el/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/el/thunderbird-52.5.0.tar.bz2";
       locale = "el";
       arch = "linux-x86_64";
-      sha512 = "ecf3dcadb1a82310494063cc317ee248b91c30594ba89a9c58a71349a423cf9e66c5bd06be4d1488ee6cd5027187bae1364144037b9ac3cd4bc8af7cd4396810";
+      sha512 = "22c3270759d095c4672694c0885d3960d87cb9f53eedcf7c030f8a38f204d4809914b3fe1cd144f32555508eded73999907c64df2d9ae9494c69ce879180278f";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/en-GB/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/en-GB/thunderbird-52.5.0.tar.bz2";
       locale = "en-GB";
       arch = "linux-x86_64";
-      sha512 = "8ddde6cd0270cffc26cdb4c4513213405b71ea4315d69a3b1bef602bbd58eca30bc09d0ddd41996cd77881e2d678dd13a93d07fa833210780dba146a931db383";
+      sha512 = "3e778e8f60101d2371ce7eb369c3f80c26fdc8164f5fcc78b8f65f2986288388e06d1413387b493ae479bd95b3af7fdd76f88365aa5803c4e9e3bb23e4f3aa59";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/en-US/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/en-US/thunderbird-52.5.0.tar.bz2";
       locale = "en-US";
       arch = "linux-x86_64";
-      sha512 = "edf130b3b061f15137e6eb83c9674642f0f475de56b293d4acde60f1e7ebcf0d262085fa2a513787ac201ceec5552c029167cec5ad0556baa7b0dd3b52ae4c3f";
+      sha512 = "d4eb0d90d621b28cc706bca0f6884361b7fd53cb02dd9ecccfc3f6027634353cc8f4c911824ebe6bf1d7bbfb06318258daad32fd47687f2f3b930c90da4b8830";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/es-AR/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/es-AR/thunderbird-52.5.0.tar.bz2";
       locale = "es-AR";
       arch = "linux-x86_64";
-      sha512 = "931644cbf5e7b4f032f607a52a78f553a7a2ee8fc77fb7d0e73e6d276a6a1ba4a724cc91921c5ef5ac5ad21a3536ffbff264b80eb8d8a658133a24ca0b869456";
+      sha512 = "0088b0380aa533e4c2818e0b384f5edafeaa3c84256e81eefd0dff95f27adc32c8a22b3368576d13aa1276674f519333b5c3f4a825fcc38da1abd0751c48f996";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/es-ES/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/es-ES/thunderbird-52.5.0.tar.bz2";
       locale = "es-ES";
       arch = "linux-x86_64";
-      sha512 = "c2673d9f6b347493e3fc807cec86f55300a6e894c9c1edd7f7bec63cb073fdda2e9cf7794269f02f744280788bbcb8e42ee6249c317aabc57f91cbaa3635492f";
+      sha512 = "251cf4cba82dbc10bc38039348894843b8f5c76875be72ce5ea1cb26cf26939055350e61a86e8ed9f63964bb95e99aac5442389c87588829e45e9ef41709ac7b";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/et/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/et/thunderbird-52.5.0.tar.bz2";
       locale = "et";
       arch = "linux-x86_64";
-      sha512 = "dd634f76848fb990b4fb1bd28e2cceafca651280ece9ead3aad6b9746d0eaeef76b5ad925163a68367d84f66949e799e2649cf358ad0949ee4f2538c71b8914b";
+      sha512 = "609bfd8fd7f8dc17b52173de9916133e0cd52e41e66a488ee2bd1aea5078cb9e08084c10d0b20be36204bfc3f785574500e2bbf9a81f307394b169068ef3ff07";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/eu/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/eu/thunderbird-52.5.0.tar.bz2";
       locale = "eu";
       arch = "linux-x86_64";
-      sha512 = "1c9f04cc1b32ffb21bfacb186f327aa945f36f12ae316a9cff8b2a4f8584ff8847ac5be1c8bd898ea1a71fbf3294a2f54b270eb6f0b63abb3da3178c6a125600";
+      sha512 = "ebbc42c9d491f0f0e9ac5528d58c5d8604a913d77fb3d4548cb0127e356817c729c1ce87fd7874ae6f688268ab64b8b898611780b5c6b11707b455f529ab5f65";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/fi/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/fi/thunderbird-52.5.0.tar.bz2";
       locale = "fi";
       arch = "linux-x86_64";
-      sha512 = "03880d8334ede087a419443e9fb56bcf6727c652f435a366b4b49fb6116a62225686297ba82f298378e03267dc1aa50e90d75b81ea277a7afeb93331c45c3459";
+      sha512 = "807b4fe85c2b751e815dd4ac19b0e80199f391f7a8fe7e7f5c1f7f75e896620ddc7b758aae076bd44f9cd7774b2020640f858e139db57b508919d78caa77d913";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/fr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/fr/thunderbird-52.5.0.tar.bz2";
       locale = "fr";
       arch = "linux-x86_64";
-      sha512 = "6f9909df3329a32d6d0c2203b484fdaa8b54a17849283bffcb04298601a284a6fe30eac20ec6b3a97ad2e8e3d4e0360c6145e87baa2af11049ae0d94fe9dcd44";
+      sha512 = "d2d6e92815ed9176a2743578c32ac82150d4097eee6bf31356a9bc1cc1ba649c86008d301654e291bf0bf5ae2d81c13d941c4203aaa9dd3c4110d36a34f28140";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/fy-NL/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/fy-NL/thunderbird-52.5.0.tar.bz2";
       locale = "fy-NL";
       arch = "linux-x86_64";
-      sha512 = "b20f130ad4a9b0f8448707945773cc76198e04854a0114a06379fd33c3d5abd9abb1f14e4f145df9c1c46e5d1e09522af640ded99f4f20543fd444e365d81fb9";
+      sha512 = "bb5e34f15d63abecc4b68a74cf818def59caa2de47c9ab71458ca79839fd29f3fc2476b5e38a95d5d5252acb03595f0e065bcba5eaba6ff2eba29be66607f417";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ga-IE/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ga-IE/thunderbird-52.5.0.tar.bz2";
       locale = "ga-IE";
       arch = "linux-x86_64";
-      sha512 = "3fd6839351470d65f14165e3633c80950270ede2c4c9e658c001424126ffbf29c7bde86a720ca33e50cbe9a5306f0339c5cd491371e3ad03a6ee575c75889d63";
+      sha512 = "e6f84323e42ad5a0df546307ba0a87be57d1ead7b7a807ffed4cb977b5b4c19c91ce8058794da07fb1ce678e4f8e59838454deb9a19232a5cd7d60c6cbbce74c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/gd/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/gd/thunderbird-52.5.0.tar.bz2";
       locale = "gd";
       arch = "linux-x86_64";
-      sha512 = "a7aae188c866586606f9adb82d5110bc2b89a6bd757191e798b9b2dc799916ae56cbc82932f4b8da76e88a3c1f5ffc828c58aee0cd8f83ede19bde2be2164b79";
+      sha512 = "1e28be9ff5c3ccefc320e020dbe574f9d5f8319eaa79e441ab7f1283557eca01501a2e0f4aca6af6e58157b4c1686422d70a258010657803ceb272b900ad3e3a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/gl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/gl/thunderbird-52.5.0.tar.bz2";
       locale = "gl";
       arch = "linux-x86_64";
-      sha512 = "3cdab0c553f1d09cdb4dfd1160371eec3d1f878329dcf2f81a177f17647f8dd9b73566a56427d2a593f70f6aecfec951e3dfc2a389c838a4069e5f4db68c10eb";
+      sha512 = "db2d76733fb97558d05b3ccb963ad82ab6886d1db32923bb73e4a62bbd80353fb7d7cbe4e1a82fc9095d582e467fe9a045d82be0aeb319fddcdc88c530733381";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/he/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/he/thunderbird-52.5.0.tar.bz2";
       locale = "he";
       arch = "linux-x86_64";
-      sha512 = "b71593a5c7cf8fe3960c701f5bce270366f5717b7ccd2a5f20dcdf402d1435b79db06662629deb4bd28e24b251fd2fa1a71a9e932f132e2df7a25ab5a8849de3";
+      sha512 = "1b4640496d3a1acc7b8a146c8642f25dbc5dcccb7a164fb49a0ddad41e5a43d571936111154838b149bcee091205f0212926618ba5f233aaee051d5def345889";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/hr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/hr/thunderbird-52.5.0.tar.bz2";
       locale = "hr";
       arch = "linux-x86_64";
-      sha512 = "d55deeebb9605565ae3c062c8617d7e351f2f514c13f00507d75a5da4ef8e8d845247147d2aa111d4e78c57ceb01404ed3ac2bb69883bddab7b59ce0ff5eff35";
+      sha512 = "5d4e361e7597b4dd0a896e38e31cf737dc1d51e87c09490a298147e4f0f395989567de2edff69f862fccc860dd0c18b24d2f91356736294c71429d22f47eab4d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/hsb/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/hsb/thunderbird-52.5.0.tar.bz2";
       locale = "hsb";
       arch = "linux-x86_64";
-      sha512 = "c177a0e3c6074eef1abf086fa34e95b09f39a1529ce640927b7be6ee8b7ee8c740ba4e2afbadefe3fa83314cb7c3223499b1a5f08e3b4e381b60bee1ffbdac7c";
+      sha512 = "40b51097b472a36078a7de4ed35446baf9a3a5806a92f13d49cb0024ca154e511195e6b470959b6084ba689c4475224acb81010f417618686a4e99efc624754d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/hu/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/hu/thunderbird-52.5.0.tar.bz2";
       locale = "hu";
       arch = "linux-x86_64";
-      sha512 = "1442a03fa4367d1f33337d0e88a193de8a6992ab8aa91e28e4a46b8f1860a3cc346d15c00d745b5074b8dec1beca5dba182b5fe2e87827e7ea83b82aba28b721";
+      sha512 = "01a11e4e59c527e43d13c5c12dd95665bea7aad105d9ee9988e94671e394b7a55c2e85154e1bfb200d9290373de32d7c33ad1364e6cf2c189d8c9d8b52fb813a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/hy-AM/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/hy-AM/thunderbird-52.5.0.tar.bz2";
       locale = "hy-AM";
       arch = "linux-x86_64";
-      sha512 = "c01325976516765a14a196ff04eb3296a2dfd81670cbf4d693682e78795b14b54f4d2801566f0ccd52c52f0b7100b6040f4e3540c4f3cb8c8b92038e059df45d";
+      sha512 = "bc3c78d1d3da660c66b64930d295f3e79467684d178c831ae4f2eceb9d9c7753e5f1b60453fca674346da5e6eaf3c835df7340f0cdeb0e9040be546aa69d0cfc";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/id/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/id/thunderbird-52.5.0.tar.bz2";
       locale = "id";
       arch = "linux-x86_64";
-      sha512 = "db56686b1d8713da9584e03633bcb2b14706c0b44d24484d6625de638eddcbdad1b1afacecf7dba52db6d18b2bbaaa15ea5f4d492366c24c5e2e212050f16c12";
+      sha512 = "d377473cce2365f60aa5a65680daa2569716f3c331d20427f3d9002a72b42c0356e112f943db228a026f0d8cd5319168a9f718f3144b4c0a93ea3209c9003680";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/is/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/is/thunderbird-52.5.0.tar.bz2";
       locale = "is";
       arch = "linux-x86_64";
-      sha512 = "5423202ebccaddd114393e5a2038b2efbe93fd528dc3d7b659987ab5aa2a4ad82921b3b835249285135be67216eed03de6d58b72800d9c7bf87ec812a37f21ab";
+      sha512 = "bf41f55ef16c9ec322d732174a1076e5ab6a5db12f861891bb0ad1becf2b630b7504155505789e9ff7778b6c708642da55630aa20c0c18ccf11734572f62bab4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/it/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/it/thunderbird-52.5.0.tar.bz2";
       locale = "it";
       arch = "linux-x86_64";
-      sha512 = "b64e31155c73f13cd84bb4488e63df5c95473957c792f63f8cf25308d2b860b084aa6beb519a7666fde83d3db25e28ffb1064ddd0abca73ff631924cfa83d7f6";
+      sha512 = "eef60e791ffabfae57c4e9f4094a39c8cb5c61ad4a8296aa111c6ff4e14f05bd86d4f9e682859ba6ae4e8d0c10001403d21bf8fa54e7c5688ca9e0ff06b4d2fb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ja/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ja/thunderbird-52.5.0.tar.bz2";
       locale = "ja";
       arch = "linux-x86_64";
-      sha512 = "8852c526663f69b038ded6bb1382e02de700eab741cb04ccb8d3e329ee4534477a6ea402134a76fe82a020bad279c66e70bc06b0ed8d0fbaea9aaeaafa051b44";
+      sha512 = "43dfc61aebfd6b80651900b1bd066e3c731e06854bb375d2eba206733d4bffb42f9b0116fbea0853f2aa440a6873cbe9e188ed528cff25c8634d7afb59e9d3c2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/kab/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/kab/thunderbird-52.5.0.tar.bz2";
       locale = "kab";
       arch = "linux-x86_64";
-      sha512 = "b08dc52afb713142e11805c5b99f73a11bd3c16756dc5bbb6a0c3de13cc801f27438887d8733cf4b97d70d4741abcb0d8782b9e6f6ffc359f38318f1702fcb7f";
+      sha512 = "e75c653e6dcaa6a3116aba962afc6196c29e9194235b726e3ba0b4fe050129512f6d67358a2ce9e2b6879f6f52c6ada583af10b70cddde7ee0b8fa72edacc40d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ko/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ko/thunderbird-52.5.0.tar.bz2";
       locale = "ko";
       arch = "linux-x86_64";
-      sha512 = "0de39397e4401ad939dbce0c02e35505c593398bc2078ad19d680a797a8cfa3f0950a810c8650634e3d40ea3b5265f9e193b77408f1588b51575d87446a336c9";
+      sha512 = "52e29e6b2996a59dc4ffeee6f7a35f7a491e1d44af370ab1537d0a45c8d9ab8b1bf972a24f1f2efbcb6fa1d8e9b7b15c7b0c00d5aaf24546fe7860c7a6f97afb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/lt/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/lt/thunderbird-52.5.0.tar.bz2";
       locale = "lt";
       arch = "linux-x86_64";
-      sha512 = "13842d9f210dd192e2072c138d8d0778e85d028dde92b08e616dff6ba62f84b6aa36363a259dca69bb006850de2fb8c42fd93874a4befa970d817aad34d47b57";
+      sha512 = "d935c882dd6a9a3ad5a6c5609047a6e3c2c4146b198e8c28657ad166d7b6ad826e6db0e4c88944214521f0cda0907281b50a6088432b574d1ee13e5c504c939a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/nb-NO/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/nb-NO/thunderbird-52.5.0.tar.bz2";
       locale = "nb-NO";
       arch = "linux-x86_64";
-      sha512 = "ec9c96abe94ac17139e9fa83ac2d7ca8ddc6889e7286a4d31e61625db6daea3969fcbaa0796ae0bea41e3a433ed3e170a73c4be1a177bedcbfcf705e306e28e9";
+      sha512 = "bd607e451f2601483aa4d59cf6225318a3bf1b2066d0f6b76c64025de0b20a8c8d8211f95b953440505248905d5b4dac569cdc610fe4d9d658a6ecc124966b82";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/nl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/nl/thunderbird-52.5.0.tar.bz2";
       locale = "nl";
       arch = "linux-x86_64";
-      sha512 = "52e117078f1871bfc7b549a47617d277c763267f7033136c9715223d8f876184c0b5012b193a5f497e1fdba78b902a3c38651e0115829b0f5ca7f0cbb1c439d3";
+      sha512 = "4767403a33047512f301617dfdc779f92e001114a06f31244e5b9a648ed4a7a96c6fa16194a803682417d151f2f9d61da241065f15cdd2e5953eb5ef41220093";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/nn-NO/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/nn-NO/thunderbird-52.5.0.tar.bz2";
       locale = "nn-NO";
       arch = "linux-x86_64";
-      sha512 = "24258bbf5e3643544ba5db26fab9678f7e2a44b390ee993be4a304d148b5a57674158afd308d6ef93a86c8e525b37e1aee55ed07be6953301f164a2da00688d4";
+      sha512 = "f2fd66bc8a520f90fb65e5f737ea25e44f5e3270429cfcf878e4b128f1facfc3bd29282586aa6ba73478de04cb796322436d14580d86fb5861072b6722e2ef87";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/pa-IN/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/pa-IN/thunderbird-52.5.0.tar.bz2";
       locale = "pa-IN";
       arch = "linux-x86_64";
-      sha512 = "e9d8b4e6019d4cf1ce562e6cc9b9aeac0e93d8b9ac9283c7e8f260b4d611fe2bd0bf6d71c9f82c9d2cbfba5770659d21cfb03fc2deb36b80be0a424178a65936";
+      sha512 = "8e4c38febf02e61b874f931b0cf03221781ed9543f9b7a392ca9122f101622c20135f0fd94e5ee7696d0741a9910e1d1031fad3c825941d54da1f56a2533b61f";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/pl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/pl/thunderbird-52.5.0.tar.bz2";
       locale = "pl";
       arch = "linux-x86_64";
-      sha512 = "81ced2424282fe6dc7ca6f5e043f6c42ae87cddef900b73fddfe6cd8c488a90e3099824b57d0971816a60c3f43ce66e1799195ae21369958b2e8085018017267";
+      sha512 = "3e6fda867feb132f37913a8b2bda2ff2736f4d804e274f01c306d387b3c48fe30aa04b6f85eb4a7fb444036bdd4b3fcd4f68cbb53244d85b5064aa36c3588cde";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/pt-BR/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/pt-BR/thunderbird-52.5.0.tar.bz2";
       locale = "pt-BR";
       arch = "linux-x86_64";
-      sha512 = "4120b94c13a9fcf1aa31a2abc3fdde27ef8c0354550ae8511b61641745cdd5eaec16e1ddd1d22193ca6680f070b71c188d94cdc75a40fa1596fa88ed59545b28";
+      sha512 = "662e0616d12fcb7dcfcb98a4e07228509ae7ad731c93d2c90a7bb7ebc3bd0f9636563a70977db14733c832220258eede361526b01132dd02a4e44b16acc6a5e6";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/pt-PT/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/pt-PT/thunderbird-52.5.0.tar.bz2";
       locale = "pt-PT";
       arch = "linux-x86_64";
-      sha512 = "a89dd739da5262713c99aa9aa28544e48710e80b83770810b240681ff0546c3b3faa37b48ae56c018a6d1d625f0411df557ced12eddfb3a1198eea474418eb68";
+      sha512 = "8037be03b26263f3a1e69c4971cb70db50f95356c97e3252f76f080f5a7961c1b2ac5aea09d2e142994c5fc91c91ab8db738e5a104795e8506a06c997977930a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/rm/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/rm/thunderbird-52.5.0.tar.bz2";
       locale = "rm";
       arch = "linux-x86_64";
-      sha512 = "3665bad7a0d1f2d725d0a44ad55918228c2d9cef49112fb19d2c3d885d1ec62af89c15aa0ce96ddebdabf97c8a5e10fdd58d892c085e5b9d17bab6658e7bf444";
+      sha512 = "93a76b870c15b61a1135e405f76897a86674e1fad2dfa9b3a71cab83f99c9369b7363a395e813536492a25133548f227f5254795cd20de78f127c969fa3ff5aa";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ro/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ro/thunderbird-52.5.0.tar.bz2";
       locale = "ro";
       arch = "linux-x86_64";
-      sha512 = "07afa28b22705e0e84e17026d04111cb9a5283838fcb94225e2c05da1fa0692770b17052c52d8cfcdb7bd3372fdbba9cd9ed9bc16f6f59f2e3ab6f4308543d91";
+      sha512 = "4a535aac1f6666d20c7aee65ee974bd545cd4aba56fd0ea2655d89a532b60bcbb174b8046792365041b431d3d3099e0c273c5ce83f1e1f3599a476028b482f37";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ru/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ru/thunderbird-52.5.0.tar.bz2";
       locale = "ru";
       arch = "linux-x86_64";
-      sha512 = "189c40a8d950496d62f980180502ad342621caf3a2ddffb0fe4f813c9c2d4a25aa375d8ad70c8b7e8ff85f09607bc2ced3366524346a70eed731bd8d9409e5d2";
+      sha512 = "ec56cb45428ce24497ad398716f99f49d6a5787a042855dd5839e5185d43763ea87b89090bf15c571841aa0526f5b4b0fec8958bd673a39ccf33ad5f2937b33a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/si/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/si/thunderbird-52.5.0.tar.bz2";
       locale = "si";
       arch = "linux-x86_64";
-      sha512 = "0b6ee1e5ca86472a5cc67cdc242a6b62aeea50609661e369c8dd3dfac5a774f50eaf0a68973b1fe5d6d9bdf6a385c52a90b8711c80facbf9fb301981a7aae395";
+      sha512 = "e1b19b27571cc833de579d1460d27629042529480546cf3de11a39608b8d599ffd19451ae3df96390009e95b87521f17e5843bc77251c923823d3b0529167f17";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/sk/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/sk/thunderbird-52.5.0.tar.bz2";
       locale = "sk";
       arch = "linux-x86_64";
-      sha512 = "9c1f164a2da43aeb51e8b64115618590ba0e9284f3eca8b16d3792b33e269a0acc253314ab7943cbaee94ffc2ae321247b4982798d9d48608e85a935afcb6faf";
+      sha512 = "d20d0649426fbcc812b536d368ec5785b32def01b91d67776d5776a7fb45d9c723e1c455d20eedc7825370b03e484634ea42fb55dab5b3c860167cbeb8596c7b";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/sl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/sl/thunderbird-52.5.0.tar.bz2";
       locale = "sl";
       arch = "linux-x86_64";
-      sha512 = "5d4698be05af9f9181af63eb3ca6718feb1c74c81f0a6fbc82217791c911dc5f14ab433d32f6484ced2cd75d5db4b76aff3bbe420d619afcddfcbcaef25873e7";
+      sha512 = "c37ecb24cc9bfe2d31459590d0882fd9cf196e822a18105b61150db4049bd52c31bad2a05ebfb710bf1d1d879a22b3e6fdca08ec81663e1c1735a4a2d157b4b2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/sq/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/sq/thunderbird-52.5.0.tar.bz2";
       locale = "sq";
       arch = "linux-x86_64";
-      sha512 = "32d62e6dfe28c67cc7b0e2cd27c96fd7c7e1079790eb73a8731af44e8a62f8fd1ea2e7298dc772e3014fc8255f022f38bbd5478430629140d0dca9ba0daa401e";
+      sha512 = "0ed120ba3b39f884784269a6098242b8e1298bb4287749b901c2702d06c6824f762942bfe05a0dc1966c19e883239b09312139ee7eeb2cb22995d47aa2d124cc";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/sr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/sr/thunderbird-52.5.0.tar.bz2";
       locale = "sr";
       arch = "linux-x86_64";
-      sha512 = "6aca04c1b4378489239cef6b5032ef6dfd6d39d84308c335d03e97ea7c48acf021f6cffe35d652e117f71e6ae3f31f54e5ca73a44b4dc51dedcb3f5faf7d016f";
+      sha512 = "5e83710d06507a40705ae5177e4749c31aed4e932efc0c51f8da6a4b30d598328601f8a53b9fc0dc35cadcc130bb637771454d9cf55e8dec2b934287213e17f8";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/sv-SE/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/sv-SE/thunderbird-52.5.0.tar.bz2";
       locale = "sv-SE";
       arch = "linux-x86_64";
-      sha512 = "099e22013b8d6791857c378c0f94373ca42d35bbc442cf273c9de2360ab8e64d712eccaedd5a13915ee19a195b6c9f04748ba738e7bbf9b8153edc4c66070d31";
+      sha512 = "4cbb20b1d818f0238cb0d5235ea82a1984b8dd632467ca91e3f3f4e8ba58de904603d1135c8a7ea359188f1b01a6ffe8d654a2d0a73b4af1f3862011d697f755";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/ta-LK/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/ta-LK/thunderbird-52.5.0.tar.bz2";
       locale = "ta-LK";
       arch = "linux-x86_64";
-      sha512 = "d3c95f37ffbbc5ef78b7c050a4e091bd9f36fa9529ed7c38e25f5495694c1b792d0bfcf53d15b74b52239acb21bd0d235ceb07c7f68f99e1b31e59e6f6282aaf";
+      sha512 = "3c2397e9b9e8abbbef10af15cd35ba086336daa5c317ba60d4489786b3ae4fee89457f2b34c0b42ea550000e8536ca3fee94032848b11dbb2c4cb6fe489efe6c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/tr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/tr/thunderbird-52.5.0.tar.bz2";
       locale = "tr";
       arch = "linux-x86_64";
-      sha512 = "2f79b9d45d747424a65271033a75a86ff503694d88a30238452fbf817ba153c4638395d3e59f5f6cc662ab3361d2304d5a4c925957d9d6e6d7bddf34947acdf7";
+      sha512 = "9360797bca24f5477120d93665f9b4aa1614463558b6646e2813b31fac5b5bf84d5e88a752696c28fb51613c288482e3d88197ded2310b66515582b11f81aeb0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/uk/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/uk/thunderbird-52.5.0.tar.bz2";
       locale = "uk";
       arch = "linux-x86_64";
-      sha512 = "e0d891b4cc082e32d3f6af318f9224e996a8ed3c7e1385bb86a5e2f963239999712c444fed00d779320f6b06efb38f3eb97023e353f91eeb7831b44a870c6394";
+      sha512 = "ee521d20fd5e7cc3f803f74ef5a9ecc4c1df8b149668489b28cc212ad2d5c765bda838904ad726b92b5e0e2eb35c2ba6fd4f48ac7c700e41e896e0e976fe2028";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/vi/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/vi/thunderbird-52.5.0.tar.bz2";
       locale = "vi";
       arch = "linux-x86_64";
-      sha512 = "5a9e13e126c7bc8ef435b8edde1896b9773ce1dfc39fe3fe1bb31e54fe4f592acdb3db360fe0890eb35b1896aeed0954bbd051fde6116b07cb513b1390ee56e7";
+      sha512 = "3d7b7cd1f83e80290f460829b49b6893a73871456cd10ab22da482381ece0ac14fac3e5c0e2fdf1e61d463b7c211c33ec8d98120fc0bc17d2052bbbcd4e16af8";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/zh-CN/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/zh-CN/thunderbird-52.5.0.tar.bz2";
       locale = "zh-CN";
       arch = "linux-x86_64";
-      sha512 = "b0374f022c2a259076d52bc0dc142098975f9f1d3a886192332fd1c1b2a5c9dabc0d3fc1a7fc0f28f6f17979931b9c78a9682be1226ff751446c5427a5219a51";
+      sha512 = "c0f9902bacbb659f5f012f30b6190d4e3e53baa7e4473cf231da0b7c509beb98e49f0e4fd1ca3ed9917c54279609ce5fba1c51b80b12aeafedb82a83218856d2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-x86_64/zh-TW/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-x86_64/zh-TW/thunderbird-52.5.0.tar.bz2";
       locale = "zh-TW";
       arch = "linux-x86_64";
-      sha512 = "7e289afc737339be5a3db5869125d891da65fb75a62b7670c3880943ae11bda33122f81cab46bfa95223c45662684b8fb66ec11cfc5f375e024f4d57be098684";
+      sha512 = "64dbbbe05b3ade46901686fa4733cc7c25570d1f02b378a2b2855b75905e687db9f97db852bb53e2baaa1010a0ff365bbd90060eb7cec7db745faf014c5e5564";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ar/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ar/thunderbird-52.5.0.tar.bz2";
       locale = "ar";
       arch = "linux-i686";
-      sha512 = "872ceb5933a562d352cb3bfc6e9cc95a7485625e5256380cae367d38a560f75bd7964fed1becfa5359db3befbe4aa249f114df307cf14e2db75dd047d87e5c53";
+      sha512 = "1e6449d23bb937d07fd28049ef4e36b64c1f36edf3f4def640dfa6412d354ec6acd5b1642e0b266f18334f3ab7806a9cbb016946c0a36ec4222cfcae39339bcf";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ast/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ast/thunderbird-52.5.0.tar.bz2";
       locale = "ast";
       arch = "linux-i686";
-      sha512 = "9955dde6ae54c096dbc5e5a28729963a72997fda97505657ccec6e0b5f95f35508815fe663f266932c79ef91463ef6c5da79ace4c19149b17dde9655dbe8017f";
+      sha512 = "38f0fddb28d8a894798e9811599e706e60ff80131b22568e3dc70ff7f43388acd6de5ee4485587c59fdba8f790b393f4f16cef6bcdd86b928f3fa1bfff7297e8";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/be/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/be/thunderbird-52.5.0.tar.bz2";
       locale = "be";
       arch = "linux-i686";
-      sha512 = "94106fb12bf932f3a8217f3252b4f76394f13cb19c602d1b4a67e4477c3a0c781c3481ac973e40af7b306fdb32c88d4c70f8302b14e693c7270e2afab0dc2539";
+      sha512 = "0966c3fdbf73a51d2c7776918abba4b77392dfe2308aee36970cffcbbc3e1de537625c0b5881a85eea74817b33055278d976af719773579885b3294746a3ae50";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/bg/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/bg/thunderbird-52.5.0.tar.bz2";
       locale = "bg";
       arch = "linux-i686";
-      sha512 = "194a420d07f952f7d088cb15fd14dce30e352dac13e543321e94fc60b7780678ea1ba51d450aac2d7566a8f23a583cba70e3aed373602ac896e0be13d234f8f2";
+      sha512 = "a0a792063a3eaad2d15f4b726c9ed170f59f99b1ba9c966fdcd6471865dcf2f25284ab5e4e28641a66fa8ddcb019f8b8f521d69f5ed5e8d1ebc2729abd9be8b0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/bn-BD/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/bn-BD/thunderbird-52.5.0.tar.bz2";
       locale = "bn-BD";
       arch = "linux-i686";
-      sha512 = "08a439a7fe40121f318131b035e7a5a1b44a56a6f3434b2854136103b0e11fd720540352ed04bde23f33c7ef75cb57eabbe86425c8f2e440f92c9260ddf1a902";
+      sha512 = "ea583cbba8a0080a5529fb91988a0ee1c7aada1447b616e1ae43b6eff86dde87768cb4fe90fdede8454ad5240d266bc5e6ba9f1e5e05f2ad82cd3ef68ba374d3";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/br/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/br/thunderbird-52.5.0.tar.bz2";
       locale = "br";
       arch = "linux-i686";
-      sha512 = "68984b8fb564e24f3e331504a0c8a2e88cc1021319b2a47beeffd145eb42a19bd555aca495ac60612efb191830c273c473e0c3cd5844f109e78a4908834926b1";
+      sha512 = "18060c8473e82554ff793ba495ba6760c7d7d8c2ccf8fdafbb41589c57474baa0a88808d154a29f6359c657bec40d9d164e53066d44bead78d4661b229522783";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ca/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ca/thunderbird-52.5.0.tar.bz2";
       locale = "ca";
       arch = "linux-i686";
-      sha512 = "2202c43a63bb283d9eef16c27e0d6125d43284b9c1acdb8cbbdc71f3a9d6f6d527c4a03363dced911321f28399a86ef25defd294befddb8fae41912e17c2fdef";
+      sha512 = "f63dc5e923d8e60470fa4e4bc5adb8ef629a82dcca84a87a6e742e9d34a8709cd0946a85bf5822b19b5ff5c1c34b6e290439f3e3418e4ab86844a0ff54c2632a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/cs/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/cs/thunderbird-52.5.0.tar.bz2";
       locale = "cs";
       arch = "linux-i686";
-      sha512 = "d01c6ba52794d3850656c1538e46b64eb69a7c1e3a17347ab5cfda9fb1e91976a4bfc7096f7d12bdf2f15625387aec7066b0a25879d979687c955058b92ce6c7";
+      sha512 = "72e1a77e10105a757c51542bb236d10c417f96f58c3875b63112c71848ce023c8754971bcd34dc5d2a48719070939d3733df9dbe4d2218e7bae7e89049d067cd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/cy/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/cy/thunderbird-52.5.0.tar.bz2";
       locale = "cy";
       arch = "linux-i686";
-      sha512 = "3d056c91e1599e91249774cb21d8fbc887b7bab38546aca1815ca9c49fbf4d641bab2427f03ea993a72dc29793feb1cb0cb26217a4f6827e9e0d9d3cb5e3ca0c";
+      sha512 = "4901eb53235ac29cdf685dbee78db301abc1f088ea9df585e388814c8f48d81aa0daf816f927b0c7d6df7985d8dd1e64c0c1cc26026f3ad9625251a72b666692";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/da/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/da/thunderbird-52.5.0.tar.bz2";
       locale = "da";
       arch = "linux-i686";
-      sha512 = "c940d26284c8ab0a45bc6a55b67b467df7ac160c8774f0e2e2deb9082ea9500142a1d3c8851031a7e7a1763fdf5348c14de57d7168c3f1bb23fed3cf31a1b09e";
+      sha512 = "0f061a7ad1e3b113d7b954487d661b4ca57a0ae861770c44081257a069e324388ba506b27ef0123a240cd949edb4ae60f500712c0addeed146cb922c76bbdc32";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/de/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/de/thunderbird-52.5.0.tar.bz2";
       locale = "de";
       arch = "linux-i686";
-      sha512 = "b1b63590885f30797ae9825f2286deca69a82a73e7c407be87fa92280b904c0605e7047a402bf6ce1e13936933a27efaa2b35d534b23f745a2ab4a9538d31b47";
+      sha512 = "12ecdd09f77035ece4161c97cf4ae8bffab6a7eb46c7b9a2f7323dbcbdcf4f3d1bfcf5fab4d40b2887fbf64b541c0d5bac54f1b8f73ce7e31bfa201e955077c0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/dsb/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/dsb/thunderbird-52.5.0.tar.bz2";
       locale = "dsb";
       arch = "linux-i686";
-      sha512 = "fc81fbfcc6533d34fde2e08351dea6d7e2a561a3620a6d0d225dc1081f59d9927ceb0abfca7c2d21b1cc727c0319646a2f386c022524178e90aa6bba344371c3";
+      sha512 = "54fe7ff647565d5b82843d879ce3f791b2962bb034ec2ec2d5ea85cea3019ddae49f9f45384751d1a2d0f879aff4203a61687a4432ebdb948fd30569b6ddd7be";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/el/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/el/thunderbird-52.5.0.tar.bz2";
       locale = "el";
       arch = "linux-i686";
-      sha512 = "baf8d0a52fbb12afdccd003209614ce8d5b4062336744ee783a6c3e7eb5a542c4da233fb680f320226f3681b440ab1d0717616a3664051d231b6638729903b00";
+      sha512 = "d667a2d4f3782c30b308cfa6dd13ad321f6b7108d95f05c68dabe085228de28439f8e851920205404e48849829e65a07601ddcc553f3c73b08e233175805f046";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/en-GB/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/en-GB/thunderbird-52.5.0.tar.bz2";
       locale = "en-GB";
       arch = "linux-i686";
-      sha512 = "0f5fac2fd3da05cbdece404fe3d170ef49574b5abff07a17120d189338140fadbc0971c7be05656544819df2b1987fd86c0f9fdfcd312e540035e70877212342";
+      sha512 = "ed7d40db832e9abf89d0d1e497f1b276dec7836e494b616eee8db1557cddd33f6f700bc9f17db0324f7a3b191ea425a7701b7e2b10630c21ab07f3c709039312";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/en-US/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/en-US/thunderbird-52.5.0.tar.bz2";
       locale = "en-US";
       arch = "linux-i686";
-      sha512 = "1f3a640d140fa305e115158d98aadf95d180b396aa3935de4505f0f94f510d206ae6e45adf36572cb160175383d0aaad11c3244003e4a99dae613e1a749430cf";
+      sha512 = "9ffe74492c2fe29523a34b02ab869f9660aa1c33b16e45a026c4404e714b9cb6a5d2b24e73c7ac2f52e22f21e6e88e9a7686edbeb2c0876594054b17222d9ad5";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/es-AR/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/es-AR/thunderbird-52.5.0.tar.bz2";
       locale = "es-AR";
       arch = "linux-i686";
-      sha512 = "42525a75e154fdf263f276330a998f127de697519a79b447d4860403c40ca2a6caec0a225a978461ae776e56218313a3fa31441817cbb13db34cd47afb9a5eb8";
+      sha512 = "9f154f4fcb465925d445cbaecad4495d12d6381f0afd502973c4869890dfcd77366fa90bba835016729343947e064772163529528bfa76d52fc87bba5e9af1d0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/es-ES/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/es-ES/thunderbird-52.5.0.tar.bz2";
       locale = "es-ES";
       arch = "linux-i686";
-      sha512 = "86b47481b760206b49f87d15a917754d875203d83613c0c8b83e181f95986e6252ff26cd6dd6f7c6545f9d4da4801f6f236fa82dcce0d0172f19228b4eb5fe33";
+      sha512 = "4dc72ba78d8de913ab2b3a76920e0f4e3bb75cd880c3a8a55af72cc38334906e5786b24feb0db7d1e12db845f995c28e3342b5bb1bd4600c70de6b9fba012194";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/et/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/et/thunderbird-52.5.0.tar.bz2";
       locale = "et";
       arch = "linux-i686";
-      sha512 = "4bbfa1fde3a6270b49989747b4b27c284abb89819c46119cc3f2f90f0cad1648e49a2e1e01a35ef193eed4cf504a3e027138ea30a225c3d75347aa062d56afeb";
+      sha512 = "64279f558880cd6f6653e9387b479f08dcff440a23dc9a7bda664f09ca641cea05a268bea7cb7ee6495910fc67f1294f78bb163d09d70df06f335486d46d7ee9";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/eu/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/eu/thunderbird-52.5.0.tar.bz2";
       locale = "eu";
       arch = "linux-i686";
-      sha512 = "292fd0f2db956e5bc86a84d5edf51e3e36141610c99f75b1dd8af0f086fa8bc4a4e5a4e1c3d085587b6bf2d6e3435bc70ee66d379809886a391d67e2c243d762";
+      sha512 = "90185fb2a72b648af46b83470b2c57ab8784baad2c75c32920a5e6e1d5e03b5fd3a5ffad04cd52ea73a942c4ccc9b02d71ef7ca4887d3d089ba8f13745087b79";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/fi/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/fi/thunderbird-52.5.0.tar.bz2";
       locale = "fi";
       arch = "linux-i686";
-      sha512 = "b8df95d4ca36efdc4370821068590b1d7e3fb9f348afeb18a0a02c977027312457aaa59c38ee02908e944f166d485576522ea0cb087b28fa857963107e43ced7";
+      sha512 = "3d8fbda9afd0bb82db6baba04d06682c5083a8a05cb941552c5ae2abfa0fd7e9ea9e020423877f3141922485a69c1af5d48235dda29fb4b583c1f4435a747f59";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/fr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/fr/thunderbird-52.5.0.tar.bz2";
       locale = "fr";
       arch = "linux-i686";
-      sha512 = "7880654b4133e50ee248b6e287d52ba867361b900fbbdd149c6f06c9d5df1d0b57ce6d9d9bed3e1ab68e90b0ddf874d0b2427553b24ea39f267f576c63357bca";
+      sha512 = "669723deede608bb8239ee5a04dcccfccf3680e32da494d28fe5380714b012a322caca38eb3b6ccb3c136a3a9742f917a5614f1183ee08b80d760fa5cb19493a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/fy-NL/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/fy-NL/thunderbird-52.5.0.tar.bz2";
       locale = "fy-NL";
       arch = "linux-i686";
-      sha512 = "4784b06aeb705141d84103bf46635e6ba6a7f7795b40e654f63c783a63ee19d54843c211eac90c4246c5131ecc8808940e560f2fd2a2543522cef13bf3828938";
+      sha512 = "c35371dc26545e5f1b30a1c866538380e8d6cd21456e1415260cfdcde3c37f6f301f1a5ebfcba4d6a5612ed3809f7a27e5a5470fd5f5b7146b923ab15a5046a7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ga-IE/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ga-IE/thunderbird-52.5.0.tar.bz2";
       locale = "ga-IE";
       arch = "linux-i686";
-      sha512 = "91b4145d82a4748ef2cfe6d4d46c9e92c3a54a55f72ab1c28135363471d68ee028064ec0c0bb334fb731c6577305177a06d85b2a9d820d9e2a44fb01ac961beb";
+      sha512 = "1f5eaa4928e7b56ad27937b6a49f90fc5739149dfa8119563eb6153cd1d850243ce3a15e42d6e5a7a7c306401c97424b5ebbb6bbc7d20102aab09723c91925a5";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/gd/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/gd/thunderbird-52.5.0.tar.bz2";
       locale = "gd";
       arch = "linux-i686";
-      sha512 = "4e979ce305a014de612c0f3797b9f8c8d89445f05972a24d8c13cd01160aa2c15007b0e505f9a0cb354f8cf65e286ba52eae8a6bbdcf4c7cf4e89809e0ce530a";
+      sha512 = "61c1f4d9769981149a5961c096d9826e737ed356582b90d09efc437c38f93d9897ee84489f33e3fdc20787dd9d437ed58a5592bc5f586748d3e5897ddda38b20";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/gl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/gl/thunderbird-52.5.0.tar.bz2";
       locale = "gl";
       arch = "linux-i686";
-      sha512 = "b3081eee4473c097b37b9070cdcdd8eb48e1cf69ee63fd76f1eee0d5ed84009b69d0b31fb38c36f7d5137b78d0ab32087a8e668f1ad01e6ef96984ecd973af11";
+      sha512 = "cd23d74ddd303be4d86e4c63d5d2186ce3d0237caa62b0a48987b63c63322898f591e4b2c7a5fa5d219c49cb28070fde5cd933050dc0c0e6b9aefdd5f03e5b1d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/he/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/he/thunderbird-52.5.0.tar.bz2";
       locale = "he";
       arch = "linux-i686";
-      sha512 = "2781cc8fcac549ea394629ba1d7c43c683ea25b4d3c5807f7a4da50541e47ba18ed4d4080e7f3c785be8e71e0a8e2ae0cb9a24e348f830b71b7398efd06863e5";
+      sha512 = "58d98ff08576c3cd3d5a8637b8ba8dbab1b7e61942f4dd772ca48e3fb447a2dbcefe2cb9ed8cd3e86ffd0d9f8ba33366dbe01d744a825bf513861ea870d69ecc";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/hr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/hr/thunderbird-52.5.0.tar.bz2";
       locale = "hr";
       arch = "linux-i686";
-      sha512 = "d42587bb96454e3ee24b964dee1de0f51283b2c3316dd25e798a8809d2289306bf6eba6078f664f87720e7038b14f009640fdb4d3acf211195dc881e6e207c6c";
+      sha512 = "770a4a095993a9a84266b15e461645c4446ba6370092f1d0984d2ebcf836d24538276f63f9513dcaa537a4f016bb699169dafb14a68450f1e13050679800c5b3";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/hsb/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/hsb/thunderbird-52.5.0.tar.bz2";
       locale = "hsb";
       arch = "linux-i686";
-      sha512 = "49e3ee2559c124db79e2dbb2fe74291a377ccf1fbd75b450c8d4913000a055cea855fad03369e7420391faf114e160e35b02d432de847e673e352b731986bb84";
+      sha512 = "35f0a061f152d871636723b4690d3a3ff7172abb5adf0644b02e44fd23583e9a9d8ea68890a5313d74d190a6d293798b5ae8969a38b1166cd942a3d17b0246f6";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/hu/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/hu/thunderbird-52.5.0.tar.bz2";
       locale = "hu";
       arch = "linux-i686";
-      sha512 = "fad46a1ea3e8a1df49e4ba836c68b1744577fdfec319d9dc0b2bd8756d4dc859cb5af7484791b83f2260bd40d1ae64f19539f8f4b3977252a1f559b7df9fef35";
+      sha512 = "a4e9dd6ad2295cde7d7e5bfa8efee3c68123ae11d7535f0c076e29b18b952320ef39e4c92e8ad4aa66f63d8490b5737ee849e425378db04df8c794bb64f5393e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/hy-AM/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/hy-AM/thunderbird-52.5.0.tar.bz2";
       locale = "hy-AM";
       arch = "linux-i686";
-      sha512 = "6a34e03e5e272c847f674bd8c48cee66fb659cbf88251debe505c54011b029cea7b7e8a9722c61b3e603d66aaa4313a5971fdbf2035fd06d305cf229cd8b2afa";
+      sha512 = "8006eedb925424458cc9e084b367d4b8f16f78a6245159c61f13b75455404adf13eba353b4141cc555d82d4d6060deae9f97633884ba6d3b18d88af8bf93c4c7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/id/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/id/thunderbird-52.5.0.tar.bz2";
       locale = "id";
       arch = "linux-i686";
-      sha512 = "1cce3d3653b474219f00f4555990406b661a14c4198f3d246624def4e5a3ad3ea393a74f6c80e0f17b5799784e212778ccb8b56bda31c5e48a55193bef09c417";
+      sha512 = "df166f9e33adadd2e38290d1ea92a035c9cd0d910c1b246906ed38181c8db12bba29e69b4a909594a79b8b3eccc23131f34236afb40d6746793cdbda3a195bcd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/is/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/is/thunderbird-52.5.0.tar.bz2";
       locale = "is";
       arch = "linux-i686";
-      sha512 = "f3604e918502d16ba92e65e9def425efbb829a261d2c433ce83ec89d6ebfebbfcddd1b01508f953ec3c26166c6d01112486cdab6d1a0fe1e6a582f0566900b89";
+      sha512 = "1a05df69389d95d9920e133e085a0d3a05eb917b1b28c24fe9d8cdce316e19319fe08aa7a3fec304153fa0f59a0b8a630f9c44fa1d9c0310de03fc102172dbc4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/it/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/it/thunderbird-52.5.0.tar.bz2";
       locale = "it";
       arch = "linux-i686";
-      sha512 = "458bc19bd6b08f6834e310f7ec4591ad4e84067ae2373864ca9019c20551abbcbc067467fffada229000dda01369da3c28967df522182d8eda1a147d136b6315";
+      sha512 = "c446fa3e15e9eb72aff880f928f5c8a0b2b0c96632c243db4f5c377bd2dab56ccfb569a8500e9778ac5a4459ca634dc6d2ec1ec0f05aaa2980d3f45109fa2ffa";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ja/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ja/thunderbird-52.5.0.tar.bz2";
       locale = "ja";
       arch = "linux-i686";
-      sha512 = "05faf43b8b0f616bf552988a577891e816fe36b208b7d6292c9896a6946386815e117278feef33063b4f2eb7b5ec89aebc59e1d4432021969bf3b95e750defa3";
+      sha512 = "c7699f90c49fc4bca1580c749ccc446a95cb9f1a5a48cfee3b2a566ba13e073a4e405ba7b17ebff704f719639e323332f533db19f7c82007300322330f2b3983";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/kab/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/kab/thunderbird-52.5.0.tar.bz2";
       locale = "kab";
       arch = "linux-i686";
-      sha512 = "594669d5518b0be87095527b3013799812c9f45254434523903ad19edb2ebd4bc32409df6f646b1d1e953098e126673427400238a056e0a8c44b672009a12a2c";
+      sha512 = "5c098954ce0e642c76c3597d419bcd5f286d62af96ccf2726bd00cefe12036708217cc6829c39cd669a21ed0cdfd8a6d511b8a55e8dafefa8c3940040e99d9a6";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ko/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ko/thunderbird-52.5.0.tar.bz2";
       locale = "ko";
       arch = "linux-i686";
-      sha512 = "db3e6c9efbeeed833384256814a713a5bf3d2a220a74c88fd28f91ec0dd6c7600d77e18ce66c9dc9f1929f5da7452c5904f012fa8f5e4fa04084892e17b2647f";
+      sha512 = "0a435742a13454634ef563b704d1618ce492a997814466ece1066e244160494e2092588b5cbbe5d1a7076b89c895b5f1a3288a377b547d454eb411960e3faeb4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/lt/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/lt/thunderbird-52.5.0.tar.bz2";
       locale = "lt";
       arch = "linux-i686";
-      sha512 = "2b8e8b74bbba2a72dc88a8dba457189cad1c902c0bf2cbc54bf989c6444c8b164238f1d9e21c2c8e470df5198d8586cd613b40292b737c04f4c2d834d298dc13";
+      sha512 = "0ffbe8a40179cdce48423c70ce871ebbce066932cf9ab21560ba3107d2794198a7c8f5d5d3fefa58627beac4faa2ed398a09c429a47b261153f3045fe5779883";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/nb-NO/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/nb-NO/thunderbird-52.5.0.tar.bz2";
       locale = "nb-NO";
       arch = "linux-i686";
-      sha512 = "bf99756bb7bc5fa699cae5ef3da5a3614e57483b2892e2f6f769699ef3478e22847ddeaf63fc0c521cd1fbcccbdf9bc5054430a5cdbb50e26e371818cae404fb";
+      sha512 = "d44ece21a5ce26df33d7ea04f56cf2a21dc67bb053212a71a2a30dbabb7894bc9cd5b8a07f86906c882fda29603d2c8ff16d675c8e8bef8ec362be8c824624a9";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/nl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/nl/thunderbird-52.5.0.tar.bz2";
       locale = "nl";
       arch = "linux-i686";
-      sha512 = "80170d51276bb77de4af8d45d5869069c7d9c6db7ad6d5786fd4c2c5cfb0a20ceb1cdce7b5dbf99a79dca329efa5d9a53d4ed738cbe7f77bdcb65a8b6e2e7511";
+      sha512 = "8c2489dd4d860fc657893986f268746512cef54943b19f7c129013e5a6a8db8f4a8fb0ef22b1cfdc41306bbd63d1c81131989af7161d310cabe2427e21ab4702";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/nn-NO/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/nn-NO/thunderbird-52.5.0.tar.bz2";
       locale = "nn-NO";
       arch = "linux-i686";
-      sha512 = "f223dd33108a750563a498e92b53cd3e68e3d50fdb1a08e295a9c3e893c20908ea56c9c5312874469b2f96d1046f754df55bc38d1595d5b811b7ed659e267d98";
+      sha512 = "57270f4645bc1d82f3602a49aad11bb6261a2be39200b3284ee65082df363b5870b1cacbaeb3802a83f6ef1554a4d6a2c6e6b2720aa2b9d29b7a86208d676f6a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/pa-IN/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/pa-IN/thunderbird-52.5.0.tar.bz2";
       locale = "pa-IN";
       arch = "linux-i686";
-      sha512 = "a418fea2521ff6971d68d975823bd0917580450a7ff38975455b891c8e3cbcfdf51c40502fa072ebc1f43ce93a3b07ce93db369edfbd511beee5dfc5041a0a84";
+      sha512 = "7a7464cbf08e418c56c979abba5ef7120f1202073ab630ef4ce070aa1b55520597dda0b0f31e7afc50e14c8c4fe0f33759a2278035d5db5f21edacb6d521672c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/pl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/pl/thunderbird-52.5.0.tar.bz2";
       locale = "pl";
       arch = "linux-i686";
-      sha512 = "05adc7298c91853b373756944d360589caeef6a999f6c5ea9babe3b12ff9409909040b69b641b69b78bd17bddda59f9828e294f5cd5f7d7061cc3f51eb3c48b3";
+      sha512 = "ae0b8da805a3b055bbb64a3c0f1d3562f44fae08751026b8300c130f4a2629a1a17857d2be2468c9e2ddb2a082155d35a26b7b1f0c99369b2031a90b34aa2443";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/pt-BR/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/pt-BR/thunderbird-52.5.0.tar.bz2";
       locale = "pt-BR";
       arch = "linux-i686";
-      sha512 = "4a2503e3a1daf5b9cb26acf25720c4d0fdc7a170bd454a185e4cf2cd9c9429dcbdee4c13e59e11a2a275d88513b1ae31dffae8bdf70c3196249e432360fbe705";
+      sha512 = "f61d66c71c2144aba0781f82370318fcff0637d4bb28cda3703f099718691f13bbbc51eaa4252ef1fbd1dbe821032597e41adb80b1abec89a2bc50df043f5099";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/pt-PT/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/pt-PT/thunderbird-52.5.0.tar.bz2";
       locale = "pt-PT";
       arch = "linux-i686";
-      sha512 = "cb02054a64a74c2e1f936594f001dd721e3016cc68cf705c0413a732153bbe45aaa14736d38b22358bda5f3d059f7306087c27faf040d91bd7f92066403e65c1";
+      sha512 = "ad0d63ab9389e3c4cf6985835dc4277d3ac5cf79e09457331f87629c8f9a58e95ce7b68c2eec8973ab445cc8f8c50c0b01b78ebd0ada042f4fa6a2d2bc838241";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/rm/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/rm/thunderbird-52.5.0.tar.bz2";
       locale = "rm";
       arch = "linux-i686";
-      sha512 = "8e745e5d1e5a4d3f432bf8c5f90906a22c8d2fe4c6d77ec032cb7eccae1f2f9e7cf0620dd3ef378414d6f34cc25346ff44b7fbee05016f34c49a0c8c5959184c";
+      sha512 = "5e5f96598101695ad0d16a7f3aea38c42d875b3d7b7e2eb529786f16cc008ca8b20bfcb24d2b975cdd2e114d00c1d17f8901f19fa84263f64506d9d75568e6be";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ro/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ro/thunderbird-52.5.0.tar.bz2";
       locale = "ro";
       arch = "linux-i686";
-      sha512 = "20d9b9666704c87f73f4c8cbe8d09cf79349e811f4c4da93f2754886cc89fabf7c2388430f9f072a3918b38984742adab48ada320dd75761a7443f3be1198a8e";
+      sha512 = "82a0324bc4724460d5aafa194a78d611c1d11cc347446d5c2203e9fb40a45f6c7ffb0e17aa87b603af8b3ae5847fa91cac529ae878a6981c9c754ea91b8b6b52";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ru/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ru/thunderbird-52.5.0.tar.bz2";
       locale = "ru";
       arch = "linux-i686";
-      sha512 = "ff7c64ed9a4403e24b7f0f9fb06bc4b96153fbe7d30b94ea7e145d33dc24bb1b2807db8d6e3398dc84e13f68d9c5c4fbaacc3027cd46ee58fecaa8b7b17b27a7";
+      sha512 = "508d949263abd425ff805f417cfa60736d391e1dc99b53dca2243c4c93487ad2889ac6a9bd8beed59b4e09bc82ba31b9c5cbc9fe084ee3b5fde74baaa2720a7e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/si/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/si/thunderbird-52.5.0.tar.bz2";
       locale = "si";
       arch = "linux-i686";
-      sha512 = "b2358e6df5f5cda477c530dddd9d27e35a8919aa346b66521336fb0cddd2821bb7dd867f4ad005c135ce040a1eb64ad9f1feef81a268a299ca2170312f7c89ef";
+      sha512 = "e9869c86acbba32bab6b536f2542b498e9de0a306558b3115ffaf143f83c5a5010ead37573ed7ce9565c42b6306d98b4f92da866ba62f5c4042dd537f66e377e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/sk/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/sk/thunderbird-52.5.0.tar.bz2";
       locale = "sk";
       arch = "linux-i686";
-      sha512 = "fc3eae35914d2a2ec6d44bf6348f71872f7ccb09d25ed974843b8010526f219437e6530c4d86825d027f1593da0943e0b9a5557bf41d4095e4e9d37108a94c3a";
+      sha512 = "1297d9a8ed5d062790766ee5cb66a1c3b67526326440b5d3f27b712440c0e3525ab2231774e02436bfad4b8ccf1006e5a16d2fce4be26bf2c757427228f7fed7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/sl/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/sl/thunderbird-52.5.0.tar.bz2";
       locale = "sl";
       arch = "linux-i686";
-      sha512 = "532b87d22bd05194470801cccf242ffbae57685e69a836c8179e2fc562bdf2aba196f214b7a66006ef90d7fb1781d66e1ea62c2cf95820402deb9a73122ad143";
+      sha512 = "734d57ba493e160547953debc20b1d5565c31b0e6e5b486344f5da65aa4cbc77fa7790f49f4ad6322a633232fbcca2f21bdeae7f4abb2aa8cf13e5741519d706";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/sq/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/sq/thunderbird-52.5.0.tar.bz2";
       locale = "sq";
       arch = "linux-i686";
-      sha512 = "b621973b1f76f2d789afa854917e20b7b48e3381344da29e07b8c5bfd469162c47d51e9552ab2428895c45dab9662d8fdc2704e65c96faa4afbddc4649a77dec";
+      sha512 = "e7a21ce516318f46d467f987dd244174ed2533bdeeeba41c2fff3a838ebb78047febabe6f3e86ab57bcc12f0b1418fb7ac195ca044a7c84eda404e152690b554";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/sr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/sr/thunderbird-52.5.0.tar.bz2";
       locale = "sr";
       arch = "linux-i686";
-      sha512 = "d26812c232168c30c6a76dad5f3f7e20fe88cd75fc63f863bca255fa353928b8d3988c56abbb649266e52b8d31d70182c59ded496607aae17d7d2d0409ecc53a";
+      sha512 = "132fbcd2a7890ac413dbc3b1651a02227b741a8a31e2406780f36415fd47ed75503968a93414ec31384f28ecf1e14753f0e1bb2988468d973dfac9ab45787519";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/sv-SE/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/sv-SE/thunderbird-52.5.0.tar.bz2";
       locale = "sv-SE";
       arch = "linux-i686";
-      sha512 = "294e141cabec4edab0695e7c8e29149543e4cf4d451cfe9ba038a6997a822e02f223045ac3a8ac25b99a1e847740fac4d9d5c0b5ce0c5d69d331d823bf8e4899";
+      sha512 = "6e07841987bba5fcd69f790fc8a292ad7a3d71bcd802d16081145f243a71d49c8c57c5b6ad60ebfe1a550d62b1c9713843a83066893a397889f925e8b88904ef";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/ta-LK/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/ta-LK/thunderbird-52.5.0.tar.bz2";
       locale = "ta-LK";
       arch = "linux-i686";
-      sha512 = "9c9b79cf21e64461b8a78dd0f7816346ada2cce0ef4bce4da291497c9fd1aa414c199d57265390e5b885828b1efa38f9883882870b84a5b3a64ffffb47da79e1";
+      sha512 = "978b1ba5f77271906ea67b37637b31a9c1da0f97453ea4e140adff8558ee2b01fe32f3018a48b141198cd0ad9f9d927ce213100be3f3310b020bfb3ff8b1d69c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/tr/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/tr/thunderbird-52.5.0.tar.bz2";
       locale = "tr";
       arch = "linux-i686";
-      sha512 = "61a671ae2804b06143e636c9e8ae0badb460bf9cbb3555213bf43aa2d56b2a9f13ca3a13362f2a9b7ecafb4b03451093ea2f817a104cc7d4555e11b1ffb18103";
+      sha512 = "2531185c167e66b77c6b7f968927a64a9e8de56580fd82c7b2408bfac71523738610b740650644eeee4c485dbf532a8da92367bdc574733d0df0d749613bd6b4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/uk/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/uk/thunderbird-52.5.0.tar.bz2";
       locale = "uk";
       arch = "linux-i686";
-      sha512 = "629ede67d8bbfd6b1233d2030234fed7f99915045131caa11edce99b6e9c314b7cfd6ef457d26a0e628b525bb78c05426e8c078364ade5e606dfaba90200feee";
+      sha512 = "3f9eed73e2e85528deef2f2ffcbc166d2a836d363693f6ece98adeabe872a6aaa77facd16efd918fac9eefebed68ff35c59750d7116545a6540c9e1aede45c51";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/vi/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/vi/thunderbird-52.5.0.tar.bz2";
       locale = "vi";
       arch = "linux-i686";
-      sha512 = "728644651b7eff73be44bceccf8038bca79e020fbaad87d74fb1ff4856554766e6494e1e16a0d93187615f5f8cb663fc3233855d66e8cf0996fe597c9645273c";
+      sha512 = "fa776aca6c434491925e6fcd1802f047fcdcc2ae817805ffae0c873e17f1ad233836954544d85ac378ab28fb607c9cbc5b1808a12bbfa1d9337c8e47de4eddd7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/zh-CN/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/zh-CN/thunderbird-52.5.0.tar.bz2";
       locale = "zh-CN";
       arch = "linux-i686";
-      sha512 = "ef5a81e04ed973fd2ed576d1654f1ada7d9cefb6943bf604bee53053fedc4b2127c780ac2ff3c9b568813699f29f744950e899bc71733cd8d385368e1d0c07c2";
+      sha512 = "ddc20a6b05b48d6bcbc59c585b4a2365cee6d526ddef29e3dd04d38c8632c5c7ddda9eab24f2850dd2614bb7acc6e982ae4673c2b51c679eb5afd48047bf6fca";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.4.0/linux-i686/zh-TW/thunderbird-52.4.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.5.0/linux-i686/zh-TW/thunderbird-52.5.0.tar.bz2";
       locale = "zh-TW";
       arch = "linux-i686";
-      sha512 = "ddf5a00621d6916c6033f81589c9376a8aaba3bf12810a2fd41358af323d9f6354384a5b938f299855d27a1272d36e99ca3f45a8ab8299aa7afc118d942ae624";
+      sha512 = "aa527aeaa6b10d785e3fa3a8052c5dfa70f9aae2601119aed7dfd60e8af30f03cc1b4d93f749c36be4e54bbce6071fe66fb1937fa392b8391ca695e55ffe68ab";
     }
     ];
 }
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 2e1f8ed507017..966e1886f34b8 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -22,11 +22,11 @@ let
   wrapperTool = if enableGTK3 then wrapGAppsHook else makeWrapper;
 in stdenv.mkDerivation rec {
   name = "thunderbird-${version}";
-  version = "52.4.0";
+  version = "52.5.0";
 
   src = fetchurl {
     url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
-    sha512 = "6ac39cecca9e53b51754d7a8bd7cae228d197eb234b03a2386c16fd665f4f7a67f10bbdf981c20b3f7a21a5ef67e2771154a3dd9f249c6a884c48a9e59bcfc78";
+    sha512 = "b9b599e5853887bd518e5a57f6fd04751bb78f553f97b260cd9ba7268c4cff307be40b81b00f1320f5a5156e5c67115595b2d389f931c265d0c3448f56fb8319";
   };
 
   # New sed no longer tolerates this mistake.
@@ -72,7 +72,6 @@ in stdenv.mkDerivation rec {
       "--enable-system-sqlite"
       #"--enable-system-cairo"
       "--enable-startup-notification"
-      "--enable-content-sandbox"            # available since 26.0, but not much info available
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
diff --git a/pkgs/applications/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index 1563cdf3d056f..ea503b8df9bd8 100644
--- a/pkgs/applications/office/abiword/default.nix
+++ b/pkgs/applications/office/abiword/default.nix
@@ -15,7 +15,11 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   patches = [
-    ./patches/fix-13791.patch
+    # https://bugzilla.abisource.com/show_bug.cgi?id=13791
+    (fetchurl {
+      url = https://bugzilla.abisource.com/attachment.cgi?id=5860;
+      sha256 = "02p8kz02xm1197zcpzjs010mna9hxsbq5lwgxr8b7qhh9yxja7al";
+    })
   ];
 
   buildInputs =
diff --git a/pkgs/applications/office/abiword/patches/fix-13791.patch b/pkgs/applications/office/abiword/patches/fix-13791.patch
deleted file mode 100644
index 98004f01bcbaf..0000000000000
--- a/pkgs/applications/office/abiword/patches/fix-13791.patch
+++ /dev/null
@@ -1,161 +0,0 @@
-From 46388f407c893123d9b3824a7570b050fc3b049b Mon Sep 17 00:00:00 2001
-From: James Cameron <quozl@laptop.org>
-Date: Thu, 17 Aug 2017 15:05:39 +1000
-Subject: [PATCH] Fix flickering
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-- in GR_Caret::s_blink_timeout, avoid repeated calls by stopping the
-  timer, it will be restarted when needed,
-
-- in GR_Caret::s_enable, avoid extra unnecessary _blink calls when blink
-  is enabled, as they serve no purpose,
-
-- in XAP_UnixFrameImpl::_fe::expose, use the Cairo clip rectangle
-  instead of the expose event area, thanks to Hubert Figuière in
-  865c1dda7e13deff04573ffc42028b71fee07f9c,
-
-- in XAP_UnixFrameImpl::_fe::expose, do not return FALSE, as other
-  handlers will need to handle the draw event,
-
-- in GR_UnixCairoGraphics::flush, fix excessive draw events;
-  gtk_widget_queue_draw only marks the widget as needing redrawing,
-  which causes a draw event for each call to flush, therefore every
-  caret blink, so use gdk_flush instead,
-
-Fixes AbiSource #13791.
-Fixes Debian #851052.
-Fixes Fedora #1287835.
-Fixes Ubuntu LP: #1574278.
-Fixes Sugar Labs #4915.
-
-Signed-off-by: James Cameron <quozl@laptop.org>
----
- src/af/gr/gtk/gr_UnixCairoGraphics.cpp |  4 +---
- src/af/gr/xp/gr_Caret.cpp              | 13 ++++---------
- src/af/xap/gtk/xap_UnixFrameImpl.cpp   | 27 ++++++++++++++++++---------
- src/af/xap/gtk/xap_UnixFrameImpl.h     |  2 +-
- 4 files changed, 24 insertions(+), 22 deletions(-)
-
-diff --git a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
-index 509bd37..7c3c06f 100644
---- a/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
-+++ b/src/af/gr/gtk/gr_UnixCairoGraphics.cpp
-@@ -577,9 +577,7 @@ void GR_UnixCairoGraphics::_endPaint()
- 
- void GR_UnixCairoGraphics::flush(void)
- {
--	if (m_Widget) {
--		gtk_widget_queue_draw(m_Widget);
--	}
-+	gdk_flush();
- }
- 
- bool GR_UnixCairoGraphics::queryProperties(GR_Graphics::Properties gp) const
-diff --git a/src/af/gr/xp/gr_Caret.cpp b/src/af/gr/xp/gr_Caret.cpp
-index 5d5d116..a8aa451 100644
---- a/src/af/gr/xp/gr_Caret.cpp
-+++ b/src/af/gr/xp/gr_Caret.cpp
-@@ -155,22 +155,17 @@ void GR_Caret::s_enable(UT_Worker * _w)
- {
- 	GR_Caret * c = static_cast<GR_Caret *>(_w->getInstanceData());
- 
-+	c->m_enabler->stop();
- 	c->m_worker->stop();
--	c->_blink(true);
--	if (!c->m_bCursorIsOn)
--		c->_blink(true); // blink again
--	else
--	{
--		c->_blink(true); // ?? - MARCM
--		c->_blink(true);
--	}
- 	c->m_worker->start();
--	c->m_enabler->stop();
-+	c->_blink(true);
- }
- 
- void GR_Caret::s_blink_timeout(UT_Worker * _w)
- {
- 	GR_Caret * c = static_cast<GR_Caret *>(_w->getInstanceData());
-+
-+	c->m_blinkTimeout->stop();
- 	if (c->isEnabled())
- 		c->disable();
- }
-diff --git a/src/af/xap/gtk/xap_UnixFrameImpl.cpp b/src/af/xap/gtk/xap_UnixFrameImpl.cpp
-index 780000e..e81961a 100644
---- a/src/af/xap/gtk/xap_UnixFrameImpl.cpp
-+++ b/src/af/xap/gtk/xap_UnixFrameImpl.cpp
-@@ -1208,15 +1208,23 @@ gint XAP_UnixFrameImpl::_fe::delete_event(GtkWidget * w, GdkEvent * /*event*/, g
- }
- 
- #if GTK_CHECK_VERSION(3,0,0)
--gint XAP_UnixFrameImpl::_fe::draw(GtkWidget * w, cairo_t * cr)
-+gboolean XAP_UnixFrameImpl::_fe::draw(GtkWidget * w, cairo_t * cr)
- #else
- gint XAP_UnixFrameImpl::_fe::expose(GtkWidget * w, GdkEventExpose* pExposeEvent)
- #endif
- {
- 	XAP_UnixFrameImpl * pUnixFrameImpl = static_cast<XAP_UnixFrameImpl *>(g_object_get_data(G_OBJECT(w), "user_data"));
- 	FV_View * pView = static_cast<FV_View *>(pUnixFrameImpl->getFrame()->getCurrentView());
-+	double x, y, width, height;
- #if GTK_CHECK_VERSION(3,0,0)
--	GdkEventExpose *pExposeEvent = reinterpret_cast<GdkEventExpose *>(gtk_get_current_event());
-+	cairo_clip_extents (cr, &x, &y, &width, &height);
-+	width -= x;
-+	height -= y;
-+#else
-+	x = pExposeEvent->area.x;
-+	y = pExposeEvent->area.y;
-+	width = pExposeEvent->area.width;
-+	height = pExposeEvent->area.height;
- #endif
- /* Jean: commenting out next lines since the zoom update code does draw only
-  * part of what needs to be updated. */
-@@ -1230,20 +1238,21 @@ gint XAP_UnixFrameImpl::_fe::expose(GtkWidget * w, GdkEventExpose* pExposeEvent)
- 		UT_Rect rClip;
- 		if (pGr->getPaintCount () > 0)
- 			return TRUE;
--		xxx_UT_DEBUGMSG(("Expose area: x %d y %d width %d  height %d \n",pExposeEvent->area.x,pExposeEvent->area.y,pExposeEvent->area.width,pExposeEvent->area.height));
--		rClip.left = pGr->tlu(pExposeEvent->area.x);
--		rClip.top = pGr->tlu(pExposeEvent->area.y);
--		rClip.width = pGr->tlu(pExposeEvent->area.width)+1;
--		rClip.height = pGr->tlu(pExposeEvent->area.height)+1;
--#if GTK_CHECK_VERSION(3,0,0)
-+		rClip.left = pGr->tlu(x);
-+		rClip.top = pGr->tlu(y);
-+ #if GTK_CHECK_VERSION(3,0,0)
-+		rClip.width = pGr->tlu(width);
-+		rClip.height = pGr->tlu(height);
- 		static_cast<GR_CairoGraphics *>(pGr)->setCairo(cr);
- 		pView->draw(&rClip);
- 		static_cast<GR_CairoGraphics *>(pGr)->setCairo(NULL);
- #else
-+		rClip.width = pGr->tlu(width)+1;
-+		rClip.height = pGr->tlu(height)+1;
- 		pView->draw(&rClip);
- #endif
- 	}
--	return FALSE;
-+	return TRUE;
- }
- 
- static bool bScrollWait = false;
-diff --git a/src/af/xap/gtk/xap_UnixFrameImpl.h b/src/af/xap/gtk/xap_UnixFrameImpl.h
-index 30ee5d8..26fbb2e 100644
---- a/src/af/xap/gtk/xap_UnixFrameImpl.h
-+++ b/src/af/xap/gtk/xap_UnixFrameImpl.h
-@@ -152,7 +152,7 @@ protected:
- 			static gint key_release_event(GtkWidget* w, GdkEventKey* e);
- 			static gint delete_event(GtkWidget * w, GdkEvent * /*event*/, gpointer /*data*/);
- #if GTK_CHECK_VERSION(3,0,0)
--			static gint draw(GtkWidget * w, cairo_t * cr);
-+			static gboolean draw(GtkWidget * w, cairo_t * cr);
- #else
- 			static gint expose(GtkWidget * w, GdkEventExpose* pExposeEvent);
- #endif
--- 
-2.11.0
-
diff --git a/pkgs/applications/office/paperwork/backend.nix b/pkgs/applications/office/paperwork/backend.nix
index 5575299646495..2e052243a052a 100644
--- a/pkgs/applications/office/paperwork/backend.nix
+++ b/pkgs/applications/office/paperwork/backend.nix
@@ -9,7 +9,7 @@
 }:
 
 buildPythonPackage rec {
-  name = "paperwork-backend-${version}";
+  pname = "paperwork-backend";
   version = "1.2.1";
 
   src = fetchFromGitHub {
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index 5903edd337df4..190186db1810b 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -12,7 +12,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoconf automake ];
 
-  preConfigure = "./autogen.sh";
+  preConfigure = ''
+    ./autogen.sh
+
+    # Build fails on Linux with windres.
+    export ac_cv_prog_WINDRES=
+  '';
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = http://gravit.slowchop.com;
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index 5e42992cbe22f..c0b6720690058 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -32,6 +32,7 @@ stdenv.mkDerivation {
     ./symlinks-in-bin.patch
     ./git-sh-i18n.patch
     ./ssh-path.patch
+    ./git-send-email-honor-PATH.patch
   ];
 
   postPatch = ''
diff --git a/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch
new file mode 100644
index 0000000000000..1aec77504b7b9
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git/git-send-email-honor-PATH.patch
@@ -0,0 +1,47 @@
+From 9a4396ddaedaf59ebee16d69900884e990b79cdd Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Fri, 17 Nov 2017 13:21:37 +0100
+Subject: [PATCH] git-send-email: honor $PATH
+
+This will search $PATH for a sendmail binary, instead of the (previously
+fixed) list of paths.
+
+Signed-off-by: Florian Klink <flokli@flokli.de>
+---
+ Documentation/git-send-email.txt | 5 ++---
+ git-send-email.perl              | 3 ++-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/Documentation/git-send-email.txt b/Documentation/git-send-email.txt
+index bac9014ac..b9b1f2c41 100644
+--- a/Documentation/git-send-email.txt
++++ b/Documentation/git-send-email.txt
+@@ -203,9 +203,8 @@ a password is obtained using 'git-credential'.
+ 	specify a full pathname of a sendmail-like program instead;
+ 	the program must support the `-i` option.  Default value can
+ 	be specified by the `sendemail.smtpServer` configuration
+-	option; the built-in default is `/usr/sbin/sendmail` or
+-	`/usr/lib/sendmail` if such program is available, or
+-	`localhost` otherwise.
++	option; the built-in default is to search in $PATH if such program is
++	available, or `localhost` otherwise.
+ 
+ --smtp-server-port=<port>::
+ 	Specifies a port different from the default port (SMTP
+diff --git a/git-send-email.perl b/git-send-email.perl
+index 2208dcc21..8e357aeab 100755
+--- a/git-send-email.perl
++++ b/git-send-email.perl
+@@ -885,7 +885,8 @@ if (defined $initial_reply_to) {
+ }
+ 
+ if (!defined $smtp_server) {
+-	foreach (qw( /usr/sbin/sendmail /usr/lib/sendmail )) {
++	my @sendmail_paths = map {"$_/sendmail"} split /:/, $ENV{PATH};
++	foreach (@sendmail_paths) {
+ 		if (-x $_) {
+ 			$smtp_server = $_;
+ 			last;
+-- 
+2.15.0
+
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 0952fd1af0801..3e502cde08b20 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -19,10 +19,10 @@ let
   python = python2;
   buildType = "release";
   # Manually sha256sum the extensionPack file, must be hex!
-  extpack = "005ba9211862643e2516d549e98b80942918047f1f6c55fcfe08c490dd1947bc";
-  extpackRev = "118431";
-  main = "0m6y98pvkngprw5iaswvkbbfxmzvfl8yvgi984p1866zwap77z16";
-  version = "5.2.0";
+  extpack = "9328548ca8cbc526232c0631cb5a17618c771b07665b362c1e3d89a2425bf799";
+  extpackRev = "119230";
+  main = "05y03fcp013gc500q34bj6hvx1banib41v8l3hcxknzfgwq0rarm";
+  version = "5.2.2";
 
   # See https://github.com/NixOS/nixpkgs/issues/672 for details
   extensionPack = requireFile rec {
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index 87b89a98e7801..0aa0423fc13aa 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -19,12 +19,14 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "1r6dybr3pfclffk7gppf7n8gwj3ziw7pmfvbwwkdw00q9ah7h5l4";
+    sha256 = "1f0vm20qdjxqsbciwgybxqqpn609gj5dy68an8lpi1wlk93s05w3";
   };
 
   KERN_DIR = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build";
   KERN_INCL = "${kernel.dev}/lib/modules/${kernel.modDirVersion}/source/include";
 
+  patchFlags = [ "-p1" "-d" "install/src/vboxguest-${version}" ];
+
   patches = [
     ./fix_kerndir.patch
     ./fix_kernincl.patch
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch b/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch
index e7feed853b129..0be949f63c92d 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kerndir.patch
@@ -1,7 +1,7 @@
-diff --git a/install/src/vboxguest-5.2.0/vboxsf/Makefile.include.header b/install/src/vboxguest-5.2.0/vboxsf/Makefile.include.header
+diff --git a/vboxsf/Makefile.include.header b/vboxsf/Makefile.include.header
 index 8df1eb4d25..5a3e5604e7 100644
---- a/install/src/vboxguest-5.2.0/vboxsf/Makefile.include.header
-+++ b/install/src/vboxguest-5.2.0/vboxsf/Makefile.include.header
+--- a/vboxsf/Makefile.include.header
++++ b/vboxsf/Makefile.include.header
 @@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
  endif # neq($(KERNELRELEASE),)
 
@@ -11,10 +11,10 @@ index 8df1eb4d25..5a3e5604e7 100644
   $(error Error: unable to find the headers of the Linux kernel to build against. \
            Specify KERN_VER=<version> and run Make again)
 
-diff --git a/install/src/vboxguest-5.2.0/vboxguest/Makefile.include.header b/install/src/vboxguest-5.2.0/vboxguest/Makefile.include.header
+diff --git a/vboxguest/Makefile.include.header b/vboxguest/Makefile.include.header
 index 8df1eb4d25..5a3e5604e7 100644
---- a/install/src/vboxguest-5.2.0/vboxguest/Makefile.include.header
-+++ b/install/src/vboxguest-5.2.0/vboxguest/Makefile.include.header
+--- a/vboxguest/Makefile.include.header
++++ b/vboxguest/Makefile.include.header
 @@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
  endif # neq($(KERNELRELEASE),)
 
@@ -24,10 +24,10 @@ index 8df1eb4d25..5a3e5604e7 100644
   $(error Error: unable to find the headers of the Linux kernel to build against. \
            Specify KERN_VER=<version> and run Make again)
 
-diff --git a/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header b/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
+diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header
 index 8df1eb4d25..5a3e5604e7 100644
---- a/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
-+++ b/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
+--- a/vboxvideo/Makefile.include.header
++++ b/vboxvideo/Makefile.include.header
 @@ -117,7 +117,6 @@ else # neq($(KERNELRELEASE),)
  endif # neq($(KERNELRELEASE),)
 
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch b/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch
index 251394e5d13e4..e59e2e98c1b3b 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/fix_kernincl.patch
@@ -1,7 +1,7 @@
-diff --git a/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header b/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
+diff --git a/vboxvideo/Makefile.include.header b/vboxvideo/Makefile.include.header
 index 8df1eb4d25..5a3e5604e7 100644
---- a/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
-+++ b/install/src/vboxguest-5.2.0/vboxvideo/Makefile.include.header
+--- a/vboxvideo/Makefile.include.header
++++ b/vboxvideo/Makefile.include.header
 @@ -122,7 +122,6 @@ ifneq ($(shell if test -d $(KERN_DIR); then echo yes; fi),yes)
            Specify KERN_VER=<version> and run Make again)
  endif
diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix
index 8f4d4858ca11b..22521cc6da8db 100644
--- a/pkgs/applications/window-managers/qtile/default.nix
+++ b/pkgs/applications/window-managers/qtile/default.nix
@@ -36,9 +36,9 @@ python27Packages.buildPythonApplication rec {
 
   postInstall = ''
     wrapProgram $out/bin/qtile \
-      --set QTILE_WRAPPER '$0' \
-      --set QTILE_SAVED_PYTHONPATH '$PYTHONPATH' \
-      --set QTILE_SAVED_PATH '$PATH'
+      --run 'export QTILE_WRAPPER=$0' \
+      --run 'export QTILE_SAVED_PYTHONPATH=$PYTHONPATH' \
+      --run 'export QTILE_SAVED_PATH=$PATH'
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/window-managers/weston/default.nix b/pkgs/applications/window-managers/weston/default.nix
index 395541d62503b..0b78debdc589a 100644
--- a/pkgs/applications/window-managers/weston/default.nix
+++ b/pkgs/applications/window-managers/weston/default.nix
@@ -7,11 +7,11 @@
 
 stdenv.mkDerivation rec {
   name = "weston-${version}";
-  version = "1.12.0";
+  version = "3.0.0";
 
   src = fetchurl {
     url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "ac7ac2a32e3b9f50131fccded5d2326bd36b2226712d90b61999118a09af5033";
+    sha256 = "19936zlkb75xcaidd8fag4ah8000wrh2ziqy7nxkq36pimgdbqfd";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh
index f9d435df655ba..f75b285bacf21 100644
--- a/pkgs/build-support/setup-hooks/make-wrapper.sh
+++ b/pkgs/build-support/setup-hooks/make-wrapper.sh
@@ -47,7 +47,12 @@ makeWrapper() {
             varName="${params[$((n + 1))]}"
             value="${params[$((n + 2))]}"
             n=$((n + 2))
-            echo "export $varName=\"$value\"" >> "$wrapper"
+            echo "export $varName=${value@Q}" >> "$wrapper"
+        elif [[ "$p" == "--set-default" ]]; then
+            varName="${params[$((n + 1))]}"
+            value="${params[$((n + 2))]}"
+            n=$((n + 2))
+            echo "export $varName=\${$varName-${value@Q}}" >> "$wrapper"
         elif [[ "$p" == "--unset" ]]; then
             varName="${params[$((n + 1))]}"
             n=$((n + 1))
@@ -63,9 +68,9 @@ makeWrapper() {
             n=$((n + 3))
             if test -n "$value"; then
                 if test "$p" = "--suffix"; then
-                    echo "export $varName=\$$varName\${$varName:+$separator}$value" >> "$wrapper"
+                    echo "export $varName=\$$varName\${$varName:+${separator@Q}}${value@Q}" >> "$wrapper"
                 else
-                    echo "export $varName=$value\${$varName:+$separator}\$$varName" >> "$wrapper"
+                    echo "export $varName=${value@Q}\${$varName:+${separator@Q}}\$$varName" >> "$wrapper"
                 fi
             fi
         elif [[ "$p" == "--suffix-each" ]]; then
@@ -74,7 +79,7 @@ makeWrapper() {
             values="${params[$((n + 3))]}"
             n=$((n + 3))
             for value in $values; do
-                echo "export $varName=\$$varName\${$varName:+$separator}$value" >> "$wrapper"
+                echo "export $varName=\$$varName\${$varName:+$separator}${value@Q}" >> "$wrapper"
             done
         elif [[ ("$p" == "--suffix-contents") || ("$p" == "--prefix-contents") ]]; then
             varName="${params[$((n + 1))]}"
@@ -82,10 +87,11 @@ makeWrapper() {
             fileNames="${params[$((n + 3))]}"
             n=$((n + 3))
             for fileName in $fileNames; do
+                contents="$(cat "$fileName")"
                 if test "$p" = "--suffix-contents"; then
-                    echo "export $varName=\$$varName\${$varName:+$separator}$(cat "$fileName")" >> "$wrapper"
+                    echo "export $varName=\$$varName\${$varName:+$separator}${contents@Q}" >> "$wrapper"
                 else
-                    echo "export $varName=$(cat "$fileName")\${$varName:+$separator}\$$varName" >> "$wrapper"
+                    echo "export $varName=${contents@Q}\${$varName:+$separator}\$$varName" >> "$wrapper"
                 fi
             done
         elif [[ "$p" == "--add-flags" ]]; then
diff --git a/pkgs/build-support/setup-hooks/multiple-outputs.sh b/pkgs/build-support/setup-hooks/multiple-outputs.sh
index 60d4ccf99ed1f..ac2368a5b2197 100644
--- a/pkgs/build-support/setup-hooks/multiple-outputs.sh
+++ b/pkgs/build-support/setup-hooks/multiple-outputs.sh
@@ -164,8 +164,6 @@ _multioutDevs() {
 }
 
 # Make the "dev" propagate other outputs needed for development.
-# Note: with current cross-building setup, all packages are "native" if not cross-building;
-# however, if cross-building, the outputs are non-native. We have to choose the right file.
 _multioutPropagateDev() {
     if [ "$outputs" = "out" ]; then return; fi;
 
@@ -193,16 +191,8 @@ _multioutPropagateDev() {
         return
     fi
 
-    local propagatedBuildInputsFile
-    if [ -z "$crossConfig" ]; then
-        propagatedBuildInputsFile=propagated-native-build-inputs
-    else
-        propagatedBuildInputsFile=propagated-build-inputs
-    fi
-
     mkdir -p "${!propagaterOutput}"/nix-support
     for output in $propagatedBuildOutputs; do
-        echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/$propagatedBuildInputsFile
+        echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs
     done
 }
-
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 32214db658424..7d44feb5ca653 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -101,7 +101,7 @@ rec {
         mkdir -p $out/nix-support
         cp ${script} $out/nix-support/setup-hook
       '' + lib.optionalString (deps != []) ''
-        printWords ${toString deps} > $out/nix-support/propagated-native-build-inputs
+        printWords ${toString deps} > $out/nix-support/propagated-build-inputs
       '' + lib.optionalString (substitutions != {}) ''
         substituteAll ${script} $out/nix-support/setup-hook
       '');
diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix
index ef2bae8dbaf9b..1b4d967af553e 100644
--- a/pkgs/data/misc/tzdata/default.nix
+++ b/pkgs/data/misc/tzdata/default.nix
@@ -33,7 +33,8 @@ stdenv.mkDerivation rec {
   postInstall =
     ''
       rm $out/share/zoneinfo-posix
-      ln -s . $out/share/zoneinfo/posix
+      mkdir $out/share/zoneinfo/posix
+      ( cd $out/share/zoneinfo/posix; ln -s ../* .; rm posix )
       mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right
 
       mkdir -p "$dev/include"
diff --git a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
index ff5670935bd9e..6de97f3dea26c 100644
--- a/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
+++ b/pkgs/desktops/gnome-3/core/gnome-settings-daemon/default.nix
@@ -1,7 +1,7 @@
 { fetchurl, stdenv, pkgconfig, gnome3, intltool, glib, libnotify, lcms2, libXtst
 , libxkbfile, libpulseaudio, libcanberra_gtk3, upower, colord, libgweather, polkit
 , geoclue2, librsvg, xf86_input_wacom, udev, libgudev, libwacom, libxslt, libtool, networkmanager
-, docbook_xsl, docbook_xsl_ns, wrapGAppsHook, ibus, xkeyboard_config }:
+, docbook_xsl, docbook_xsl_ns, wrapGAppsHook, ibus, xkeyboard_config, tzdata }:
 
 stdenv.mkDerivation rec {
   inherit (import ./src.nix fetchurl) name src;
@@ -16,6 +16,10 @@ stdenv.mkDerivation rec {
       polkit geocode_glib geoclue2 librsvg xf86_input_wacom udev libgudev libwacom libxslt
       libtool docbook_xsl docbook_xsl_ns wrapGAppsHook gnome_themes_standard ];
 
+  postPatch = ''
+    substituteInPlace plugins/datetime/tz.h --replace /usr/share/zoneinfo/zone.tab ${tzdata}/share/zoneinfo/zone.tab
+  '';
+
   meta = with stdenv.lib; {
     platforms = platforms.linux;
     maintainers = gnome3.maintainers;
diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix
index a828ba0fe7bc4..cae5c74b4428e 100644
--- a/pkgs/desktops/plasma-5/default.nix
+++ b/pkgs/desktops/plasma-5/default.nix
@@ -58,11 +58,7 @@ let
                     # Propagate $dev so that this setup hook is propagated
                     # But only if there is a separate $dev output
                     if [ "$outputDev" != out ]; then
-                        if [ -n "$crossConfig" ]; then
-                          propagatedBuildInputs="$propagatedBuildInputs @dev@"
-                        else
-                          propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
-                        fi
+                        propagatedBuildInputs="$propagatedBuildInputs @dev@"
                     fi
                 fi
               '';
diff --git a/pkgs/development/compilers/chicken/eggDerivation.nix b/pkgs/development/compilers/chicken/eggDerivation.nix
index 97ce9d9be79ba..58247e5aeb533 100644
--- a/pkgs/development/compilers/chicken/eggDerivation.nix
+++ b/pkgs/development/compilers/chicken/eggDerivation.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation ({
       wrapProgram $f \
         --set CHICKEN_REPOSITORY $CHICKEN_REPOSITORY \
         --prefix CHICKEN_REPOSITORY_EXTRA : "$out/lib/chicken/${toString chicken.binaryVersion}/:$CHICKEN_REPOSITORY_EXTRA" \
-        --prefix CHICKEN_INCLUDE_PATH \; \"$CHICKEN_INCLUDE_PATH\;$out/share/\" \
+        --prefix CHICKEN_INCLUDE_PATH \; "$CHICKEN_INCLUDE_PATH;$out/share/" \
         --prefix PATH : "$out/bin:${chicken}/bin:$CHICKEN_REPOSITORY_EXTRA:$CHICKEN_REPOSITORY"
     done
 
diff --git a/pkgs/development/compilers/dmd/2.067.1.nix b/pkgs/development/compilers/dmd/2.067.1.nix
index 6a3cddbd2e508..29a8618dc7b97 100644
--- a/pkgs/development/compilers/dmd/2.067.1.nix
+++ b/pkgs/development/compilers/dmd/2.067.1.nix
@@ -146,7 +146,7 @@ stdenv.mkDerivation rec {
 
       wrapProgram $out/bin/dmd \
           --prefix PATH ":" "${stdenv.cc}/bin" \
-          --set CC "$""{CC:-$CC""}"
+          --set-default CC "$CC"
 
       cd $out/bin
       tee dmd.conf << EOF
diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix
index 938dd04904bf3..ff19a5b872cc6 100644
--- a/pkgs/development/compilers/dmd/default.nix
+++ b/pkgs/development/compilers/dmd/default.nix
@@ -152,7 +152,7 @@ stdenv.mkDerivation rec {
 
       wrapProgram $out/bin/dmd \
           --prefix PATH ":" "${stdenv.cc}/bin" \
-          --set CC "$""{CC:-$CC""}"
+          --set-default CC "$CC"
 
       cd $out/bin
       tee dmd.conf << EOF
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index e7b188ad71b84..088a64ff54388 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -67,55 +67,54 @@ let version = "4.5.4";
     gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null targetPlatform;
     gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null targetPlatform;
     gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null targetPlatform;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
     crossMingw = (targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt");
 
     crossConfigureFlags =
-      withArch +
-      withCpu +
-      withAbi +
+      optional (gccArch != null) "--with-arch=${gccArch}" ++
+      optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+      optional (gccAbi != null) "--with-abi=${gccAbi}" ++
       # Ensure that -print-prog-name is able to find the correct programs.
-      " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-      " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-      (if crossMingw && crossStageStatic then
-        " --with-headers=${libcCross}/include" +
-        " --with-gcc" +
-        " --with-gnu-as" +
-        " --with-gnu-ld" +
-        " --with-gnu-ld" +
-        " --disable-shared" +
-        " --disable-nls" +
-        " --disable-debug" +
-        " --enable-sjlj-exceptions" +
-        " --enable-threads=win32" +
-        " --disable-win32-registry"
-        else if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        (if crossMingw then
-          " --enable-threads=win32" +
-          " --enable-sjlj-exceptions" +
-          " --enable-hash-synchronization" +
-          " --enable-version-specific-runtime-libs" +
-          " --disable-libssp" +
-          " --disable-nls" +
-          " --with-dwarf2"
-          else
-          " --enable-threads=posix" +
-          " --enable-nls" +
-          " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-        );
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libmudflap"
+        "--disable-libgomp"
+        "--disable-shared"
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        "--with-headers=${libcCross}/include"
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--enable-version-specific-runtime-libs"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+        ] else [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
@@ -241,44 +240,62 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if enableMultilib then "" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if ppl != null then "--with-ppl=${ppl}" else ""}
-    ${if cloogppl != null then "--with-cloog=${cloogppl}" else ""}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp=${gmp.dev}"
+      "--with-mpfr=${mpfr.dev}"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          )
+        )
+      }"
+    ] ++
+    optional (!enableMultilib) "--disable-multilib" ++
+    optional (!enableShared) "--disable-shared" ++
+
+    # Optional features
+    optional (cloogppl != null) "--with-cloog=${cloogppl}" ++
+    optional (ppl != null) "--with-ppl=${ppl}" ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp=${gmp.dev}
-    --with-mpfr=${mpfr.dev}
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        )
-      )
-    }
-    ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
-      if targetPlatform == hostPlatform && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    # Trick that should be taken out once we have a mips64el-linux not loongson2f
+    optional (targetPlatform == hostPlatform && stdenv.system == "mips64el-linux") "--with-arch=loongson2f"
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -295,37 +312,41 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      optional (ppl != null) "--with-ppl=${ppl.crossDrv}" ++
+      optional (cloogppl != null) "--with-cloog=${cloogppl.crossDrv}" ++
+
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${if targetplatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-      ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+      optional (targetPlatform != hostPlatform) crossConfigureFlags
+    ;
   };
- 
+
 
   # Needed for the cross compilation to work
   AR = "ar";
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index ab91528049c40..7003ace28905d 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -108,102 +108,81 @@ let version = "4.8.5";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
+     in
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libmudflap " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
-           else                " --with-headers=${libcCross.dev}/include") +
-          # Ensure that -print-prog-name is able to find the correct programs.
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
@@ -329,63 +308,92 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr-include=${mpfr.dev}/include"
+      "--with-mpfr-lib=${mpfr.out}/lib"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+    optionals (cloog != null) [
+      "--with-cloog=${cloog}"
+      "--disable-cloog-version-check"
+      "--enable-cloog-backend=isl"
+    ] ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp-include=${gmp.dev}/include
-    --with-gmp-lib=${gmp.out}/lib
-    --with-mpfr-include=${mpfr.dev}/include
-    --with-mpfr-lib=${mpfr.out}/lib
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals hostPlatform.isSunOS [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -404,11 +412,6 @@ stdenv.mkDerivation ({
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -422,38 +425,40 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      optional (cloog != null) "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 794d809fa7276..362670ff5dbd5 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -99,107 +99,88 @@ let version = "4.9.4";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
+     in
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${libcCross.out}/share/sysroot"
-           else                " --with-headers=${libcCross.dev}/include") +
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # libsanitizer requires netrom/netrom.h which is not
-              # available in uclibc.
-              " --disable-libsanitizer" +
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # libsanitizer requires netrom/netrom.h which is not
+            # available in uclibc.
+            "--disable-libsanitizer"
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
-  bootstrap = targetPlatform == hostPlatform;
+    bootstrap = targetPlatform == hostPlatform;
 
 in
 
@@ -326,61 +307,91 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${optionalString (cloog != null) "--with-cloog=${cloog} --disable-cloog-version-check --enable-cloog-backend=isl"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr=${mpfr.dev}"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+    optionals (cloog != null) [
+      "--with-cloog=${cloog}"
+      "--disable-cloog-version-check"
+      "--enable-cloog-backend=isl"
+    ] ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp=${gmp.dev}
-    --with-mpfr=${mpfr.dev}
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals hostPlatform.isSunOS [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -393,17 +404,13 @@ stdenv.mkDerivation ({
     then "install-strip"
     else "install";
 
+  /* For cross-built gcc (build != host == target) */
   crossAttrs = let
     xgccArch = targetPlatform.gcc.arch or null;
     xgccCpu = targetPlatform.gcc.cpu or null;
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -417,38 +424,40 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      optional (cloog != null) "--with-cloog=${cloog.crossDrv}" "--enable-cloog-backend=isl" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 345e2baf6718f..c9b49c0ede631 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -103,107 +103,88 @@ let version = "5.5.0";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
+     in
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
-           else                " --with-headers=${getDev libcCross}/include") +
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # libsanitizer requires netrom/netrom.h which is not
-              # available in uclibc.
-              " --disable-libsanitizer" +
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # libsanitizer requires netrom/netrom.h which is not
+            # available in uclibc.
+            "--disable-libsanitizer"
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
-  bootstrap = targetPlatform == hostPlatform;
+    bootstrap = targetPlatform == hostPlatform;
 
 in
 
@@ -340,62 +321,87 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr-include=${mpfr.dev}/include"
+      "--with-mpfr-lib=${mpfr.out}/lib"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp-include=${gmp.dev}/include
-    --with-gmp-lib=${gmp.out}/lib
-    --with-mpfr-include=${mpfr.dev}/include
-    --with-mpfr-lib=${mpfr.out}/lib
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals hostPlatform.isSunOS [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -408,17 +414,13 @@ stdenv.mkDerivation ({
     then "install-strip"
     else "install";
 
+  /* For cross-built gcc (build != host == target) */
   crossAttrs = let
     xgccArch = targetPlatform.gcc.arch or null;
     xgccCpu = targetPlatform.gcc.cpu or null;
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -432,37 +434,39 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 03c6b3834ea42..a68946a6f3451 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -100,103 +100,84 @@ let version = "6.4.0";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
       in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
-           else                " --with-headers=${getDev libcCross}/include") +
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # libsanitizer requires netrom/netrom.h which is not
-              # available in uclibc.
-              " --disable-libsanitizer" +
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # libsanitizer requires netrom/netrom.h which is not
+            # available in uclibc.
+            "--disable-libsanitizer"
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
@@ -341,85 +322,104 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr-include=${mpfr.dev}/include"
+      "--with-mpfr-lib=${mpfr.out}/lib"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp-include=${gmp.dev}/include
-    --with-gmp-lib=${gmp.out}/lib
-    --with-mpfr-include=${mpfr.dev}/include
-    --with-mpfr-lib=${mpfr.out}/lib
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals (hostPlatform.isSunOS) [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
-  buildFlags = if bootstrap then
-    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
-    else "";
+  buildFlags =
+    optional bootstrap (if profiledCompiler then "profiledbootstrap" else "bootstrap");
 
   installTargets =
     if stripped
     then "install-strip"
     else "install";
 
+  /* For cross-built gcc (build != host == target) */
   crossAttrs = let
     xgccArch = targetPlatform.gcc.arch or null;
     xgccCpu = targetPlatform.gcc.cpu or null;
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -433,37 +433,39 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index 3a7c0eb64437e..c201ca6373b79 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -98,108 +98,88 @@ let version = "7.2.0";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
+     in
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
-           else                " --with-headers=${getDev libcCross}/include") +
-          # Ensure that -print-prog-name is able to find the correct programs.
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # libsanitizer requires netrom/netrom.h which is not
-              # available in uclibc.
-              " --disable-libsanitizer" +
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # libsanitizer requires netrom/netrom.h which is not
+            # available in uclibc.
+            "--disable-libsanitizer"
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
-  bootstrap = targetPlatform == hostPlatform;
+    bootstrap = targetPlatform == hostPlatform;
 
 in
 
@@ -335,62 +315,87 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr-include=${mpfr.dev}/include"
+      "--with-mpfr-lib=${mpfr.out}/lib"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp-include=${gmp.dev}/include
-    --with-gmp-lib=${gmp.out}/lib
-    --with-mpfr-include=${mpfr.dev}/include
-    --with-mpfr-lib=${mpfr.out}/lib
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals hostPlatform.isSunOS [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -403,17 +408,13 @@ stdenv.mkDerivation ({
     then "install-strip"
     else "install";
 
+  /* For cross-built gcc (build != host == target) */
   crossAttrs = let
     xgccArch = targetPlatform.gcc.arch or null;
     xgccCpu = targetPlatform.gcc.cpu or null;
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -427,37 +428,39 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, targetPlatform != hostPlatform
     NIX_CC_CROSS = if targetPlatform == hostPlatform then "${stdenv.ccCross}" else "";
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index 4ec92b7bdb621..38df9de08c2cf 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -98,108 +98,88 @@ let version = "7-20170409";
     javaAwtGtk = langJava && x11Support;
 
     /* Platform flags */
-    platformFlags = let
-        gccArch = stdenv.platform.gcc.arch or null;
-        gccCpu = stdenv.platform.gcc.cpu or null;
-        gccAbi = stdenv.platform.gcc.abi or null;
-        gccFpu = stdenv.platform.gcc.fpu or null;
-        gccFloat = stdenv.platform.gcc.float or null;
-        gccMode = stdenv.platform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode;
-
-    /* Cross-gcc settings */
+    mkPlatformFlags = platform: let
+        gccArch = platform.gcc.arch or null;
+        gccCpu = platform.gcc.cpu or null;
+        gccAbi = platform.gcc.abi or null;
+        gccFpu = platform.gcc.fpu or null;
+        gccFloat = platform.gcc.float or null;
+        gccMode = platform.gcc.mode or null;
+     in
+        optional (gccArch != null) "--with-arch=${gccArch}" ++
+        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
+        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
+        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
+        optional (gccFloat != null) "--with-float=${gccFloat}" ++
+        optional (gccMode != null) "--with-mode=${gccMode}";
+
+    /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
-    crossConfigureFlags = let
-        gccArch = targetPlatform.gcc.arch or null;
-        gccCpu = targetPlatform.gcc.cpu or null;
-        gccAbi = targetPlatform.gcc.abi or null;
-        gccFpu = targetPlatform.gcc.fpu or null;
-        gccFloat = targetPlatform.gcc.float or null;
-        gccMode = targetPlatform.gcc.mode or null;
-        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
-        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
-        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
-      in
-        withArch +
-        withCpu +
-        withAbi +
-        withFpu +
-        withFloat +
-        withMode +
-        # Ensure that -print-prog-name is able to find the correct programs.
-        " --with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as" +
-        " --with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" +
-        (if crossMingw && crossStageStatic then
-          " --with-headers=${libcCross}/include" +
-          " --with-gcc" +
-          " --with-gnu-as" +
-          " --with-gnu-ld" +
-          " --with-gnu-ld" +
-          " --disable-shared" +
-          " --disable-nls" +
-          " --disable-debug" +
-          " --enable-sjlj-exceptions" +
-          " --enable-threads=win32" +
-          " --disable-win32-registry"
-          else if crossStageStatic then
-          " --disable-libssp --disable-nls" +
-          " --without-headers" +
-          " --disable-threads " +
-          " --disable-libgomp " +
-          " --disable-libquadmath" +
-          " --disable-shared" +
-          " --disable-libatomic " +  # libatomic requires libc
-          " --disable-decimal-float" # libdecnumber requires libc
-          else
-          (if crossDarwin then " --with-sysroot=${getLib libcCross}/share/sysroot"
-           else                " --with-headers=${getDev libcCross}/include") +
-          # Ensure that -print-prog-name is able to find the correct programs.
-          " --enable-__cxa_atexit" +
-          " --enable-long-long" +
-          (if crossMingw then
-            " --enable-threads=win32" +
-            " --enable-sjlj-exceptions" +
-            " --enable-hash-synchronization" +
-            " --disable-libssp" +
-            " --disable-nls" +
-            " --with-dwarf2" +
-            # I think noone uses shared gcc libs in mingw, so we better do the same.
-            # In any case, mingw32 g++ linking is broken by default with shared libs,
-            # unless adding "-lsupc++" to any linking command. I don't know why.
-            " --disable-shared" +
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else (if targetPlatform.libc == "uclibc" then
-              # libsanitizer requires netrom/netrom.h which is not
-              # available in uclibc.
-              " --disable-libsanitizer" +
-              # In uclibc cases, libgomp needs an additional '-ldl'
-              # and as I don't know how to pass it, I disable libgomp.
-              " --disable-libgomp" else "") +
-            " --enable-threads=posix" +
-            " --enable-nls" +
-            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-          );
+    crossConfigureFlags =
+      mkPlatformFlags targetPlatform ++
+
+      # Ensure that -print-prog-name is able to find the correct programs.
+      [ "--with-as=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-as"
+        "--with-ld=${targetPackages.stdenv.cc.bintools}/bin/${targetPlatform.config}-ld" ] ++
+      (if crossMingw && crossStageStatic then [
+        "--with-headers=${libcCross}/include"
+        "--with-gcc"
+        "--with-gnu-as"
+        "--with-gnu-ld"
+        "--with-gnu-ld"
+        "--disable-shared"
+        "--disable-nls"
+        "--disable-debug"
+        "--enable-sjlj-exceptions"
+        "--enable-threads=win32"
+        "--disable-win32-registry"
+      ] else if crossStageStatic then [
+        "--disable-libssp"
+        "--disable-nls"
+        "--without-headers"
+        "--disable-threads"
+        "--disable-libgomp"
+        "--disable-libquadmath"
+        "--disable-shared"
+        "--disable-libatomic"  # libatomic requires libc
+        "--disable-decimal-float" # libdecnumber requires libc
+      ] else [
+        (if crossDarwin then "--with-sysroot=${getLib libcCross}/share/sysroot"
+         else                "--with-headers=${getDev libcCross}/include")
+        "--enable-__cxa_atexit"
+        "--enable-long-long"
+      ] ++
+        (if crossMingw then [
+          "--enable-threads=win32"
+          "--enable-sjlj-exceptions"
+          "--enable-hash-synchronization"
+          "--disable-libssp"
+          "--disable-nls"
+          "--with-dwarf2"
+          # I think noone uses shared gcc libs in mingw, so we better do the same.
+          # In any case, mingw32 g++ linking is broken by default with shared libs,
+          # unless adding "-lsupc++" to any linking command. I don't know why.
+          "--disable-shared"
+          # To keep ABI compatibility with upstream mingw-w64
+          "--enable-fully-dynamic-string"
+        ] else
+          optionals (targetPlatform.libc == "uclibc") [
+            # libsanitizer requires netrom/netrom.h which is not
+            # available in uclibc.
+            "--disable-libsanitizer"
+            # In uclibc cases, libgomp needs an additional '-ldl'
+            # and as I don't know how to pass it, I disable libgomp.
+            "--disable-libgomp"
+          ] ++ [
+          "--enable-threads=posix"
+          "--enable-nls"
+          "--disable-decimal-float" # No final libdecnumber (it may work only in 386)
+        ]));
     stageNameAddon = if crossStageStatic then "-stage-static" else "-stage-final";
     crossNameAddon = if targetPlatform != hostPlatform then "-${targetPlatform.config}" + stageNameAddon else "";
 
-  bootstrap = targetPlatform == hostPlatform;
+    bootstrap = targetPlatform == hostPlatform;
 
 in
 
@@ -322,62 +302,87 @@ stdenv.mkDerivation ({
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags = "
-    ${if hostPlatform.isSunOS then
-      " --enable-long-long --enable-libssp --enable-threads=posix --disable-nls --enable-__cxa_atexit " +
-      # On Illumos/Solaris GNU as is preferred
-      " --with-gnu-as --without-gnu-ld "
-      else ""}
-    --enable-lto
-    ${if enableMultilib then "--enable-multilib --disable-libquadmath" else "--disable-multilib"}
-    ${if enableShared then "" else "--disable-shared"}
-    ${if enablePlugin then "--enable-plugin" else "--disable-plugin"}
-    ${optionalString (isl != null) "--with-isl=${isl}"}
-    ${if langJava then
-      "--with-ecj-jar=${javaEcj} " +
+  configureFlags =
+    # Basic dependencies
+    [
+      "--with-gmp-include=${gmp.dev}/include"
+      "--with-gmp-lib=${gmp.out}/lib"
+      "--with-mpfr-include=${mpfr.dev}/include"
+      "--with-mpfr-lib=${mpfr.out}/lib"
+      "--with-mpc=${libmpc}"
+    ] ++
+    optional (libelf != null) "--with-libelf=${libelf}" ++
+
+    # Basic configuration
+    [
+      "--enable-lto"
+      "--disable-libstdcxx-pch"
+      "--without-included-gettext"
+      "--with-system-zlib"
+      "--enable-static"
+      "--enable-languages=${
+        concatStrings (intersperse ","
+          (  optional langC        "c"
+          ++ optional langCC       "c++"
+          ++ optional langFortran  "fortran"
+          ++ optional langJava     "java"
+          ++ optional langAda      "ada"
+          ++ optional langVhdl     "vhdl"
+          ++ optional langGo       "go"
+          ++ optional langObjC     "objc"
+          ++ optional langObjCpp   "obj-c++"
+          ++ optionals crossDarwin [ "objc" "obj-c++" ]
+          )
+        )
+      }"
+    ] ++
+
+    (if enableMultilib
+      then ["--enable-multilib" "--disable-libquadmath"]
+      else ["--disable-multilib"]) ++
+    optional (!enableShared) "--disable-shared" ++
+    (if enablePlugin
+      then ["--enable-plugin"]
+      else ["--disable-plugin"]) ++
+
+    # Optional features
+    optional (isl != null) "--with-isl=${isl}" ++
+
+    # Java options
+    optionals langJava [
+      "--with-ecj-jar=${javaEcj}"
 
       # Follow Sun's layout for the convenience of IcedTea/OpenJDK.  See
       # <http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2010-April/008888.html>.
-      "--enable-java-home --with-java-home=\${prefix}/lib/jvm/jre "
-      else ""}
-    ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-    ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr}" else ""}
-    --with-gmp-include=${gmp.dev}/include
-    --with-gmp-lib=${gmp.out}/lib
-    --with-mpfr-include=${mpfr.dev}/include
-    --with-mpfr-lib=${mpfr.out}/lib
-    --with-mpc=${libmpc}
-    ${if libelf != null then "--with-libelf=${libelf}" else ""}
-    --disable-libstdcxx-pch
-    --without-included-gettext
-    --with-system-zlib
-    --enable-static
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC        "c"
-        ++ optional langCC       "c++"
-        ++ optional langFortran  "fortran"
-        ++ optional langJava     "java"
-        ++ optional langAda      "ada"
-        ++ optional langVhdl     "vhdl"
-        ++ optional langGo       "go"
-        ++ optional langObjC     "objc"
-        ++ optional langObjCpp   "obj-c++"
-        ++ optionals crossDarwin [ "objc" "obj-c++" ]
-        )
-      )
-    }
-    ${if targetPlatform == hostPlatform
-      then if hostPlatform.isDarwin
-        then " --with-native-system-header-dir=${darwin.usr-include}"
-        else " --with-native-system-header-dir=${getDev stdenv.cc.libc}/include"
-      else ""}
-    ${if langAda then " --enable-libada" else ""}
-    ${if targetPlatform == hostPlatform && targetPlatform.isi686 then "--with-arch=i686" else ""}
-    ${if targetPlatform != hostPlatform then crossConfigureFlags else ""}
-    ${if !bootstrap then "--disable-bootstrap" else ""}
-    ${if targetPlatform == hostPlatform then platformFlags else ""}
-  ";
+      "--enable-java-home"
+      "--with-java-home=\${prefix}/lib/jvm/jre"
+    ] ++
+    optional javaAwtGtk "--enable-java-awt=gtk" ++
+    optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
+
+    # Ada
+    optional langAda "--enable-libada" ++
+
+    # Cross-compilation
+    optional (targetPlatform == hostPlatform) (
+      let incDir = if hostPlatform.isDarwin
+                     then "${darwin.usr-include}"
+                     else "${getDev stdenv.cc.libc}/include";
+      in "--with-native-system-header-dir=${incDir}"
+    ) ++
+
+    optional (targetPlatform == hostPlatform) (mkPlatformFlags stdenv.platform) ++
+    optional (targetPlatform != hostPlatform) crossConfigureFlags ++
+    optional (!bootstrap) "--disable-bootstrap" ++
+
+    # Platform-specific flags
+    optional (targetPlatform == hostPlatform && targetPlatform.isi686) "--with-arch=i686" ++
+    optionals hostPlatform.isSunOS [
+      "--enable-long-long" "--enable-libssp" "--enable-threads=posix" "--disable-nls" "--enable-__cxa_atexit"
+      # On Illumos/Solaris GNU as is preferred
+      "--with-gnu-as" "--without-gnu-ld"
+    ]
+  ;
 
   targetConfig = if targetPlatform != hostPlatform then targetPlatform.config else null;
 
@@ -390,17 +395,13 @@ stdenv.mkDerivation ({
     then "install-strip"
     else "install";
 
+  /* For cross-built gcc (build != host == target) */
   crossAttrs = let
     xgccArch = targetPlatform.gcc.arch or null;
     xgccCpu = targetPlatform.gcc.cpu or null;
     xgccAbi = targetPlatform.gcc.abi or null;
     xgccFpu = targetPlatform.gcc.fpu or null;
     xgccFloat = targetPlatform.gcc.float or null;
-    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
-    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
-    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
-    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
-    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
   in {
     AR = "${targetPlatform.config}-ar";
     LD = "${targetPlatform.config}-ld";
@@ -414,37 +415,39 @@ stdenv.mkDerivation ({
     # If we are making a cross compiler, cross != null
     NIX_CC_CROSS = optionalString (targetPlatform == hostPlatform) builtins.toString stdenv.cc;
     dontStrip = true;
-    configureFlags = ''
-      ${if enableMultilib then "" else "--disable-multilib"}
-      ${if enableShared then "" else "--disable-shared"}
-      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
-      ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
-      --with-gmp=${gmp.crossDrv}
-      --with-mpfr=${mpfr.crossDrv}
-      --with-mpc=${libmpc.crossDrv}
-      --disable-libstdcxx-pch
-      --without-included-gettext
-      --with-system-zlib
-      --enable-languages=${
-        concatStrings (intersperse ","
-          (  optional langC        "c"
-          ++ optional langCC       "c++"
-          ++ optional langFortran  "fortran"
-          ++ optional langJava     "java"
-          ++ optional langAda      "ada"
-          ++ optional langVhdl     "vhdl"
-          ++ optional langGo       "go"
+    configureFlags =
+      optional (!enableMultilib) "--disable-multilib" ++
+      optional (!enableShared) "--disable-shared" ++
+      optional langJava "--with-ecj-jar=${javaEcj.crossDrv}" ++
+      optional javaAwtGtk "--enable-java-awt=gtk" ++
+      optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr.crossDrv}" ++
+      [
+        "--with-gmp=${gmp.crossDrv}"
+        "--with-mpfr=${mpfr.crossDrv}"
+        "--with-mpc=${libmpc.crossDrv}"
+        "--disable-libstdcxx-pch"
+        "--without-included-gettext"
+        "--with-system-zlib"
+        "--enable-languages=${
+          concatStrings (intersperse ","
+            (  optional langC        "c"
+            ++ optional langCC       "c++"
+            ++ optional langFortran  "fortran"
+            ++ optional langJava     "java"
+            ++ optional langAda      "ada"
+            ++ optional langVhdl     "vhdl"
+            ++ optional langGo       "go"
+            )
           )
-        )
-      }
-      ${if langAda then " --enable-libada" else ""}
-      ${xwithArch}
-      ${xwithCpu}
-      ${xwithAbi}
-      ${xwithFpu}
-      ${xwithFloat}
-    '';
+        }"
+      ] ++
+      optional langAda "--enable-libada" ++
+      optional (xgccArch != null) "--with-arch=${xgccArch}" ++
+      optional (xgccCpu != null) "--with-cpu=${xgccCpu}" ++
+      optional (xgccAbi != null) "--with-abi=${xgccAbi}" ++
+      optional (xgccFpu != null) "--with-fpu=${xgccFpu}" ++
+      optional (xgccFloat != null) "--with-float=${xgccFloat}"
+    ;
     buildFlags = "";
   };
 
diff --git a/pkgs/development/compilers/go/1.4.nix b/pkgs/development/compilers/go/1.4.nix
index 2a1944debd918..b8c283fef07e7 100644
--- a/pkgs/development/compilers/go/1.4.nix
+++ b/pkgs/development/compilers/go/1.4.nix
@@ -23,6 +23,9 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "all" ];
 
+  # The tests try to do stuff with 127.0.0.1 and localhost
+  __darwinAllowLocalNetworking = true;
+
   # I'm not sure what go wants from its 'src', but the go installation manual
   # describes an installation keeping the src.
   preUnpack = ''
diff --git a/pkgs/development/compilers/jsonnet/default.nix b/pkgs/development/compilers/jsonnet/default.nix
index cc19f7afe3472..790f9a4827ae8 100644
--- a/pkgs/development/compilers/jsonnet/default.nix
+++ b/pkgs/development/compilers/jsonnet/default.nix
@@ -4,6 +4,7 @@ let version = "0.9.4"; in
 
 stdenv.mkDerivation {
   name = "jsonnet-${version}";
+  version = version;
 
   src = fetchFromGitHub {
     rev = "v${version}";
diff --git a/pkgs/development/compilers/llvm/3.4/llvm.nix b/pkgs/development/compilers/llvm/3.4/llvm.nix
index 6e7ef22392b1a..27047e7d941c3 100644
--- a/pkgs/development/compilers/llvm/3.4/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.4/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python2
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -67,7 +67,7 @@ in stdenv.mkDerivation rec {
     "-DLLVM_BUILD_TESTS=ON"
     "-DLLVM_ENABLE_FFI=ON"
     "-DLLVM_REQUIRES_RTTI=1"
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     "-DCMAKE_CXX_FLAGS=-std=c++11"
   ] ++ stdenv.lib.optional (!stdenv.isDarwin) "-DBUILD_SHARED_LIBS=ON";
 
diff --git a/pkgs/development/compilers/llvm/3.5/llvm.nix b/pkgs/development/compilers/llvm/3.5/llvm.nix
index 26144e38619f8..00b2548d56e6a 100644
--- a/pkgs/development/compilers/llvm/3.5/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.5/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -70,7 +70,7 @@ in stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optional enableSharedLibraries
     "-DBUILD_SHARED_LIBS=ON"
     ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     ++ stdenv.lib.optionals ( isDarwin) [
     "-DCMAKE_CXX_FLAGS=-stdlib=libc++"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/llvm/3.7/llvm.nix b/pkgs/development/compilers/llvm/3.7/llvm.nix
index 54ab8c1087738..1654914ff8c4c 100644
--- a/pkgs/development/compilers/llvm/3.7/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.7/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python2
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -80,7 +80,7 @@ in stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optional enableSharedLibraries
     "-DBUILD_SHARED_LIBS=ON"
     ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     ++ stdenv.lib.optionals ( isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/llvm/3.8/llvm.nix b/pkgs/development/compilers/llvm/3.8/llvm.nix
index a0fbdf2b706a4..0f259977f702d 100644
--- a/pkgs/development/compilers/llvm/3.8/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.8/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -79,7 +79,7 @@ in stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optional enableSharedLibraries [
     "-DLLVM_LINK_LLVM_DYLIB=ON"
   ] ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     ++ stdenv.lib.optionals ( isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/llvm/3.9/llvm.nix b/pkgs/development/compilers/llvm/3.9/llvm.nix
index 495f95a5bbdbc..f80201167505f 100644
--- a/pkgs/development/compilers/llvm/3.9/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.9/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -123,7 +123,7 @@ in stdenv.mkDerivation rec {
   ] ++ stdenv.lib.optional enableSharedLibraries [
     "-DLLVM_LINK_LLVM_DYLIB=ON"
   ] ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     ++ stdenv.lib.optionals (isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/llvm/4/llvm.nix b/pkgs/development/compilers/llvm/4/llvm.nix
index 332fee8529ba8..0559a7aee2320 100644
--- a/pkgs/development/compilers/llvm/4/llvm.nix
+++ b/pkgs/development/compilers/llvm/4/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -107,7 +107,7 @@ in stdenv.mkDerivation rec {
     "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
   ]
   ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
   ++ stdenv.lib.optionals (isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/llvm/5/llvm.nix b/pkgs/development/compilers/llvm/5/llvm.nix
index 011eab5678c13..520e42c336043 100644
--- a/pkgs/development/compilers/llvm/5/llvm.nix
+++ b/pkgs/development/compilers/llvm/5/llvm.nix
@@ -6,7 +6,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -101,7 +101,7 @@ in stdenv.mkDerivation rec {
     "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
   ]
   ++ stdenv.lib.optional (!isDarwin)
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
   ++ stdenv.lib.optionals (isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
diff --git a/pkgs/development/compilers/mono/llvm.nix b/pkgs/development/compilers/mono/llvm.nix
index 6a4fd784d236d..8e9dcc1dbcb54 100644
--- a/pkgs/development/compilers/mono/llvm.nix
+++ b/pkgs/development/compilers/mono/llvm.nix
@@ -5,7 +5,7 @@
 , cmake
 , python
 , libffi
-, binutils
+, libbfd
 , libxml2
 , valgrind
 , ncurses
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = with stdenv; [
     "-DLLVM_ENABLE_FFI=ON"
-    "-DLLVM_BINUTILS_INCDIR=${stdenv.lib.getDev binutils}/include"
+    "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     "-DCMAKE_CXX_FLAGS=-std=c++11"
   ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
 
diff --git a/pkgs/development/compilers/openjdk-darwin/8.nix b/pkgs/development/compilers/openjdk-darwin/8.nix
index 6234b63208cd9..cc7c5fd371d2e 100644
--- a/pkgs/development/compilers/openjdk-darwin/8.nix
+++ b/pkgs/development/compilers/openjdk-darwin/8.nix
@@ -33,7 +33,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $out/nix-support
-      printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+      printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
       install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib
 
diff --git a/pkgs/development/compilers/openjdk-darwin/default.nix b/pkgs/development/compilers/openjdk-darwin/default.nix
index 1e8f88beea664..6ecc785be3b93 100644
--- a/pkgs/development/compilers/openjdk-darwin/default.nix
+++ b/pkgs/development/compilers/openjdk-darwin/default.nix
@@ -23,7 +23,7 @@ let
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $out/nix-support
-      printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+      printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
       install_name_tool -change /usr/X11/lib/libfreetype.6.dylib ${freetype}/lib/libfreetype.6.dylib $out/jre/lib/libfontmanager.dylib
 
diff --git a/pkgs/development/compilers/openjdk/7.nix b/pkgs/development/compilers/openjdk/7.nix
index 72f0ba293ba99..372bb1532698a 100644
--- a/pkgs/development/compilers/openjdk/7.nix
+++ b/pkgs/development/compilers/openjdk/7.nix
@@ -184,13 +184,13 @@ let
     preFixup = ''
       prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
       patchELF $jre
-      propagatedNativeBuildInputs+=" $jre"
+      propagatedBuildInputs+=" $jre"
 
       # Propagate the setJavaClassPath setup hook from the JRE so that
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $jre/nix-support
-      printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
+      printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
diff --git a/pkgs/development/compilers/openjdk/8.nix b/pkgs/development/compilers/openjdk/8.nix
index 4499a9126a0cf..71ce9271bfa6f 100644
--- a/pkgs/development/compilers/openjdk/8.nix
+++ b/pkgs/development/compilers/openjdk/8.nix
@@ -206,13 +206,13 @@ let
     preFixup = ''
       prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
       patchELF $jre
-      propagatedNativeBuildInputs+=" $jre"
+      propagatedBuildInputs+=" $jre"
 
       # Propagate the setJavaClassPath setup hook from the JRE so that
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $jre/nix-support
-      printWords ${setJavaClassPath} > $jre/nix-support/propagated-native-build-inputs
+      printWords ${setJavaClassPath} > $jre/nix-support/propagated-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
diff --git a/pkgs/development/compilers/openjdk/9.nix b/pkgs/development/compilers/openjdk/9.nix
index ce556a32c11dc..8697712de988a 100644
--- a/pkgs/development/compilers/openjdk/9.nix
+++ b/pkgs/development/compilers/openjdk/9.nix
@@ -204,14 +204,14 @@ let
     preFixup = ''
       prefix=$jre stripDirs "$stripDebugList" "''${stripDebugFlags:--S}"
       patchELF $jre
-      propagatedNativeBuildInputs+=" $jre"
+      propagatedBuildInputs+=" $jre"
 
       # Propagate the setJavaClassPath setup hook from the JRE so that
       # any package that depends on the JRE has $CLASSPATH set up
       # properly.
       mkdir -p $jre/nix-support
       #TODO or printWords?  cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
-      echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-native-build-inputs
+      echo -n "${setJavaClassPath}" > $jre/nix-support/propagated-build-inputs
 
       # Set JAVA_HOME automatically.
       mkdir -p $out/nix-support
diff --git a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
index 2a00cf5f2d29c..c2866446f76ff 100644
--- a/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
@@ -166,7 +166,7 @@ let result = stdenv.mkDerivation rec {
     ln -s $jrePath/lib/${architecture}/libnpjp2.so $jrePath/lib/${architecture}/plugins
 
     mkdir -p $out/nix-support
-    printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+    printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
diff --git a/pkgs/development/compilers/oraclejdk/jdk9-linux.nix b/pkgs/development/compilers/oraclejdk/jdk9-linux.nix
index fbda96e142584..29d77a613b38c 100644
--- a/pkgs/development/compilers/oraclejdk/jdk9-linux.nix
+++ b/pkgs/development/compilers/oraclejdk/jdk9-linux.nix
@@ -124,7 +124,7 @@ let result = stdenv.mkDerivation rec {
     ln -s $out $out/jre
 
     mkdir -p $out/nix-support
-    printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+    printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
diff --git a/pkgs/development/compilers/rust/binaryBuild.nix b/pkgs/development/compilers/rust/binaryBuild.nix
index e67b305106e16..8dfe26f72f4ad 100644
--- a/pkgs/development/compilers/rust/binaryBuild.nix
+++ b/pkgs/development/compilers/rust/binaryBuild.nix
@@ -70,6 +70,11 @@ rec {
           --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
           "$out/bin/rustdoc"
       ''}
+      ${optionalString (stdenv.isDarwin && bootstrapping) ''
+        install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
+        install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
+        install_name_tool -change /usr/lib/libz.1.dylib '${stdenv.lib.getLib zlib}/lib/libz.1.dylib' "$out/bin/cargo"
+      ''}
 
       ${patchBootstrapCargo}
 
diff --git a/pkgs/development/compilers/rust/rustc.nix b/pkgs/development/compilers/rust/rustc.nix
index 9f96d05c11631..4d92566edd4a7 100644
--- a/pkgs/development/compilers/rust/rustc.nix
+++ b/pkgs/development/compilers/rust/rustc.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   inherit src;
 
-  __impureHostDeps = [ "/usr/lib/libedit.3.dylib" ];
+  __darwinAllowLocalNetworking = true;
 
   NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${llvmShared}/lib";
 
@@ -109,6 +109,14 @@ stdenv.mkDerivation {
     # Disable all lldb tests.
     # error: Can't run LLDB test because LLDB's python path is not set
     rm -vr src/test/debuginfo/*
+
+    # Disable tests that fail when sandboxing is enabled.
+    substituteInPlace src/libstd/sys/unix/ext/net.rs \
+        --replace '#[test]' '#[test] #[ignore]'
+    substituteInPlace src/test/run-pass/env-home-dir.rs \
+        --replace 'home_dir().is_some()' true
+    rm -v src/test/run-pass/fds-are-cloexec.rs  # FIXME: pipes?
+    rm -v src/test/run-pass/sync-send-in-std.rs  # FIXME: ???
   '';
 
   preConfigure = ''
diff --git a/pkgs/development/compilers/zulu/8.nix b/pkgs/development/compilers/zulu/8.nix
index f7638757ff7a1..1be0247c5ec33 100644
--- a/pkgs/development/compilers/zulu/8.nix
+++ b/pkgs/development/compilers/zulu/8.nix
@@ -54,7 +54,7 @@ in stdenv.mkDerivation rec {
     find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
 
     mkdir -p $out/nix-support
-    printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+    printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
diff --git a/pkgs/development/compilers/zulu/default.nix b/pkgs/development/compilers/zulu/default.nix
index 92f1f0a111edd..63551d2824759 100644
--- a/pkgs/development/compilers/zulu/default.nix
+++ b/pkgs/development/compilers/zulu/default.nix
@@ -51,7 +51,7 @@ in stdenv.mkDerivation rec {
     find $out -name "*.so" -exec patchelf --set-rpath "$rpath" {} \;
 
     mkdir -p $out/nix-support
-    printWords ${setJavaClassPath} > $out/nix-support/propagated-native-build-inputs
+    printWords ${setJavaClassPath} > $out/nix-support/propagated-build-inputs
 
     # Set JAVA_HOME automatically.
     cat <<EOF >> $out/nix-support/setup-hook
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 68e8bcffe65d8..0b98c7948df7c 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -41,7 +41,7 @@ self: super: {
 
   # cabal-install needs Cabal 2.x. hackage-security's test suite does not compile with
   # Cabal 2.x, though. See https://github.com/haskell/hackage-security/issues/188.
-  cabal-install = super.cabal-install.overrideScope (self: super: { Cabal = self.Cabal_2_0_0_2; });
+  cabal-install = super.cabal-install.overrideScope (self: super: { Cabal = self.Cabal_2_0_1_0; });
   hackage-security = dontCheck super.hackage-security;
 
   # Link statically to avoid runtime dependency on GHC.
diff --git a/pkgs/development/haskell-modules/configuration-ghc-8.0.x.nix b/pkgs/development/haskell-modules/configuration-ghc-8.0.x.nix
index 1dee726dcf36d..51276ce8c89d9 100644
--- a/pkgs/development/haskell-modules/configuration-ghc-8.0.x.nix
+++ b/pkgs/development/haskell-modules/configuration-ghc-8.0.x.nix
@@ -60,6 +60,6 @@ self: super: {
   apply-refact = super.apply-refact_0_3_0_1;
 
   # This builds needs the latest Cabal version.
-  cabal2nix = super.cabal2nix.overrideScope (self: super: { Cabal = self.Cabal_2_0_0_2; });
+  cabal2nix = super.cabal2nix.overrideScope (self: super: { Cabal = self.Cabal_2_0_1_0; });
 
 }
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 27ec7bfb5c500..2f09aaf39f763 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -271,6 +271,33 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "ADPfusionForest" = callPackage
+    ({ mkDerivation, ADPfusion, base, containers, criterion, DPutils
+     , fgl, ForestStructures, GrammarProducts, PrimitiveArray
+     , QuickCheck, strict, tasty, tasty-quickcheck, tasty-th, text
+     , unordered-containers, vector, vector-algorithms, vector-instances
+     , vector-th-unbox
+     }:
+     mkDerivation {
+       pname = "ADPfusionForest";
+       version = "0.0.0.1";
+       sha256 = "1ikv9y1hs478s5ns8g42cnsga3kw8qxpn1yc3vi5ix95i6q6wi4v";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         ADPfusion base containers DPutils fgl ForestStructures
+         GrammarProducts PrimitiveArray strict text unordered-containers
+         vector vector-algorithms vector-instances vector-th-unbox
+       ];
+       testHaskellDepends = [
+         base QuickCheck tasty tasty-quickcheck tasty-th
+       ];
+       benchmarkHaskellDepends = [ base criterion ForestStructures ];
+       homepage = "https://github.com/choener/ADPfusionForest";
+       description = "Dynamic programming on tree and forest structures";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "ADPfusionSet" = callPackage
     ({ mkDerivation, ADPfusion, base, bits, containers, DPutils, mmorph
      , mtl, OrderedBits, primitive, PrimitiveArray, QuickCheck
@@ -1186,8 +1213,8 @@ self: {
      }:
      mkDerivation {
        pname = "BNFC-meta";
-       version = "0.4.0.3";
-       sha256 = "10rfljhygdl75ibmj0xqj7qwdk0ppjr8iw4wmvzdpl28mqjshny2";
+       version = "0.5";
+       sha256 = "1hwm7mnmmrnw42n19xhs1qkl35lvl69sa8imjmibhsv9zq0fddd1";
        libraryHaskellDepends = [
          alex-meta array base happy-meta haskell-src-meta syb
          template-haskell
@@ -1612,21 +1639,23 @@ self: {
      }) {};
 
   "BiobaseTypes" = callPackage
-    ({ mkDerivation, aeson, base, bimaps, binary, cereal, cereal-text
-     , cereal-vector, data-default, deepseq, hashable, intern, primitive
-     , PrimitiveArray, QuickCheck, string-conversions, tasty
-     , tasty-quickcheck, tasty-th, text, text-binary, vector
-     , vector-binary-instances, vector-th-unbox
+    ({ mkDerivation, aeson, base, bimaps, binary, bytestring, cereal
+     , cereal-text, cereal-vector, containers, data-default, deepseq
+     , hashable, intern, lens, mtl, primitive, PrimitiveArray
+     , QuickCheck, string-conversions, tasty, tasty-quickcheck, tasty-th
+     , text, text-binary, utf8-string, vector, vector-binary-instances
+     , vector-th-unbox
      }:
      mkDerivation {
        pname = "BiobaseTypes";
-       version = "0.1.2.1";
-       sha256 = "11wcwnhz9n7vs8xmsr3jdwa219797kcbaw5dw2qip9jih41gijwj";
+       version = "0.1.3.0";
+       sha256 = "15yzg4llvz7pq5f0chfwrkaqspwrqxan4xvczrk4mvwa07z3abbp";
        libraryHaskellDepends = [
-         aeson base bimaps binary cereal cereal-text cereal-vector
-         data-default deepseq hashable intern primitive PrimitiveArray
-         QuickCheck string-conversions text text-binary vector
-         vector-binary-instances vector-th-unbox
+         aeson base bimaps binary bytestring cereal cereal-text
+         cereal-vector containers data-default deepseq hashable intern lens
+         mtl primitive PrimitiveArray QuickCheck string-conversions text
+         text-binary utf8-string vector vector-binary-instances
+         vector-th-unbox
        ];
        testHaskellDepends = [
          base QuickCheck tasty tasty-quickcheck tasty-th
@@ -1654,31 +1683,33 @@ self: {
      }) {};
 
   "BiobaseXNA" = callPackage
-    ({ mkDerivation, aeson, base, bimaps, binary, bytes, bytestring
-     , cereal, cereal-vector, cmdargs, containers, csv, deepseq
-     , file-embed, hashable, lens, primitive, PrimitiveArray, QuickCheck
-     , split, tasty, tasty-quickcheck, tasty-th, text, tuple, vector
+    ({ mkDerivation, aeson, attoparsec, base, bimaps, binary
+     , BiobaseTypes, bytes, bytestring, cereal, cereal-vector, cmdargs
+     , containers, csv, deepseq, file-embed, ForestStructures, hashable
+     , lens, mtl, primitive, PrimitiveArray, QuickCheck, split, tasty
+     , tasty-quickcheck, tasty-th, text, tuple, vector
      , vector-binary-instances, vector-th-unbox
      }:
      mkDerivation {
        pname = "BiobaseXNA";
-       version = "0.9.3.1";
-       sha256 = "0jlcdd0slq7d5wr44h3h6lnfcp310h36cabd4r7l32xhcxns9k6h";
+       version = "0.10.0.0";
+       sha256 = "0ah8qzr3wv4x1khh970isbrdn2fabsa7f9v92wif7ls798hw5abz";
        isLibrary = true;
        isExecutable = true;
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [
-         aeson base bimaps binary bytes bytestring cereal cereal-vector
-         containers csv deepseq file-embed hashable lens primitive
-         PrimitiveArray QuickCheck split text tuple vector
-         vector-binary-instances vector-th-unbox
+         aeson attoparsec base bimaps binary BiobaseTypes bytes bytestring
+         cereal cereal-vector containers csv deepseq file-embed
+         ForestStructures hashable lens mtl primitive PrimitiveArray
+         QuickCheck split text tuple vector vector-binary-instances
+         vector-th-unbox
        ];
        executableHaskellDepends = [ base cmdargs ];
        testHaskellDepends = [
          base QuickCheck tasty tasty-quickcheck tasty-th vector
        ];
        homepage = "https://github.com/choener/BiobaseXNA";
-       description = "Efficient RNA/DNA representations";
+       description = "Efficient RNA/DNA/Protein Primary/Secondary Structure";
        license = stdenv.lib.licenses.gpl3;
      }) {};
 
@@ -2460,17 +2491,15 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
-  "Cabal_2_0_0_2" = callPackage
+  "Cabal_2_0_1_0" = callPackage
     ({ mkDerivation, array, base, binary, bytestring, containers
      , deepseq, directory, filepath, pretty, process, QuickCheck, tagged
      , tar, tasty, tasty-hunit, tasty-quickcheck, time, unix
      }:
      mkDerivation {
        pname = "Cabal";
-       version = "2.0.0.2";
-       sha256 = "0chhl2113jbahd5gychx9rdqj1aw22h7dyj6z44871hzqxngx6bc";
-       revision = "1";
-       editedCabalFile = "1k4alrrz7yza66kaya69m0rkcz45mw48afrcv1x54q31cka9xyx1";
+       version = "2.0.1.0";
+       sha256 = "15jc66l38z3vi1rf3ak4i4hc9vckm5x59qfhqqlbf46nlnc10ii9";
        libraryHaskellDepends = [
          array base binary bytestring containers deepseq directory filepath
          pretty process time unix
@@ -5631,6 +5660,33 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "Forestry" = callPackage
+    ({ mkDerivation, ADPfusion, ADPfusionForest, base, BiobaseNewick
+     , BiobaseTypes, containers, criterion, ForestStructures
+     , FormalGrammars, lens, log-domain, PrimitiveArray
+     , PrimitiveArray-Pretty, QuickCheck, tasty, tasty-quickcheck
+     , tasty-th, text, vector
+     }:
+     mkDerivation {
+       pname = "Forestry";
+       version = "0.0.0.1";
+       sha256 = "0l56ajrdxkpk59ahrdzr5qk4vxp8j3i0w6n6vpp1cl414rwg51qz";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         ADPfusion ADPfusionForest base BiobaseNewick BiobaseTypes
+         containers ForestStructures FormalGrammars lens log-domain
+         PrimitiveArray PrimitiveArray-Pretty text vector
+       ];
+       testHaskellDepends = [
+         base QuickCheck tasty tasty-quickcheck tasty-th
+       ];
+       benchmarkHaskellDepends = [ base criterion ];
+       homepage = "https://github.com/choener/Forestry";
+       description = "Comparison of trees and forests";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "ForkableT" = callPackage
     ({ mkDerivation, base, monad-control, mtl, resourcet }:
      mkDerivation {
@@ -10650,6 +10706,23 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "JuPyTer-notebook" = callPackage
+    ({ mkDerivation, aeson, base, bytestring, json-autotype, text }:
+     mkDerivation {
+       pname = "JuPyTer-notebook";
+       version = "0.1.0.0";
+       sha256 = "1bmnwi0z68fzlzjf2599xs6rzi89p1jpv1gmnsi05cfsh1bysda7";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [ base json-autotype ];
+       executableHaskellDepends = [
+         aeson base bytestring json-autotype text
+       ];
+       homepage = "http://github.com/mgajda/ipynb";
+       description = "JuPyTer notebook parser";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "JuicyPixels" = callPackage
     ({ mkDerivation, base, binary, bytestring, containers, deepseq, mtl
      , primitive, transformers, vector, zlib
@@ -11047,8 +11120,8 @@ self: {
     ({ mkDerivation, base }:
      mkDerivation {
        pname = "LParse";
-       version = "0.1.3.1";
-       sha256 = "0gyc1cqbz97cps8awvkl3yfmlvaf7fkvxgs48rq95j1b2xbf417p";
+       version = "0.2.1.0";
+       sha256 = "0sck36lfmfgb16nhfwm13mnsqa9d7m1fx1xl6x5wln9w6q3rhrls";
        libraryHaskellDepends = [ base ];
        testHaskellDepends = [ base ];
        homepage = "https://github.com/MarcusVoelker/LParse#readme";
@@ -18331,17 +18404,18 @@ self: {
      }) {};
 
   "ViennaRNA-bindings" = callPackage
-    ({ mkDerivation, array, base, c2hs, QuickCheck, tasty, tasty-hunit
-     , tasty-silver, tasty-th
+    ({ mkDerivation, array, base, bytestring, c2hs, QuickCheck, tasty
+     , tasty-hunit, tasty-silver, tasty-th
      }:
      mkDerivation {
        pname = "ViennaRNA-bindings";
-       version = "0.233.1.2";
-       sha256 = "1iq4f15znpmfs5i6i3cvrzkn220apxj4rp720yyh0xbji211wg3d";
-       libraryHaskellDepends = [ array base ];
+       version = "0.233.2.0";
+       sha256 = "1hzw4x493vqwmcdjj7ahn8cj7r2zw5mjs8gpl1alnsp1lp0j517y";
+       libraryHaskellDepends = [ array base bytestring ];
        libraryToolDepends = [ c2hs ];
        testHaskellDepends = [
-         array base QuickCheck tasty tasty-hunit tasty-silver tasty-th
+         array base bytestring QuickCheck tasty tasty-hunit tasty-silver
+         tasty-th
        ];
        testToolDepends = [ c2hs ];
        homepage = "https://github.com/choener/ViennaRNA-bindings";
@@ -18349,6 +18423,30 @@ self: {
        license = "unknown";
      }) {};
 
+  "ViennaRNA-extras" = callPackage
+    ({ mkDerivation, array, attoparsec, base, BiobaseTypes, BiobaseXNA
+     , bytestring, deepseq, lens, QuickCheck, streaming
+     , streaming-bytestring, strict, strict-base-types, tasty
+     , tasty-quickcheck, tasty-th, vector, ViennaRNA-bindings
+     }:
+     mkDerivation {
+       pname = "ViennaRNA-extras";
+       version = "0.0.0.1";
+       sha256 = "06az042v9ja888nq59bdcsj6i7zk4dmbjsb9qcbdzqv6xw1lm8ac";
+       libraryHaskellDepends = [
+         array attoparsec base BiobaseTypes BiobaseXNA bytestring deepseq
+         lens QuickCheck streaming streaming-bytestring strict
+         strict-base-types ViennaRNA-bindings
+       ];
+       testHaskellDepends = [
+         attoparsec base bytestring QuickCheck tasty tasty-quickcheck
+         tasty-th vector
+       ];
+       homepage = "https://github.com/choener/ViennaRNA-extras";
+       description = "ViennaRNA v2 extensions";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "ViennaRNAParser" = callPackage
     ({ mkDerivation, base, hspec, parsec, ParsecTools, process
      , transformers
@@ -22875,6 +22973,8 @@ self: {
        pname = "alex-meta";
        version = "0.3.0.9";
        sha256 = "0882p9j272dhq94kgmg6pnxzi3qfwa01fk7npsz748rgx6ggycyr";
+       revision = "1";
+       editedCabalFile = "0p6j9ilvn5gjx0n7v1war0z8rlmcz1qnvpc8lcik8l7baydz6qjl";
        libraryHaskellDepends = [
          array base containers haskell-src-meta QuickCheck template-haskell
        ];
@@ -27477,8 +27577,8 @@ self: {
      }:
      mkDerivation {
        pname = "amqp-utils";
-       version = "0.2.1.5";
-       sha256 = "1r0h93nivl0pvl6mppz18jpi3csar37ii867a2yfg7g4a5lra3hf";
+       version = "0.3.0.0";
+       sha256 = "05yz8pgj1g8m2y35psvkkpf0xr9dr0qz0andqv452w0ak7vy54bk";
        isLibrary = false;
        isExecutable = true;
        executableHaskellDepends = [
@@ -30791,7 +30891,7 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
-  "atom-conduit_0_5_0_0" = callPackage
+  "atom-conduit_0_5_0_1" = callPackage
     ({ mkDerivation, base, blaze-builder, conduit, conduit-combinators
      , data-default, hlint, lens-simple, mono-traversable, parsers
      , quickcheck-instances, resourcet, safe-exceptions, tasty
@@ -30800,8 +30900,8 @@ self: {
      }:
      mkDerivation {
        pname = "atom-conduit";
-       version = "0.5.0.0";
-       sha256 = "06a7g93zhsp8smy5m4c45hjhb3yz3l89a60vb09s31l0idgf4j42";
+       version = "0.5.0.1";
+       sha256 = "1k9ix1br0vfajjqnprlnhzidvkx9a1pmkyiv2rb3nxb7fp3wb24c";
        libraryHaskellDepends = [
          base blaze-builder conduit conduit-combinators lens-simple
          mono-traversable parsers safe-exceptions text time timerep
@@ -40801,8 +40901,8 @@ self: {
      }:
      mkDerivation {
        pname = "cabal-debian";
-       version = "4.36";
-       sha256 = "0kwn0drd57wkpz2xl4n8104zc8zjf32gab6sks9vg03zhy4hjvwq";
+       version = "4.36.1";
+       sha256 = "1nvf3virir795bq4a00b8mzhhsbkdfzasw31bwb4rh1s6gqm058r";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -41574,26 +41674,26 @@ self: {
     ({ mkDerivation, aeson, ansi-wl-pprint, base, bytestring, Cabal
      , cabal-doctest, containers, deepseq, directory
      , distribution-nixpkgs, doctest, filepath, hackage-db, hopenssl
-     , language-nix, lens, monad-par, monad-par-extras, mtl
+     , hpack, language-nix, lens, monad-par, monad-par-extras, mtl
      , optparse-applicative, pretty, process, split, text, time
      , transformers, utf8-string, yaml
      }:
      mkDerivation {
        pname = "cabal2nix";
-       version = "2.6";
-       sha256 = "0zy0pf8s2flykpm7419zz393dx92lxpf04gi9d827m5dwrlr0j3z";
+       version = "2.7";
+       sha256 = "1ypzldvifqm4nv9bwzvm5pfsxxn4mp19z50fpkxk84fhb5pb6nbd";
        isLibrary = true;
        isExecutable = true;
        setupHaskellDepends = [ base Cabal cabal-doctest ];
        libraryHaskellDepends = [
          aeson ansi-wl-pprint base bytestring Cabal containers deepseq
-         directory distribution-nixpkgs filepath hackage-db hopenssl
+         directory distribution-nixpkgs filepath hackage-db hopenssl hpack
          language-nix lens optparse-applicative pretty process split text
          time transformers yaml
        ];
        executableHaskellDepends = [
          aeson ansi-wl-pprint base bytestring Cabal containers deepseq
-         directory distribution-nixpkgs filepath hackage-db hopenssl
+         directory distribution-nixpkgs filepath hackage-db hopenssl hpack
          language-nix lens monad-par monad-par-extras mtl
          optparse-applicative pretty process split text time transformers
          utf8-string yaml
@@ -41601,8 +41701,8 @@ self: {
        testHaskellDepends = [
          aeson ansi-wl-pprint base bytestring Cabal containers deepseq
          directory distribution-nixpkgs doctest filepath hackage-db hopenssl
-         language-nix lens optparse-applicative pretty process split text
-         time transformers yaml
+         hpack language-nix lens optparse-applicative pretty process split
+         text time transformers yaml
        ];
        homepage = "https://github.com/nixos/cabal2nix#readme";
        description = "Convert Cabal files into Nix build instructions";
@@ -47719,8 +47819,8 @@ self: {
     ({ mkDerivation, array, base, bytestring, file-embed, text }:
      mkDerivation {
        pname = "cndict";
-       version = "0.8.5";
-       sha256 = "1gh3165z95drfa87zrgnqvhyr6g6dc732dywz3nwh4k2wb4467nl";
+       version = "0.9.0";
+       sha256 = "0v0drr7zxh2ndq91vhpsi4ykna993fnkfmxana7g1q4c2vn8b5sc";
        libraryHaskellDepends = [ array base bytestring file-embed text ];
        homepage = "https://github.com/Lemmih/cndict";
        description = "Chinese/Mandarin <-> English dictionary, Chinese lexer";
@@ -49282,8 +49382,8 @@ self: {
     ({ mkDerivation, base, hspec, QuickCheck }:
      mkDerivation {
        pname = "compose-ltr";
-       version = "0.2.3";
-       sha256 = "1br7jyp5c0riq9wdd638n1yvwp0s7s8nazqzj9g6kninyf3vnvgp";
+       version = "0.2.4";
+       sha256 = "1vgllk949s9sc2nhwbpjqx52m06563qcq8yd49kyaf2lq05n23hm";
        libraryHaskellDepends = [ base ];
        testHaskellDepends = [ base hspec QuickCheck ];
        description = "More intuitive, left-to-right function composition";
@@ -50542,6 +50642,29 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "conduit-parse_0_1_2_2" = callPackage
+    ({ mkDerivation, base, conduit, conduit-combinators, dlist, hlint
+     , mtl, parsers, resourcet, safe, safe-exceptions, tasty
+     , tasty-hunit, text, transformers
+     }:
+     mkDerivation {
+       pname = "conduit-parse";
+       version = "0.1.2.2";
+       sha256 = "19ywaknrdcg88ximmx6fa08bq9xvp76ybly09gyp21xjnfdznsr9";
+       libraryHaskellDepends = [
+         base conduit conduit-combinators dlist mtl parsers safe
+         safe-exceptions text transformers
+       ];
+       testHaskellDepends = [
+         base conduit hlint mtl parsers resourcet safe-exceptions tasty
+         tasty-hunit
+       ];
+       homepage = "https://github.com/k0ral/conduit-parse";
+       description = "Parsing framework based on conduit";
+       license = stdenv.lib.licenses.publicDomain;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "conduit-resumablesink" = callPackage
     ({ mkDerivation, base, bytestring, conduit, hspec, resourcet
      , transformers, void
@@ -53718,7 +53841,7 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
-  "cron_0_6_0" = callPackage
+  "cron_0_6_1" = callPackage
     ({ mkDerivation, attoparsec, base, criterion, data-default-class
      , generics-sop, mtl, mtl-compat, old-locale, quickcheck-instances
      , semigroups, tasty, tasty-hunit, tasty-quickcheck, text, time
@@ -53726,8 +53849,8 @@ self: {
      }:
      mkDerivation {
        pname = "cron";
-       version = "0.6.0";
-       sha256 = "0s40b0dlkrwhx3sqbca0a883wd54xbkgqfz4w0ncmsb06x3sdx04";
+       version = "0.6.1";
+       sha256 = "0l9jigxr271gyf8a69igag5rckvcngv6h93jkf02d43jvqxza6lc";
        libraryHaskellDepends = [
          attoparsec base data-default-class mtl mtl-compat old-locale
          semigroups text time
@@ -53960,6 +54083,8 @@ self: {
        pname = "crypto-enigma";
        version = "0.0.2.9";
        sha256 = "18nc5gqsy4dsm22van6iz96lqq45f7jqik4fljczgp6n1knyig9z";
+       revision = "1";
+       editedCabalFile = "1hbcnj3w5z7cmlrmfih7mv27n75bpcpbiq66wsfgrrvaiycrb58n";
        libraryHaskellDepends = [ base containers MissingH mtl split ];
        testHaskellDepends = [ base HUnit QuickCheck ];
        homepage = "https://github.com/orome/crypto-enigma-hs";
@@ -64853,6 +64978,17 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "dual" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "dual";
+       version = "0.1.0.0";
+       sha256 = "02abbnynjxhr2dvqqph3mnzc24v9wc655qkhh70flc168dk0k6hr";
+       libraryHaskellDepends = [ base ];
+       description = "Dual category";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "dual-tree" = callPackage
     ({ mkDerivation, base, monoid-extras, newtype-generics, QuickCheck
      , semigroups, testing-feat
@@ -64879,8 +65015,8 @@ self: {
      }:
      mkDerivation {
        pname = "dublincore-xml-conduit";
-       version = "0.1.0.1";
-       sha256 = "1irrn82jk0l026l98pajvbbhsgxh6lybjxggyipxijibg7fbkx08";
+       version = "0.1.0.2";
+       sha256 = "17jzyj49j88xwsz54higi81a6v8kvb8i338n5416z1ni475qsynl";
        libraryHaskellDepends = [
          base conduit conduit-combinators safe-exceptions text time timerep
          uri-bytestring xml-conduit xml-types
@@ -65422,17 +65558,18 @@ self: {
      , exceptions, generics-sop, hashable, hspec, lens, monad-loops
      , monad-supply, safe-exceptions, scientific, semigroups, tagged
      , template-haskell, text, transformers, unordered-containers
-     , vector
+     , uuid-types, vector
      }:
      mkDerivation {
        pname = "dynamodb-simple";
-       version = "0.4.0.0";
-       sha256 = "0yfa2vy82ksbv2mha10yzrzppa24m8a847w2s6arm4nh34dkd832";
+       version = "0.5.0.0";
+       sha256 = "12jkl425nzgds8zszhk41ns4mg3rn9mjfmd853b88x6dn9wk95g7";
        libraryHaskellDepends = [
          aeson amazonka amazonka-core amazonka-dynamodb base bytestring
          conduit containers double-conversion exceptions generics-sop
          hashable lens monad-loops monad-supply scientific semigroups tagged
-         template-haskell text transformers unordered-containers vector
+         template-haskell text transformers unordered-containers uuid-types
+         vector
        ];
        testHaskellDepends = [
          amazonka amazonka-dynamodb base conduit containers hashable hspec
@@ -66278,8 +66415,8 @@ self: {
      }:
      mkDerivation {
        pname = "egison";
-       version = "3.7.3";
-       sha256 = "10lv2g62sj6skrg9j40994kcrann379byzqhyzsq16lhlbpia19s";
+       version = "3.7.4";
+       sha256 = "055m2099slgz01pzz23v6l2v6f9b149qkfxyf8pcviv59mjq2xsc";
        isLibrary = true;
        isExecutable = true;
        enableSeparateDataOutput = true;
@@ -66327,8 +66464,8 @@ self: {
      }:
      mkDerivation {
        pname = "egison-tutorial";
-       version = "3.7.1";
-       sha256 = "1s95xa3iyai0y67v4v6fxrx9gkxgcaqrwzla598lg49lp83c6lqc";
+       version = "3.7.4";
+       sha256 = "0932x2hmh982vfq0zgn6dj58bicq1p0lh93h4aq1hc75lzjk9ydl";
        isLibrary = false;
        isExecutable = true;
        executableHaskellDepends = [
@@ -66444,22 +66581,20 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "either_4_5" = callPackage
-    ({ mkDerivation, base, bifunctors, exceptions, free, mmorph
-     , monad-control, MonadRandom, mtl, profunctors, semigroupoids
-     , semigroups, transformers, transformers-base
+  "either_5" = callPackage
+    ({ mkDerivation, base, bifunctors, hedgehog, mtl, profunctors
+     , semigroupoids, semigroups
      }:
      mkDerivation {
        pname = "either";
-       version = "4.5";
-       sha256 = "1mzj86pbplgs3h7a49j3rk22s5cbw06wmd992gdm6harm15hzyzc";
+       version = "5";
+       sha256 = "087lrgvyns9jfgi95rr2lliivxf7fsd4d0hzqzk80kx385vf5kkm";
        libraryHaskellDepends = [
-         base bifunctors exceptions free mmorph monad-control MonadRandom
-         mtl profunctors semigroupoids semigroups transformers
-         transformers-base
+         base bifunctors mtl profunctors semigroupoids semigroups
        ];
+       testHaskellDepends = [ base hedgehog ];
        homepage = "http://github.com/ekmett/either/";
-       description = "An either monad transformer";
+       description = "Combinators for working with sums";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -70688,15 +70823,15 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
-  "extensible-effects_2_0_1_0" = callPackage
+  "extensible-effects_2_1_0_0" = callPackage
     ({ mkDerivation, base, directory, HUnit, QuickCheck, test-framework
      , test-framework-hunit, test-framework-quickcheck2
      , test-framework-th, transformers, transformers-base, type-aligned
      }:
      mkDerivation {
        pname = "extensible-effects";
-       version = "2.0.1.0";
-       sha256 = "1rnwc9jaw231j784ck9a7mzaw333bsj6c1bvqxkmnwz9r87vzpi2";
+       version = "2.1.0.0";
+       sha256 = "069v7ql359msnnsbapy1dwgsw3g6f0w8rrc0ihix1jm7p2ivjyrc";
        libraryHaskellDepends = [
          base transformers transformers-base type-aligned
        ];
@@ -73108,6 +73243,23 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "fin" = callPackage
+    ({ mkDerivation, base, deepseq, hashable, inspection-testing
+     , tagged
+     }:
+     mkDerivation {
+       pname = "fin";
+       version = "0";
+       sha256 = "0nzjqw6q01rc6faqp30771v8mxz6cndzskkvfaj55ygp34faycih";
+       revision = "1";
+       editedCabalFile = "0lin85p7gwdj96liwq5g2fpfmk3d23239zn99ghz12i6l8xwigxh";
+       libraryHaskellDepends = [ base deepseq hashable ];
+       testHaskellDepends = [ base inspection-testing tagged ];
+       homepage = "https://github.com/phadej/vec";
+       description = "Nat and Fin";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "final" = callPackage
     ({ mkDerivation, base, stm, transformers }:
      mkDerivation {
@@ -73279,6 +73431,19 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "finite-typelits_0_1_3_0" = callPackage
+    ({ mkDerivation, base, deepseq }:
+     mkDerivation {
+       pname = "finite-typelits";
+       version = "0.1.3.0";
+       sha256 = "17a82djlpapdzw34afv79w99jrpy5nlbdw1k1xjs59bvvqv36wyv";
+       libraryHaskellDepends = [ base deepseq ];
+       homepage = "https://github.com/mniip/finite-typelits";
+       description = "A type inhabited by finitely many values, indexed by type-level naturals";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "firefly" = callPackage
     ({ mkDerivation, aeson, base, blaze-html, bytestring
      , case-insensitive, containers, cookie, http-types, mtl, regex-pcre
@@ -74584,26 +74749,25 @@ self: {
 
   "fluid-idl" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, errors
-     , exceptions, fluid, hspec, lifted-async, monad-control
-     , monad-logger, mtl, random, safe-exceptions, scientific, text
-     , text-conversions, tuple, unordered-containers, vector
+     , exceptions, hspec, lifted-async, monad-control, monad-logger, mtl
+     , random, safe-exceptions, scientific, text, text-conversions
+     , unordered-containers, vector
      }:
      mkDerivation {
        pname = "fluid-idl";
-       version = "0.0.4";
-       sha256 = "1kdiq6mw01dr85ii7vg7bsw8m260y6njjf5afx3p718hsxwiw4yr";
+       version = "0.0.5";
+       sha256 = "1yv4qslqa335r6bwjpll45lz8y6pj3m8cvjzlc2xadg05m2yy89w";
        libraryHaskellDepends = [
          aeson base bytestring containers errors exceptions lifted-async
          monad-control monad-logger mtl random safe-exceptions scientific
          text text-conversions unordered-containers vector
        ];
        testHaskellDepends = [
-         aeson base containers fluid hspec scientific text tuple vector
+         aeson base containers hspec scientific text vector
        ];
        description = "Fluid | The Programmatic IDL";
        license = stdenv.lib.licenses.bsd3;
-       broken = true;
-     }) {fluid = null;};
+     }) {};
 
   "fluid-idl-http-client" = callPackage
     ({ mkDerivation, aeson, base, bytestring, fluid-idl, http-client
@@ -78859,19 +79023,22 @@ self: {
 
   "genesis" = callPackage
     ({ mkDerivation, base, directory, envparse, file-embed, filepath
-     , hspec, monad-control, monad-logger, monad-persist, persistent
-     , persistent-postgresql, persistent-sqlite, persistent-template
-     , resource-pool, template-haskell, text, text-conversions
+     , hspec, monad-control, monad-io-adapter, monad-logger
+     , monad-persist, persistent, persistent-postgresql
+     , persistent-sqlite, persistent-template, resource-pool
+     , template-haskell, text, text-conversions, transformers
+     , transformers-base
      }:
      mkDerivation {
        pname = "genesis";
-       version = "0.0.1.0";
-       sha256 = "15l23rf4ifqxziz3fa8ra2p7jch6ph651139cvpqszqbzm9wp4sc";
+       version = "0.1.0.0";
+       sha256 = "1bz47rf5qkkm809440y3ki1bahyg6sxdlxrfkc4mjy49fcbgh4si";
        libraryHaskellDepends = [
          base directory envparse file-embed filepath monad-control
-         monad-logger monad-persist persistent persistent-postgresql
-         persistent-template resource-pool template-haskell text
-         text-conversions
+         monad-io-adapter monad-logger monad-persist persistent
+         persistent-postgresql persistent-template resource-pool
+         template-haskell text text-conversions transformers
+         transformers-base
        ];
        testHaskellDepends = [
          base hspec monad-control monad-logger monad-persist
@@ -78886,16 +79053,17 @@ self: {
   "genesis-test" = callPackage
     ({ mkDerivation, base, envparse, genesis, hspec, hspec-expectations
      , lifted-base, monad-control, monad-logger, monad-persist
-     , persistent-postgresql, persistent-template, text
+     , persistent-postgresql, persistent-template, text, transformers
      , transformers-base
      }:
      mkDerivation {
        pname = "genesis-test";
-       version = "0.0.1.0";
-       sha256 = "12s0vg0013465cpxxhyz0xw9sbhh8knkl988dq8jaxvl81d0jzj2";
+       version = "0.1.0.0";
+       sha256 = "0d93wq9b5wm5cgw9kfvf8smm7d3adv8y4a8kxc6m17lvgjmjjph4";
        libraryHaskellDepends = [
          base genesis hspec hspec-expectations lifted-base monad-control
-         monad-logger monad-persist persistent-postgresql transformers-base
+         monad-logger monad-persist persistent-postgresql transformers
+         transformers-base
        ];
        testHaskellDepends = [
          base envparse genesis hspec monad-logger monad-persist
@@ -79791,6 +79959,8 @@ self: {
        pname = "ghc-compact";
        version = "0.1.0.0";
        sha256 = "03sf8ap1ncjsibp9z7k9xgcsj9s0q3q6l4shf8k7p8dkwpjl1g2h";
+       revision = "1";
+       editedCabalFile = "1fwcfk515lv3pjzxz87bddk3kdbkaxswxrr37spdlkvyyfrbxyak";
        libraryHaskellDepends = [ base bytestring ghc-prim ];
        description = "In memory storage of deeply evaluated data structure";
        license = stdenv.lib.licenses.bsd3;
@@ -87611,6 +87781,18 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "groups_0_4_1_0" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "groups";
+       version = "0.4.1.0";
+       sha256 = "0ggkygkyxw5ga4cza82bjvdraavl294k0h6b62d2px7z3nvqhifx";
+       libraryHaskellDepends = [ base ];
+       description = "Haskell 98 groups";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "growler" = callPackage
     ({ mkDerivation, aeson, base, blaze-builder, bytestring
      , case-insensitive, either, http-types, lens, monad-control, mtl
@@ -87751,8 +87933,8 @@ self: {
      }:
      mkDerivation {
        pname = "gssapi";
-       version = "0.2.0.0";
-       sha256 = "1kvyy05m3wcvcp76ap4i499j5mmm7dlz49i0m0a5vanpn2jfpkwy";
+       version = "0.2.0.1";
+       sha256 = "0bpwjggsdkckwfgmp89rvkzxjlagiliawrzf9pzvxrka7wk1ip14";
        libraryHaskellDepends = [ base bytestring resourcet transformers ];
        librarySystemDepends = [ gssapi_krb5 krb5 ];
        homepage = "https://github.com/ondrap/gssapi";
@@ -87767,8 +87949,8 @@ self: {
      }:
      mkDerivation {
        pname = "gssapi-wai";
-       version = "0.1.2.1";
-       sha256 = "0n9295ql2zrsipnf91af24lcc35f8l6d6313cz8xiyx4dhf1arln";
+       version = "0.1.2.2";
+       sha256 = "1fkgsdc4nkxwkhnz3b8rz6zx8jq6325mgniy5h5s3cr7k0kwnv0s";
        libraryHaskellDepends = [
          base base64-bytestring bytestring case-insensitive gssapi
          http-types vault wai wai-extra
@@ -92356,6 +92538,8 @@ self: {
        pname = "happy-meta";
        version = "0.2.0.9";
        sha256 = "1w3bmwnsg9714kyqxzfrbw0az4i2dqprn2hms3kbdq5984yhi9bg";
+       revision = "1";
+       editedCabalFile = "1mq8gdq11bqgii498as0078pf8s1mnawh4rvys6hjnd77iaf9nfk";
        libraryHaskellDepends = [
          array base containers haskell-src-meta mtl template-haskell
        ];
@@ -94009,6 +94193,38 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "haskell-lsp_0_2_0_0" = callPackage
+    ({ mkDerivation, aeson, base, bytestring, containers, data-default
+     , directory, filepath, hashable, hslogger, hspec, lens, mtl, parsec
+     , sorted-list, stm, text, time, transformers, unordered-containers
+     , vector, yi-rope
+     }:
+     mkDerivation {
+       pname = "haskell-lsp";
+       version = "0.2.0.0";
+       sha256 = "1hvqimg580hbanlhim2kxni3wk6rfwsd93agkfjhy216lb8bd9h8";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         aeson base bytestring containers data-default directory filepath
+         hashable hslogger lens mtl parsec sorted-list stm text time
+         unordered-containers yi-rope
+       ];
+       executableHaskellDepends = [
+         aeson base bytestring containers data-default directory filepath
+         hslogger lens mtl parsec stm text time transformers
+         unordered-containers vector yi-rope
+       ];
+       testHaskellDepends = [
+         aeson base containers directory hashable hspec lens sorted-list
+         text yi-rope
+       ];
+       homepage = "https://github.com/alanz/haskell-lsp";
+       description = "Haskell library for the Microsoft Language Server Protocol";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "haskell-menu" = callPackage
     ({ mkDerivation, base, containers }:
      mkDerivation {
@@ -94566,14 +94782,14 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-ast_0_9_0_0" = callPackage
+  "haskell-tools-ast_1_0_0_0" = callPackage
     ({ mkDerivation, base, ghc, mtl, references, template-haskell
      , uniplate
      }:
      mkDerivation {
        pname = "haskell-tools-ast";
-       version = "0.9.0.0";
-       sha256 = "1hhlp7bvn1q18jsfmi6pig26aggq6961p7lq7p140lk2jlvv9i1i";
+       version = "1.0.0.0";
+       sha256 = "174xh6a0p43kb0cia3z1n18kqhpsnbf51299l0rbn2makvn68zk4";
        libraryHaskellDepends = [
          base ghc mtl references template-haskell uniplate
        ];
@@ -94655,15 +94871,15 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-backend-ghc_0_9_0_0" = callPackage
+  "haskell-tools-backend-ghc_1_0_0_0" = callPackage
     ({ mkDerivation, base, bytestring, containers, ghc, ghc-boot-th
      , haskell-tools-ast, mtl, references, safe, split, template-haskell
      , transformers, uniplate
      }:
      mkDerivation {
        pname = "haskell-tools-backend-ghc";
-       version = "0.9.0.0";
-       sha256 = "17v38npf016pm80wiynimdqw83v3y8f1hdjjl7lbkwyj7rgkpx6n";
+       version = "1.0.0.0";
+       sha256 = "09jhc2i7ypfcgpdmjfg7bacf9a0nlxrvbz99zh86kgbrjh1xjr8f";
        libraryHaskellDepends = [
          base bytestring containers ghc ghc-boot-th haskell-tools-ast mtl
          references safe split template-haskell transformers uniplate
@@ -94674,6 +94890,37 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "haskell-tools-builtin-refactorings" = callPackage
+    ({ mkDerivation, base, Cabal, containers, directory, either
+     , filepath, ghc, ghc-paths, haskell-tools-ast
+     , haskell-tools-backend-ghc, haskell-tools-prettyprint
+     , haskell-tools-refactor, haskell-tools-rewrite, mtl, old-time
+     , polyparse, references, split, tasty, tasty-hunit
+     , template-haskell, time, transformers, uniplate
+     }:
+     mkDerivation {
+       pname = "haskell-tools-builtin-refactorings";
+       version = "1.0.0.0";
+       sha256 = "0mhigqzivx1r04gi9v4jb7cvzirly8bbm3nckib170yws884gcba";
+       libraryHaskellDepends = [
+         base Cabal containers directory filepath ghc ghc-paths
+         haskell-tools-ast haskell-tools-backend-ghc
+         haskell-tools-prettyprint haskell-tools-refactor
+         haskell-tools-rewrite mtl references split template-haskell
+         transformers uniplate
+       ];
+       testHaskellDepends = [
+         base Cabal containers directory either filepath ghc ghc-paths
+         haskell-tools-ast haskell-tools-backend-ghc
+         haskell-tools-prettyprint haskell-tools-refactor
+         haskell-tools-rewrite mtl old-time polyparse references split tasty
+         tasty-hunit template-haskell time transformers uniplate
+       ];
+       homepage = "https://github.com/haskell-tools/haskell-tools";
+       description = "Refactoring Tool for Haskell";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "haskell-tools-cli" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, criterion
      , directory, filepath, ghc, ghc-paths, haskell-tools-ast
@@ -94704,7 +94951,7 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
-  "haskell-tools-cli_0_9_0_0" = callPackage
+  "haskell-tools-cli_1_0_0_0" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, criterion
      , directory, filepath, ghc, ghc-paths, Glob
      , haskell-tools-builtin-refactorings, haskell-tools-daemon
@@ -94713,8 +94960,8 @@ self: {
      }:
      mkDerivation {
        pname = "haskell-tools-cli";
-       version = "0.9.0.0";
-       sha256 = "04ycy6hqnzqj9gc4vqf95flc3yh3swx201n2daggkmxayasiivqj";
+       version = "1.0.0.0";
+       sha256 = "1y0jlgp3b8bxgrs406c32drdphblnn5c7rsqj2n9gvmhmdj01iwc";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -94723,8 +94970,8 @@ self: {
          haskell-tools-refactor mtl references split strict
        ];
        executableHaskellDepends = [
-         base directory filepath Glob haskell-tools-builtin-refactorings mtl
-         optparse-applicative process split
+         base directory filepath Glob haskell-tools-builtin-refactorings
+         haskell-tools-daemon mtl optparse-applicative process split
        ];
        testHaskellDepends = [
          base bytestring directory filepath
@@ -94732,14 +94979,14 @@ self: {
        ];
        benchmarkHaskellDepends = [
          aeson base bytestring criterion directory filepath
-         haskell-tools-builtin-refactorings knob split time
+         haskell-tools-builtin-refactorings haskell-tools-daemon knob split
+         time
        ];
        homepage = "https://github.com/haskell-tools/haskell-tools";
        description = "Command-line frontend for Haskell-tools Refact";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
-       broken = true;
-     }) {haskell-tools-builtin-refactorings = null;};
+     }) {};
 
   "haskell-tools-daemon" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, Diff
@@ -94768,6 +95015,41 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "haskell-tools-daemon_1_0_0_0" = callPackage
+    ({ mkDerivation, aeson, base, bytestring, Cabal, containers
+     , deepseq, Diff, directory, filepath, fswatch, ghc, ghc-paths, Glob
+     , haskell-tools-builtin-refactorings, haskell-tools-prettyprint
+     , haskell-tools-refactor, HUnit, mtl, network, optparse-applicative
+     , pretty, process, references, split, strict, tasty, tasty-hunit
+     , template-haskell
+     }:
+     mkDerivation {
+       pname = "haskell-tools-daemon";
+       version = "1.0.0.0";
+       sha256 = "0pgpir9p693wym1krw2pyk17aq0dv10xbypw44ik6syzmy8j1zla";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         aeson base bytestring Cabal containers deepseq Diff directory
+         filepath fswatch ghc ghc-paths haskell-tools-builtin-refactorings
+         haskell-tools-prettyprint haskell-tools-refactor mtl network
+         optparse-applicative pretty process references split strict
+         template-haskell
+       ];
+       executableHaskellDepends = [
+         base directory filepath haskell-tools-builtin-refactorings
+       ];
+       testHaskellDepends = [
+         aeson base bytestring directory filepath ghc Glob
+         haskell-tools-builtin-refactorings HUnit network process tasty
+         tasty-hunit
+       ];
+       homepage = "https://github.com/haskell-tools/haskell-tools";
+       description = "Background process for Haskell-tools that editors can connect to";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "haskell-tools-debug" = callPackage
     ({ mkDerivation, base, filepath, ghc, ghc-paths, haskell-tools-ast
      , haskell-tools-backend-ghc, haskell-tools-prettyprint
@@ -94790,7 +95072,7 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-debug_0_9_0_0" = callPackage
+  "haskell-tools-debug_1_0_0_0" = callPackage
     ({ mkDerivation, base, filepath, ghc, ghc-paths, haskell-tools-ast
      , haskell-tools-backend-ghc, haskell-tools-builtin-refactorings
      , haskell-tools-prettyprint, haskell-tools-refactor, references
@@ -94798,8 +95080,8 @@ self: {
      }:
      mkDerivation {
        pname = "haskell-tools-debug";
-       version = "0.9.0.0";
-       sha256 = "0lbb8ip5y511v41i9xw9yi4nk2f0xmxv8ddcr0faxvy503miv613";
+       version = "1.0.0.0";
+       sha256 = "0jbiid1plb2y2sfpi5m46kl6waap8xhk8bqk5q9km2w7np0fv5dc";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -94813,8 +95095,7 @@ self: {
        description = "Debugging Tools for Haskell-tools";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
-       broken = true;
-     }) {haskell-tools-builtin-refactorings = null;};
+     }) {};
 
   "haskell-tools-demo" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, directory
@@ -94846,7 +95127,7 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-demo_0_9_0_0" = callPackage
+  "haskell-tools-demo_1_0_0_0" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, directory
      , filepath, ghc, ghc-paths, haskell-tools-ast
      , haskell-tools-backend-ghc, haskell-tools-builtin-refactorings
@@ -94856,8 +95137,8 @@ self: {
      }:
      mkDerivation {
        pname = "haskell-tools-demo";
-       version = "0.9.0.0";
-       sha256 = "1mb2ica5x5x66z68px9sfy0gndla1qmydlb9vcwvvc2wv8jmn8mr";
+       version = "1.0.0.0";
+       sha256 = "0kyf83wg514yl795k63wlklrdlz3fnnxl9qjkcwv5fxkxxixxf07";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -94876,8 +95157,38 @@ self: {
        description = "A web-based demo for Haskell-tools Refactor";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
-       broken = true;
-     }) {haskell-tools-builtin-refactorings = null;};
+     }) {};
+
+  "haskell-tools-experimental-refactorings" = callPackage
+    ({ mkDerivation, base, Cabal, containers, directory, either
+     , filepath, ghc, ghc-paths, haskell-tools-ast
+     , haskell-tools-backend-ghc, haskell-tools-prettyprint
+     , haskell-tools-refactor, haskell-tools-rewrite, mtl, references
+     , split, tasty, tasty-hunit, template-haskell, time, transformers
+     , uniplate
+     }:
+     mkDerivation {
+       pname = "haskell-tools-experimental-refactorings";
+       version = "1.0.0.0";
+       sha256 = "1k3grr8jca4samw0hqm1yrq8yjg4nw0z4gwx366anjpvwb1chr9a";
+       libraryHaskellDepends = [
+         base Cabal containers directory filepath ghc ghc-paths
+         haskell-tools-ast haskell-tools-backend-ghc
+         haskell-tools-prettyprint haskell-tools-refactor
+         haskell-tools-rewrite mtl references split template-haskell
+         transformers uniplate
+       ];
+       testHaskellDepends = [
+         base Cabal containers directory either filepath ghc ghc-paths
+         haskell-tools-ast haskell-tools-backend-ghc
+         haskell-tools-prettyprint haskell-tools-refactor
+         haskell-tools-rewrite mtl references split tasty tasty-hunit
+         template-haskell time transformers uniplate
+       ];
+       homepage = "https://github.com/haskell-tools/haskell-tools";
+       description = "Refactoring Tool for Haskell";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
 
   "haskell-tools-prettyprint" = callPackage
     ({ mkDerivation, base, containers, ghc, haskell-tools-ast, mtl
@@ -94896,14 +95207,14 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-prettyprint_0_9_0_0" = callPackage
+  "haskell-tools-prettyprint_1_0_0_0" = callPackage
     ({ mkDerivation, base, containers, ghc, haskell-tools-ast, mtl
      , references, split, text, uniplate
      }:
      mkDerivation {
        pname = "haskell-tools-prettyprint";
-       version = "0.9.0.0";
-       sha256 = "15ym19dhn4lvv2szyp4bj7347bmbj43p76hj5fi1v2z20irjvmfi";
+       version = "1.0.0.0";
+       sha256 = "1f27xziimiz81sjns8hia6xsk94zm3yjpcdvihaqr0g0dq1mkfwl";
        libraryHaskellDepends = [
          base containers ghc haskell-tools-ast mtl references split text
          uniplate
@@ -94944,7 +95255,7 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-refactor_0_9_0_0" = callPackage
+  "haskell-tools-refactor_1_0_0_0" = callPackage
     ({ mkDerivation, base, Cabal, containers, directory, filepath, ghc
      , ghc-paths, haskell-tools-ast, haskell-tools-backend-ghc
      , haskell-tools-prettyprint, haskell-tools-rewrite, mtl, references
@@ -94952,8 +95263,8 @@ self: {
      }:
      mkDerivation {
        pname = "haskell-tools-refactor";
-       version = "0.9.0.0";
-       sha256 = "0n9j8rlv613b0l5g3lihqp6rfkxxdm21f1m4fqygbi7fb3d6n7ss";
+       version = "1.0.0.0";
+       sha256 = "0s3mdwpsla79ppcsl7n3r1yjbi0db0w6yk2zf143p5ngbhj08rs4";
        libraryHaskellDepends = [
          base Cabal containers directory filepath ghc ghc-paths
          haskell-tools-ast haskell-tools-backend-ghc
@@ -94988,15 +95299,15 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "haskell-tools-rewrite_0_9_0_0" = callPackage
+  "haskell-tools-rewrite_1_0_0_0" = callPackage
     ({ mkDerivation, base, containers, directory, filepath, ghc
      , haskell-tools-ast, haskell-tools-prettyprint, mtl, references
      , tasty, tasty-hunit
      }:
      mkDerivation {
        pname = "haskell-tools-rewrite";
-       version = "0.9.0.0";
-       sha256 = "1vdbnb7808v2wycrg7nz0zx6rb8mjb1d50i57g6irfwk3s46k31s";
+       version = "1.0.0.0";
+       sha256 = "0zm7bdlfda29md86s0bz40y3ml1pb6x8fvp4br8gxj7r3j1l8852";
        libraryHaskellDepends = [
          base containers ghc haskell-tools-ast haskell-tools-prettyprint mtl
          references
@@ -97617,29 +97928,28 @@ self: {
      }) {};
 
   "hcg-minus" = callPackage
-    ({ mkDerivation, base, colour }:
+    ({ mkDerivation, base, colour, random }:
      mkDerivation {
        pname = "hcg-minus";
-       version = "0.15";
-       sha256 = "04g0f4sr7904w3ynyl0gnbyi2sl0z7ziv5q15mfb6c7h0zl25d5r";
+       version = "0.16";
+       sha256 = "0578yi5zc61chmp936s5wczdd8j3593br24zx57sqr5a50c0mwmc";
        enableSeparateDataOutput = true;
-       libraryHaskellDepends = [ base colour ];
+       libraryHaskellDepends = [ base colour random ];
        homepage = "http://rd.slavepianos.org/t/hcg-minus";
        description = "haskell cg (minus)";
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
   "hcg-minus-cairo" = callPackage
-    ({ mkDerivation, base, cairo, colour, filepath, hcg-minus
-     , utf8-string
+    ({ mkDerivation, base, cairo, colour, filepath, hcg-minus, process
      }:
      mkDerivation {
        pname = "hcg-minus-cairo";
-       version = "0.15";
-       sha256 = "002gh8adqzhcjfnqkbcnpzz8qiqbj9zkbk6jj11dnnxjigc4l2q9";
+       version = "0.16";
+       sha256 = "0q51m7rac2dij9y34pp74xpz8qsskjb2if7i5dynpk9jnpqkj26h";
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [
-         base cairo colour filepath hcg-minus utf8-string
+         base cairo colour filepath hcg-minus process
        ];
        homepage = "http://rd.slavepianos.org/t/hcg-minus-cairo";
        description = "haskell cg (minus) (cairo rendering)";
@@ -102411,13 +102721,15 @@ self: {
      }) {};
 
   "hly" = callPackage
-    ({ mkDerivation, base, directory, filepath, hmt, process }:
+    ({ mkDerivation, base, directory, filepath, hmt, process, split }:
      mkDerivation {
        pname = "hly";
-       version = "0.15";
-       sha256 = "192szfq39g3fdcdsxj4bsi13bfha8gjbqbixav3iywmdsgxp1hj8";
+       version = "0.16";
+       sha256 = "0ccd5w4vzwki6p9dc69hx65ac1mkbjh5dx96gp2cb8qj3w3cas2m";
        enableSeparateDataOutput = true;
-       libraryHaskellDepends = [ base directory filepath hmt process ];
+       libraryHaskellDepends = [
+         base directory filepath hmt process split
+       ];
        homepage = "http://rd.slavepianos.org/t/hly";
        description = "Haskell LilyPond";
        license = "GPL";
@@ -102935,20 +103247,20 @@ self: {
      }) {inherit (pkgs) mpfr;};
 
   "hmt" = callPackage
-    ({ mkDerivation, array, base, bytestring, colour, containers
-     , data-ordlist, directory, filepath, lazy-csv, logict
-     , multiset-comb, parsec, permutation, primes, safe, split
-     , utf8-string
+    ({ mkDerivation, aeson, array, base, bytestring, colour, containers
+     , data-ordlist, directory, fgl, filepath, lazy-csv, logict
+     , modular-arithmetic, multiset-comb, parsec, permutation, primes
+     , random, safe, split, text
      }:
      mkDerivation {
        pname = "hmt";
-       version = "0.15";
-       sha256 = "051kgsh9nl5f1nw8a24x7ds18g6ppzbhk3d9lf74nvvnccnzg3a9";
+       version = "0.16";
+       sha256 = "1s6fjyphq57wh15vryj6y493ikaqa3g14x6hj9lg2h6wf6g8042h";
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [
-         array base bytestring colour containers data-ordlist directory
-         filepath lazy-csv logict multiset-comb parsec permutation primes
-         safe split utf8-string
+         aeson array base bytestring colour containers data-ordlist
+         directory fgl filepath lazy-csv logict modular-arithmetic
+         multiset-comb parsec permutation primes random safe split text
        ];
        homepage = "http://rd.slavepianos.org/t/hmt";
        description = "Haskell Music Theory";
@@ -104426,18 +104738,38 @@ self: {
        license = "GPL";
      }) {};
 
+  "hosc_0_16" = callPackage
+    ({ mkDerivation, base, binary, blaze-builder, bytestring
+     , data-binary-ieee754, network, time, transformers
+     }:
+     mkDerivation {
+       pname = "hosc";
+       version = "0.16";
+       sha256 = "1xj5kkpkzzwfi26n28s0gkr9vzkmvp276n9jb75j2ccbr8q79vbj";
+       enableSeparateDataOutput = true;
+       libraryHaskellDepends = [
+         base binary blaze-builder bytestring data-binary-ieee754 network
+         time transformers
+       ];
+       homepage = "http://rd.slavepianos.org/t/hosc";
+       description = "Haskell Open Sound Control";
+       license = "GPL";
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "hosc-json" = callPackage
     ({ mkDerivation, aeson, attoparsec, base, bifunctors, bytestring
-     , hosc, json, text, unordered-containers, utf8-string, vector
+     , hosc, json, text, transformers, unordered-containers, utf8-string
+     , vector
      }:
      mkDerivation {
        pname = "hosc-json";
-       version = "0.15";
-       sha256 = "0sask4nr5njf9grzigldflrbp7460z55fsam1pc3wcnsa575hxhi";
+       version = "0.16";
+       sha256 = "059wpgvr2vbkdq2gmy8mrwqkqv1zrh2qz499v6i242q0z9m4gr3m";
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [
          aeson attoparsec base bifunctors bytestring hosc json text
-         unordered-containers utf8-string vector
+         transformers unordered-containers utf8-string vector
        ];
        homepage = "http://rd.slavepianos.org/t/hosc-json";
        description = "Haskell Open Sound Control JSON Serialisation";
@@ -105317,19 +105649,14 @@ self: {
      }) {};
 
   "hps" = callPackage
-    ({ mkDerivation, base, directory, filepath, hcg-minus, random }:
+    ({ mkDerivation, base, filepath, hcg-minus, process }:
      mkDerivation {
        pname = "hps";
-       version = "0.15";
-       sha256 = "0kmmrjg93rr6cjmg5n821p00qr4m3q46nnyfhql2s2nf20p7kprh";
-       isLibrary = true;
-       isExecutable = true;
+       version = "0.16";
+       sha256 = "0y819776sk97hdwf67x67289gdqmxn2g39l7ri0n8z8vdap5rq96";
        enableSeparateDataOutput = true;
-       libraryHaskellDepends = [ base hcg-minus ];
-       executableHaskellDepends = [
-         base directory filepath hcg-minus random
-       ];
-       homepage = "http://rd.slavepianos.org/?t=hps";
+       libraryHaskellDepends = [ base filepath hcg-minus process ];
+       homepage = "http://rd.slavepianos.org/t/hps";
        description = "Haskell Postscript";
        license = "GPL";
      }) {};
@@ -105836,6 +106163,17 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {inherit (pkgs) fltk; fltk_images = null;};
 
+  "hs-functors" = callPackage
+    ({ mkDerivation, base, transformers }:
+     mkDerivation {
+       pname = "hs-functors";
+       version = "0.1.0.0";
+       sha256 = "0hm7cmmamn9sgdcy38i1lvxkjmlzab7k2x97mpzf881rs7wdp9s3";
+       libraryHaskellDepends = [ base transformers ];
+       description = "Functors from products of Haskell and its dual to Haskell";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "hs-gchart" = callPackage
     ({ mkDerivation, base, mtl }:
      mkDerivation {
@@ -106549,19 +106887,19 @@ self: {
      }) {};
 
   "hsc3" = callPackage
-    ({ mkDerivation, base, binary, bytestring, containers, data-default
-     , data-ordlist, directory, filepath, hashable, hosc, network
-     , process, random, safe, split, transformers
+    ({ mkDerivation, array, base, binary, bytestring, containers
+     , data-default, data-ordlist, directory, filepath, hashable, hosc
+     , network, process, random, safe, split, transformers, vector
      }:
      mkDerivation {
        pname = "hsc3";
-       version = "0.15.1";
-       sha256 = "1ad5q4rq82v7l556rinaiikglr1kjswi5raw0dxqwsfjbp8imbha";
+       version = "0.16";
+       sha256 = "0m6pas8dx48mx91159s7p7fljnivs13cg34gys906nhq11dmjdqn";
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [
-         base binary bytestring containers data-default data-ordlist
+         array base binary bytestring containers data-default data-ordlist
          directory filepath hashable hosc network process random safe split
-         transformers
+         transformers vector
        ];
        homepage = "http://rd.slavepianos.org/t/hsc3";
        description = "Haskell SuperCollider";
@@ -106634,8 +106972,8 @@ self: {
     ({ mkDerivation, base, directory, filepath, hsc3, process }:
      mkDerivation {
        pname = "hsc3-dot";
-       version = "0.15";
-       sha256 = "1ck2g15zw23smry1xvn9ida8ln57vnvkxvr3khhp5didwisgm90m";
+       version = "0.16";
+       sha256 = "0jz3x6s6svgil1cyalq4xkv09s55d8r44cc2ksp0npmgpmp3x454";
        enableSeparateDataOutput = true;
        libraryHaskellDepends = [ base directory filepath hsc3 process ];
        homepage = "http://rd.slavepianos.org/t/hsc3-dot";
@@ -110024,20 +110362,22 @@ self: {
      }) {};
 
   "html-tokenizer" = callPackage
-    ({ mkDerivation, attoparsec, base, base-prelude, case-insensitive
-     , conversion, conversion-case-insensitive, conversion-text
-     , directory, doctest, filepath, text
+    ({ mkDerivation, attoparsec, base, base-prelude, html-entities
+     , QuickCheck, quickcheck-instances, rerebase, semigroups, tasty
+     , tasty-hunit, tasty-quickcheck, text, text-builder, vector
+     , vector-builder
      }:
      mkDerivation {
        pname = "html-tokenizer";
-       version = "0.4.1";
-       sha256 = "1h8pxphfx4pic0ds6mivk74ca761wkiklyd3bmfyqgbnhllsfxhh";
+       version = "0.5";
+       sha256 = "1i8pgl8vz36l6xm6cfx5slnav1115mhdj4qy2arkxysa7xh8lw7y";
        libraryHaskellDepends = [
-         attoparsec base-prelude case-insensitive conversion
-         conversion-case-insensitive conversion-text text
+         attoparsec base base-prelude html-entities semigroups text
+         text-builder vector vector-builder
        ];
        testHaskellDepends = [
-         base base-prelude directory doctest filepath
+         attoparsec QuickCheck quickcheck-instances rerebase tasty
+         tasty-hunit tasty-quickcheck
        ];
        homepage = "https://github.com/nikita-volkov/html-tokenizer";
        description = "An \"attoparsec\"-based HTML tokenizer";
@@ -111222,8 +111562,8 @@ self: {
      }:
      mkDerivation {
        pname = "http2-client";
-       version = "0.5.0.0";
-       sha256 = "1vzbh65ifndpbwdwaam1zcy7myqxk39sl0m8244pg7ixy8yrnc25";
+       version = "0.6.0.0";
+       sha256 = "09xbpasgjy7hziml68237jvxadvl3wgg6mgykfd61lb7fiq3f7kl";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -116366,12 +116706,16 @@ self: {
      }) {};
 
   "inspection-testing" = callPackage
-    ({ mkDerivation, base, containers, ghc, template-haskell }:
+    ({ mkDerivation, base, containers, ghc, mtl, template-haskell
+     , transformers
+     }:
      mkDerivation {
        pname = "inspection-testing";
-       version = "0.1.1.2";
-       sha256 = "1q8xqm63s0filhlg942kql71m9w85dgr409z4wzr7fsrvqydmaqi";
-       libraryHaskellDepends = [ base containers ghc template-haskell ];
+       version = "0.1.2";
+       sha256 = "1si89b5scc7qw88shmyzi1abbvgl7fv16yw731n5niw4cqps329j";
+       libraryHaskellDepends = [
+         base containers ghc mtl template-haskell transformers
+       ];
        testHaskellDepends = [ base ];
        homepage = "https://github.com/nomeata/inspection-testing";
        description = "GHC plugin to do inspection testing";
@@ -116995,6 +117339,22 @@ self: {
        hydraPlatforms = [ "i686-linux" "x86_64-linux" ];
      }) {};
 
+  "intrinsic-superclasses" = callPackage
+    ({ mkDerivation, base, containers, haskell-src-meta, mtl
+     , template-haskell
+     }:
+     mkDerivation {
+       pname = "intrinsic-superclasses";
+       version = "0.1.0.0";
+       sha256 = "0vvkh65fdm6sgx3m5irk6l96krg99f14h3z45lz19z6xj57627y5";
+       libraryHaskellDepends = [
+         base containers haskell-src-meta mtl template-haskell
+       ];
+       homepage = "https://github.com/daig/intrinsic-superclasses#readme";
+       description = "A quasiquoter implementation of the Intrinsic Superclasses Proposal";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "intro" = callPackage
     ({ mkDerivation, base, bifunctors, binary, bytestring, containers
      , deepseq, dlist, extra, hashable, lens, mtl, QuickCheck, safe
@@ -126493,15 +126853,15 @@ self: {
      }) {};
 
   "lenz" = callPackage
-    ({ mkDerivation, base, base-unicode-symbols, profunctors
+    ({ mkDerivation, base, base-unicode-symbols, hs-functors
      , transformers
      }:
      mkDerivation {
        pname = "lenz";
-       version = "0.2.1.0";
-       sha256 = "1c2l5r8p2j59lns7340j50wfv3dpmjj3cw71k88d82d9qc842hwl";
+       version = "0.2.2.1";
+       sha256 = "0w8imq8x5g71byjv8q00fp688mc02kf19n2i23b8474z6sk1mhg8";
        libraryHaskellDepends = [
-         base base-unicode-symbols profunctors transformers
+         base base-unicode-symbols hs-functors transformers
        ];
        description = "Van Laarhoven lenses";
        license = stdenv.lib.licenses.bsd3;
@@ -130491,8 +130851,8 @@ self: {
      }:
      mkDerivation {
        pname = "logging-effect-extra";
-       version = "1.2.0";
-       sha256 = "0d4n4swwgwz4hw750a9firyi516mhb83nr3gqpnrbfyf4mqnr1bc";
+       version = "1.2.1";
+       sha256 = "0sk4wagknvspn45lll1sy5jx3vz1ljsjj3yabyx7cnlyf5bl3k61";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -130530,8 +130890,8 @@ self: {
      }:
      mkDerivation {
        pname = "logging-effect-extra-handler";
-       version = "1.1.0";
-       sha256 = "01kkkcn49m684rbf7vgyl5swbfv6yv7h1nkwcii2caghkc0yxapi";
+       version = "1.1.1";
+       sha256 = "1g73xyd1skh7paamnsia0x3cdayd34s12xvvxqaifm3wm19jy1rf";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -131992,6 +132352,28 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {inherit (pkgs) lzma;};
 
+  "lzma-conduit_1_2_0" = callPackage
+    ({ mkDerivation, base, base-compat, bytestring, conduit, HUnit
+     , lzma, QuickCheck, resourcet, test-framework, test-framework-hunit
+     , test-framework-quickcheck2, transformers
+     }:
+     mkDerivation {
+       pname = "lzma-conduit";
+       version = "1.2.0";
+       sha256 = "0jpzl1nb422d1a5k4ylh5wkl225x816xnx1y7qkd8wzxp5xxa7ba";
+       libraryHaskellDepends = [
+         base bytestring conduit lzma resourcet transformers
+       ];
+       testHaskellDepends = [
+         base base-compat bytestring conduit HUnit QuickCheck resourcet
+         test-framework test-framework-hunit test-framework-quickcheck2
+       ];
+       homepage = "http://github.com/alphaHeavy/lzma-conduit";
+       description = "Conduit interface for lzma/xz compression";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "lzma-enumerator" = callPackage
     ({ mkDerivation, base, bindings-DSL, bytestring, enumerator, HUnit
      , lzma, mtl, QuickCheck, test-framework, test-framework-hunit
@@ -134974,6 +135356,28 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "mega-sdist_0_3_0_4" = callPackage
+    ({ mkDerivation, base, bytestring, classy-prelude-conduit
+     , conduit-extra, directory, filepath, http-conduit, optparse-simple
+     , tar-conduit, temporary, text, typed-process, yaml
+     }:
+     mkDerivation {
+       pname = "mega-sdist";
+       version = "0.3.0.4";
+       sha256 = "1qf7lhk2063lpkg2bm7x7sxxxf87laxjwsr4rw46hvjj2m8frh41";
+       isLibrary = false;
+       isExecutable = true;
+       executableHaskellDepends = [
+         base bytestring classy-prelude-conduit conduit-extra directory
+         filepath http-conduit optparse-simple tar-conduit temporary text
+         typed-process yaml
+       ];
+       homepage = "https://github.com/snoyberg/mega-sdist#readme";
+       description = "Handles uploading to Hackage from mega repos";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "megaparsec" = callPackage
     ({ mkDerivation, base, bytestring, containers, criterion, deepseq
      , exceptions, hspec, hspec-expectations, mtl, QuickCheck
@@ -136263,8 +136667,8 @@ self: {
      }:
      mkDerivation {
        pname = "midimory";
-       version = "0.0.0.2";
-       sha256 = "13bfb2s6ybvspmmq427v55nb2csvcp4ijfgm9fvfh6cab2pm1dyz";
+       version = "0.0.0.3";
+       sha256 = "0jnzj3br3pb9ld1ha96kxk4zsxc38gc3njxmqb7nj8155b7r7x96";
        isLibrary = false;
        isExecutable = true;
        executableHaskellDepends = [
@@ -137672,8 +138076,8 @@ self: {
      }:
      mkDerivation {
        pname = "moesocks";
-       version = "1.0.0.42";
-       sha256 = "17817g4fyy03la1jh718mrncpjf6vjh819rpvgjcmzk6dl2p0a49";
+       version = "1.0.0.43";
+       sha256 = "1wbxvsisk1aah186xn32sndw8djrk96dpawhsmygxkncn264599f";
        isLibrary = false;
        isExecutable = true;
        executableHaskellDepends = [
@@ -138070,6 +138474,24 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "monad-io-adapter" = callPackage
+    ({ mkDerivation, base, exceptions, hspec, monad-control
+     , monad-logger, mtl, transformers, transformers-base
+     }:
+     mkDerivation {
+       pname = "monad-io-adapter";
+       version = "0.1.0.0";
+       sha256 = "0lbgc89d4wh7ciiv9mdp9fr1zfffqgsj504jxv9v6v1ba25fy9is";
+       libraryHaskellDepends = [
+         base exceptions monad-control monad-logger mtl transformers
+         transformers-base
+       ];
+       testHaskellDepends = [ base hspec transformers-base ];
+       homepage = "https://github.com/cjdev/monad-io-adapter#readme";
+       description = "Adapters between MonadIO and MonadBase IO";
+       license = stdenv.lib.licenses.isc;
+     }) {};
+
   "monad-journal" = callPackage
     ({ mkDerivation, base, either, monad-control, mtl, transformers
      , transformers-base
@@ -138816,12 +139238,31 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "monad-unlift-ref_0_2_1" = callPackage
+    ({ mkDerivation, base, constraints, exceptions, monad-control
+     , monad-unlift, mtl, mutable-containers, resourcet, stm
+     , transformers, transformers-base
+     }:
+     mkDerivation {
+       pname = "monad-unlift-ref";
+       version = "0.2.1";
+       sha256 = "078xjz3a6rgqqgf8zg9ngspixf9pgch845l6gs5ssy3l54wra18g";
+       libraryHaskellDepends = [
+         base constraints exceptions monad-control monad-unlift mtl
+         mutable-containers resourcet stm transformers transformers-base
+       ];
+       homepage = "https://github.com/fpco/monad-unlift";
+       description = "Typeclasses for representing monad transformer unlifting";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "monad-var" = callPackage
     ({ mkDerivation, base, stm, transformers }:
      mkDerivation {
        pname = "monad-var";
-       version = "0.1.0.1";
-       sha256 = "03il4cas2qsv900pcz5cd65kv1nv8vj7rdms04j9lkq1rsgc7qll";
+       version = "0.1.1.1";
+       sha256 = "1j9ydl29a4cqhkackcpzlp7amiwk0ifvyxdcmi2vka7m1d98jc6z";
        libraryHaskellDepends = [ base stm transformers ];
        homepage = "https://github.com/effectfully/monad-var#readme";
        description = "Generic operations over variables";
@@ -148666,6 +149107,36 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "opml-conduit_0_6_0_4" = callPackage
+    ({ mkDerivation, base, bytestring, case-insensitive, conduit
+     , conduit-combinators, containers, data-default, hlint, lens-simple
+     , mono-traversable, monoid-subclasses, mtl, parsers, QuickCheck
+     , quickcheck-instances, resourcet, safe-exceptions, semigroups
+     , tasty, tasty-hunit, tasty-quickcheck, text, time, timerep
+     , uri-bytestring, xml-conduit, xml-types
+     }:
+     mkDerivation {
+       pname = "opml-conduit";
+       version = "0.6.0.4";
+       sha256 = "07axacfa0wik2cnpzcnjjp9w6ws8sjhinzxdc4vrxdxaj1v5a2s8";
+       enableSeparateDataOutput = true;
+       libraryHaskellDepends = [
+         base case-insensitive conduit conduit-combinators containers
+         lens-simple mono-traversable monoid-subclasses safe-exceptions
+         semigroups text time timerep uri-bytestring xml-conduit xml-types
+       ];
+       testHaskellDepends = [
+         base bytestring conduit conduit-combinators containers data-default
+         hlint lens-simple mono-traversable mtl parsers QuickCheck
+         quickcheck-instances resourcet semigroups tasty tasty-hunit
+         tasty-quickcheck text time uri-bytestring xml-conduit
+       ];
+       homepage = "https://github.com/k0ral/opml-conduit";
+       description = "Streaming parser/renderer for the OPML 2.0 format.";
+       license = stdenv.lib.licenses.publicDomain;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "opn" = callPackage
     ({ mkDerivation, base, directory, filepath, ini, network-uri
      , optparse-applicative, process, text, unordered-containers
@@ -150073,22 +150544,25 @@ self: {
        maintainers = with stdenv.lib.maintainers; [ peti ];
      }) {};
 
-  "pandoc_2_0_2" = callPackage
+  "pandoc_2_0_3" = callPackage
     ({ mkDerivation, aeson, aeson-pretty, base, base64-bytestring
      , binary, blaze-html, blaze-markup, bytestring, Cabal
      , case-insensitive, cmark-gfm, containers, criterion, data-default
      , deepseq, Diff, directory, doctemplates, executable-path, filepath
-     , Glob, haddock-library, hslua, HTTP, http-client, http-client-tls
-     , http-types, JuicyPixels, mtl, network, network-uri, pandoc-types
-     , parsec, process, QuickCheck, random, safe, scientific, SHA
-     , skylighting, split, syb, tagsoup, tasty, tasty-golden
-     , tasty-hunit, tasty-quickcheck, temporary, texmath, text, time
-     , unix, unordered-containers, vector, xml, yaml, zip-archive, zlib
+     , Glob, haddock-library, hslua, hslua-module-text, HTTP
+     , http-client, http-client-tls, http-types, JuicyPixels, mtl
+     , network, network-uri, pandoc-types, parsec, process, QuickCheck
+     , random, safe, scientific, SHA, skylighting, split, syb, tagsoup
+     , tasty, tasty-golden, tasty-hunit, tasty-quickcheck, temporary
+     , texmath, text, time, unix, unordered-containers, vector, xml
+     , yaml, zip-archive, zlib
      }:
      mkDerivation {
        pname = "pandoc";
-       version = "2.0.2";
-       sha256 = "1ygrxq5hpzr29pdmir3ms2crihg1bqrdjlxjvm6yfq4pjdlxg7xp";
+       version = "2.0.3";
+       sha256 = "1vmk5kcys400gwbddxwsnh5lhv4n8jvi9nnhad1pf1hzva3y056q";
+       revision = "1";
+       editedCabalFile = "1fzvy28900577aca4sb8g36h4n50ifvmbhayppm02a755rfzqzdl";
        configureFlags = [ "-fhttps" "-f-trypandoc" ];
        isLibrary = true;
        isExecutable = true;
@@ -150098,11 +150572,11 @@ self: {
          aeson aeson-pretty base base64-bytestring binary blaze-html
          blaze-markup bytestring case-insensitive cmark-gfm containers
          data-default deepseq directory doctemplates filepath Glob
-         haddock-library hslua HTTP http-client http-client-tls http-types
-         JuicyPixels mtl network network-uri pandoc-types parsec process
-         random safe scientific SHA skylighting split syb tagsoup temporary
-         texmath text time unix unordered-containers vector xml yaml
-         zip-archive zlib
+         haddock-library hslua hslua-module-text HTTP http-client
+         http-client-tls http-types JuicyPixels mtl network network-uri
+         pandoc-types parsec process random safe scientific SHA skylighting
+         split syb tagsoup temporary texmath text time unix
+         unordered-containers vector xml yaml zip-archive zlib
        ];
        executableHaskellDepends = [ base ];
        testHaskellDepends = [
@@ -153954,8 +154428,8 @@ self: {
      }:
      mkDerivation {
        pname = "persistent-relational-record";
-       version = "0.1.1.0";
-       sha256 = "145am29vwjvvs93z8kqj4dgh71h64ascmqnd70w9g9qszb2rjwrm";
+       version = "0.1.2.0";
+       sha256 = "1xbrkf7vw872hxk6g7bv4c5hx0708x6sqf38a4qm0m9bf2qiakgd";
        libraryHaskellDepends = [
          base conduit containers mtl persistable-record persistent
          relational-query resourcet template-haskell text
@@ -161281,8 +161755,8 @@ self: {
      }:
      mkDerivation {
        pname = "propellor";
-       version = "5.0.0";
-       sha256 = "1q4c2bhw6fjjc5344yz7bz5ig70gccv4s1cxkwh3ps1z7sbqbyk9";
+       version = "5.1.0";
+       sha256 = "0bl1kb24s2bs7li096s4iwvd2wj188lb2y3cfymhgsyqj8c2fbzp";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -162871,8 +163345,8 @@ self: {
      }:
      mkDerivation {
        pname = "pusher-ws";
-       version = "0.1.0.1";
-       sha256 = "0i5659wljhaindimm8b6khibr8mcmcr5iaags2a33zjb67gjbsd7";
+       version = "0.1.1.0";
+       sha256 = "04nk5jdw7pv57366hjscl5sdhbhyplpfb34y1dj3i31d8s20yn1a";
        libraryHaskellDepends = [
          aeson base bytestring containers deepseq hashable http-conduit lens
          lens-aeson network scientific stm text time transformers
@@ -163301,15 +163775,16 @@ self: {
 
   "qr-imager" = callPackage
     ({ mkDerivation, aeson, base, bytestring, cryptonite, directory
-     , haskell-qrencode, hspec, jose-jwt, JuicyPixels, libqrencode
-     , microlens, MissingH, optparse-applicative, process, vector
+     , either, haskell-qrencode, hspec, jose-jwt, JuicyPixels
+     , libqrencode, microlens, MissingH, optparse-applicative, process
+     , vector
      }:
      mkDerivation {
        pname = "qr-imager";
-       version = "1.0.1.2";
-       sha256 = "0hvyjhb1pki1w59zhps7lbzz8l7wslz0a46vb4licm81m85fxhbk";
+       version = "1.0.1.3";
+       sha256 = "0n2y4z6s00b31dj5qwyykncxfi4yyiqvpxq1r7ls2xvv9pa4bhgc";
        libraryHaskellDepends = [
-         aeson base bytestring cryptonite directory haskell-qrencode
+         aeson base bytestring cryptonite directory either haskell-qrencode
          jose-jwt JuicyPixels microlens MissingH optparse-applicative
          process vector
        ];
@@ -169789,6 +170264,19 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "repline_0_1_7_0" = callPackage
+    ({ mkDerivation, base, containers, haskeline, mtl, process }:
+     mkDerivation {
+       pname = "repline";
+       version = "0.1.7.0";
+       sha256 = "1pjmkr5lnc6vdy8g90wnxlh1rzq6f3sc0j1facfc42iqi9fh6fjh";
+       libraryHaskellDepends = [ base containers haskeline mtl process ];
+       homepage = "https://github.com/sdiehl/repline";
+       description = "Haskeline wrapper for GHCi-like REPL interfaces";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "repo-based-blog" = callPackage
     ({ mkDerivation, base, blaze-html, containers, data-default
      , directory, dyre, filepath, filestore, hspec, hspec-discover
@@ -170969,6 +171457,34 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "rfc" = callPackage
+    ({ mkDerivation, aeson, aeson-diff, async, base, blaze-html
+     , classy-prelude, containers, data-default, exceptions, hedis
+     , http-api-data, http-client-tls, http-types, lens, lifted-async
+     , markdown, monad-control, postgresql-simple, resource-pool
+     , servant, servant-blaze, servant-docs, servant-server
+     , servant-swagger, simple-logger, string-conversions, swagger2
+     , temporary, text, time-units, unordered-containers, url
+     , uuid-types, vector, wai, wai-cors, wai-extra, wreq
+     }:
+     mkDerivation {
+       pname = "rfc";
+       version = "0.0.0.3";
+       sha256 = "0068sckjcgcacjlj7xp0z02q60qghkji9l4frjagjsxxsskkksvc";
+       libraryHaskellDepends = [
+         aeson aeson-diff async base blaze-html classy-prelude containers
+         data-default exceptions hedis http-api-data http-client-tls
+         http-types lens lifted-async markdown monad-control
+         postgresql-simple resource-pool servant servant-blaze servant-docs
+         servant-server servant-swagger simple-logger string-conversions
+         swagger2 temporary text time-units unordered-containers url
+         uuid-types vector wai wai-cors wai-extra wreq
+       ];
+       homepage = "https://github.com/RobertFischer/rfc#README.md";
+       description = "Robert Fischer's Common library, for all Robert Fischer's common needs";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "rfc1413-server" = callPackage
     ({ mkDerivation, base, network-simple, rfc1413-types }:
      mkDerivation {
@@ -180925,8 +181441,8 @@ self: {
      }:
      mkDerivation {
        pname = "silvi";
-       version = "0.0.2";
-       sha256 = "1rls25wifkgkz1fg4xw4bvpxa1807dp1h2q8kk7j7if7b66pj0cx";
+       version = "0.0.3";
+       sha256 = "1brvx8acfvpcw402b3676ydi6r95js6bhaasll59bm1khhl8d90b";
        libraryHaskellDepends = [
          base bytestring chronos http-types ip quantification savage text
        ];
@@ -182477,7 +182993,7 @@ self: {
        license = stdenv.lib.licenses.gpl2;
      }) {};
 
-  "skylighting_0_4_3_2" = callPackage
+  "skylighting_0_4_4" = callPackage
     ({ mkDerivation, aeson, attoparsec, base, base64-bytestring, binary
      , blaze-html, bytestring, case-insensitive, containers, criterion
      , Diff, directory, filepath, HUnit, hxt, mtl, pretty-show, random
@@ -182486,8 +183002,8 @@ self: {
      }:
      mkDerivation {
        pname = "skylighting";
-       version = "0.4.3.2";
-       sha256 = "00qs35kjj68z75vmc0ijqn5ghrq2gdyi5q2j9x4lchvizgq6czhw";
+       version = "0.4.4";
+       sha256 = "0i5wp229gbix0dhdwqm59af0v6g51wsdk8q5b7d49kp3rl4iv2bi";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [
@@ -185312,19 +185828,15 @@ self: {
      }) {};
 
   "sort-by-pinyin" = callPackage
-    ({ mkDerivation, air, air-extra, air-th, base, bytestring
-     , containers, text
-     }:
+    ({ mkDerivation, air, base, bytestring, containers, text }:
      mkDerivation {
        pname = "sort-by-pinyin";
-       version = "2014.5.19";
-       sha256 = "1ksfx5zhagg2y8virg8am1w8ljrzc9ddmf7xgvi5gx88zibi32fd";
+       version = "2017.10.18";
+       sha256 = "0gxz5kmkcmq8330v1iclhxqzfb6p9qk4prnskm16qmv2i4dp1p34";
        enableSeparateDataOutput = true;
-       libraryHaskellDepends = [
-         air air-extra air-th base bytestring containers text
-       ];
+       libraryHaskellDepends = [ air base bytestring containers text ];
        homepage = "https://github.com/nfjinjing/sort-by-pinyin";
-       description = "Sort simplified Chinese by PinYin";
+       description = "Sort Simplified Chinese by PinYin";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -185994,8 +186506,8 @@ self: {
     ({ mkDerivation, base, cmdargs, containers, leancheck }:
      mkDerivation {
        pname = "speculate";
-       version = "0.3.0";
-       sha256 = "05xc8dkrzf60pdbxw4mpdy2yqd4l3vxsqkq27f2wf6qqf6bc4vsh";
+       version = "0.3.1";
+       sha256 = "01w44hd53n770fm49x70k3c4pwvsvp641x7kdnafg6czy8500s2k";
        libraryHaskellDepends = [ base cmdargs containers leancheck ];
        testHaskellDepends = [ base leancheck ];
        benchmarkHaskellDepends = [ base leancheck ];
@@ -191215,6 +191727,19 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "subzero" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "subzero";
+       version = "0.1.0.1";
+       sha256 = "09fbj5gkppy2i7bnkhm8qai0zqazw0943d8fk1jfzhdz59pby4vm";
+       libraryHaskellDepends = [ base ];
+       testHaskellDepends = [ base ];
+       homepage = "https://github.com/code5hot/subzero#readme";
+       description = "Helps when going \"seed values\" -> alternatives and optional -> answers";
+       license = stdenv.lib.licenses.gpl2;
+     }) {};
+
   "success" = callPackage
     ({ mkDerivation, base, monad-control, mtl, transformers
      , transformers-base
@@ -191591,14 +192116,17 @@ self: {
      }) {};
 
   "supermonad" = callPackage
-    ({ mkDerivation, base, containers, fgl, ghc, mtl, transformers }:
+    ({ mkDerivation, base, containers, fgl, ghc, mtl, QuickCheck
+     , transformers
+     }:
      mkDerivation {
        pname = "supermonad";
-       version = "0.1";
-       sha256 = "0qlf3alrfi8zibqzlnd6gd422vwbhz37inr0ycdl7cz5x7m4g5pd";
+       version = "0.2.0";
+       sha256 = "1k1ysyjgnq5wic8hifrhpcmbi267inllqrh1dij234xykrkifd1m";
        libraryHaskellDepends = [
          base containers fgl ghc mtl transformers
        ];
+       testHaskellDepends = [ base containers ghc QuickCheck ];
        description = "Plugin and base library to support supermonads in Haskell";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -192228,8 +192756,8 @@ self: {
     ({ mkDerivation, base, containers, hashable, QuickCheck, vector }:
      mkDerivation {
        pname = "sym";
-       version = "0.12.1";
-       sha256 = "0qh023v5008byrfcc5ryj8fcl2pck3g8yjqdnrdij0jb4fhx3prw";
+       version = "0.13.0";
+       sha256 = "0ppgdhhxn5w05194mwcsca6m853h8hh5bxsm2l3jz52y388pi0ic";
        libraryHaskellDepends = [ base containers hashable vector ];
        testHaskellDepends = [ base hashable QuickCheck ];
        homepage = "https://github.com/akc/sym";
@@ -197109,8 +197637,8 @@ self: {
      }:
      mkDerivation {
        pname = "text-builder";
-       version = "0.4.2";
-       sha256 = "1k3dna9l438cxlcyl2a28ld68ki3a7qrc35vrssn2dlcf5l89ng4";
+       version = "0.5.1";
+       sha256 = "1x5dacn3zkc3v72kspdicmp0c1cr8yq83xp115lfj7aq5riw6z1r";
        libraryHaskellDepends = [
          base base-prelude bytestring semigroups text
        ];
@@ -201707,8 +202235,8 @@ self: {
      }:
      mkDerivation {
        pname = "traildb";
-       version = "0.1.2.0";
-       sha256 = "0a6pjkslq4vi84l04g8s640hwg2yki3015z1glcslyyj4x4wb47m";
+       version = "0.1.4.0";
+       sha256 = "1qp3m8vfjy9kim9jikhxplyp6c21scj18n9qnb0pfd0hpjyigd9b";
        libraryHaskellDepends = [
          base bytestring containers directory exceptions primitive
          profunctors text time transformers unix vector
@@ -206479,8 +207007,8 @@ self: {
      }:
      mkDerivation {
        pname = "universum";
-       version = "0.7.1.1";
-       sha256 = "08q3ldx0saahlxh2zkwmsq71lkwrvfrs19nzbgwwdvd31y4r0iq6";
+       version = "0.8.0";
+       sha256 = "058c9fhf5lysswch8gwicpjjpqh6l03iz861vm913r3a8lam777f";
        libraryHaskellDepends = [
          base bytestring containers deepseq exceptions ghc-prim hashable
          microlens microlens-mtl mtl safe safe-exceptions stm text
@@ -207889,6 +208417,17 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "util" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "util";
+       version = "0.1.0.0";
+       sha256 = "10n0c7yxvyzf7j4i3mlkxcz1xpc7vdll80rd4pwrs7rhqmd94viw";
+       libraryHaskellDepends = [ base ];
+       description = "Utilities";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "util-plus" = callPackage
     ({ mkDerivation, array, base, containers, hashable, HTF, QuickCheck
      , safe, unordered-containers
@@ -209102,6 +209641,26 @@ self: {
        license = "GPL";
      }) {};
 
+  "vec" = callPackage
+    ({ mkDerivation, adjunctions, base, base-compat, boring, criterion
+     , deepseq, distributive, fin, hashable, inspection-testing, lens
+     , semigroupoids, semigroups, tagged, vector
+     }:
+     mkDerivation {
+       pname = "vec";
+       version = "0";
+       sha256 = "1h4s4j10z94mjdifyibpnc7zzq6a8xklbzj164ck8hdq8fp7qj52";
+       libraryHaskellDepends = [
+         adjunctions base base-compat boring deepseq distributive fin
+         hashable lens semigroupoids semigroups
+       ];
+       testHaskellDepends = [ base fin inspection-testing tagged ];
+       benchmarkHaskellDepends = [ base criterion fin vector ];
+       homepage = "https://github.com/phadej/vec";
+       description = "Nat, Fin and Vec types";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "vect" = callPackage
     ({ mkDerivation, base, random }:
      mkDerivation {
@@ -210956,6 +211515,38 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "wai-extra_3_0_20_2" = callPackage
+    ({ mkDerivation, aeson, ansi-terminal, base, base64-bytestring
+     , blaze-builder, bytestring, case-insensitive, containers, cookie
+     , data-default-class, deepseq, directory, fast-logger, hspec
+     , http-types, HUnit, iproute, lifted-base, network, old-locale
+     , resourcet, streaming-commons, stringsearch, text, time
+     , transformers, unix, unix-compat, vault, void, wai, wai-logger
+     , word8, zlib
+     }:
+     mkDerivation {
+       pname = "wai-extra";
+       version = "3.0.20.2";
+       sha256 = "0szmh1wnbcw1mi89rrp35kgnjglc2dx6ib5l3rcki4d9fc04w8xn";
+       isLibrary = true;
+       isExecutable = true;
+       libraryHaskellDepends = [
+         aeson ansi-terminal base base64-bytestring blaze-builder bytestring
+         case-insensitive containers cookie data-default-class deepseq
+         directory fast-logger http-types iproute lifted-base network
+         old-locale resourcet streaming-commons stringsearch text time
+         transformers unix unix-compat vault void wai wai-logger word8 zlib
+       ];
+       testHaskellDepends = [
+         base blaze-builder bytestring case-insensitive cookie fast-logger
+         hspec http-types HUnit resourcet text time transformers wai zlib
+       ];
+       homepage = "http://github.com/yesodweb/wai";
+       description = "Provides some basic WAI handlers and middleware";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "wai-frontend-monadcgi" = callPackage
     ({ mkDerivation, base, bytestring, case-insensitive, cgi
      , containers, http-types, transformers, wai
@@ -211803,6 +212394,28 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "wai-middleware-throttle_0_2_2_0" = callPackage
+    ({ mkDerivation, base, bytestring, bytestring-builder, containers
+     , hashable, hspec, http-types, HUnit, mtl, network, QuickCheck, stm
+     , text, token-bucket, transformers, wai, wai-extra
+     }:
+     mkDerivation {
+       pname = "wai-middleware-throttle";
+       version = "0.2.2.0";
+       sha256 = "0k5q6vziq67bscfrm1dx6i4wkvw30wa35mgdd7x1dzniibx87dva";
+       libraryHaskellDepends = [
+         base bytestring bytestring-builder containers hashable http-types
+         mtl network stm text token-bucket transformers wai
+       ];
+       testHaskellDepends = [
+         base bytestring hspec http-types HUnit QuickCheck stm transformers
+         wai wai-extra
+       ];
+       description = "WAI Middleware for Request Throttling";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "wai-middleware-verbs" = callPackage
     ({ mkDerivation, base, errors, exceptions, hashable, http-types
      , mmorph, monad-logger, mtl, resourcet, text, transformers
@@ -213805,6 +214418,27 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "weigh_0_0_6" = callPackage
+    ({ mkDerivation, base, bytestring-trie, containers, deepseq, mtl
+     , process, random, split, template-haskell, temporary
+     , unordered-containers
+     }:
+     mkDerivation {
+       pname = "weigh";
+       version = "0.0.6";
+       sha256 = "0izi5qsxjq2cjhk0xzdkmf8q36zg469csricyzy8vhd70mlp9g4r";
+       libraryHaskellDepends = [
+         base deepseq mtl process split template-haskell temporary
+       ];
+       testHaskellDepends = [
+         base bytestring-trie containers deepseq random unordered-containers
+       ];
+       homepage = "https://github.com/fpco/weigh#readme";
+       description = "Measure allocations of a Haskell functions/values";
+       license = stdenv.lib.licenses.bsd3;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "weighted" = callPackage
     ({ mkDerivation, base, mtl, semiring-num, transformers }:
      mkDerivation {
@@ -216272,15 +216906,15 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
-  "xeno_0_3_1" = callPackage
+  "xeno_0_3_2" = callPackage
     ({ mkDerivation, array, base, bytestring, criterion, deepseq
      , ghc-prim, hexml, hexpat, hspec, mtl, mutable-containers, vector
      , weigh, xml
      }:
      mkDerivation {
        pname = "xeno";
-       version = "0.3.1";
-       sha256 = "19ymz1gymv6balkrak90z4z6131lnd6k00i67s3l1djdnv1p1qqm";
+       version = "0.3.2";
+       sha256 = "14vwfkhfrxpa0mszjlbvm704nnv1xpbnb4klsyifihp7j4hngpp9";
        libraryHaskellDepends = [
          array base bytestring deepseq mtl mutable-containers vector
        ];
@@ -216842,6 +217476,29 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "xml-conduit-parse_0_3_1_2" = callPackage
+    ({ mkDerivation, base, conduit, conduit-parse, containers
+     , data-default, exceptions, hlint, parsers, resourcet, tasty
+     , tasty-hunit, text, xml-conduit, xml-types
+     }:
+     mkDerivation {
+       pname = "xml-conduit-parse";
+       version = "0.3.1.2";
+       sha256 = "0233jcpv7lzan2hh6siw2rrjkjp4f5i1kkpjpdfija01f8by3an1";
+       libraryHaskellDepends = [
+         base conduit conduit-parse containers exceptions parsers text
+         xml-conduit xml-types
+       ];
+       testHaskellDepends = [
+         base conduit conduit-parse data-default hlint parsers resourcet
+         tasty tasty-hunit
+       ];
+       homepage = "https://github.com/k0ral/xml-conduit-parse";
+       description = "Streaming XML parser based on conduits";
+       license = "unknown";
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "xml-conduit-writer" = callPackage
     ({ mkDerivation, base, containers, data-default, dlist, mtl, text
      , xml-conduit, xml-types
@@ -218438,8 +219095,8 @@ self: {
        pname = "yampa-canvas";
        version = "0.2.2";
        sha256 = "0g1yvb6snnsbvy2f74lrlqff5zgnvfh2f6r8xdwxi61dk71qsz0n";
-       revision = "1";
-       editedCabalFile = "0jpksvr3ycw0mraryn113x0b44f0574fkd0n24lbga3ha5armscq";
+       revision = "2";
+       editedCabalFile = "1wl5g0mrxkpkdlhjizh7m9z33pdygb460zxjm6qrcy90naywchqj";
        isLibrary = true;
        isExecutable = true;
        libraryHaskellDepends = [ base blank-canvas stm time Yampa ];
@@ -219451,17 +220108,17 @@ self: {
      }) {};
 
   "yesod-csp" = callPackage
-    ({ mkDerivation, attoparsec, base, hspec, mono-traversable
-     , network-uri, semigroups, syb, template-haskell, text, uniplate
-     , yesod, yesod-core, yesod-test
+    ({ mkDerivation, attoparsec, base, case-insensitive, hspec
+     , mono-traversable, network-uri, semigroups, syb, template-haskell
+     , text, wai, yesod, yesod-core, yesod-test
      }:
      mkDerivation {
        pname = "yesod-csp";
-       version = "0.2.1.0";
-       sha256 = "15af948x2z9qyj358ba9ggil65jw9bc5d99h6xcydxpnlgvmg0q6";
+       version = "0.2.3.0";
+       sha256 = "167yl3c68bfr91mqxl650lfa64d6ljaqach7cyl91gvdxwb1q262";
        libraryHaskellDepends = [
-         attoparsec base mono-traversable network-uri semigroups syb
-         template-haskell text uniplate yesod yesod-core
+         attoparsec base case-insensitive mono-traversable network-uri
+         semigroups syb template-haskell text wai yesod yesod-core
        ];
        testHaskellDepends = [
          attoparsec base hspec network-uri semigroups template-haskell yesod
@@ -220032,6 +220689,29 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "yesod-persistent_1_4_3" = callPackage
+    ({ mkDerivation, base, blaze-builder, conduit, hspec, persistent
+     , persistent-sqlite, persistent-template, resource-pool, resourcet
+     , text, transformers, wai-extra, yesod-core
+     }:
+     mkDerivation {
+       pname = "yesod-persistent";
+       version = "1.4.3";
+       sha256 = "0kiksw46c8ww9yiwl28pkrppx8d6fhsasr0hvmsliqbrp16likj8";
+       libraryHaskellDepends = [
+         base blaze-builder conduit persistent persistent-template
+         resource-pool resourcet transformers yesod-core
+       ];
+       testHaskellDepends = [
+         base blaze-builder conduit hspec persistent persistent-sqlite text
+         wai-extra yesod-core
+       ];
+       homepage = "http://www.yesodweb.com/";
+       description = "Some helpers for using Persistent from Yesod";
+       license = stdenv.lib.licenses.mit;
+       hydraPlatforms = stdenv.lib.platforms.none;
+     }) {};
+
   "yesod-platform" = callPackage
     ({ mkDerivation, ansi-terminal, ansi-wl-pprint, asn1-encoding
      , asn1-parse, asn1-types, attoparsec-conduit, authenticate
diff --git a/pkgs/development/interpreters/lush/default.nix b/pkgs/development/interpreters/lush/default.nix
index a39e79badb6ca..6958bd2465f5f 100644
--- a/pkgs/development/interpreters/lush/default.nix
+++ b/pkgs/development/interpreters/lush/default.nix
@@ -1,5 +1,5 @@
 {stdenv, fetchurl, libX11, xproto, indent, readline, gsl, freeglut, mesa, SDL
-, blas, binutils, intltool, gettext, zlib, libSM}:
+, blas, libbfd, intltool, gettext, zlib, libSM}:
 
 stdenv.mkDerivation rec {
   baseName = "lush";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    libX11 libSM xproto indent readline gsl freeglut mesa SDL blas binutils
+    libX11 libSM xproto indent readline gsl freeglut mesa SDL blas libbfd
     intltool gettext zlib
   ];
 
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix
index 97e395d2a6dfe..d2fff13e2ee42 100644
--- a/pkgs/development/interpreters/perl/default.nix
+++ b/pkgs/development/interpreters/perl/default.nix
@@ -44,7 +44,6 @@ let
       substituteInPlace dist/PathTools/Cwd.pm \
         --replace "/bin/pwd" "$pwd"
     '';
-    sandboxProfile = sandbox.allow "ipc-sysv-sem";
 
     # Build a thread-safe Perl with a dynamic libperls.o.  We need the
     # "installstyle" option to ensure that modules are put under
diff --git a/pkgs/development/interpreters/python/build-python-package.nix b/pkgs/development/interpreters/python/build-python-package.nix
index b26bf1539cd5c..982542c1fc3e5 100644
--- a/pkgs/development/interpreters/python/build-python-package.nix
+++ b/pkgs/development/interpreters/python/build-python-package.nix
@@ -1,11 +1,14 @@
-/* This function provides a generic Python package builder.  It is
-   intended to work with packages that use `distutils/setuptools'
-   (http://pypi.python.org/pypi/setuptools/), which represents a large
-   number of Python packages nowadays.  */
+# This function provides a generic Python package builder,
+# and can build packages that use distutils, setuptools or flit.
 
 { lib
 , python
-, mkPythonDerivation
+, wrapPython
+, setuptools
+, unzip
+, ensureNewerSourcesHook
+, pythonModule
+, namePrefix
 , bootstrapped-pip
 , flit
 }:
@@ -15,6 +18,9 @@ let
   flit-specific = import ./build-python-package-flit.nix { inherit python flit; };
   wheel-specific = import ./build-python-package-wheel.nix { };
   common = import ./build-python-package-common.nix { inherit python bootstrapped-pip; };
+  mkPythonDerivation = import ./mk-python-derivation.nix {
+    inherit lib python wrapPython setuptools unzip ensureNewerSourcesHook pythonModule namePrefix;
+  };
 in
 
 {
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index eb2a46cb3b793..c7483a815297e 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -201,7 +201,7 @@ in stdenv.mkDerivation {
     in rec {
       inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch;
       executable = libPrefix;
-      buildEnv = callPackage ../../wrapper.nix { python = self; };
+      buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
       withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
       pkgs = pythonPackages;
       isPy2 = true;
diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix
index a924b543fe385..5c13035be1b16 100644
--- a/pkgs/development/interpreters/python/cpython/3.4/default.nix
+++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix
@@ -160,7 +160,7 @@ in stdenv.mkDerivation {
   in rec {
     inherit libPrefix sitePackages x11Support;
     executable = "${libPrefix}m";
-    buildEnv = callPackage ../../wrapper.nix { python = self; };
+    buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
     withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
     pkgs = pythonPackages;
     isPy3 = true;
diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix
index abe220e0a3e50..951cb367528f4 100644
--- a/pkgs/development/interpreters/python/cpython/3.5/default.nix
+++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix
@@ -154,7 +154,7 @@ in stdenv.mkDerivation {
   in rec {
     inherit libPrefix sitePackages x11Support;
     executable = "${libPrefix}m";
-    buildEnv = callPackage ../../wrapper.nix { python = self; };
+    buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
     withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
     pkgs = pythonPackages;
     isPy3 = true;
diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix
index 1614159a7ef05..b44e167b9f006 100644
--- a/pkgs/development/interpreters/python/cpython/3.6/default.nix
+++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix
@@ -153,7 +153,7 @@ in stdenv.mkDerivation {
   in rec {
     inherit libPrefix sitePackages x11Support;
     executable = "${libPrefix}m";
-    buildEnv = callPackage ../../wrapper.nix { python = self; };
+    buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
     withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
     pkgs = pythonPackages;
     isPy3 = true;
diff --git a/pkgs/development/interpreters/python/mk-python-derivation.nix b/pkgs/development/interpreters/python/mk-python-derivation.nix
index 098ab0b1719f8..a0cac7d1ddda8 100644
--- a/pkgs/development/interpreters/python/mk-python-derivation.nix
+++ b/pkgs/development/interpreters/python/mk-python-derivation.nix
@@ -1,4 +1,4 @@
-/* Generic builder for Python packages that come without a setup.py. */
+# Generic builder.
 
 { lib
 , python
@@ -6,13 +6,13 @@
 , setuptools
 , unzip
 , ensureNewerSourcesHook
+# Whether the derivation provides a Python module or not.
+, pythonModule
+, namePrefix
 }:
 
 { name ? "${attrs.pname}-${attrs.version}"
 
-# by default prefix `name` e.g. "python3.3-${name}"
-, namePrefix ? python.libPrefix + "-"
-
 # Dependencies for building the package
 , buildInputs ? []
 
@@ -54,18 +54,21 @@ if disabled
 then throw "${name} not supported for interpreter ${python.executable}"
 else
 
-python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "checkInputs"] // {
+python.stdenv.mkDerivation (builtins.removeAttrs attrs [
+    "disabled" "checkInputs" "doCheck" "doInstallCheck" "dontWrapPythonPrograms" "catchConflicts"
+  ] // {
 
   name = namePrefix + name;
 
-  inherit pythonPath;
-
-  buildInputs = [ wrapPython ] ++ buildInputs ++ pythonPath
-    ++ [ (ensureNewerSourcesHook { year = "1980"; }) ]
+  buildInputs = ([ wrapPython (ensureNewerSourcesHook { year = "1980"; }) ]
     ++ (lib.optional (lib.hasSuffix "zip" attrs.src.name or "") unzip)
-    ++ lib.optionals doCheck checkInputs;
+    ++ lib.optionals doCheck checkInputs
+    ++ lib.optional catchConflicts setuptools # If we nog longer propagate setuptools
+    ++ buildInputs
+    ++ pythonPath
+  );
 
-  # propagate python/setuptools to active setup-hook in nix-shell
+  # Propagate python and setuptools. We should stop propagating setuptools.
   propagatedBuildInputs = propagatedBuildInputs ++ [ python setuptools ];
 
   # Python packages don't have a checkPhase, only an installCheckPhase
@@ -83,15 +86,12 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "checkInputs"
 
   passthru = {
     inherit python; # The python interpreter
+    inherit pythonModule;
   } // passthru;
 
-  meta = with lib.maintainers; {
+  meta = {
     # default to python's platforms
     platforms = python.meta.platforms;
-  } // meta // {
-    # add extra maintainer(s) to every package
-    maintainers = (meta.maintainers or []) ++ [ chaoflow ];
-    # a marker for release utilities to discover python packages
     isBuildPythonPackage = python.meta.platforms;
-  };
+  } // meta;
 })
diff --git a/pkgs/development/interpreters/python/pypy/2.7/default.nix b/pkgs/development/interpreters/python/pypy/2.7/default.nix
index f5ee13cfc121e..aea389d160fe9 100644
--- a/pkgs/development/interpreters/python/pypy/2.7/default.nix
+++ b/pkgs/development/interpreters/python/pypy/2.7/default.nix
@@ -137,7 +137,7 @@ in stdenv.mkDerivation rec {
     inherit zlibSupport libPrefix sitePackages;
     executable = "pypy";
     isPypy = true;
-    buildEnv = callPackage ../../wrapper.nix { python = self; };
+    buildEnv = callPackage ../../wrapper.nix { python = self; inherit (pythonPackages) requiredPythonModules; };
     interpreter = "${self}/bin/${executable}";
     withPackages = import ../../with-packages.nix { inherit buildEnv pythonPackages;};
     pkgs = pythonPackages;
diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh
index 37bd5b097395b..01b573e6ad5d8 100644
--- a/pkgs/development/interpreters/python/wrap.sh
+++ b/pkgs/development/interpreters/python/wrap.sh
@@ -83,7 +83,7 @@ wrapPythonProgramsIn() {
 
 # Adds the lib and bin directories to the PYTHONPATH and PATH variables,
 # respectively. Recurses on any paths declared in
-# `propagated-native-build-inputs`, while avoiding duplicating paths by
+# `propagated-build-inputs`, while avoiding duplicating paths by
 # flagging the directories it has visited in `pythonPathsSeen`.
 _addToPythonPath() {
     local dir="$1"
@@ -96,7 +96,7 @@ _addToPythonPath() {
     addToSearchPath program_PATH $dir/bin
 
     # Inspect the propagated inputs (if they exist) and recur on them.
-    local prop="$dir/nix-support/propagated-native-build-inputs"
+    local prop="$dir/nix-support/propagated-build-inputs"
     if [ -e $prop ]; then
         local new_path
         for new_path in $(cat $prop); do
diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix
index f42caf92c1703..fc521828ffc48 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -2,13 +2,14 @@
 , extraLibs ? []
 , extraOutputsToInstall ? []
 , postBuild ? ""
-, ignoreCollisions ? false }:
+, ignoreCollisions ? false
+, requiredPythonModules
+, }:
 
 # Create a python executable that knows about additional packages.
 let
-  recursivePthLoader = import ../../python-modules/recursive-pth-loader/default.nix { stdenv = stdenv; python = python; };
   env = let
-    paths = stdenv.lib.closePropagation (extraLibs ++ [ python recursivePthLoader ] ) ;
+    paths = requiredPythonModules (extraLibs ++ [ python ] ) ;
   in buildEnv {
     name = "${python.name}-env";
 
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index 04634aa8f2714..d75aea726e101 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -54,8 +54,9 @@ stdenv.mkDerivation rec {
   # https://bugzilla.libsdl.org/show_bug.cgi?id=1431
   dontDisableStatic = true;
 
-  # Flaky: fatal error: pointer-constraints-....h: No such file or directory
-  #enableParallelBuilding = true;
+  # /build/SDL2-2.0.7/src/video/wayland/SDL_waylandevents.c:41:10: fatal error:
+  #   pointer-constraints-unstable-v1-client-protocol.h: No such file or directory
+  enableParallelBuilding = false;
 
   # XXX: By default, SDL wants to dlopen() PulseAudio, in which case
   # we must arrange to add it to its RPATH; however, `patchelf' seems
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index 1ac96e2b4f046..421d7072397b7 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -31,6 +31,8 @@ stdenv.mkDerivation rec {
       mv $out/share/gc $out/share/doc/gc
     '';
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
 
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 3f9ae113f8491..076f43b71f365 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -125,7 +125,7 @@ in
 stdenv.mkDerivation {
   name = "boost-${version}";
 
-  inherit src patches;
+  inherit src patches version;
 
   meta = {
     homepage = http://boost.org/;
diff --git a/pkgs/development/libraries/czmq/3.x.nix b/pkgs/development/libraries/czmq/3.x.nix
index 0b4aeeb0801de..9c9d851342242 100644
--- a/pkgs/development/libraries/czmq/3.x.nix
+++ b/pkgs/development/libraries/czmq/3.x.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
   };
 
+  patches = [ ./czmq3-gcc7.patch ];
+
   # Fix build on Glibc 2.24.
   NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
 
diff --git a/pkgs/development/libraries/czmq/4.x.nix b/pkgs/development/libraries/czmq/4.x.nix
index 971d15686cab5..840fa34d6ae1b 100644
--- a/pkgs/development/libraries/czmq/4.x.nix
+++ b/pkgs/development/libraries/czmq/4.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zeromq }:
+{ stdenv, fetchurl, fetchpatch, zeromq }:
 
 stdenv.mkDerivation rec {
   version = "4.0.2";
@@ -9,6 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "12gbh57xnz2v82x1g80gv4bwapmyzl00lbin5ix3swyac8i7m340";
   };
 
+  patches = [
+    (fetchpatch {
+      url = https://patch-diff.githubusercontent.com/raw/zeromq/czmq/pull/1618.patch;
+      sha256 = "1dssy7k0fni6djail8rz0lk8p777158jvrqhgn500i636gkxaxhp";
+    })
+  ];
+
   # Needs to be propagated for the .pc file to work
   propagatedBuildInputs = [ zeromq ];
 
diff --git a/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/pkgs/development/libraries/czmq/czmq3-gcc7.patch
new file mode 100644
index 0000000000000..4ab14685a6c19
--- /dev/null
+++ b/pkgs/development/libraries/czmq/czmq3-gcc7.patch
@@ -0,0 +1,26 @@
+diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
+index 37dbb4eb..727aaa9b 100644
+--- a/src/zgossip_engine.inc
++++ b/src/zgossip_engine.inc
+@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
+ {
+     if (client) {
+         s_client_t *self = (s_client_t *) client;
+-        snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
++        snprintf (self->log_prefix, sizeof (self->log_prefix),
+             "%6d:%-33s", self->unique_id, string);
+     }
+ }
+diff --git a/src/zsys.c b/src/zsys.c
+index 4d0bb8a1..f07db9c8 100644
+--- a/src/zsys.c
++++ b/src/zsys.c
+@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
+             }
+         }
+         //   We record the current process id in the lock file
+-        char pid_buffer [10];
++        char pid_buffer [32];
+         snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
+         if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
+             zsys_error ("cannot write to lockfile: %s", strerror (errno));
diff --git a/pkgs/development/libraries/eccodes/default.nix b/pkgs/development/libraries/eccodes/default.nix
index 672fed2f015a0..651878182dc1c 100644
--- a/pkgs/development/libraries/eccodes/default.nix
+++ b/pkgs/development/libraries/eccodes/default.nix
@@ -6,11 +6,11 @@
 with stdenv.lib; 
 stdenv.mkDerivation rec {
   name = "eccodes-${version}";
-  version = "2.2.0";
+  version = "2.5.0";
 
   src = fetchurl {
-    url = https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-2.2.0-Source.tar.gz;
-    sha256 = "1hzl0akjfxphqivnaj2kg131w8ki80ba3872h0a45f4pchci4h8s";
+    url = "https://software.ecmwf.int/wiki/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
+    sha256 = "0kiff19gk0w7ij0kx5ydqpsmdq499ylxxxq79lrgss218jy49aqq";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 7894d75fbe676..86f3be15fea6e 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -91,6 +91,7 @@ stdenv.mkDerivation ({
   configureFlags =
     [ "-C"
       "--enable-add-ons"
+      "--enable-obsolete-nsl"
       "--enable-obsolete-rpc"
       "--sysconfdir=/etc"
       "--enable-stackguard-randomization"
diff --git a/pkgs/development/libraries/grantlee/5/setup-hook.sh b/pkgs/development/libraries/grantlee/5/setup-hook.sh
index d11ef5883a1fd..aaa64868dc946 100644
--- a/pkgs/development/libraries/grantlee/5/setup-hook.sh
+++ b/pkgs/development/libraries/grantlee/5/setup-hook.sh
@@ -4,20 +4,14 @@ providesGrantleeRuntime() {
     [ -d "$1/$grantleePluginPrefix" ]
 }
 
-_grantleeCrossEnvHook() {
-    if providesQtRuntime "$1"; then
-        propagatedBuildInputs+=" $1"
-        propagatedUserEnvPkgs+=" $1"
-    fi
-}
-crossEnvHooks+=(_grantleeCrossEnvHook)
-
 _grantleeEnvHook() {
     if providesGrantleeRuntime "$1"; then
-        propagatedNativeBuildInputs+=" $1"
-        if [ -z "$crossConfig" ]; then
+        propagatedBuildInputs+=" $1"
         propagatedUserEnvPkgs+=" $1"
-        fi
     fi
 }
-envHooks+=(_grantleeEnvHook)
+if [ "$crossEnv" ]; then
+    crossEnvHooks+=(_grantleeEnvHook)
+else
+    envHooks+=(_grantleeEnvHook)
+fi
diff --git a/pkgs/development/libraries/grib-api/default.nix b/pkgs/development/libraries/grib-api/default.nix
index f091fedeb2dec..3abea7d2d8c89 100644
--- a/pkgs/development/libraries/grib-api/default.nix
+++ b/pkgs/development/libraries/grib-api/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec{
   name = "grib-api-${version}";
-  version = "1.19.0";
+  version = "1.24.0";
 
   src = fetchurl {
     url = "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-${version}-Source.tar.gz";
-    sha256 = "07cj9mw5bb249lxx1m9nmfdqb8b2a8cm7s6x62cdwca3sp16dv6a";
+    sha256 = "1kbvyzaghbn1bqn97sslskmb6k3ki1dnr0g5abk5sb40n0y483bb";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index 1d0930d8d03c0..c52f30a21f73d 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gettext, perl
+{ stdenv, fetchurl, fetchpatch, pkgconfig, gettext, perl
 , expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, gobjectIntrospection
 , xorg, epoxy, json_glib, libxkbcommon, gmp
 , waylandSupport ? stdenv.isLinux, wayland, wayland-protocols
@@ -13,7 +13,7 @@ with stdenv.lib;
 
 let
   ver_maj = "3.22";
-  ver_min = "24";
+  ver_min = "26";
   version = "${ver_maj}.${ver_min}";
 in
 stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz";
-    sha256 = "cbb16e4cfc928ab8f5f22f7290616f95f6ebc8c97cc724a2007b07ced833592b";
+    sha256 = "61eef0d320e541976e2dfe445729f12b5ade53050ee9de6184235cb60cd4b967";
   };
 
   outputs = [ "out" "dev" ];
@@ -29,7 +29,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection perl ];
 
-  patches = [ ./3.0-immodules.cache.patch ];
+  patches = [
+    ./3.0-immodules.cache.patch
+    (fetchpatch {
+      name = "Xft-setting-fallback-compute-DPI-properly.patch";
+      url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123";
+      sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p";
+    })
+  ];
 
   buildInputs = [ libxkbcommon epoxy json_glib ];
   propagatedBuildInputs = with xorg; with stdenv.lib;
diff --git a/pkgs/development/libraries/kde-frameworks/default.nix b/pkgs/development/libraries/kde-frameworks/default.nix
index 2bf10737ab0b0..08eebfd83aeec 100644
--- a/pkgs/development/libraries/kde-frameworks/default.nix
+++ b/pkgs/development/libraries/kde-frameworks/default.nix
@@ -56,11 +56,7 @@ let
                     # Propagate $dev so that this setup hook is propagated
                     # But only if there is a separate $dev output
                     if [ "$outputDev" != out ]; then
-                        if [ -n "$crossConfig" ]; then
-                          propagatedBuildInputs="$propagatedBuildInputs @dev@"
-                        else
-                          propagatedNativeBuildInputs="$propagatedNativeBuildInputs @dev@"
-                        fi
+                        propagatedBuildInputs="$propagatedBuildInputs @dev@"
                     fi
                 fi
               '';
diff --git a/pkgs/development/libraries/kmsxx/default.nix b/pkgs/development/libraries/kmsxx/default.nix
index 490732c38025a..8be8eb7135726 100644
--- a/pkgs/development/libraries/kmsxx/default.nix
+++ b/pkgs/development/libraries/kmsxx/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchFromGitHub, cmake, pkgconfig, libdrm, python }:
 
 stdenv.mkDerivation rec {
-  name = "kmsxx-2017-10-10";
+  pname = "kmsxx";
+  version = "2017-10-10";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "tomba";
diff --git a/pkgs/development/libraries/libbfd/default.nix b/pkgs/development/libraries/libbfd/default.nix
new file mode 100644
index 0000000000000..700c5a928e554
--- /dev/null
+++ b/pkgs/development/libraries/libbfd/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchurl, autoreconfHook264, bison, binutils-raw
+, libiberty, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "libbfd-${version}";
+  inherit (binutils-raw) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-raw.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libbfd
+  postPatch = ''
+    cd bfd
+  '';
+
+  nativeBuildInputs = [ autoreconfHook264 bison ];
+  buildInputs = [ libiberty zlib ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+    "--with-system-zlib"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library for manipulating containers of machine code";
+    longDescription = ''
+      BFD is a library which provides a single interface to read and write
+      object files, executables, archive files, and core files in any format.
+      It is associated with GNU Binutils, and elsewhere often distributed with
+      it.
+    '';
+    homepage = http://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix
index 1f5ab2cf0969b..6608a3393b122 100644
--- a/pkgs/development/libraries/libiberty/default.nix
+++ b/pkgs/development/libraries/libiberty/default.nix
@@ -1,15 +1,18 @@
-{ stdenv, lib, fetchurl, gcc, staticBuild ? false }:
+{ stdenv, fetchurl, gcc, staticBuild ? false }:
 
 stdenv.mkDerivation rec {
   name = "libiberty-${gcc.cc.version}";
 
   inherit (gcc.cc) src;
 
+  outputs = [ "out" "dev" ];
+
   postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
 
-  configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared";
+  configureFlags = [ "--enable-install-libiberty" ]
+    ++ stdenv.lib.optional (!staticBuild) "--enable-shared";
 
-  postInstall = lib.optionalString (!staticBuild) ''
+  postInstall = stdenv.lib.optionalString (!staticBuild) ''
     cp pic/libiberty.a $out/lib*/libiberty.a
   '';
 
@@ -17,7 +20,7 @@ stdenv.mkDerivation rec {
     homepage = http://gcc.gnu.org/;
     license = licenses.lgpl2;
     description = "Collection of subroutines used by various GNU programs";
-    maintainers = with maintainers; [ abbradar ];
+    maintainers = with maintainers; [ abbradar ericson2314 ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix
index d39a71e16da93..9bf54a115ffd3 100644
--- a/pkgs/development/libraries/libinput/default.nix
+++ b/pkgs/development/libraries/libinput/default.nix
@@ -16,11 +16,11 @@ in
 with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "libinput-${version}";
-  version = "1.9.1";
+  version = "1.9.2";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/libinput/${name}.tar.xz";
-    sha256 = "1y3559146zlfizncky1jlly226i66vwikxhpdkw0jg8v47j0sy7h";
+    sha256 = "0fyy050hzk47g7305lx5pgyh2abvq7qs4xd3nn1is7zy3wj56s6x";
   };
 
   outputs = [ "out" "dev" ];
diff --git a/pkgs/development/libraries/libopcodes/default.nix b/pkgs/development/libraries/libopcodes/default.nix
new file mode 100644
index 0000000000000..f3e12db398194
--- /dev/null
+++ b/pkgs/development/libraries/libopcodes/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, buildPackages
+, fetchurl, autoreconfHook264, bison, binutils-raw
+, libiberty, libbfd
+}:
+
+stdenv.mkDerivation rec {
+  name = "libopcodes-${version}";
+  inherit (binutils-raw) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-raw.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libopcodes
+  postPatch = ''
+    cd opcodes
+    find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
+  '';
+
+  nativeBuildInputs = [ autoreconfHook264 bison buildPackages.stdenv.cc ];
+  buildInputs = [ libiberty ];
+  # dis-asm.h includes bfd.h
+  propagatedBuildInputs = [ libbfd ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    description = "A library from binutils for manipulating machine code";
+    homepage = http://www.gnu.org/software/binutils/;
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index dd2f1edc5f2ae..44638b4dfd590 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit }:
 
 stdenv.mkDerivation rec {
-  name = "libusb-1.0.20";
+  name = "libusb-1.0.21";
 
   src = fetchurl {
     url = "mirror://sourceforge/libusb/${name}.tar.bz2";
-    sha256 = "1zzp6hc7r7m3gl6zjbmzn92zkih4664cckaf49l1g5hapa8721fb";
+    sha256 = "0jw2n5kdnrqvp7zh792fd6mypzzfap6jp4gfcmq4n6c1kb79rkkx";
   };
 
   outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 8dea502a4ff4c..ba745010504b6 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -2,14 +2,14 @@
 , ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
-  version = "1.15.0";
+  version = "1.16.1";
   name = "libuv-${version}";
 
   src = fetchFromGitHub {
     owner = "libuv";
     repo = "libuv";
     rev = "v${version}";
-    sha256 = "092hxqjvbb6d03h3msc38359w2kixba1ansyrsbyqq8iqiqwnkw0";
+    sha256 = "06p3xy276spqbr9xzbs7qlpdk34qsn87s2qmp6xn4j7v3bnqja7z";
   };
 
   postPatch = let
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index bf38a954d60dc..b19f4a2953f16 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -10,11 +10,11 @@ let
 
 in stdenv.mkDerivation rec {
   name = "libxml2-${version}";
-  version = "2.9.5";
+  version = "2.9.7";
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${name}.tar.gz";
-    sha256 = "0f6d5nkvcfx8yqis2dwrnv6qaj0nhiifz49y657vmrwwxvnc2ca0";
+    sha256 = "034hylzspvkm0p4bczqbf8q05a7r2disr8dz725x4bin61ymwg7n";
   };
 
   outputs = [ "bin" "dev" "out" "man" "doc" ]
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index 1c27b6e3233b9..2f9130938734c 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -10,7 +10,9 @@ assert pythonSupport -> libxml2.pythonSupport;
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "libxslt-1.1.29";
+  pname = "libxslt";
+  version = "1.1.29";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "http://xmlsoft.org/sources/${name}.tar.gz";
@@ -51,7 +53,7 @@ stdenv.mkDerivation rec {
     moveToOutput share/man/man1 "$bin"
   '' + optionalString pythonSupport ''
     mkdir -p $py/nix-support
-    echo ${libxml2.py} >> $py/nix-support/propagated-native-build-inputs
+    echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
     moveToOutput lib/python2.7 "$py"
   '';
 
diff --git a/pkgs/development/libraries/lightning/default.nix b/pkgs/development/libraries/lightning/default.nix
index 5868fdf8b63ab..b4a33bbe7df2e 100644
--- a/pkgs/development/libraries/lightning/default.nix
+++ b/pkgs/development/libraries/lightning/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, binutils }:
+{ stdenv, fetchurl, libopcodes }:
 
 with stdenv.lib;
 stdenv.mkDerivation rec {
@@ -11,8 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz";
   };
 
-  # Needs libopcodes.so from binutils for 'make check'
-  buildInputs = [ binutils ];
+  buildInputs = stdenv.lib.optional doCheck libopcodes;
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/physics/rivet/default.nix b/pkgs/development/libraries/physics/rivet/default.nix
index 454c868dfcd2a..3e80e57585222 100644
--- a/pkgs/development/libraries/physics/rivet/default.nix
+++ b/pkgs/development/libraries/physics/rivet/default.nix
@@ -11,8 +11,6 @@ stdenv.mkDerivation rec {
 
   postPatch = "patchShebangs ./src/Analyses/cat_with_lines";
 
-  pythonPath = []; # python wrapper support
-
   patches = [
     ./darwin.patch # configure relies on impure sw_vers to -Dunix
   ];
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 c9679d227d889..f5bce5fb29971 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -164,7 +164,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ perl pkgconfig which ];
 
-  enableParallelBuilding = false;
+  enableParallelBuilding = true;
 
   NIX_CFLAGS_COMPILE =
     optionalString stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
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 258b2d09f20b5..8ec7eeda8aee7 100644
--- a/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
+++ b/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -33,29 +33,20 @@ addToQMAKEPATH() {
 # package depending on the building package. (This is necessary in case
 # the building package does not provide runtime dependencies itself and so
 # would not be propagated to the user environment.)
-qtCrossEnvHook() {
-    addToQMAKEPATH "$1"
-    if providesQtRuntime "$1"; then
-        if [ "z${!outputBin}" != "z${!outputDev}" ]; then
-            propagatedBuildInputs+=" $1"
-        fi
-        propagatedUserEnvPkgs+=" $1"
-    fi
-}
-crossEnvHooks+=(qtCrossEnvHook)
-
 qtEnvHook() {
     addToQMAKEPATH "$1"
     if providesQtRuntime "$1"; then
         if [ "z${!outputBin}" != "z${!outputDev}" ]; then
-            propagatedNativeBuildInputs+=" $1"
+            propagatedBuildInputs+=" $1"
         fi
-        if [ -z "$crossConfig" ]; then
         propagatedUserEnvPkgs+=" $1"
-        fi
     fi
 }
-envHooks+=(qtEnvHook)
+if [ "$crossConfig" ]; then
+   crossEnvHooks+=(qtEnvHook)
+else
+   envHooks+=(qtEnvHook)
+fi
 
 postPatchMkspecs() {
     local bin="${!outputBin}"
diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix
index c6797ef05ac38..7fad5c312a01c 100644
--- a/pkgs/development/libraries/science/math/atlas/default.nix
+++ b/pkgs/development/libraries/science/math/atlas/default.nix
@@ -100,6 +100,10 @@ stdenv.mkDerivation {
     fi
   '';
 
+  # 1. /buildATLAS/build/bin/ATLrun.sh: multiple segfaults.
+  # 2. "atlas does its own parallel builds"
+  enableParallelBuilding = false;
+
   meta = {
     homepage = http://math-atlas.sourceforge.net/;
     description = "Automatically Tuned Linear Algebra Software (ATLAS)";
diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix
index 836a4527b5081..5def37b791cfd 100644
--- a/pkgs/development/libraries/wayland/default.nix
+++ b/pkgs/development/libraries/wayland/default.nix
@@ -8,11 +8,11 @@ assert expat != null;
 
 stdenv.mkDerivation rec {
   name = "wayland-${version}";
-  version = "1.12.0";
+  version = "1.14.0";
 
   src = fetchurl {
     url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "d6b4135cba0188abcb7275513c72dede751d6194f6edc5b82183a3ba8b821ab1";
+    sha256 = "1f3sla6h0bw15fz8pjc67jhwj7pwmfdc7qlj42j5k9v116ycm07d";
   };
 
   configureFlags = [ "--with-scanner" "--disable-documentation" ];
diff --git a/pkgs/development/libraries/wayland/protocols.nix b/pkgs/development/libraries/wayland/protocols.nix
index 436de5609e5a1..5b1495ccbe1a9 100644
--- a/pkgs/development/libraries/wayland/protocols.nix
+++ b/pkgs/development/libraries/wayland/protocols.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "wayland-protocols-${version}";
-  version = "1.10";
+  version = "1.11";
 
   src = fetchurl {
     url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "5719c51d7354864983171c5083e93a72ac99229e2b460c4bb10513de08839c0a";
+    sha256 = "0138psvx6fv8z5x2p6xi4iij6m5k62c0qyfsb45xgcf5a4fyxz1s";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh
index 9ee8be87c028d..09b50e564110a 100644
--- a/pkgs/development/perl-modules/generic/builder.sh
+++ b/pkgs/development/perl-modules/generic/builder.sh
@@ -34,8 +34,8 @@ postFixup() {
     # dependencies in the user environment (since Perl modules don't
     # have something like an RPATH, so the only way to find the
     # dependencies is to have them in the PERL5LIB variable).
-    if test -e $out/nix-support/propagated-native-build-inputs; then
-        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
+    if test -e $out/nix-support/propagated-build-inputs; then
+        ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
     fi
 }
 
diff --git a/pkgs/development/python-modules/absl-py/default.nix b/pkgs/development/python-modules/absl-py/default.nix
index 3f37820fd35fa..1c9fa3d786fb3 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.3";
+  version = "0.1.5";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "017wc85i7l3vpjzw3shgb7k7n0jfid88g09dlf1kgdy4ll0sjfax";
+    sha256 = "94943ed0cd77077fe2d18e79b2f28d3e92f585f7d1c6edc75e640121f3c5d580";
   };
 
   propagatedBuildInputs = [ six ];
diff --git a/pkgs/development/python-modules/aiohttp/default.nix b/pkgs/development/python-modules/aiohttp/default.nix
index 5f87580643f69..53443b3b32faf 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.2";
+  version = "2.3.3";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "42373fbdbe8f09233c17e74f53cee877bc7d5b495b4fc14c32a119255e85e736";
+    sha256 = "0a2e33e90560dacb819b095b9d9611597925d75d1b93dd9490055d3826d98a82";
   };
 
   disabled = pythonOlder "3.4";
diff --git a/pkgs/development/python-modules/arelle/default.nix b/pkgs/development/python-modules/arelle/default.nix
index 3c4d802718e8a..862564dbcd156 100644
--- a/pkgs/development/python-modules/arelle/default.nix
+++ b/pkgs/development/python-modules/arelle/default.nix
@@ -5,8 +5,9 @@
   ... }:
 
 buildPythonPackage rec {
-  name = "arelle-${version}${lib.optionalString (!gui) "-headless"}";
+  pname = "arelle-${version}${lib.optionalString (!gui) "-headless"}";
   version = "2017-08-24";
+  name = pname + "-" + version;
 
   disabled = !isPy3k;
 
diff --git a/pkgs/development/python-modules/argcomplete/default.nix b/pkgs/development/python-modules/argcomplete/default.nix
index a4318fe5fa45f..37164cb427606 100644
--- a/pkgs/development/python-modules/argcomplete/default.nix
+++ b/pkgs/development/python-modules/argcomplete/default.nix
@@ -4,11 +4,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "argcomplete";
-  version = "1.9.2";
+  version = "1.9.3";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "d6ea272a93bb0387f758def836e73c36fff0c54170258c212de3e84f7db8d5ed";
+    sha256 = "d97b7f3cfaa4e494ad59ed6d04c938fc5ed69b590bd8f53274e258fb1119bd1b";
   };
 
   doCheck = false; # bash-completion test fails with "compgen: command not found".
diff --git a/pkgs/development/python-modules/asn1ate/default.nix b/pkgs/development/python-modules/asn1ate/default.nix
index ce07c23762456..7605e2c308586 100644
--- a/pkgs/development/python-modules/asn1ate/default.nix
+++ b/pkgs/development/python-modules/asn1ate/default.nix
@@ -4,7 +4,8 @@
 buildPythonPackage rec {
   pname = "asn1ate";
   date = "20160810";
-  name = "${pname}-unstable-${date}";
+  version = "unstable-${date}";
+  name = "${pname}-${version}";
 
   src = fetchFromGitHub {
     sha256 = "04pddr1mh2v9qq8fg60czwvjny5qwh4nyxszr3qc4bipiiv2xk9w";
diff --git a/pkgs/development/python-modules/augeas/default.nix b/pkgs/development/python-modules/augeas/default.nix
index 8934e1b81a81b..def46c7fccc11 100644
--- a/pkgs/development/python-modules/augeas/default.nix
+++ b/pkgs/development/python-modules/augeas/default.nix
@@ -1,7 +1,8 @@
 { stdenv, lib, buildPythonPackage, fetchFromGitHub, augeas, cffi }:
 buildPythonPackage rec {
-    name = "augeas-${version}";
+    pname = "augeas";
     version = "1.0.2";
+    name = pname + "-" + version;
 
     src = fetchFromGitHub {
       owner = "hercules-team";
diff --git a/pkgs/development/python-modules/bash_kernel/default.nix b/pkgs/development/python-modules/bash_kernel/default.nix
new file mode 100644
index 0000000000000..f35d8fae690c3
--- /dev/null
+++ b/pkgs/development/python-modules/bash_kernel/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, fetchpatch
+, ipykernel
+, isPy27
+, pexpect
+}:
+buildPythonPackage rec {
+  pname = "bash_kernel";
+  version = "0.7.1";
+  name = "${pname}-${version}";
+  format = "flit";
+  disabled = isPy27;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1s2kc7m52kq28b4j1q3456g5ani6nmq4n0rpbqi3yvh7ks0rby19";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/takluyver/bash_kernel/pull/69.diff";
+      sha256 = "1qd7qjjmcph4dk6j0bl31h2fdmfiyyazvrc9xqqj8y21ki2sl33j";
+    })
+  ];
+
+  propagatedBuildInputs = [ ipykernel pexpect ];
+
+  doCheck = false;
+
+  preBuild = ''
+    mkdir tmp
+    export HOME=$PWD/tmp
+  '';
+
+  postInstall = ''
+    python -m bash_kernel.install --prefix $out
+  '';
+
+  meta = {
+    description = "Bash Kernel for Jupyter";
+    homepage = "https://github.com/takluyver/bash_kernel";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ zimbatm ];
+  };
+}
diff --git a/pkgs/development/python-modules/blockdiag/default.nix b/pkgs/development/python-modules/blockdiag/default.nix
index fed6f6e9219e7..fde330d706f7b 100644
--- a/pkgs/development/python-modules/blockdiag/default.nix
+++ b/pkgs/development/python-modules/blockdiag/default.nix
@@ -3,8 +3,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "blockdiag-${version}";
+  pname = "blockdiag";
   version = "1.5.3";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "https://bitbucket.org/blockdiag/blockdiag/get/${version}.tar.bz2";
diff --git a/pkgs/development/python-modules/bokeh/default.nix b/pkgs/development/python-modules/bokeh/default.nix
index 61bfe7121cb93..244ee43d0aabe 100644
--- a/pkgs/development/python-modules/bokeh/default.nix
+++ b/pkgs/development/python-modules/bokeh/default.nix
@@ -78,5 +78,6 @@ buildPythonPackage rec {
     description = "Statistical and novel interactive HTML plots for Python";
     homepage = "http://github.com/bokeh/bokeh";
     license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ orivej ];
   };
 }
diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix
index 0cb817844c774..9ff0b144f100d 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 = "36.4.0";
+    version = "36.7.1";
     format = "wheel";
-    sha256 = "4d54c0bfee283e78609169213f9c075827d5837086f58b588b417b093c23464b";
+    sha256 = "eaacfa35eb11199d0b017df416421781a75209817bff3f94820556e36c49bd77";
   };
 
   # TODO: Shouldn't be necessary anymore for pip > 9.0.1!
diff --git a/pkgs/development/python-modules/bottleneck/default.nix b/pkgs/development/python-modules/bottleneck/default.nix
index 4eb5bcb6edc95..791b05e81cad2 100644
--- a/pkgs/development/python-modules/bottleneck/default.nix
+++ b/pkgs/development/python-modules/bottleneck/default.nix
@@ -8,8 +8,9 @@
 
 buildPythonPackage rec {
   pname = "Bottleneck";
-  name = "Bottleneck-${version}";
   version = "1.2.1";
+  name = pname + "-" + version;
+
   src = fetchPypi {
     inherit pname version;
     sha256 = "6efcde5f830aed64feafca0359b51db0e184c72af8ba6675b4a99f263922eb36";
@@ -23,4 +24,4 @@ buildPythonPackage rec {
   postPatch = ''
     substituteInPlace setup.py --replace "__builtins__.__NUMPY_SETUP__ = False" ""
   '';
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/cffi/default.nix b/pkgs/development/python-modules/cffi/default.nix
index b0524b4121adf..f8e313d660ebc 100644
--- a/pkgs/development/python-modules/cffi/default.nix
+++ b/pkgs/development/python-modules/cffi/default.nix
@@ -17,6 +17,20 @@ if isPyPy then null else buildPythonPackage rec {
   propagatedBuildInputs = [ libffi pycparser ];
   buildInputs = [ pytest ];
 
+  # On Darwin, the cffi tests want to hit libm a lot, and look for it in a global
+  # impure search path. It's obnoxious how much repetition there is, and how difficult
+  # it is to get it to search somewhere else (since we do actually have a libm symlink in libSystem)
+  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    substituteInPlace testing/cffi0/test_parsing.py \
+      --replace 'lib_m = "m"' 'lib_m = "System"' \
+      --replace '"libm" in name' '"libSystem" in name'
+    substituteInPlace testing/cffi0/test_unicode_literals.py --replace 'lib_m = "m"' 'lib_m = "System"'
+    substituteInPlace testing/cffi0/test_zdistutils.py --replace 'self.lib_m = "m"' 'self.lib_m = "System"'
+    substituteInPlace testing/cffi1/test_recompiler.py --replace 'lib_m = "m"' 'lib_m = "System"'
+    substituteInPlace testing/cffi0/test_function.py --replace "lib_m = 'm'" "lib_m = 'System'"
+    substituteInPlace testing/cffi0/test_verify.py --replace "lib_m = ['m']" "lib_m = ['System']"
+  '';
+
   # The tests use -Werror but with python3.6 clang detects some unreachable code.
   NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.cc.isClang [ "-Wno-unused-command-line-argument" "-Wno-unreachable-code" ];
 
diff --git a/pkgs/development/python-modules/cgroup-utils/default.nix b/pkgs/development/python-modules/cgroup-utils/default.nix
index e565e23458ca6..2c97cbd4a3349 100644
--- a/pkgs/development/python-modules/cgroup-utils/default.nix
+++ b/pkgs/development/python-modules/cgroup-utils/default.nix
@@ -2,7 +2,8 @@
 
 buildPythonPackage rec {
   version = "0.6";
-  name = "cgroup-utils-${version}";
+  pname = "cgroup-utils";
+  name = pname + "-" + version;
 
   buildInputs = [ pep8 nose ];
   # Pep8 tests fail...
diff --git a/pkgs/development/python-modules/construct/default.nix b/pkgs/development/python-modules/construct/default.nix
index 9d8e61d1f4500..78aa0aab5c081 100644
--- a/pkgs/development/python-modules/construct/default.nix
+++ b/pkgs/development/python-modules/construct/default.nix
@@ -1,8 +1,9 @@
 { stdenv, buildPythonPackage, fetchFromGitHub, six, pythonOlder }:
 
 buildPythonPackage rec {
-  name = "construct-${version}";
+  pname = "construct";
   version = "2.8.16";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "construct";
diff --git a/pkgs/development/python-modules/coverage/default.nix b/pkgs/development/python-modules/coverage/default.nix
index 137cef06b9e20..1c58ecb9aa614 100644
--- a/pkgs/development/python-modules/coverage/default.nix
+++ b/pkgs/development/python-modules/coverage/default.nix
@@ -7,12 +7,12 @@
 
 buildPythonPackage rec {
   pname = "coverage";
-  version = "4.4.1";
+  version = "4.4.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "7a9c44400ee0f3b4546066e0710e1250fd75831adc02ab99dda176ad8726f424";
+    sha256 = "309d91bd7a35063ec7a0e4d75645488bfab3f0b66373e7722f23da7f5b0f34cc";
   };
 
   # No tests in archive
diff --git a/pkgs/development/python-modules/cufflinks/default.nix b/pkgs/development/python-modules/cufflinks/default.nix
index 620f85e436d3f..6ecad9a160e2f 100644
--- a/pkgs/development/python-modules/cufflinks/default.nix
+++ b/pkgs/development/python-modules/cufflinks/default.nix
@@ -3,12 +3,12 @@
 
 buildPythonPackage rec {
   pname = "cufflinks";
-  version = "0.12.0";
+  version = "0.12.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "04ninvwm6277n3hqc17ririss90cd832wza3q3vf115rrrds3xyy";
+    sha256 = "8f11e4b6326cc5b2a18011c09fb64f178ba21002f337fd305f64818012a6c679";
   };
 
   propagatedBuildInputs = [ pandas plotly colorlover ];
diff --git a/pkgs/development/python-modules/cymem/default.nix b/pkgs/development/python-modules/cymem/default.nix
index f2c6c649a837d..8033fa96113e8 100644
--- a/pkgs/development/python-modules/cymem/default.nix
+++ b/pkgs/development/python-modules/cymem/default.nix
@@ -5,8 +5,9 @@
 , python
 }:
 buildPythonPackage rec {
-  name = "cymem-${version}";
+  pname = "cymem";
   version = "1.31.2";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "explosion";
@@ -16,14 +17,14 @@ buildPythonPackage rec {
   };
 
   propagatedBuildInputs = [
-   cython   
+   cython
   ];
-    
+
   checkPhase = ''
     cd cymem/tests
     ${python.interpreter} -m unittest discover -p "*test*"
   '';
-  
+
   meta = with stdenv.lib; {
     description = "Cython memory pool for RAII-style memory management";
     homepage = https://github.com/explosion/cymem;
diff --git a/pkgs/development/python-modules/django-hijack/default.nix b/pkgs/development/python-modules/django-hijack/default.nix
index 8eb98924491ac..b779d01c9353c 100644
--- a/pkgs/development/python-modules/django-hijack/default.nix
+++ b/pkgs/development/python-modules/django-hijack/default.nix
@@ -2,8 +2,9 @@
   django, django_compat, django_nose
 }:
 buildPythonPackage rec {
-  name = "django-hijack-${version}";
+  pname = "django-hijack";
   version = "2.1.4";
+  name = pname + "-" + version;
 
   # the pypi packages don't include everything required for the tests
   src = fetchFromGitHub {
@@ -36,4 +37,4 @@ buildPythonPackage rec {
     license = licenses.mit;
     maintainers = with maintainers; [ ris ];
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/djangorestframework/default.nix b/pkgs/development/python-modules/djangorestframework/default.nix
index 62e291306d8c4..e2c8acd1a0b16 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.1";
+  version = "3.7.3";
   pname = "djangorestframework";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/d/djangorestframework/${name}.tar.gz";
-    sha256 = "305b2c6564ca46d3b558ba21110ed717135c467adf1a6dfd192bd85f4bb04d50";
+    sha256 = "067960e5e9e5586d3b2d53a1d626c4800dc33cd8309487d404fc63355674556f";
   };
 
   # Test settings are missing
diff --git a/pkgs/development/python-modules/dkimpy/default.nix b/pkgs/development/python-modules/dkimpy/default.nix
index 30baed39bd6fb..91d5a17960d83 100644
--- a/pkgs/development/python-modules/dkimpy/default.nix
+++ b/pkgs/development/python-modules/dkimpy/default.nix
@@ -2,10 +2,11 @@
 , pytest, dns }:
 
 buildPythonApplication rec {
-  name = "${pname}-${majorversion}.${minorversion}";
+  name = "${pname}-${version}";
   pname = "dkimpy";
   majorversion = "0.6";
   minorversion = "2";
+  version = "${majorversion}.${minorversion}";
 
   src = fetchurl {
     url = "https://launchpad.net/${pname}/${majorversion}/${majorversion}.${minorversion}/+download/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/dulwich/default.nix b/pkgs/development/python-modules/dulwich/default.nix
index 422674152a689..13bcb64718695 100644
--- a/pkgs/development/python-modules/dulwich/default.nix
+++ b/pkgs/development/python-modules/dulwich/default.nix
@@ -3,13 +3,13 @@
 , git, glibcLocales }:
 
 buildPythonPackage rec {
-  version = "0.18.5";
+  version = "0.18.6";
   pname = "dulwich";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/d/dulwich/${name}.tar.gz";
-    sha256 = "838bac318fd0ed79e0eedb6cfd53b6424dc618fec6b99dc959881b12da7bd6e0";
+    sha256 = "38a04406bc68315794c3bab37c7d4ed137fb8a839482d8894e72b0d9b3eb41a9";
   };
 
   LC_ALL = "en_US.UTF-8";
diff --git a/pkgs/development/python-modules/ecpy/default.nix b/pkgs/development/python-modules/ecpy/default.nix
index 6fd445a89f5a9..25ca8dabf2bff 100644
--- a/pkgs/development/python-modules/ecpy/default.nix
+++ b/pkgs/development/python-modules/ecpy/default.nix
@@ -5,11 +5,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "ECPy";
-  version = "0.8.1";
+  version = "0.8.2";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "0ab60sx4bbsmccwmdvz1023r0cbzi4phar4ipzn5npdj5gw1ny4l";
+    sha256 = "0509a90714448ef47ef727cb7aee3415995c883c945e972521b5838fa4c50e24";
   };
 
   buildInputs = [ hidapi pycrypto pillow protobuf future ];
diff --git a/pkgs/development/python-modules/faker/default.nix b/pkgs/development/python-modules/faker/default.nix
index 02926e0fd7438..3c95a26881e8c 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.6";
+  version = "0.8.7";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "3c98dd04bba667ecfddb77fcd0dfd19b376b258d21beeaf5b95578826e275a83";
+    sha256 = "bf7dabcd6807c8829da28a4de491adf7998af506b8571db6a6eb58161157248a";
   };
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/first/default.nix b/pkgs/development/python-modules/first/default.nix
index 5ecbff90442d4..16c1d79d767a5 100644
--- a/pkgs/development/python-modules/first/default.nix
+++ b/pkgs/development/python-modules/first/default.nix
@@ -1,10 +1,9 @@
 { stdenv, buildPythonPackage, fetchPypi }:
-let
+
+buildPythonPackage rec {
   pname = "first";
   version = "2.0.1";
-in
-buildPythonPackage {
-  name = "${pname}-${version}";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/geopandas/default.nix b/pkgs/development/python-modules/geopandas/default.nix
index f8f54e0e4294f..cab25a60f3b43 100644
--- a/pkgs/development/python-modules/geopandas/default.nix
+++ b/pkgs/development/python-modules/geopandas/default.nix
@@ -3,8 +3,9 @@
 , pytest }:
 
 buildPythonPackage rec {
-  name = "geopandas-${version}";
+  pname = "geopandas";
   version = "0.3.0";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "geopandas";
diff --git a/pkgs/development/python-modules/gevent/default.nix b/pkgs/development/python-modules/gevent/default.nix
index 8a3d3b3d09b79..6b94652402e39 100644
--- a/pkgs/development/python-modules/gevent/default.nix
+++ b/pkgs/development/python-modules/gevent/default.nix
@@ -1,20 +1,15 @@
 { stdenv, fetchurl, buildPythonPackage, isPyPy, python, libev, greenlet }:
 
 buildPythonPackage rec {
-  name = "gevent-1.1.2";
+  pname = "gevent";
+  version = "1.2.2";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/g/gevent/${name}.tar.gz";
-    sha256 = "cb15cf73d69a2eeefed330858f09634e2c50bf46da9f9e7635730fcfb872c02c";
+    sha256 = "0bbbjvi423y9k9xagrcsimnayaqymg6f2dj76m9z3mjpkjpci4a7";
   };
 
-  # Why do we have this patch?
-  postPatch = ''
-    substituteInPlace libev/ev.c --replace \
-      "ecb_inline void ecb_unreachable (void) ecb_noreturn" \
-      "ecb_inline ecb_noreturn void ecb_unreachable (void)"
-  '';
-
   buildInputs = [ libev ];
   propagatedBuildInputs = stdenv.lib.optionals (!isPyPy) [ greenlet ];
 
diff --git a/pkgs/development/python-modules/gflags/default.nix b/pkgs/development/python-modules/gflags/default.nix
index f73ff2b4686d6..6fe4b7fcab874 100644
--- a/pkgs/development/python-modules/gflags/default.nix
+++ b/pkgs/development/python-modules/gflags/default.nix
@@ -2,7 +2,8 @@
 
 buildPythonPackage rec {
   version = "3.1.2";
-  name = "gflags-${version}";
+  pname = "gflags";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit version;
diff --git a/pkgs/development/python-modules/hmmlearn/default.nix b/pkgs/development/python-modules/hmmlearn/default.nix
index eeb0424521558..3295786bd08cd 100644
--- a/pkgs/development/python-modules/hmmlearn/default.nix
+++ b/pkgs/development/python-modules/hmmlearn/default.nix
@@ -1,8 +1,9 @@
 { lib, fetchurl, buildPythonPackage, numpy }:
 
 buildPythonPackage rec {
-  name = "hmmlearn-${version}";
+  pname = "hmmlearn";
   version = "0.2.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/h/hmmlearn/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/hyperlink/default.nix b/pkgs/development/python-modules/hyperlink/default.nix
index ca09c271ddace..9886f705d5484 100644
--- a/pkgs/development/python-modules/hyperlink/default.nix
+++ b/pkgs/development/python-modules/hyperlink/default.nix
@@ -1,11 +1,13 @@
 { stdenv, buildPythonPackage, fetchurl, pytest }:
+
 buildPythonPackage rec {
-  name = "hyperlink-${version}";
-  version = "17.3.0";
+  pname = "hyperlink";
+  version = "17.3.1";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/h/hyperlink/${name}.tar.gz";
-    sha256 = "06mgnxwjzx8hv34bifc7jvgxz21ixhk5s6xy2kd84hdrlbfvpbfx";
+    sha256 = "bc4ffdbde9bdad204d507bd8f554f16bba82dd356f6130cb16f41422909c33bc";
   };
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/ipywidgets/default.nix b/pkgs/development/python-modules/ipywidgets/default.nix
index 14b03e5e282a5..3d15632349104 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.3";
+  version = "7.0.5";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "f98b4c3719097c9d2e6489f303db520b20bd4de3e0b1d6d4f92f81bfe3c2a0c8";
+    sha256 = "321be3dc48193130ba16e8080172bb5cd052eb65e3ad0ea7b5f80ff73e24bc54";
   };
 
   # Tests are not distributed
diff --git a/pkgs/development/python-modules/jedi/default.nix b/pkgs/development/python-modules/jedi/default.nix
index 6cdf784dc3ba1..bf9f9f9c08239 100644
--- a/pkgs/development/python-modules/jedi/default.nix
+++ b/pkgs/development/python-modules/jedi/default.nix
@@ -10,6 +10,10 @@ buildPythonPackage rec {
     sha256 = "f6d5973573e76b1fd2ea75f6dcd6445d02d41ff3af5fc61b275b4e323d1dd396";
   };
 
+  postPatch = ''
+    substituteInPlace requirements.txt --replace "parso==0.1.0" "parso"
+  '';
+
   checkInputs = [ pytest glibcLocales tox pytestcov ];
 
   propagatedBuildInputs = [ parso ];
diff --git a/pkgs/development/python-modules/keras/default.nix b/pkgs/development/python-modules/keras/default.nix
index c2d5362b134ba..d88b6e4999b22 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.0.9";
+  version = "2.1.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "6b8572cf1b4a22fd0120b7c23382ba4fa04a6f0397e02af1249be9a7309d1767";
+    sha256 = "f0ca2458c60d9711edf4291230b31795307ad3781cb6232ff4792b53c8f55123";
   };
 
   checkInputs = [
diff --git a/pkgs/development/python-modules/keystoneclient/default.nix b/pkgs/development/python-modules/keystoneclient/default.nix
index 5b09992295f7a..a856f4db793f6 100644
--- a/pkgs/development/python-modules/keystoneclient/default.nix
+++ b/pkgs/development/python-modules/keystoneclient/default.nix
@@ -9,8 +9,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "keystoneclient-${version}";
+  pname = "keystoneclient";
   version = "1.8.1";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "openstack";
diff --git a/pkgs/development/python-modules/keyutils/default.nix b/pkgs/development/python-modules/keyutils/default.nix
index 2746f16166827..04b9e9235750f 100644
--- a/pkgs/development/python-modules/keyutils/default.nix
+++ b/pkgs/development/python-modules/keyutils/default.nix
@@ -1,9 +1,8 @@
 { lib, buildPythonPackage, fetchurl, pkgs, pytestrunner }:
 
-let
+buildPythonPackage rec {
   pname = "keyutils";
   version = "0.5";
-in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
diff --git a/pkgs/development/python-modules/libgpuarray/default.nix b/pkgs/development/python-modules/libgpuarray/default.nix
index 3c24c2ed24cbc..67353a32ada61 100644
--- a/pkgs/development/python-modules/libgpuarray/default.nix
+++ b/pkgs/development/python-modules/libgpuarray/default.nix
@@ -1,4 +1,4 @@
-{ stdenv 
+{ stdenv
 , lib
 , buildPythonPackage
 , fetchFromGitHub
@@ -11,18 +11,19 @@
 , python
 , cudaSupport ? false, cudatoolkit
 , openclSupport ? true, ocl-icd, clblas
-}: 
+}:
 
 buildPythonPackage rec {
-  name = "libgpuarray-${version}";
+  pname = "libgpuarray";
   version = "0.6.9";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
-    owner = "Theano"; 
+    owner = "Theano";
     repo = "libgpuarray";
     rev = "v${version}";
     sha256 = "06z47ls42a37gbv0x7f3l1qvils7q0hvy02s95l530klgibp19s0";
-  }; 
+  };
 
   # requires a GPU
   doCheck = false;
@@ -43,7 +44,7 @@ buildPythonPackage rec {
     export NIX_CFLAGS_COMPILE="-L $out/lib -I $out/include $NIX_CFLAGS_COMPILE"
 
     cd ..
-  ''; 
+  '';
 
   postFixup = ''
     rm $out/lib/libgpuarray-static.a
@@ -64,11 +65,11 @@ buildPythonPackage rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ 
-    cmake 
-    cython 
+  buildInputs = [
+    cmake
+    cython
     nose
-  ]; 
+  ];
 
   meta = with stdenv.lib; {
     homepage = "https://github.com/Theano/libgpuarray";
diff --git a/pkgs/development/python-modules/libtmux/default.nix b/pkgs/development/python-modules/libtmux/default.nix
index b9404ab5ec313..57f8d2c8114e4 100644
--- a/pkgs/development/python-modules/libtmux/default.nix
+++ b/pkgs/development/python-modules/libtmux/default.nix
@@ -3,11 +3,11 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "libtmux";
-  version = "0.7.5";
+  version = "0.7.7";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "12e5006e59b7d98af5d1a9294f9c8ff2829ac2c1c6ae23dc73c280100b15f485";
+    sha256 = "5670c8da8d0192d932ac1e34f010e0eeb098cdb2af6daad0307b5418e7a37733";
   };
 
   buildInputs = [ pytest_29 ];
diff --git a/pkgs/development/python-modules/llfuse/default.nix b/pkgs/development/python-modules/llfuse/default.nix
index 7c907d1e5ef33..4c4c89d8f196f 100644
--- a/pkgs/development/python-modules/llfuse/default.nix
+++ b/pkgs/development/python-modules/llfuse/default.nix
@@ -3,7 +3,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "llfuse-1.0";
+  pname = "llfuse";
+  version = "1.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/l/llfuse/${name}.tar.bz2";
diff --git a/pkgs/development/python-modules/locustio/default.nix b/pkgs/development/python-modules/locustio/default.nix
new file mode 100644
index 0000000000000..0e9386f667c54
--- /dev/null
+++ b/pkgs/development/python-modules/locustio/default.nix
@@ -0,0 +1,32 @@
+{ buildPythonPackage
+, fetchPypi
+, mock
+, unittest2
+, msgpack
+, requests
+, flask
+, gevent
+, pyzmq
+}:
+
+buildPythonPackage rec {
+  pname = "locustio";
+  version = "0.8.1";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "64583987ba1c330bb071aee3e29d2eedbfb7c8b342fa064bfb74fafcff660d61";
+  };
+
+  patchPhase = ''
+    sed -i s/"pyzmq=="/"pyzmq>="/ setup.py
+  '';
+
+  propagatedBuildInputs = [ msgpack requests flask gevent pyzmq ];
+  buildInputs = [ mock unittest2 ];
+
+  meta = {
+    homepage = http://locust.io/;
+    description = "A load testing tool";
+  };
+}
diff --git a/pkgs/development/python-modules/markdown2/default.nix b/pkgs/development/python-modules/markdown2/default.nix
index f614eb0747bba..2b576cd3b056a 100644
--- a/pkgs/development/python-modules/markdown2/default.nix
+++ b/pkgs/development/python-modules/markdown2/default.nix
@@ -2,12 +2,12 @@
 
 buildPythonPackage rec {
   pname = "markdown2";
-  version = "2.3.4";
+  version = "2.3.5";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://pypi/m/markdown2/${name}.zip";
-    sha256 = "264731e7625402227ff6fb01f2d814882da7705432659a18a419c508e8bfccb1";
+    sha256 = "8bb9a24eb2aa02f1427aabe46483f0f0215ab18c8a345315ae8e2ee3c3a09c03";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/murmurhash/default.nix b/pkgs/development/python-modules/murmurhash/default.nix
index aa5e3358866d7..023c94cdc8eab 100644
--- a/pkgs/development/python-modules/murmurhash/default.nix
+++ b/pkgs/development/python-modules/murmurhash/default.nix
@@ -6,25 +6,26 @@
 }:
 
 buildPythonPackage rec {
-  name = "murmurhash-${version}";
+  pname = "murmurhash";
   version = "0.26.4";
-  
+  name = pname + "-" + version;
+
   src = fetchFromGitHub {
     owner = "explosion";
     repo = "murmurhash";
     rev = "0.26.4";
-    sha256 = "0n2j0glhlv2yh3fjgbg4d79j1c1fpchgjd4vnpw908l9mzchhmdv";    
+    sha256 = "0n2j0glhlv2yh3fjgbg4d79j1c1fpchgjd4vnpw908l9mzchhmdv";
   };
 
   buildInputs = [
    cython
   ];
-  
+
   checkPhase = ''
     cd murmurhash/tests
     ${python.interpreter} -m unittest discover -p "*test*"
   '';
-  
+
   meta = with stdenv.lib; {
     description = "Cython bindings for MurmurHash2";
     homepage = https://github.com/explosion/murmurhash;
diff --git a/pkgs/development/python-modules/natsort/default.nix b/pkgs/development/python-modules/natsort/default.nix
index 7041768c20978..4fc1f7255c605 100644
--- a/pkgs/development/python-modules/natsort/default.nix
+++ b/pkgs/development/python-modules/natsort/default.nix
@@ -18,7 +18,7 @@
 buildPythonPackage rec {
   name = "${pname}-${version}";
   pname = "natsort";
-  version = "5.1.0";
+  version = "5.1.1";
 
   buildInputs = [
     hypothesis
@@ -36,7 +36,7 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "5db0fd17c9f8ef3d54962a6e46159ce4807c630f0931169cd15ce54f2ac395b9";
+    sha256 = "9ffbfb74bf3fc3905be1b9b052ed865675651e38fcd972ed1ed5c64a02f93cbd";
   };
 
   # do not run checks on nix_run_setup.py
diff --git a/pkgs/development/python-modules/nilearn/default.nix b/pkgs/development/python-modules/nilearn/default.nix
index f5dc7607e2d27..16036a6917910 100644
--- a/pkgs/development/python-modules/nilearn/default.nix
+++ b/pkgs/development/python-modules/nilearn/default.nix
@@ -4,7 +4,7 @@
 buildPythonPackage rec {
   pname = "nilearn";
   version = "0.3.1";
-  name = "nilearn-${version}";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/nwdiag/default.nix b/pkgs/development/python-modules/nwdiag/default.nix
index ebf7ce944c110..2b37bab525e76 100644
--- a/pkgs/development/python-modules/nwdiag/default.nix
+++ b/pkgs/development/python-modules/nwdiag/default.nix
@@ -3,11 +3,13 @@
 }:
 
 buildPythonPackage rec {
-  name = "nwdiag-1.0.3";
+  pname = "nwdiag";
+  version = "1.0.4";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/n/nwdiag/${name}.tar.gz";
-    sha256 = "0n7ary1fngxk8bk15vabc8fhnmxlh098piciwaviwn7l4a5q1zys";
+    sha256 = "002565875559789a2dfc5f578c07abdf44269c3f7cdf78d4809bdc4bdc2213fa";
   };
 
   buildInputs = [ pep8 nose unittest2 docutils ];
diff --git a/pkgs/development/python-modules/parso/default.nix b/pkgs/development/python-modules/parso/default.nix
index 26617826e1245..17e3f9fcf3e55 100644
--- a/pkgs/development/python-modules/parso/default.nix
+++ b/pkgs/development/python-modules/parso/default.nix
@@ -6,12 +6,12 @@
 
 buildPythonPackage rec {
   pname = "parso";
-  version = "0.1.0";
+  version = "0.1.1";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "c5279916bb417aa2bf634648ff895cf35dce371d7319744884827bfad06f8d7b";
+    sha256 = "5815f3fe254e5665f3c5d6f54f086c2502035cb631a91341591b5a564203cffb";
   };
 
   checkInputs = [ pytest ];
diff --git a/pkgs/development/python-modules/path.py/default.nix b/pkgs/development/python-modules/path.py/default.nix
index 3178b217a00a1..6b4af3ffcd486 100644
--- a/pkgs/development/python-modules/path.py/default.nix
+++ b/pkgs/development/python-modules/path.py/default.nix
@@ -10,7 +10,7 @@
 buildPythonPackage rec {
   pname = "path.py";
   version = "10.4";
-  name = "path.py-${version}";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
@@ -31,4 +31,4 @@ buildPythonPackage rec {
   checkPhase = ''
     py.test test_path.py
   '';
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/pexpect/default.nix b/pkgs/development/python-modules/pexpect/default.nix
new file mode 100644
index 0000000000000..c5d1e8ef3c44a
--- /dev/null
+++ b/pkgs/development/python-modules/pexpect/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, ptyprocess
+}:
+
+buildPythonPackage rec {
+  pname = "pexpect";
+  version = "4.3.0";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1nfjmz81gsixv22dywidakm7pff3ly1i4yly950bfp8gz1r0iaq0";
+  };
+
+  # Wants to run pythonin a subprocess
+  doCheck = false;
+
+  propagatedBuildInputs = [ ptyprocess ];
+
+  meta = with lib; {
+    homepage = http://www.noah.org/wiki/Pexpect;
+    description = "Automate interactive console applications such as ssh, ftp, etc";
+    license = licenses.mit;
+    maintainers = with maintainers; [ zimbatm ];
+
+    longDescription = ''
+      Pexpect is similar to the Don Libes "Expect" system, but Pexpect
+      as a different interface that is easier to understand. Pexpect
+      is basically a pattern matching system. It runs programs and
+      watches output. When output matches a given pattern Pexpect can
+      respond as if a human were typing responses. Pexpect can be used
+      for automation, testing, and screen scraping. Pexpect can be
+      used for automating interactive console applications such as
+      ssh, ftp, passwd, telnet, etc. It can also be used to control
+      web applications via "lynx", "w3m", or some other text-based web
+      browser. Pexpect is pure Python. Unlike other Expect-like
+      modules for Python Pexpect does not require TCL or Expect nor
+      does it require C extensions to be compiled. It should work on
+      any platform that supports the standard Python pty module.
+    '';
+  };
+}
diff --git a/pkgs/development/python-modules/phonenumbers/default.nix b/pkgs/development/python-modules/phonenumbers/default.nix
index 75a3f51afc614..d5c4eaa781bdf 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.5";
+  version = "8.8.6";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "adb2dd985f875ac035bbdc6a1cc57e30834e106e2ff7899e09a1690b474c1774";
+    sha256 = "ab1fa853350dde91be672192b427169b29e3348c236e46ad7a757e4ac8163c8c";
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/pip-tools/default.nix b/pkgs/development/python-modules/pip-tools/default.nix
index eed891c6f5776..d2b91eb435c61 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.1";
-  name = "pip-tools-${version}";
+  version = "1.10.2";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pip-tools/${name}.tar.gz";
-    sha256 = "37b85d69ceed97337aeefb3e52e41fe0884a505c874757a5bbaa58d92b533ce0";
+    sha256 = "d381c7249eb48350cc49447cc106df3d90e9e806b13caaede602c1cd38f61b37";
   };
 
   LC_ALL = "en_US.UTF-8";
diff --git a/pkgs/development/python-modules/plaster-pastedeploy/default.nix b/pkgs/development/python-modules/plaster-pastedeploy/default.nix
index 330ecfc7c672f..03182c902655f 100644
--- a/pkgs/development/python-modules/plaster-pastedeploy/default.nix
+++ b/pkgs/development/python-modules/plaster-pastedeploy/default.nix
@@ -5,12 +5,12 @@
 
 buildPythonPackage rec {
   pname = "plaster_pastedeploy";
-  version = "0.4.1";
+  version = "0.4.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1lrbkya5birfmg9gnfcnsa9id28klmjcqbm33rcg69pv9sfld4jv";
+    sha256 = "2a401228c7cfbe38f728249e75af7a666f91c61d642cbb8fcb78a71df69d2754";
   };
 
   checkPhase = ''
diff --git a/pkgs/development/python-modules/powerline/default.nix b/pkgs/development/python-modules/powerline/default.nix
index 028d81d2934f8..f51c6989c011b 100644
--- a/pkgs/development/python-modules/powerline/default.nix
+++ b/pkgs/development/python-modules/powerline/default.nix
@@ -12,10 +12,12 @@
 # the executables of git, mercurial and bazaar.
 
 buildPythonPackage rec {
-  rev  = "2.6";
-  name = "powerline-${rev}";
+  version  = "2.6";
+  pname = "powerline";
+  name = pname + "-" + version;
+
   src = fetchurl {
-    url    = "https://github.com/powerline/powerline/archive/${rev}.tar.gz";
+    url    = "https://github.com/powerline/powerline/archive/${version}.tar.gz";
     name   = "${name}.tar.gz";
     sha256 = "c108f11fe10dc910febb94b87d3abded85d4363fb950366a9e30282b9ba7c272";
   };
diff --git a/pkgs/development/python-modules/protobuf/default.nix b/pkgs/development/python-modules/protobuf/default.nix
index 4a67a3132edac..1a345b19ef94b 100644
--- a/pkgs/development/python-modules/protobuf/default.nix
+++ b/pkgs/development/python-modules/protobuf/default.nix
@@ -5,7 +5,7 @@
 with stdenv.lib;
 
 buildPythonPackage rec {
-  inherit (protobuf) name src;
+  inherit (protobuf) name src version;
   inherit disabled doCheck;
 
   NIX_CFLAGS_COMPILE =
diff --git a/pkgs/development/python-modules/psutil/default.nix b/pkgs/development/python-modules/psutil/default.nix
new file mode 100644
index 0000000000000..cf9b3ea267f58
--- /dev/null
+++ b/pkgs/development/python-modules/psutil/default.nix
@@ -0,0 +1,28 @@
+{ stdenv
+, buildPythonPackage
+, fetchPypi
+, darwin
+, mock
+}:
+
+buildPythonPackage rec {
+  pname = "psutil";
+  version = "5.4.1";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "42e2de159e3c987435cb3b47d6f37035db190a1499f3af714ba7af5c379b6ba2";
+  };
+
+  # No tests in archive
+  doCheck = false;
+
+  buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.IOKit ];
+
+  meta = {
+    description = "Process and system utilization information interface for python";
+    homepage = https://github.com/giampaolo/psutil;
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/python-modules/pwntools/default.nix b/pkgs/development/python-modules/pwntools/default.nix
index 57f7c2c317dcc..11f80ca3b2e89 100644
--- a/pkgs/development/python-modules/pwntools/default.nix
+++ b/pkgs/development/python-modules/pwntools/default.nix
@@ -7,7 +7,7 @@
 buildPythonPackage rec {
   version = "3.10.0";
   pname = "pwntools";
-  name = "pwntools-${version}";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/pyGithub/default.nix b/pkgs/development/python-modules/pyGithub/default.nix
index 45887bdc748df..ec8db1c5bc3df 100644
--- a/pkgs/development/python-modules/pyGithub/default.nix
+++ b/pkgs/development/python-modules/pyGithub/default.nix
@@ -3,8 +3,9 @@
 , buildPythonPackage, python-jose }:
 
 buildPythonPackage rec {
-  name = "PyGithub-${version}";
+  pname = "PyGithub";
   version = "1.32";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "PyGithub";
diff --git a/pkgs/development/python-modules/pybfd/default.nix b/pkgs/development/python-modules/pybfd/default.nix
index 259e0cea86d08..ee1a79955740e 100644
--- a/pkgs/development/python-modules/pybfd/default.nix
+++ b/pkgs/development/python-modules/pybfd/default.nix
@@ -1,25 +1,27 @@
-{ lib, buildPythonPackage, isPyPy, isPy3k, fetchurl, gdb, binutils }:
+{ lib, fetchFromGitHub, buildPythonPackage, isPyPy, isPy3k, libbfd, libopcodes }:
 
 buildPythonPackage rec {
   name = "pybfd-0.1.1";
 
   disabled = isPyPy || isPy3k;
 
-  src = fetchurl {
-    url = "mirror://pypi/p/pybfd/${name}.tar.gz";
-    sha256 = "d99b32ad077e704ddddc0b488c83cae851c14919e5cbc51715d00464a1932df4";
+  src = fetchFromGitHub {
+    owner = "orivej";
+    repo = "pybfd";
+    rev = "a2c3a7b94a3c9f7a353b863f69a79174c6a41ebe";
+    sha256 = "0wrz234dz25hs0ajzcz5w8lzc1yzf64wqa8fj01hhr4yy23vjkcr";
   };
 
-  preConfigure = ''
-    substituteInPlace setup.py \
-      --replace '"/usr/include"' '"${gdb}/include"' \
-      --replace '"/usr/lib"' '"${binutils.lib}/lib"'
-  '';
+  LIBBFD_INCLUDE_DIR = "${libbfd.dev}/include";
+  LIBBFD_LIBRARY = "${libbfd}/lib/libbfd.so";
+  LIBOPCODES_INCLUDE_DIR = "${libopcodes.dev}/include";
+  LIBOPCODES_LIBRARY = "${libopcodes}/lib/libopcodes.so";
 
   meta = {
     homepage = https://github.com/Groundworkstech/pybfd;
     description = "A Python interface to the GNU Binary File Descriptor (BFD) library";
     license = lib.licenses.gpl2;
     platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ orivej ];
   };
 }
diff --git a/pkgs/development/python-modules/pychromecast/default.nix b/pkgs/development/python-modules/pychromecast/default.nix
index 440a1aa7785e2..01014170dc7d1 100644
--- a/pkgs/development/python-modules/pychromecast/default.nix
+++ b/pkgs/development/python-modules/pychromecast/default.nix
@@ -1,8 +1,9 @@
 { lib, fetchurl, buildPythonPackage, requests, six, zeroconf, protobuf }:
 
 buildPythonPackage rec {
-  name    = "PyChromecast-${version}";
+  pname = "PyChromecast";
   version = "0.8.1";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url    = "mirror://pypi/p/pychromecast/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/pycrypto/default.nix b/pkgs/development/python-modules/pycrypto/default.nix
index 4669c05a7d566..1ecf0bf6b339b 100644
--- a/pkgs/development/python-modules/pycrypto/default.nix
+++ b/pkgs/development/python-modules/pycrypto/default.nix
@@ -3,10 +3,9 @@
 # This is a dummy package providing the drop-in replacement pycryptodome.
 # https://github.com/NixOS/nixpkgs/issues/21671
 
-let
+buildPythonPackage rec {
   version = pycryptodome.version;
   pname = "pycrypto";
-in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   # Cannot build wheel otherwise (zip 1980 issue)
diff --git a/pkgs/development/python-modules/pycuda/compyte.nix b/pkgs/development/python-modules/pycuda/compyte.nix
index 50bd81ac462cf..192d60cec46a3 100644
--- a/pkgs/development/python-modules/pycuda/compyte.nix
+++ b/pkgs/development/python-modules/pycuda/compyte.nix
@@ -1,10 +1,11 @@
-{ mkDerivation 
+{ mkDerivation
 , fetchFromGitHub
 }:
 
 mkDerivation rec {
-  name = "compyte-${version}";
-  version = "git-20150817"; 
+  pname = "compyte";
+  version = "git-20150817";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "inducer";
@@ -13,7 +14,7 @@ mkDerivation rec {
     sha256 = "1980h017qi52b7fqwm75m481xs2napgdd3fbrzkfc29k085cbign";
   };
 
-  installPhase = '' 
+  installPhase = ''
     mkdir -p $out
     cp -r * $out
   '';
diff --git a/pkgs/development/python-modules/pyev/default.nix b/pkgs/development/python-modules/pyev/default.nix
index db06fedd68cc1..e393265ae37fa 100644
--- a/pkgs/development/python-modules/pyev/default.nix
+++ b/pkgs/development/python-modules/pyev/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchurl, buildPythonPackage, libev }:
 
 buildPythonPackage rec {
-  name = "pyev-0.9.0";
+  pname = "pyev";
+  version = "0.9.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pyev/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/pyftgl/default.nix b/pkgs/development/python-modules/pyftgl/default.nix
index a02aa94576e55..117169a26121b 100644
--- a/pkgs/development/python-modules/pyftgl/default.nix
+++ b/pkgs/development/python-modules/pyftgl/default.nix
@@ -2,12 +2,14 @@
 , boost, freetype, ftgl, mesa }:
 
 buildPythonPackage rec {
-  name = "pyftgl-0.4b";
+  pname = "pyftgl";
+  version = "0.4b";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "umlaeute";
-    repo = "pyftgl";
-    rev = "0.4b";
+    repo = name;
+    rev = version;
     sha256 = "12zcjv4cwwjihiaf74kslrdmmk4bs47h7006gyqfwdfchfjdgg4r";
   };
 
diff --git a/pkgs/development/python-modules/pygame/git.nix b/pkgs/development/python-modules/pygame/git.nix
index 97f7b8b6c9935..1d8ba697f38b3 100644
--- a/pkgs/development/python-modules/pygame/git.nix
+++ b/pkgs/development/python-modules/pygame/git.nix
@@ -3,8 +3,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "pygame-${version}";
+  pname = "pygame";
   version = "2016-05-17";
+  name = pname + "-" + version;
 
   src = fetchFromBitbucket {
     owner = "pygame";
diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix
index 6afd10596bc69..db734c53007b6 100644
--- a/pkgs/development/python-modules/pygobject/3.nix
+++ b/pkgs/development/python-modules/pygobject/3.nix
@@ -3,8 +3,10 @@
 buildPythonPackage rec {
   major = "3.24";
   minor = "1";
-  name = "pygobject-${major}.${minor}";
+  version = "${major}.${minor}";
   format = "other";
+  pname = "pygobject";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://gnome/sources/pygobject/${major}/${name}.tar.xz";
diff --git a/pkgs/development/python-modules/pygobject/default.nix b/pkgs/development/python-modules/pygobject/default.nix
index 63a21cb2befd2..796fc992a7dc5 100644
--- a/pkgs/development/python-modules/pygobject/default.nix
+++ b/pkgs/development/python-modules/pygobject/default.nix
@@ -1,9 +1,10 @@
 { stdenv, fetchurl, python, buildPythonPackage, pkgconfig, glib }:
 
 buildPythonPackage rec {
-  name = "pygobject-${version}";
+  pname = "pygobject";
   version = "2.28.6";
   format = "other";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://gnome/sources/pygobject/2.28/${name}.tar.xz";
diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix
index 9b9adc64b755c..42127de2f2446 100644
--- a/pkgs/development/python-modules/pygtk/default.nix
+++ b/pkgs/development/python-modules/pygtk/default.nix
@@ -2,7 +2,9 @@
 , buildPythonPackage, libglade ? null, isPy3k }:
 
 buildPythonPackage rec {
-  name = "pygtk-2.24.0";
+  pname = "pygtk";
+  version = "2.24.0";
+  name = pname + "-" + version;
 
   disabled = isPy3k;
 
diff --git a/pkgs/development/python-modules/pygtksourceview/default.nix b/pkgs/development/python-modules/pygtksourceview/default.nix
index 7b89e6d1b28c2..a03be0ac04dff 100644
--- a/pkgs/development/python-modules/pygtksourceview/default.nix
+++ b/pkgs/development/python-modules/pygtksourceview/default.nix
@@ -1,10 +1,10 @@
 { lib, fetchurl, python, buildPythonPackage, pkgconfig, pygobject2, glib, pygtk, gnome2 }:
 
-let version = "2.10.1"; in
-
-buildPythonPackage {
-  name = "pygtksourceview-${version}";
+buildPythonPackage rec {
+  pname = "pygtksourceview";
   format = "other";
+  version = "2.10.1";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "http://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.10/pygtksourceview-${version}.tar.bz2";
diff --git a/pkgs/development/python-modules/pyocr/default.nix b/pkgs/development/python-modules/pyocr/default.nix
index 54caba10189e8..e253e64a41ca9 100644
--- a/pkgs/development/python-modules/pyocr/default.nix
+++ b/pkgs/development/python-modules/pyocr/default.nix
@@ -3,8 +3,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "pyocr-${version}";
+  pname = "pyocr";
   version = "0.4.7";
+  name = pname + "-" + version;
 
   # Don't fetch from PYPI because it doesn't contain tests.
   src = fetchFromGitHub {
diff --git a/pkgs/development/python-modules/pyqt/4.x.nix b/pkgs/development/python-modules/pyqt/4.x.nix
index b4376730e6238..0efb77d27b3ea 100644
--- a/pkgs/development/python-modules/pyqt/4.x.nix
+++ b/pkgs/development/python-modules/pyqt/4.x.nix
@@ -1,10 +1,14 @@
 { stdenv, fetchurl, pythonPackages, qt4, pkgconfig, lndir, dbus_libs, makeWrapper }:
 
 let
+  pname = "PyQt-x11-gpl";
   version = "4.12";
+
   inherit (pythonPackages) buildPythonPackage python dbus-python sip;
 in buildPythonPackage {
-  name = "PyQt-x11-gpl-${version}";
+  pname = pname;
+  name = pname + "-" + version;
+  version = version;
   format = "other";
 
   src = fetchurl {
diff --git a/pkgs/development/python-modules/pyqt/5.x.nix b/pkgs/development/python-modules/pyqt/5.x.nix
index e0c3163429c3a..dc5c964caf6d3 100644
--- a/pkgs/development/python-modules/pyqt/5.x.nix
+++ b/pkgs/development/python-modules/pyqt/5.x.nix
@@ -5,11 +5,15 @@
 }:
 
 let
+  pname = "PyQt";
   version = "5.9";
+
   inherit (pythonPackages) buildPythonPackage python dbus-python sip;
 in buildPythonPackage {
-  name = "PyQt-${version}";
+  pname = pname;
+  version = version;
   format = "other";
+  name = pname + "-" + version;
 
   meta = with lib; {
     description = "Python bindings for Qt5";
diff --git a/pkgs/development/python-modules/pyro/default.nix b/pkgs/development/python-modules/pyro/default.nix
index dbad83bef7e7b..3e2f90aa9d300 100644
--- a/pkgs/development/python-modules/pyro/default.nix
+++ b/pkgs/development/python-modules/pyro/default.nix
@@ -1,7 +1,10 @@
 { stdenv, fetchurl, buildPythonPackage, isPy3k }:
 
 buildPythonPackage rec {
-  name = "Pyro-3.16";
+  pname = "Pyro";
+  version = "3.16";
+  name = pname + "-" + version;
+
   disabled = isPy3k;
 
   src = fetchurl {
diff --git a/pkgs/development/python-modules/pyslurm/default.nix b/pkgs/development/python-modules/pyslurm/default.nix
index 3a563e5d183d1..e855b952f2769 100644
--- a/pkgs/development/python-modules/pyslurm/default.nix
+++ b/pkgs/development/python-modules/pyslurm/default.nix
@@ -1,7 +1,9 @@
 { lib, fetchFromGitHub, buildPythonPackage, cython, slurm }:
 
 buildPythonPackage rec {
-  name = "pyslurm";
+  pname = "pyslurm";
+  version = "unstable-69e4f4f";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     repo = "pyslurm";
diff --git a/pkgs/development/python-modules/pysoundfile/default.nix b/pkgs/development/python-modules/pysoundfile/default.nix
index fe24f0203f0d9..ef67ed85cc038 100644
--- a/pkgs/development/python-modules/pysoundfile/default.nix
+++ b/pkgs/development/python-modules/pysoundfile/default.nix
@@ -11,8 +11,8 @@
 
 buildPythonPackage rec {
   pname = "PySoundFile";
-  name = "PySoundFile-${version}";
   version = "0.8.1";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
@@ -35,4 +35,4 @@ buildPythonPackage rec {
 
     # https://github.com/bastibe/PySoundFile/issues/157
     disabled = isPyPy ||  stdenv.isi686;
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/pytest-expect/default.nix b/pkgs/development/python-modules/pytest-expect/default.nix
index 5abfd9423ac74..b23ae051ad8d7 100644
--- a/pkgs/development/python-modules/pytest-expect/default.nix
+++ b/pkgs/development/python-modules/pytest-expect/default.nix
@@ -6,10 +6,9 @@
 , six
 }:
 
-let
+buildPythonPackage rec {
   pname = "pytest-expect";
   version = "1.1.0";
-in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
@@ -28,4 +27,4 @@ in buildPythonPackage rec {
     homepage = https://github.com/gsnedders/pytest-expect;
     license = lib.licenses.mit;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/pytest/2_7.nix b/pkgs/development/python-modules/pytest/2_7.nix
index adaa640fdbe63..e63c3f5ebbd61 100644
--- a/pkgs/development/python-modules/pytest/2_7.nix
+++ b/pkgs/development/python-modules/pytest/2_7.nix
@@ -1,6 +1,8 @@
 { stdenv, pkgs, buildPythonPackage, fetchurl, isPy26, argparse, py, selenium }:
 buildPythonPackage rec {
-  name = "pytest-2.7.3";
+  pname = "pytest";
+  version = "2.7.3";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pytest/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/pytest/2_8.nix b/pkgs/development/python-modules/pytest/2_8.nix
index 6232ccaf7006b..963154b11ce1d 100644
--- a/pkgs/development/python-modules/pytest/2_8.nix
+++ b/pkgs/development/python-modules/pytest/2_8.nix
@@ -1,6 +1,8 @@
 { stdenv, pkgs, buildPythonPackage, fetchurl, isPy26, argparse, py, selenium }:
 buildPythonPackage rec {
-  name = "pytest-2.8.7";
+  pname = "pytest";
+  version = "2.8.7";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pytest/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/pytest/2_9.nix b/pkgs/development/python-modules/pytest/2_9.nix
index 3ca7120dd92c0..2d28517441b0d 100644
--- a/pkgs/development/python-modules/pytest/2_9.nix
+++ b/pkgs/development/python-modules/pytest/2_9.nix
@@ -1,6 +1,8 @@
 { stdenv, pkgs, buildPythonPackage, fetchurl, isPy26, argparse, py, selenium }:
 buildPythonPackage rec {
-  name = "pytest-2.9.2";
+  pname = "pytest";
+  version = "2.9.2";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/p/pytest/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/pytest/default.nix b/pkgs/development/python-modules/pytest/default.nix
index 42a591e58b642..8e280b8fd0d6c 100644
--- a/pkgs/development/python-modules/pytest/default.nix
+++ b/pkgs/development/python-modules/pytest/default.nix
@@ -1,10 +1,9 @@
 { stdenv, buildPythonPackage, fetchPypi, isPy26, argparse, hypothesis, py
-, setuptools_scm
+, setuptools_scm, setuptools
 }:
 buildPythonPackage rec {
-  version = "3.2.3";
+  version = "3.2.5";
   pname = "pytest";
-  name = "${pname}-${version}";
 
   preCheck = ''
     # don't test bash builtins
@@ -13,11 +12,12 @@ buildPythonPackage rec {
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "27fa6617efc2869d3e969a3e75ec060375bfb28831ade8b5cdd68da3a741dc3c";
+    sha256 = "6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81";
   };
 
-  buildInputs = [ hypothesis setuptools_scm ];
-  propagatedBuildInputs = [ py ]
+  checkInputs = [ hypothesis ];
+  buildInputs = [ setuptools_scm ];
+  propagatedBuildInputs = [ py setuptools ]
     ++ (stdenv.lib.optional isPy26 argparse);
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/python-utils/default.nix b/pkgs/development/python-modules/python-utils/default.nix
index 6acd0934f4717..37c15c07537e0 100644
--- a/pkgs/development/python-modules/python-utils/default.nix
+++ b/pkgs/development/python-modules/python-utils/default.nix
@@ -1,8 +1,9 @@
 { lib, buildPythonPackage, fetchFromGitHub, pytest, pytestrunner, pytestcov, pytestflakes, pytestpep8, sphinx, six }:
 
 buildPythonPackage rec {
-  name = "python-utils-${version}";
+  pname = "python-utils";
   version = "2.2.0";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "WoLpH";
diff --git a/pkgs/development/python-modules/python_fedora/default.nix b/pkgs/development/python-modules/python_fedora/default.nix
index 7ab698ecd0847..e7c3630f42f49 100644
--- a/pkgs/development/python-modules/python_fedora/default.nix
+++ b/pkgs/development/python-modules/python_fedora/default.nix
@@ -4,7 +4,7 @@
 buildPythonPackage rec {
   pname = "python-fedora";
   version = "0.9.0";
-  name = "python-fedora-${version}";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/rackspace-novaclient/default.nix b/pkgs/development/python-modules/rackspace-novaclient/default.nix
index 144b61c9b9a57..3993503e95625 100644
--- a/pkgs/development/python-modules/rackspace-novaclient/default.nix
+++ b/pkgs/development/python-modules/rackspace-novaclient/default.nix
@@ -1,7 +1,9 @@
 { buildPythonPackage, fetchurl, isPy3k, requests, novaclient, six, lib }:
 let
 os-virtual-interfacesv2-python-novaclient-ext = buildPythonPackage rec {
-  name = "os_virtual_interfacesv2_python_novaclient_ext-0.20";
+  pname = "os_virtual_interfacesv2_python_novaclient_ext";
+  version = "0.20";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/o/os-virtual-interfacesv2-python-novaclient-ext/${name}.tar.gz";
@@ -18,7 +20,9 @@ os-virtual-interfacesv2-python-novaclient-ext = buildPythonPackage rec {
 };
 
 ip-associations-python-novaclient-ext = buildPythonPackage rec {
-  name = "ip_associations_python_novaclient_ext-0.2";
+  pname = "ip_associations_python_novaclient_ext";
+  version = "0.2";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/i/ip_associations_python_novaclient_ext/${name}.tar.gz";
@@ -34,9 +38,10 @@ ip-associations-python-novaclient-ext = buildPythonPackage rec {
   };
 };
 
-
 rackspace-auth-openstack = buildPythonPackage rec {
-  name = "rackspace-auth-openstack-1.3";
+  pname = "rackspace-auth-openstack";
+  version = "1.3";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/rackspace-auth-openstack/${name}.tar.gz";
@@ -52,7 +57,9 @@ rackspace-auth-openstack = buildPythonPackage rec {
   };
 };
 rax-default-network-flags-python-novaclient-ext = buildPythonPackage rec {
-  name = "rax_default_network_flags_python_novaclient_ext-0.4.0";
+  pname = "rax_default_network_flags_python_novaclient_ext";
+  version = "0.4.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/rax_default_network_flags_python_novaclient_ext/${name}.tar.gz";
@@ -68,7 +75,9 @@ rax-default-network-flags-python-novaclient-ext = buildPythonPackage rec {
   };
 };
 os-networksv2-python-novaclient-ext = buildPythonPackage rec {
-  name = "os_networksv2_python_novaclient_ext-0.26";
+  pname = "os_networksv2_python_novaclient_ext";
+  version = "0.26";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/o/os_networksv2_python_novaclient_ext/${name}.tar.gz";
@@ -85,7 +94,9 @@ os-networksv2-python-novaclient-ext = buildPythonPackage rec {
 };
 
 rax-scheduled-images-python-novaclient-ext = buildPythonPackage rec {
-  name = "rax_scheduled_images_python_novaclient_ext-0.3.1";
+  pname = "rax_scheduled_images_python_novaclient_ext";
+  version = "0.3.1";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/rax_scheduled_images_python_novaclient_ext/${name}.tar.gz";
@@ -102,7 +113,9 @@ rax-scheduled-images-python-novaclient-ext = buildPythonPackage rec {
 };
 
 os-diskconfig-python-novaclient-ext = buildPythonPackage rec {
-  name = "os_diskconfig_python_novaclient_ext-0.1.3";
+  pname = "os_diskconfig_python_novaclient_ext";
+  version = "0.1.3";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/o/os_diskconfig_python_novaclient_ext/${name}.tar.gz";
@@ -120,7 +133,9 @@ os-diskconfig-python-novaclient-ext = buildPythonPackage rec {
 
 in
 buildPythonPackage rec {
-  name = "rackspace-novaclient-2.1";
+  pname = "rackspace-novaclient";
+  version = "2.1";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/rackspace-novaclient/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/raven/default.nix b/pkgs/development/python-modules/raven/default.nix
index 00bc54d844b1a..e7b56cb3f3508 100644
--- a/pkgs/development/python-modules/raven/default.nix
+++ b/pkgs/development/python-modules/raven/default.nix
@@ -1,7 +1,9 @@
 { lib, buildPythonPackage, fetchurl, isPy3k, contextlib2 }:
 
 buildPythonPackage rec {
-  name = "raven-6.3.0";
+  pname = "raven";
+  version = "6.3.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/raven/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/recursive-pth-loader/default.nix b/pkgs/development/python-modules/recursive-pth-loader/default.nix
index 9a17e722679f3..359b482a16829 100644
--- a/pkgs/development/python-modules/recursive-pth-loader/default.nix
+++ b/pkgs/development/python-modules/recursive-pth-loader/default.nix
@@ -1,7 +1,9 @@
 { stdenv, python }:
 
 stdenv.mkDerivation rec {
-  name = "python-recursive-pth-loader-1.0";
+  pname = "python-recursive-pth-loader";
+  version = "1.0";
+  name = pname + "-" + version;
 
   unpackPhase = "true";
 
diff --git a/pkgs/development/python-modules/restructuredtext_lint/default.nix b/pkgs/development/python-modules/restructuredtext_lint/default.nix
index 1a863c6297384..e58066cbef4d3 100644
--- a/pkgs/development/python-modules/restructuredtext_lint/default.nix
+++ b/pkgs/development/python-modules/restructuredtext_lint/default.nix
@@ -11,12 +11,12 @@
 
 buildPythonPackage rec {
   pname = "restructuredtext_lint";
-  version = "1.1.1";
+  version = "1.1.2";
   name = "${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "167e8adaa5bdc30531ee91760d6c216b306a8a3372aad34b1f72d8adcc5e011e";
+    sha256 = "9201d354e22c27be61cf6d8212da6e10c875eec7ec8d1bdb1067b2a5ba931637";
   };
 
   checkInputs = [ nose flake8 pyyaml testtools ];
diff --git a/pkgs/development/python-modules/robomachine/default.nix b/pkgs/development/python-modules/robomachine/default.nix
index 1e7b020cd5139..8f71bab9c2501 100644
--- a/pkgs/development/python-modules/robomachine/default.nix
+++ b/pkgs/development/python-modules/robomachine/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchurl, buildPythonPackage, pyparsing, argparse, robotframework }:
 
 buildPythonPackage rec {
-  name = "robomachine-0.6";
+  pname = "robomachine";
+  version = "0.6";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/R/RoboMachine/RoboMachine-0.6.tar.gz";
diff --git a/pkgs/development/python-modules/robotframework-ride/default.nix b/pkgs/development/python-modules/robotframework-ride/default.nix
index a9b536fc76ed4..8bac32ba91123 100644
--- a/pkgs/development/python-modules/robotframework-ride/default.nix
+++ b/pkgs/development/python-modules/robotframework-ride/default.nix
@@ -2,8 +2,9 @@
 
 buildPythonPackage rec {
   version = "1.2.3";
-  name = "robotframework-ride-${version}";
+  pname = "robotframework-ride";
   disabled = isPy3k;
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "https://robotframework-ride.googlecode.com/files/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/robotframework/default.nix b/pkgs/development/python-modules/robotframework/default.nix
index e0a05eb2e2585..6a4a88670251d 100644
--- a/pkgs/development/python-modules/robotframework/default.nix
+++ b/pkgs/development/python-modules/robotframework/default.nix
@@ -2,8 +2,9 @@
 
 buildPythonPackage rec {
   version = "3.0.2";
-  name = "robotframework-${version}";
+  pname = "robotframework";
   disabled = isPy3k;
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/r/robotframework/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/scapy/default.nix b/pkgs/development/python-modules/scapy/default.nix
index 5241b632f122d..6670394ac0bb1 100644
--- a/pkgs/development/python-modules/scapy/default.nix
+++ b/pkgs/development/python-modules/scapy/default.nix
@@ -1,7 +1,9 @@
 { stdenv, fetchurl, buildPythonPackage, isPy3k, isPyPy }:
 
 buildPythonPackage rec {
-  name = "scapy-2.2.0";
+  pname = "scapy";
+  version = "2.2.0";
+  name = pname + "-" + version;
 
   disabled = isPy3k || isPyPy;
 
diff --git a/pkgs/development/python-modules/selenium/default.nix b/pkgs/development/python-modules/selenium/default.nix
index d33e86a3f079c..6b64cd18b4fa5 100644
--- a/pkgs/development/python-modules/selenium/default.nix
+++ b/pkgs/development/python-modules/selenium/default.nix
@@ -8,7 +8,10 @@
 }:
 
 buildPythonPackage rec {
-  name = "selenium-3.6.0";
+  pname = "selenium";
+  version = "3.6.0";
+  name = pname + "-" + version;
+
   src = fetchurl {
     url = "mirror://pypi/s/selenium/${name}.tar.gz";
     sha256 = "15qpvz0bdwjvpcj11fm0rw6r5inr66sqw89ww50l025sbhf04qwm";
@@ -47,4 +50,4 @@ buildPythonPackage rec {
     license = licenses.asl20;
     maintainers = with maintainers; [ jraygauthier ];
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/seqdiag/default.nix b/pkgs/development/python-modules/seqdiag/default.nix
index 98a81873a718c..2ce155210484c 100644
--- a/pkgs/development/python-modules/seqdiag/default.nix
+++ b/pkgs/development/python-modules/seqdiag/default.nix
@@ -3,11 +3,13 @@
 }:
 
 buildPythonPackage rec {
-  name = "seqdiag-0.9.4";
+  pname = "seqdiag";
+  version = "0.9.5";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/s/seqdiag/${name}.tar.gz";
-    sha256 = "1qa7d0m1wahvmrj95rxkb6128cbwd4w3gy8gbzncls66h46bifiz";
+    sha256 = "994402cb19fef77ee113d18810aa397a7290553cda5f900be2bb44e2c7742657";
   };
 
   buildInputs = [ pep8 nose unittest2 docutils ];
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index a65b0206ee53d..3c919db42f4a3 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 = "36.6.0";
+  version = "36.7.1";
   name = "${python.libPrefix}-${pname}-${version}";
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "62074589522a798da243f47348f38020d55b6c945652e2f2c09d3a96299812b7";
+    sha256 = "543becf5d33d8989dc5222403997488e9dc3872bdecdabb0f57184ca253ec1e8";
   };
 
   buildInputs = [ python wrapPython unzip ];
diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix
index 452f3f1d92344..40df45616e936 100644
--- a/pkgs/development/python-modules/spacy/default.nix
+++ b/pkgs/development/python-modules/spacy/default.nix
@@ -4,7 +4,7 @@
 , python
 , fetchPypi
 , fetchFromGitHub
-, pytest 
+, pytest
 , cython
 , cymem
 , preshed
@@ -28,20 +28,21 @@ let
     version = "2017.04.05";
 
     src = fetchPypi {
-      inherit pname version;      
+      inherit pname version;
       sha256 = "0c95gf3jzz8mv52lkgq0h7sbasjwvdhghm4s0phmy5k9sr78f4fq";
     };
   };
 in buildPythonPackage rec {
-  name = "spacy-${version}";
+  pname = "spacy";
   version = "1.8.2";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "explosion";
     repo = "spaCy";
     rev = "v${version}";
-    sha256 = "0v3bmmar31a6968y4wl0lmgnc3829l2mnwd8s959m4pqw1y1w648";    
-  };  
+    sha256 = "0v3bmmar31a6968y4wl0lmgnc3829l2mnwd8s959m4pqw1y1w648";
+  };
 
   propagatedBuildInputs = [
    cython
@@ -65,8 +66,8 @@ in buildPythonPackage rec {
   doCheck = false;
   # checkPhase = ''
   #   ${python.interpreter} -m pytest spacy/tests --vectors --models --slow
-  # '';  
-  
+  # '';
+
   meta = with stdenv.lib; {
     description = "Industrial-strength Natural Language Processing (NLP) with Python and Cython";
     homepage = https://github.com/explosion/spaCy;
diff --git a/pkgs/development/python-modules/sphfile/default.nix b/pkgs/development/python-modules/sphfile/default.nix
index 8c2351c981e93..189fa7c932da5 100644
--- a/pkgs/development/python-modules/sphfile/default.nix
+++ b/pkgs/development/python-modules/sphfile/default.nix
@@ -1,8 +1,9 @@
 { lib, fetchurl, buildPythonPackage, numpy }:
 
 buildPythonPackage rec {
-  name = "sphfile-${version}";
+  pname = "sphfile";
   version = "1.0.0";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/s/sphfile/${name}.tar.gz";
diff --git a/pkgs/development/python-modules/spotipy/default.nix b/pkgs/development/python-modules/spotipy/default.nix
index ec73485193a57..c14b3cd770bbf 100644
--- a/pkgs/development/python-modules/spotipy/default.nix
+++ b/pkgs/development/python-modules/spotipy/default.nix
@@ -2,8 +2,8 @@
 
 buildPythonPackage rec {
   pname = "spotipy";
-  name = "spotipy-${version}";
   version = "2.4.4";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/sybase/default.nix b/pkgs/development/python-modules/sybase/default.nix
index df27172d8d492..51c80e0fa9109 100644
--- a/pkgs/development/python-modules/sybase/default.nix
+++ b/pkgs/development/python-modules/sybase/default.nix
@@ -6,8 +6,9 @@
 }:
 
 buildPythonPackage rec {
-  name = "python-sybase-${version}";
+  pname = "python-sybase";
   version = "0.40pre2";
+  name = pname + "-" + version;
   disabled = isPy3k;
 
   src = fetchurl {
diff --git a/pkgs/development/python-modules/systemd/default.nix b/pkgs/development/python-modules/systemd/default.nix
index 4786e7eb7e185..ec5b3b325dd2f 100644
--- a/pkgs/development/python-modules/systemd/default.nix
+++ b/pkgs/development/python-modules/systemd/default.nix
@@ -1,8 +1,9 @@
 { stdenv, buildPythonPackage, fetchFromGitHub, systemd, pkgconfig }:
 
 buildPythonPackage rec {
-  name = "python-systemd-${version}";
+  pname = "systemd";
   version = "234";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "systemd";
diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix
index 2ce419fa7fb61..63630c1e14635 100644
--- a/pkgs/development/python-modules/tensorflow/default.nix
+++ b/pkgs/development/python-modules/tensorflow/default.nix
@@ -97,6 +97,8 @@ let
   };
 
 in buildPythonPackage (common // {
+  pname = "tensorflow";
+  version = common.version;
   name = "tensorflow-${common.version}";
 
   deps = stdenv.mkDerivation (common // {
diff --git a/pkgs/development/python-modules/testfixtures/default.nix b/pkgs/development/python-modules/testfixtures/default.nix
index 23b5a5aa9e261..498c722a0464b 100644
--- a/pkgs/development/python-modules/testfixtures/default.nix
+++ b/pkgs/development/python-modules/testfixtures/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonPackage rec {
   pname = "testfixtures";
-  version = "5.3.0";
+  version = "5.3.1";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "1xfar653qmikwb94xj3f0xfp8dh2llxjsxipx1272d8qwl0aknnx";
+    sha256 = "670ade9410b7132278209e6a2e893caf098b040c4ba4d5ea848367a9c5588728";
   };
 
   checkInputs = [ mock manuel pytest sybil zope_component ];
diff --git a/pkgs/development/python-modules/thespian/default.nix b/pkgs/development/python-modules/thespian/default.nix
new file mode 100644
index 0000000000000..7a6ff3cc53d1f
--- /dev/null
+++ b/pkgs/development/python-modules/thespian/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchPypi, buildPythonPackage, lib }:
+
+buildPythonPackage rec {
+  version = "3.8.3";
+  pname = "thespian";
+  name = "${pname}-${version}";
+
+  src = fetchPypi {
+    inherit pname version;
+    extension = "zip";
+    sha256 = "0vvwsh3waxd5ldrayr86kdcshv07bp361fl7p16g9i044vklwly4";
+  };
+
+  # Do not run the test suite: it takes a long type and uses
+  # significant system resources, including requiring localhost
+  # network operations.  Thespian tests are performed via it's Travis
+  # CI configuration and do not need to be duplicated here.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Python Actor concurrency library";
+    homepage = http://thespianpy.com/;
+    license = licenses.mit;
+    maintainers = [ maintainers.kquick ];
+  };
+}
diff --git a/pkgs/development/python-modules/thinc/default.nix b/pkgs/development/python-modules/thinc/default.nix
index 817ea6388f953..15794caf58b92 100644
--- a/pkgs/development/python-modules/thinc/default.nix
+++ b/pkgs/development/python-modules/thinc/default.nix
@@ -30,21 +30,22 @@ let
     version = "1.0.1";
 
     src = fetchPypi {
-      inherit pname version;      
+      inherit pname version;
       sha256 = "17zajiw4mjbkkv6ahp3xf025qglkj0805m9s41c45zryzj6p2h39";
     };
 
     doCheck = false; # fails to import support from test
   };
 in buildPythonPackage rec {
-  name = "thinc-${version}";
+  pname = "thinc";
   version = "6.5.1";
+  name = pname + "-" + version;
 
   src = fetchFromGitHub {
     owner = "explosion";
     repo = "thinc";
     rev = "v${version}";
-    sha256 = "008kmjsvanh6qgnpvsn3qacfcyprxirxbw4yfd8flyg7mxw793ws";    
+    sha256 = "008kmjsvanh6qgnpvsn3qacfcyprxirxbw4yfd8flyg7mxw793ws";
   };
 
   propagatedBuildInputs = [
@@ -67,14 +68,14 @@ in buildPythonPackage rec {
   ];
 
   doCheck = false;
-  
+
   # fails to import some modules
   # checkPhase = ''
   #   ${python.interpreter} -m pytest thinc/tests
   #   # cd thinc/tests
   #   # ${python.interpreter} -m unittest discover -p "*test*"
   # '';
-  
+
   meta = with stdenv.lib; {
     description = "Practical Machine Learning for NLP in Python";
     homepage = https://github.com/explosion/thinc;
diff --git a/pkgs/development/python-modules/tiros/default.nix b/pkgs/development/python-modules/tiros/default.nix
index c0056eb66b3b1..a620c6eb58df1 100644
--- a/pkgs/development/python-modules/tiros/default.nix
+++ b/pkgs/development/python-modules/tiros/default.nix
@@ -5,11 +5,11 @@
 buildPythonPackage rec {
   pname = "tiros";
   name = "${pname}-${version}";
-  version = "1.0.39";
+  version = "1.0.40";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "10wh84lpl7k8i69hlxwrzp2lln63w2afv9l7ij7r3lqjwd0z0skr";
+    sha256 = "841ca13564e3cddfd1404cbc60b3433bcc1e31c2753ecea20d0ad68173b80169";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/python-modules/tqdm/default.nix b/pkgs/development/python-modules/tqdm/default.nix
index 95039cc591fc4..2392a4a9968c7 100644
--- a/pkgs/development/python-modules/tqdm/default.nix
+++ b/pkgs/development/python-modules/tqdm/default.nix
@@ -21,6 +21,12 @@ buildPythonPackage rec {
 
   buildInputs = [ nose coverage glibcLocales flake8 ];
 
+  postPatch = ''
+    # Remove performance testing.
+    # Too sensitive for on Hydra.
+    rm tqdm/tests/tests_perf.py
+  '';
+
   LC_ALL="en_US.UTF-8";
 
   meta = {
diff --git a/pkgs/development/python-modules/trollius/default.nix b/pkgs/development/python-modules/trollius/default.nix
index ef367c3525d30..7b61633a7fc78 100644
--- a/pkgs/development/python-modules/trollius/default.nix
+++ b/pkgs/development/python-modules/trollius/default.nix
@@ -13,7 +13,7 @@ buildPythonPackage rec {
 
   buildInputs = [ mock ];
 
-  propagatedBuildInputs = lib.optional (isPy27 || isPyPy) [ futures ];
+  propagatedBuildInputs = lib.optionals (isPy27 || isPyPy) [ futures ];
 
   patches = [
     ./tests.patch
diff --git a/pkgs/development/python-modules/u-msgpack-python/default.nix b/pkgs/development/python-modules/u-msgpack-python/default.nix
index aca4e370e4611..bab0bc2885029 100644
--- a/pkgs/development/python-modules/u-msgpack-python/default.nix
+++ b/pkgs/development/python-modules/u-msgpack-python/default.nix
@@ -5,10 +5,9 @@
 , python
 }:
 
-let
+buildPythonPackage rec {
   pname = "u-msgpack-python";
   version = "2.4.1";
-in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
diff --git a/pkgs/development/python-modules/umemcache/default.nix b/pkgs/development/python-modules/umemcache/default.nix
index 4d09fda83da45..416c857bdc68d 100644
--- a/pkgs/development/python-modules/umemcache/default.nix
+++ b/pkgs/development/python-modules/umemcache/default.nix
@@ -1,9 +1,10 @@
 { stdenv, buildPythonPackage, isPy3k, fetchurl }:
 
 buildPythonPackage rec {
-  name = "umemcache-${version}";
+  pname = "umemcache";
   version = "1.6.3";
   disabled = isPy3k;
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "mirror://pypi/u/umemcache/${name}.zip";
diff --git a/pkgs/development/python-modules/uritools/default.nix b/pkgs/development/python-modules/uritools/default.nix
index 99b648b0ee1f8..108a7cf5bb0be 100644
--- a/pkgs/development/python-modules/uritools/default.nix
+++ b/pkgs/development/python-modules/uritools/default.nix
@@ -2,8 +2,8 @@
 
 buildPythonPackage rec {
   pname = "uritools";
-  name = "uritools-${version}";
   version = "2.1.0";
+  name = pname + "-" + version;
 
   src = fetchPypi {
     inherit pname version;
diff --git a/pkgs/development/python-modules/urwid/default.nix b/pkgs/development/python-modules/urwid/default.nix
index d77a212003b11..b76a1475bbfb4 100644
--- a/pkgs/development/python-modules/urwid/default.nix
+++ b/pkgs/development/python-modules/urwid/default.nix
@@ -23,6 +23,11 @@ buildPythonPackage (rec {
    })
   ];
 
+  postPatch = ''
+    # Several tests keep failing on Hydra
+    rm urwid/tests/test_vterm.py
+  '';
+
   meta = with stdenv.lib; {
     description = "A full-featured console (xterm et al.) user interface library";
     homepage = http://excess.org/urwid;
diff --git a/pkgs/development/python-modules/usbtmc/default.nix b/pkgs/development/python-modules/usbtmc/default.nix
index 0c6842749073b..bcbaa0b728c35 100644
--- a/pkgs/development/python-modules/usbtmc/default.nix
+++ b/pkgs/development/python-modules/usbtmc/default.nix
@@ -1,8 +1,9 @@
 { stdenv, fetchurl, buildPythonPackage, pyusb }:
 
 buildPythonPackage rec {
-  name = "usbtmc-${version}";
+  pname = "usbtmc";
   version = "0.8";
+  name = pname + "-" + version;
 
   src = fetchurl {
     url = "https://github.com/python-ivi/python-usbtmc/archive/v${version}.tar.gz";
diff --git a/pkgs/development/python-modules/waitress-django/default.nix b/pkgs/development/python-modules/waitress-django/default.nix
index 6efaf800b3cd9..421995e3792ac 100644
--- a/pkgs/development/python-modules/waitress-django/default.nix
+++ b/pkgs/development/python-modules/waitress-django/default.nix
@@ -1,6 +1,10 @@
 { buildPythonPackage, django_1_8, waitress }:
-buildPythonPackage {
-  name = "waitress-django";
+
+buildPythonPackage rec {
+  pname = "waitress-django";
+  version = "0.0.0";
+  name = pname;
+
   src = ./.;
   pythonPath = [ django_1_8 waitress ];
   doCheck = false;
diff --git a/pkgs/development/python-modules/webencodings/default.nix b/pkgs/development/python-modules/webencodings/default.nix
index 834a0ab07fbfe..edd0a364ea147 100644
--- a/pkgs/development/python-modules/webencodings/default.nix
+++ b/pkgs/development/python-modules/webencodings/default.nix
@@ -4,10 +4,9 @@
 , pytest
 }:
 
-let
+buildPythonPackage rec {
   pname = "webencodings";
   version = "0.5.1";
-in buildPythonPackage rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
@@ -26,4 +25,4 @@ in buildPythonPackage rec {
     homepage = https://github.com/SimonSapin/python-webencodings;
     license = lib.licenses.bsd3;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/python-modules/widgetsnbextension/default.nix b/pkgs/development/python-modules/widgetsnbextension/default.nix
index 760af59918acf..b9ab1dfbc1d24 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.6";
+  version = "3.0.8";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "3fbedb4ae0883f48af2397c65a8f9fbf8ed868f1808db70f8aa72f25d391fa9b";
+    sha256 = "a57e29e733b989e68fdd0f3d6927a3691763b39792591d573b95a89a5a12ec15";
   };
 
   propagatedBuildInputs = [ notebook ];
diff --git a/pkgs/development/python-modules/wxPython/3.0.nix b/pkgs/development/python-modules/wxPython/3.0.nix
index 14f6f802ba2ac..ab7b44019c541 100644
--- a/pkgs/development/python-modules/wxPython/3.0.nix
+++ b/pkgs/development/python-modules/wxPython/3.0.nix
@@ -19,8 +19,9 @@
 assert wxGTK.unicode;
 
 buildPythonPackage rec {
-  name = "wxPython-${version}";
+  pname = "wxPython";
   version = "3.0.2.0";
+  name = pname + "-" + version;
 
   disabled = isPy3k || isPyPy;
   doCheck = false;
diff --git a/pkgs/development/r-modules/generic-builder.nix b/pkgs/development/r-modules/generic-builder.nix
index 582b8aa44dc29..ff6c3ad1b9039 100644
--- a/pkgs/development/r-modules/generic-builder.nix
+++ b/pkgs/development/r-modules/generic-builder.nix
@@ -41,8 +41,8 @@ stdenv.mkDerivation ({
   '';
 
   postFixup = ''
-    if test -e $out/nix-support/propagated-native-build-inputs; then
-        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
+    if test -e $out/nix-support/propagated-build-inputs; then
+        ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
     fi
   '';
 
diff --git a/pkgs/development/tools/analysis/garcosim/tracefilegen/builder.sh b/pkgs/development/tools/analysis/garcosim/tracefilegen/builder.sh
deleted file mode 100644
index 6c66eb25ba31d..0000000000000
--- a/pkgs/development/tools/analysis/garcosim/tracefilegen/builder.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-source "$stdenv"/setup
-
-cp --recursive "$src" ./
-
-chmod --recursive u=rwx ./"$(basename "$src")"
-
-cd ./"$(basename "$src")"
-
-cmake ./ 
-
-make
-
-mkdir --parents "$out"/bin
-cp ./TraceFileGen "$out"/bin
-
-mkdir --parents "$out"/share/doc/"$name"/html
-cp --recursive ./Documentation/html/* "$out/share/doc/$name/html/"
diff --git a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
index 07e3a579d3454..f96f7e9b66bd0 100644
--- a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
+++ b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
@@ -1,22 +1,29 @@
-{ stdenv, fetchgit, cmake }:
+{ stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
 
-  name = "tracefilegen-2015-11-14";
+  name = "tracefilegen-2017-05-13";
 
-  src = fetchgit {
-    url = "https://github.com/GarCoSim/TraceFileGen.git";
-    rev = "4acf75b142683cc475c6b1c841a221db0753b404";
-    sha256 = "0mh661l9d1lczv0mr2y9swzqqlwikyqiv1hdd71r9v8cvm54y5ij";
+  src = fetchFromGitHub {
+    owner = "GarCoSim";
+    repo = "TraceFileGen";
+    rev = "0ebfd1fdb54079d4bdeaa81fc9267ecb9f016d60";
+    sha256 = "1gsx18ksgz5gwl3v62vgrmhxc0wc99i74qwhpn0h57zllk41drjc";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
-  builder = ./builder.sh;
+  patches = [ ./gcc7.patch ];
+
+  installPhase = ''
+    install -Dm755 TraceFileGen $out/bin/TraceFileGen
+    mkdir -p $out/share/doc/${name}/
+    cp -ar $src/Documentation/html $out/share/doc/${name}/.
+  '';
 
   meta = with stdenv.lib; {
     description = "Automatically generate all types of basic memory management operations and write into trace files";
-    homepage = https://github.com/GarCoSim; 
+    homepage = https://github.com/GarCoSim;
     maintainers = [ maintainers.cmcdragonkai ];
     license = licenses.gpl2;
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/analysis/garcosim/tracefilegen/gcc7.patch b/pkgs/development/tools/analysis/garcosim/tracefilegen/gcc7.patch
new file mode 100644
index 0000000000000..48301bbf61ad8
--- /dev/null
+++ b/pkgs/development/tools/analysis/garcosim/tracefilegen/gcc7.patch
@@ -0,0 +1,13 @@
+diff --git a/Utils/Logger.cpp b/Utils/Logger.cpp
+index 747cd63..e3efdf1 100644
+--- a/Utils/Logger.cpp
++++ b/Utils/Logger.cpp
+@@ -29,7 +29,7 @@ Logger::Logger(char* tracepath) {
+ 	trace = fopen(tracepath, "w");

+ 

+ 	// dot file is not used, set null as default value

+-	dot = '\0';

++	dot = nullptr;

+ 	//dot = fopen("gcKons.dot", "w");

+ 	//fprintf(dot,"digraph G {\n");

+ }

diff --git a/pkgs/development/tools/analysis/kcov/default.nix b/pkgs/development/tools/analysis/kcov/default.nix
index 509f3e19e8023..3c3665e72200c 100644
--- a/pkgs/development/tools/analysis/kcov/default.nix
+++ b/pkgs/development/tools/analysis/kcov/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, binutils}:
+{stdenv, fetchFromGitHub, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, libopcodes}:
 
 stdenv.mkDerivation rec {
   name = "kcov-${version}";
@@ -12,8 +12,9 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = "patchShebangs src/bin-to-c-source.py";
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake zlib curl elfutils python libiberty binutils ];
+  nativeBuildInputs = [ cmake pkgconfig ];
+
+  buildInputs = [ zlib curl elfutils python libiberty libopcodes ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix
index bbfcc8513078c..8568b218f37e2 100644
--- a/pkgs/development/tools/build-managers/gradle/default.nix
+++ b/pkgs/development/tools/build-managers/gradle/default.nix
@@ -52,12 +52,12 @@ rec {
   };
 
   gradle_latest = gradleGen rec {
-    name = "gradle-4.3";
+    name = "gradle-4.3.1";
     nativeVersion = "0.14";
 
     src = fetchurl {
       url = "http://services.gradle.org/distributions/${name}-bin.zip";
-      sha256 = "0k358y18pp2809kn5il4kv3qvlqrbwmy276bbm3mnmwjxx7g9jwd";
+      sha256 = "1irsv5c4g0c8iln5hiikjr78rj1w2hjgyar5dp8a54h3rscf1sqm";
     };
   };
 
diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix
index fff6af396b9fb..c59d2faaf26c7 100644
--- a/pkgs/development/tools/build-managers/ninja/default.nix
+++ b/pkgs/development/tools/build-managers/ninja/default.nix
@@ -1,29 +1,28 @@
-{ stdenv, fetchurl, python, asciidoc, re2c }:
+{ stdenv, fetchFromGitHub, python, asciidoc, re2c }:
 
 stdenv.mkDerivation rec {
   name = "ninja-${version}";
-  version = "1.7.2";
+  version = "1.8.2";
 
-  src = fetchurl {
-    name = "${name}.tar.gz";
-    url = "https://github.com/ninja-build/ninja/archive/v${version}.tar.gz";
-    sha256 = "1n8n3g26ppwh7zwrc37n3alkbpbj0wki34ih53s3rkhs8ajs1p9f";
+  src = fetchFromGitHub {
+    owner = "ninja-build";
+    repo = "ninja";
+    rev = "v${version}";
+    sha256 = "16scq9hcq6c5ap6sy8j4qi75qps1zvrf3p79j1vbrvnqzp928i5f";
   };
 
-  buildInputs = [ python asciidoc re2c ];
+  nativeBuildInputs = [ python asciidoc re2c ];
 
   buildPhase = ''
-    python bootstrap.py
+    python configure.py --bootstrap
     asciidoc doc/manual.asciidoc
   '';
 
   installPhase = ''
-    mkdir -p $out/bin
-    cp ninja $out/bin/
-
-    mkdir -p $out/share/doc/ninja
-    cp doc/manual.asciidoc $out/share/doc/ninja/
-    cp doc/manual.html $out/share/doc/ninja/
+    install -Dm555 -t $out/bin ninja
+    install -Dm444 -t $out/share/doc/ninja doc/manual.asciidoc doc/manual.html
+    install -Dm444 misc/bash-completion $out/share/bash-completion/completions/ninja
+    install -Dm444 misc/zsh-completion $out/share/zsh/site-functions/_ninja
   '';
 
   setupHook = ./setup-hook.sh;
@@ -36,9 +35,9 @@ stdenv.mkDerivation rec {
       input files generated by a higher-level build system, and it is designed
       to run builds as fast as possible.
     '';
-    homepage = http://martine.github.io/ninja/;
+    homepage = https://ninja-build.org/;
     license = licenses.asl20;
     platforms = platforms.unix;
-    maintainers = [ maintainers.thoughtpolice maintainers.bjornfor ];
+    maintainers = with maintainers; [ thoughtpolice bjornfor orivej ];
   };
 }
diff --git a/pkgs/development/tools/build-managers/redo-sh/default.nix b/pkgs/development/tools/build-managers/redo-sh/default.nix
index f81ff3b91d4f5..c888627cfce32 100644
--- a/pkgs/development/tools/build-managers/redo-sh/default.nix
+++ b/pkgs/development/tools/build-managers/redo-sh/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     mv man "$out/share"
     mv bin "$out"
     for p in $out/bin/*; do
-      wrapProgram "$p" --set PATH '$PATH:'"$out/bin"
+      wrapProgram "$p" --suffix PATH : "$out/bin"
     done
   '';
 
diff --git a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
index 44e4f494ff241..369f2f86bee69 100644
--- a/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
+++ b/pkgs/development/tools/continuous-integration/gitlab-runner/default.nix
@@ -1,16 +1,16 @@
 { lib, buildGoPackage, fetchFromGitLab, fetchurl, go-bindata }:
 
 let
-  version = "10.1.0";
+  version = "10.2.0";
   # Gitlab runner embeds some docker images these are prebuilt for arm and x86_64
   docker_x86_64 = fetchurl {
     url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-x86_64.tar.xz";
-    sha256 = "0h8fwqsr8ibd82jxq4pc9p8x7af0i8jyrrsj13p4daqhla0srxr4";
+    sha256 = "191yzh9k6ivj7mdfi5mv7wgbdcclb5q99rcbry70h064vzwfgkp6";
   };
 
   docker_arm = fetchurl {
     url = "https://gitlab-runner-downloads.s3.amazonaws.com/v${version}/docker/prebuilt-arm.tar.xz";
-    sha256 = "0bzj8zr6d5ab5bjlbw7q3iwn19ha8fksymrvw6cyzs4qacfsj54w";
+    sha256 = "1xvfsffwks5z74kxba6f4cilbabcsxhr0kskbxwczi90pn0rxsnn";
   };
 in
 buildGoPackage rec {
@@ -29,7 +29,7 @@ buildGoPackage rec {
     owner = "gitlab-org";
     repo = "gitlab-runner";
     rev = "v${version}";
-    sha256 = "0knvjmxcscyr6v5b9vvyvm8w6p58a1h6nfcvf13dxp59psm71q00";
+    sha256 = "1psnajn4b3ym2fpvn6rizxqb093s78lvxcs3bysgrmf9q1ivf3a6";
   };
 
   patches = [ ./fix-shell-path.patch ];
diff --git a/pkgs/development/tools/misc/binutils/build-components-separately.patch b/pkgs/development/tools/misc/binutils/build-components-separately.patch
new file mode 100644
index 0000000000000..d3cd0d2131ccb
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/build-components-separately.patch
@@ -0,0 +1,178 @@
+From bc09a9236f67e710d545ac11bcdac7b55dbcc1a0 Mon Sep 17 00:00:00 2001
+From: John Ericson <John.Ericson@Obsidian.Systems>
+Date: Thu, 12 Oct 2017 11:16:57 -0400
+Subject: [PATCH] Build components separately
+
+---
+ bfd/configure.ac     | 18 +++---------------
+ opcodes/Makefile.am  | 17 +++++++++++++----
+ opcodes/configure.ac | 45 ++++++---------------------------------------
+ 3 files changed, 22 insertions(+), 58 deletions(-)
+
+diff --git a/bfd/configure.ac b/bfd/configure.ac
+index 9a183c1628..8728837384 100644
+--- a/bfd/configure.ac
++++ b/bfd/configure.ac
+@@ -241,31 +241,19 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+ 
+ LT_LIB_M
+ 
+-# When building a shared libbfd, link against the pic version of libiberty
+-# so that apps that use libbfd won't need libiberty just to satisfy any
+-# libbfd references.
+-# We can't do that if a pic libiberty is unavailable since including non-pic
+-# code would insert text relocations into libbfd.
+ SHARED_LIBADD=
+-SHARED_LDFLAGS=
++SHARED_LDFLAGS=-liberty
+ if test "$enable_shared" = "yes"; then
+-changequote(,)dnl
+-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+-changequote([,])dnl
+-  if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+-  fi
+-
+ # More hacks to build DLLs on Windows.
+   case "${host}" in
+   *-*-cygwin*)
+     SHARED_LDFLAGS="-no-undefined"
+-    SHARED_LIBADD="-L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin -lkernel32"
++    SHARED_LIBADD="-liberty -lintl -lcygwin -lkernel32"
+   ;;
+ 
+   # Hack to build or1k-src on OSX
+   or1k*-*-darwin*)
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -L`pwd`/../intl -liberty -lintl"
++    SHARED_LIBADD="-liberty -lintl"
+   ;;
+   esac
+ 
+diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am
+index 925e7ff651..47b395c195 100644
+--- a/opcodes/Makefile.am
++++ b/opcodes/Makefile.am
+@@ -52,7 +52,7 @@ libopcodes_la_LDFLAGS += -rpath $(rpath_bfdlibdir)
+ endif
+ 
+ # This is where bfd.h lives.
+-BFD_H = ../bfd/bfd.h
++BFD_H = $(BFDDIR)/bfd.h
+ 
+ BUILD_LIBS = @BUILD_LIBS@
+ BUILD_LIB_DEPS = @BUILD_LIB_DEPS@
+@@ -303,7 +303,7 @@ OFILES = @BFD_MACHINES@
+ # development.sh is used to determine -Werror default.
+ CONFIG_STATUS_DEPENDENCIES = $(BFDDIR)/development.sh
+ 
+-AM_CPPFLAGS = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
++AM_CPPFLAGS = -I. -I$(srcdir) -I$(INCDIR) -I$(BFDDIR) @HDEFINES@ @INCINTL@
+ 
+ disassemble.lo: disassemble.c
+ if am__fastdepCC
+@@ -324,12 +324,21 @@ libopcodes_la_SOURCES =  dis-buf.c disassemble.c dis-init.c
+ # old version of libbfd, or to pick up libbfd for the wrong architecture
+ # if host != build. So for building with shared libraries we use a
+ # hardcoded path to libbfd.so instead of relying on the entries in libbfd.la.
+-libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@
++libopcodes_la_DEPENDENCIES = $(OFILES) @SHARED_DEPENDENCIES@ libtool-soversion
+ libopcodes_la_LIBADD = $(OFILES) @SHARED_LIBADD@
+-libopcodes_la_LDFLAGS += -release `cat ../bfd/libtool-soversion` @SHARED_LDFLAGS@
++libopcodes_la_LDFLAGS += -release `cat libtool-soversion` @SHARED_LDFLAGS@
+ # Allow dependency tracking to work on all the source files.
+ EXTRA_libopcodes_la_SOURCES = $(LIBOPCODES_CFILES)
+ 
++libtool-soversion:
++	@echo "creating $@"
++	bfd_soversion="$(VERSION)" ;\
++	. $(BFDDIR)/development.sh ;\
++	if test "$$development" = true ; then \
++	  bfd_soversion="$(VERSION).$${bfd_version_date}" ;\
++	fi ;\
++	echo "$${bfd_soversion}" > $@
++
+ # libtool will build .libs/libopcodes.a.  We create libopcodes.a in
+ # the build directory so that we don't have to convert all the
+ # programs that use libopcodes.a simultaneously.  This is a hack which
+diff --git a/opcodes/configure.ac b/opcodes/configure.ac
+index b9f5eb8a4f..ef2c2152b7 100644
+--- a/opcodes/configure.ac
++++ b/opcodes/configure.ac
+@@ -89,6 +89,7 @@ AC_PROG_INSTALL
+ 
+ AC_CHECK_HEADERS(string.h strings.h stdlib.h limits.h)
+ ACX_HEADER_STRING
++GCC_HEADER_STDINT(bfd_stdint.h)
+ 
+ AC_CHECK_DECLS([basename, stpcpy])
+ 
+@@ -134,61 +135,27 @@ AC_CACHE_CHECK(linker --as-needed support, bfd_cv_ld_as_needed,
+ 
+ LT_LIB_M
+ 
+-#Libs for generator progs
+-if test "x$cross_compiling" = "xno"; then
+-  BUILD_LIBS=../libiberty/libiberty.a
+-  BUILD_LIB_DEPS=$BUILD_LIBS
+-else
+-  # if cross-compiling, assume that the system provides -liberty
+-  # and that the version is compatible with new headers.
+-  BUILD_LIBS=-liberty
+-  BUILD_LIB_DEPS=
+-fi
+-BUILD_LIBS="$BUILD_LIBS $LIBINTL"
+-BUILD_LIB_DEPS="$BUILD_LIB_DEPS $LIBINTL_DEP"
++BUILD_LIBS="-liberty $LIBINTL"
++BUILD_LIB_DEPS="$LIBINTL_DEP"
+ 
+ AC_SUBST(BUILD_LIBS)
+ AC_SUBST(BUILD_LIB_DEPS)
+ 
+ # Horrible hacks to build DLLs on Windows and a shared library elsewhere.
+ SHARED_LDFLAGS=
+-SHARED_LIBADD=
++SHARED_LIBADD=-liberty
+ SHARED_DEPENDENCIES=
+ if test "$enable_shared" = "yes"; then
+-# When building a shared libopcodes, link against the pic version of libiberty
+-# so that apps that use libopcodes won't need libiberty just to satisfy any
+-# libopcodes references.
+-# We can't do that if a pic libiberty is unavailable since including non-pic
+-# code would insert text relocations into libopcodes.
+ # Note that linking against libbfd as we do here, which is itself linked
+ # against libiberty, may not satisfy all the libopcodes libiberty references
+ # since libbfd may not pull in the entirety of libiberty.
+-changequote(,)dnl
+-  x=`sed -n -e 's/^[ 	]*PICFLAG[ 	]*=[ 	]*//p' < ../libiberty/Makefile | sed -n '$p'`
+-changequote([,])dnl
+-  if test -n "$x"; then
+-    SHARED_LIBADD="-L`pwd`/../libiberty/pic -liberty"
+-  fi
+-
+   case "${host}" in
+     *-*-cygwin*)
+       SHARED_LDFLAGS="-no-undefined"
+-      SHARED_LIBADD="-L`pwd`/../bfd -lbfd -L`pwd`/../libiberty -liberty -L`pwd`/../intl -lintl -lcygwin"
++      SHARED_LIBADD="-lbfd -liberty -lintl -lcygwin"
+       ;;
+-   *-*-darwin*)
+-     SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.dylib ${SHARED_LIBADD}"
+-     SHARED_DEPENDENCIES="../bfd/libbfd.la"
+-     ;;
+     *)
+-      case "$host_vendor" in
+-        hp)
+-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.sl ${SHARED_LIBADD}"
+-	  ;;
+-	*)
+-          SHARED_LIBADD="-Wl,`pwd`/../bfd/.libs/libbfd.so ${SHARED_LIBADD}"
+-	  ;;
+-      esac
+-      SHARED_DEPENDENCIES="../bfd/libbfd.la"
++      SHARED_LIBADD="-lbfd ${SHARED_LIBADD}"
+       ;;
+   esac
+ 
+-- 
+2.14.2
+
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 62b4812fae5b9..8e44a982067d5 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -48,15 +48,16 @@ stdenv.mkDerivation rec {
     # there) and causes a cycle between the lib and bin outputs, so
     # get rid of it.
     ./no-plugins.patch
+
+    # Help bfd choose between elf32-littlearm, elf32-littlearm-symbian, and
+    # elf32-littlearm-vxworks in favor of the first.
+    # https://github.com/NixOS/nixpkgs/pull/30484#issuecomment-345472766
+    ./disambiguate-arm-targets.patch
   ];
 
-  outputs = [ "out" ]
-    ++ optional (targetPlatform == hostPlatform && !hostPlatform.isDarwin) "lib" # problems in Darwin stdenv
-    ++ [ "info" ]
-    ++ optional (targetPlatform == hostPlatform) "dev";
+  outputs = [ "out" "info" ];
 
-  nativeBuildInputs = [ bison ]
-    ++ optional (hostPlatform != buildPlatform) buildPackages.stdenv.cc;
+  nativeBuildInputs = [ bison buildPackages.stdenv.cc ];
   buildInputs = [ zlib ];
 
   inherit noSysDirs;
@@ -87,16 +88,21 @@ stdenv.mkDerivation rec {
     then []
     else [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
-  configureFlags =
-    [ "--enable-shared" "--enable-deterministic-archives" "--disable-werror" ]
-    ++ optional (stdenv.system == "mips64el-linux") "--enable-fix-loongson2f-nop"
-    ++ optionals gold [ "--enable-gold" "--enable-plugins" ]
-    ++ optional (stdenv.system == "i686-linux") "--enable-targets=x86_64-linux-gnu";
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--disable-install-libbfd"
+    "--disable-shared" "--enable-static"
+    "--with-system-zlib"
+
+    "--enable-deterministic-archives"
+    "--disable-werror"
+    "--enable-fix-loongson2f-nop"
+  ] ++ optionals gold [ "--enable-gold" "--enable-plugins" ];
 
   enableParallelBuilding = true;
 
   passthru = {
-    inherit prefix;
+    inherit prefix version;
   };
 
   meta = with stdenv.lib; {
@@ -109,6 +115,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://www.gnu.org/software/binutils/;
     license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
     platforms = platforms.unix;
 
     /* Give binutils a lower priority than gcc-wrapper to prevent a
diff --git a/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch b/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
new file mode 100644
index 0000000000000..abbfa73da05dc
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/disambiguate-arm-targets.patch
@@ -0,0 +1,23 @@
+diff --git a/bfd/elf32-arm.c b/bfd/elf32-arm.c
+index 9f956d3..f5b61f1 100644
+--- a/bfd/elf32-arm.c
++++ b/bfd/elf32-arm.c
+@@ -19585,7 +19585,10 @@ elf32_arm_vxworks_final_write_processing (bfd *abfd, bfd_boolean linker)
+ #undef  ELF_MAXPAGESIZE
+ #define ELF_MAXPAGESIZE			0x1000
+ 
++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-vxworks (priority 2) */
++#define elf_match_priority 2
+ #include "elf32-target.h"
++#undef  elf_match_priority
+ 
+ 
+ /* Merge backend specific data from an object file to the output
+@@ -19974,4 +19977,7 @@ elf32_arm_symbian_plt_sym_val (bfd_vma i, const asection *plt,
+ #undef  ELF_MAXPAGESIZE
+ #define ELF_MAXPAGESIZE			0x8000
+ 
++/* Prioritize elf32-*arm (priority 1) over elf32-*arm-symbian (priority 2) */
++#define elf_match_priority 2
+ #include "elf32-target.h"
++#undef  elf_match_priority
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 6ecc6bc0e52fe..d1148ad48d82b 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -1,18 +1,19 @@
-{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo, zlib
-, dejagnu, perl, pkgconfig
+{ stdenv
+
+# Build time
+, fetchurl, pkgconfig, perl, texinfo, setupDebugInfoDirs
+
+# Run time
+, ncurses, readline, gmp, mpfr, expat, zlib, dejagnu
 
 , buildPlatform, hostPlatform, targetPlatform
 
 , pythonSupport ? hostPlatform == buildPlatform && !hostPlatform.isCygwin, python ? null
 , guile ? null
 
-# Support all known targets in one gdb binary.
-, multitarget ? false
-
 # Additional dependencies for GNU/Hurd.
 , mig ? null, hurd ? null
 
-, setupDebugInfoDirs
 }:
 
 let
@@ -58,10 +59,16 @@ stdenv.mkDerivation rec {
   configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = with stdenv.lib; [
-    "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
-    "--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
-  ] ++ stdenv.lib.optional (!pythonSupport) "--without-python"
-    ++ stdenv.lib.optional multitarget "--enable-targets=all";
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--disable-install-libbfd"
+    "--disable-shared" "--enable-static"
+    "--with-system-zlib"
+    "--with-system-readline"
+
+    "--with-gmp=${gmp.dev}"
+    "--with-mpfr=${mpfr.dev}"
+    "--with-expat" "--with-libexpat-prefix=${expat.dev}"
+  ] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
 
   postInstall =
     '' # Remove Info files already provided by Binutils and other packages.
diff --git a/pkgs/development/tools/profiling/EZTrace/default.nix b/pkgs/development/tools/profiling/EZTrace/default.nix
index 004e5dbd46e55..98b38697992d6 100644
--- a/pkgs/development/tools/profiling/EZTrace/default.nix
+++ b/pkgs/development/tools/profiling/EZTrace/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, fetchurl, autoconf, libelf, libiberty, gfortran, zlib, binutils }:
+{ stdenv
+, fetchurl, autoconf, gfortran
+, libelf, libiberty, zlib, libbfd, libopcodes
+, buildPackages
+}:
 
 stdenv.mkDerivation rec {
   version = "1.0.6";
@@ -9,12 +13,15 @@ stdenv.mkDerivation rec {
     sha256 = "06q5y9qmdn1h0wjmy28z6gwswskmph49j7simfqcqwv05gvd9svr";
   };
 
-  # Goes past the rpl_malloc linking failure
+  # Goes past the rpl_malloc linking failure; fixes silent file breakage
   preConfigure = ''
     export ac_cv_func_malloc_0_nonnull=yes
+    substituteInPlace ./configure \
+      --replace "/usr/bin/file" "${buildPackages.file}/bin/file"
   '';
 
-  buildInputs = [ autoconf libelf libiberty gfortran zlib binutils ];
+  nativeBuildInputs = [ autoconf gfortran ];
+  buildInputs = [ libelf libiberty zlib libbfd libopcodes ];
 
   meta = {
     description = "Tool that aims at generating automatically execution trace from HPC programs";
diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix
index dc447465b2386..6087400af5be3 100644
--- a/pkgs/development/tools/profiling/oprofile/default.nix
+++ b/pkgs/development/tools/profiling/oprofile/default.nix
@@ -1,5 +1,8 @@
-{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig, linuxHeaders, coreutils
-, libiberty_static, withGUI ? false , qt4 ? null}:
+{ stdenv, buildPackages
+, fetchurl, pkgconfig
+, libbfd, popt, zlib, linuxHeaders, libiberty_static
+, withGUI ? false, qt4 ? null
+}:
 
 # libX11 is needed because the Qt build stuff automatically adds `-lX11'.
 assert withGUI -> qt4 != null;
@@ -14,12 +17,12 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     substituteInPlace opjitconv/opjitconv.c \
-      --replace "/bin/rm" "${coreutils}/bin/rm" \
-      --replace "/bin/cp" "${coreutils}/bin/cp"
+      --replace "/bin/rm" "${buildPackages.coreutils}/bin/rm" \
+      --replace "/bin/cp" "${buildPackages.coreutils}/bin/cp"
   '';
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ binutils zlib popt linuxHeaders libiberty_static ]
+  buildInputs = [ libbfd zlib popt linuxHeaders libiberty_static ]
     ++ stdenv.lib.optionals withGUI [ qt4 ];
 
   configureFlags = [
diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix
index 001560df0a040..a2ea3444db602 100644
--- a/pkgs/development/tools/profiling/sysprof/default.nix
+++ b/pkgs/development/tools/profiling/sysprof/default.nix
@@ -1,5 +1,7 @@
-{ fetchurl, stdenv, binutils
-, pkgconfig, gtk2, glib, pango, libglade }:
+{ stdenv
+, fetchurl, pkgconfig
+, gtk2, glib, pango, libglade
+}:
 
 stdenv.mkDerivation rec {
   name = "sysprof-1.2.0";
@@ -10,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ binutils gtk2 glib pango libglade ];
+  buildInputs = [ gtk2 glib pango libglade ];
 
   meta = {
     homepage = http://sysprof.com/;
diff --git a/pkgs/development/tools/wp-cli/default.nix b/pkgs/development/tools/wp-cli/default.nix
index e0aac84abb70a..9dfd3b7e7289f 100644
--- a/pkgs/development/tools/wp-cli/default.nix
+++ b/pkgs/development/tools/wp-cli/default.nix
@@ -2,11 +2,11 @@
 
 let
   name = "wp-cli-${version}";
-  version = "1.4.0";
+  version = "1.4.1";
 
   src = fetchurl {
     url    = "https://github.com/wp-cli/wp-cli/releases/download/v${version}/${name}.phar";
-    sha256 = "0rav5a6znx81gwaxin1ib10sbfg16bgdnnyv1zn5sjify3f1wpqj";
+    sha256 = "0fyfwpsbm9s3khxq8876ah85vjwfd5r4a59aix3zjmhq2v7j8n9j";
   };
 
   completion = fetchurl {
diff --git a/pkgs/development/web/nodejs/v9.nix b/pkgs/development/web/nodejs/v9.nix
index aa51421253fb6..8a1cd2d148d1b 100644
--- a/pkgs/development/web/nodejs/v9.nix
+++ b/pkgs/development/web/nodejs/v9.nix
@@ -5,7 +5,7 @@ let
 in
   buildNodejs {
     inherit enableNpm;
-    version = "9.0.0";
-    sha256 = "19az7mxcb3d1aj0f7gvhriyyghn1rwn0425924pa84d6j1mbsljv";
+    version = "9.2.0";
+    sha256 = "1hmvwfbavk2axqz9kin8b5zsld25gznhvlz55h3yl6nwx9iz5jk4";
     patches = lib.optionals stdenv.isDarwin [ ./no-xcode-v7.patch ];
   }
diff --git a/pkgs/games/freedink/default.nix b/pkgs/games/freedink/default.nix
index 94451ef8930d1..c1bfda9e2f2f3 100644
--- a/pkgs/games/freedink/default.nix
+++ b/pkgs/games/freedink/default.nix
@@ -28,11 +28,18 @@ in stdenv.mkDerivation rec {
     pkgconfig intltool fontconfig libzip zip zlib
   ];
 
+  preConfigure = ''
+    # Build fails on Linux with windres.
+    export ac_cv_prog_ac_ct_WINDRES=
+  '';
+
   postInstall = ''
     mkdir -p "$out/share/"
     ln -s ${freedink_data}/share/dink "$out/share/"
   '';
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "A free, portable and enhanced version of the Dink Smallwood game engine";
 
diff --git a/pkgs/games/freesweep/default.nix b/pkgs/games/freesweep/default.nix
new file mode 100644
index 0000000000000..9d07eda74b81c
--- /dev/null
+++ b/pkgs/games/freesweep/default.nix
@@ -0,0 +1,35 @@
+{ fetchurl, ncurses, stdenv,
+  updateAutotoolsGnuConfigScriptsHook }:
+
+stdenv.mkDerivation rec {
+  name = "freesweep-${version}";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/rwestlund/freesweep/archive/v${version}.tar.gz";
+    sha256 = "0l2kf14558lsq9qd2hs0kcyn9bbl1jdbzwrvcs6mnyjl7zpizcpj";
+  };
+
+  nativeBuildInputs = [ updateAutotoolsGnuConfigScriptsHook ];
+  buildInputs = [ ncurses ];
+
+  preConfigure = ''
+    configureFlags="$configureFlags --with-prefsdir=$out/share"
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -D -m 0555 freesweep $out/bin/freesweep
+    install -D -m 0444 sweeprc $out/share/sweeprc
+    install -D -m 0444 freesweep.6 $out/share/man/man6/freesweep.6
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A console minesweeper-style game written in C for Unix-like systems";
+    homepage = https://github.com/rwestlund/freesweep;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ kierdavis ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/games/macopix/default.nix b/pkgs/games/macopix/default.nix
index 72b0b0d00cddd..b490231442e3a 100644
--- a/pkgs/games/macopix/default.nix
+++ b/pkgs/games/macopix/default.nix
@@ -11,6 +11,13 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ gtk openssl ];
 
+  preConfigure = ''
+    # Build fails on Linux with windres.
+    export ac_cv_prog_WINDRES=
+  '';
+
+  enableParallelBuilding = true;
+
   meta = {
     description = "Mascot Constructive Pilot for X";
     homepage = http://rosegray.sakura.ne.jp/macopix/index-e.html;
diff --git a/pkgs/games/mudlet/default.nix b/pkgs/games/mudlet/default.nix
index 078075931dae7..673efb0e118da 100644
--- a/pkgs/games/mudlet/default.nix
+++ b/pkgs/games/mudlet/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     cp -r mudlet-lua $out
 
     makeWrapper $out/mudlet $out/bin/mudlet \
-      --set LUA_CPATH "\"${luaFileSystemPath};${luaZipPath};${lrexlibPath};${luasqlitePath}\"" \
+      --set LUA_CPATH "${luaFileSystemPath};${luaZipPath};${lrexlibPath};${luasqlitePath}" \
       --run "cd $out";
   '';
 
diff --git a/pkgs/games/pysolfc/default.nix b/pkgs/games/pysolfc/default.nix
new file mode 100644
index 0000000000000..85424ebea9ba6
--- /dev/null
+++ b/pkgs/games/pysolfc/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, python2, stdenv }:
+
+with python2.pkgs;
+
+buildPythonApplication rec {
+  pname = "PySolFC";
+  version = "2.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pysolfc/${pname}-${version}.tar.bz2";
+    sha256 = "0v0v8iflw55f5mghglkw80j8b7lv1hffjassfhqc4y84dmz8xjyv";
+  };
+
+  patches = [
+    ./pysolfc-datadir.patch
+  ];
+
+  propagatedBuildInputs = [
+    tkinter
+  ];
+
+  # No tests in archive
+  doCheck = false;
+
+  postInstall = ''
+    # executables should not have an extension
+    pushd $out/bin
+    mv pysol.py pysol
+    rm pysol.pyc
+    popd
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A collection of more than 1000 solitaire card games";
+    homepage = http://pysolfc.sourceforge.net/;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ kierdavis ];
+  };
+}
diff --git a/pkgs/games/pysolfc/pysolfc-datadir.patch b/pkgs/games/pysolfc/pysolfc-datadir.patch
new file mode 100644
index 0000000000000..d9f1cf4e09f50
--- /dev/null
+++ b/pkgs/games/pysolfc/pysolfc-datadir.patch
@@ -0,0 +1,19 @@
+diff --git a/pysollib/util.py b/pysollib/util.py
+index 8de3f00..26f4bc7 100644
+--- a/pysollib/util.py
++++ b/pysollib/util.py
+@@ -110,13 +110,7 @@ class DataLoader:
+         head, tail = os.path.split(argv0)
+         if not head:
+             head = os.curdir
+-        # dir where placed startup script
+-        path.append(head)
+-        path.append(os.path.join(head, "data"))
+-        path.append(os.path.join(head, os.pardir, "data"))
+-        # dir where placed pysol package
+-        path.append(os.path.join(sys.path[0], "data"))
+-        path.append(os.path.join(sys.path[0], "pysollib", "data"))
++        path.append(os.path.join(head, "..", "share", "PySolFC"))
+         # from settings.py
+         path.extend(DATA_DIRS)
+         # check path for valid directories
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix b/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix
new file mode 100644
index 0000000000000..2856aee4a5d25
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/default.nix
@@ -0,0 +1,150 @@
+{ stdenv, lib, fetchzip,
+  autoconf, automake, libtool,
+  cups, popt, libtiff, libpng,
+  ghostscript, glib, libusb, libxml2 }:
+
+/* this derivation is basically just a transcription of the rpm .spec
+   file included in the tarball */
+
+let arch = 
+  if stdenv.system == "x86_64-linux" then "64"
+    else if stdenv.system == "i686-linux" then "32"
+    else abort "Unsupported architecture";
+
+in stdenv.mkDerivation rec {
+  name = "cnijfilter-${version}";
+
+  /* important note about versions: cnijfilter packages seem to use
+     versions in a non-standard way.  the version indicates which
+     printers are supported in the package.  so this package should
+     not be "upgraded" in the usual way.
+
+     instead, if you want to include another version supporting your
+     printer, you should try to abstract out the common things (which
+     should be pretty much everything except the version and the 'pr'
+     and 'pr_id' values to loop over). */
+  version = "4.00";
+
+  src = fetchzip {
+    url = "http://gdlp01.c-wss.com/gds/5/0100005515/01/cnijfilter-source-4.00-1.tar.gz";
+    sha256 = "1f6vpx1z3qa88590i5m0s49j9n90vpk81xmw6pvj0nfd3qbvzkya";
+  };
+
+  buildInputs = [ autoconf libtool automake
+                  cups popt libtiff libpng
+                  ghostscript glib libusb libxml2 ];
+
+  # patches from https://github.com/tokiclover/bar-overlay/tree/master/net-print/cnijfilter
+  patches = [
+    ./patches/cnijfilter-3.80-1-cups-1.6.patch
+    ./patches/cnijfilter-3.80-6-cups-1.6.patch
+    ./patches/cnijfilter-4.00-4-ppd.patch
+    ./patches/cnijfilter-4.00-5-abi_x86_32.patch
+    ./patches/cnijfilter-4.00-6-headers.patch
+  ];
+
+  postPatch = ''
+    sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backend/src/Makefile.am;
+    sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" backendnet/backend/Makefile.am;
+    sed -i "s|/usr/lib/cups/backend|$out/lib/cups/backend|" cnijbe/src/Makefile.am;
+    sed -i "s|/usr|$out|" backend/src/cnij_backend_common.c;
+    sed -i "s|/usr/bin|${ghostscript}/bin|" pstocanonij/filter/pstocanonij.c;
+  '';
+
+  configurePhase = ''
+    cd libs
+    ./autogen.sh --prefix=$out 
+
+    cd ../bscc2sts
+    ./autogen.sh 
+
+    cd ../cnijnpr
+    ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib
+
+    cd ../cngpij
+    ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+
+    cd ../cngpijmnt
+    ./autogen.sh --prefix=$out --enable-progpath=$out/bin
+
+    cd ../pstocanonij
+    ./autogen.sh --prefix=$out --enable-progpath=$out/bin 
+
+    cd ../backend
+    ./autogen.sh --prefix=$out
+
+    cd ../backendnet
+    ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin 
+
+    cd ../cmdtocanonij
+    ./autogen.sh --prefix=$out --datadir=$out/share
+
+    cd ../cnijbe
+    ./autogen.sh --prefix=$out --enable-progpath=$out/bin 
+
+    cd ../lgmon2
+    substituteInPlace src/Makefile.am \
+        --replace /usr/include/libusb-1.0 \
+                  ${libusb.dev}/include/libusb-1.0
+    ./autogen.sh --prefix=$out --enable-libpath=$out/lib/bjlib --enable-progpath=$out/bin 
+
+    cd ..;
+
+    sed -e "s,cnijlgmon2_LDADD =,cnijlgmon2_LDADD = -L../../com/libs_bin${arch}," \
+    -i lgmon2/src/Makefile.am || die
+  '';
+
+  preInstall = ''
+    mkdir -p $out/bin $out/lib/cups/filter $out/share/cups/model;
+  '';
+
+  postInstall = ''
+    set -o xtrace
+    for pr in mg2400 mg2500 mg3500 mg5500 mg6400 mg6500 mg7100 p200; do
+      cd ppd;
+      ./autogen.sh --prefix=$out --program-suffix=$pr
+      make clean;
+      make;
+      make install;
+
+      cd ../cnijfilter;
+      ./autogen.sh --prefix=$out --program-suffix=$pr --enable-libpath=/var/lib/cups/path/lib/bjlib --enable-binpath=$out/bin;
+      make clean;
+      make;
+      make install;
+
+      cd ..;
+    done;
+
+    mkdir -p $out/lib/bjlib;
+    for pr_id in 423 424 425 426 427 428 429 430; do
+      install -c -m 755 $pr_id/database/* $out/lib/bjlib;
+      install -c -s -m 755 $pr_id/libs_bin${arch}/*.so.* $out/lib;
+    done;
+
+    pushd $out/lib;
+    for so_file in *.so.*; do
+      ln -s $so_file ''${so_file/.so.*/}.so;
+      patchelf --set-rpath $out/lib $so_file;
+    done;
+    popd;
+  '';
+
+  /* the tarball includes some pre-built shared libraries.  we run
+     'patchelf --set-rpath' on them just a few lines above, so that
+     they can find each other.  but that's not quite enough.  some of
+     those libraries load each other in non-standard ways -- they
+     don't list each other in the DT_NEEDED section.  so, if the
+     standard 'patchelf --shrink-rpath' (from
+     pkgs/development/tools/misc/patchelf/setup-hook.sh) is run on
+     them, it undoes the --set-rpath.  this prevents that. */
+  dontPatchELF = true;
+
+  meta = with lib; {
+    description = "Canon InkJet printer drivers for the MG2400 MG2500 MG3500 MG5500 MG6400 MG6500 MG7100 and P200 series.";
+    homepage = https://www.canon-europe.com/support/consumer_products/products/fax__multifunctionals/inkjet/pixma_mg_series/pixma_mg5550.aspx?type=drivers&driverdetailid=tcm:13-1094072;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ chpatrick ];
+  };
+}
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch
new file mode 100644
index 0000000000000..dfc0bb2268cb2
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-1-cups-1.6.patch
@@ -0,0 +1,62 @@
+--- a/cngpij/cngpij/bjcups.c
++++ a/cngpij/cngpij/bjcups.c
+@@ -698,8 +719,8 @@
+ 	else {
+ 		pRequest = ippNew();
+ 		
+-		pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
+-		pRequest->request.op.request_id   = 1;
++		ippSetOperation(pRequest, CUPS_GET_PRINTERS);
++		ippSetRequestId(pRequest, 1);
+ 		
+ 		pLanguage = bjcupsLangDefault();	// cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+ 		
+@@ -708,29 +729,29 @@
+ 		ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
+ 		
+ 		if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+-			if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++			if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ 				fputs("ERROR: IPP ERROR\n", stderr);
+ 				goto onErr;
+ 			}
+ 			else {
+-				pAttribute = pResponse->attrs;
++				pAttribute = ippFirstAttribute(pResponse);
+ 
+ 				while (pAttribute != NULL) {
+-					while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
+-						pAttribute = pAttribute->next;
++					while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
++						pAttribute = ippNextAttribute(pResponse);
+ 					}
+ 					if (pAttribute == NULL) {
+ 						break;
+ 					}
+ 					
+-					while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
+-						if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
+-							pPrinter = pAttribute->values[0].string.text;
++					while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
++						if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
++							pPrinter = ippGetString(pAttribute, 0, NULL);
+ 						}
+-						if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
+-							pDUri = pAttribute->values[0].string.text;
++						if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
++							pDUri = ippGetString(pAttribute, 0, NULL);
+ 						}
+-						pAttribute = pAttribute->next;
++						pAttribute = ippNextAttribute(pResponse);
+ 					}
+ 
+ 					if (strcasecmp(pDestName, pPrinter) == 0) {
+@@ -739,7 +760,7 @@
+ 					}
+ 					
+ 					if (pAttribute != NULL)
+-						 pAttribute = pAttribute->next;
++						pAttribute = ippNextAttribute(pResponse);
+ 				}
+ 			}
+
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch
new file mode 100644
index 0000000000000..6b51d4837d455
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-3.80-6-cups-1.6.patch
@@ -0,0 +1,87 @@
+diff --git a/cngpijmnt/src/getipc.c b/cngpijmnt/src/getipc.c
+index 8688032..54c7933 100755
+--- a/cngpijmnt/src/getipc.c
++++ b/cngpijmnt/src/getipc.c
+@@ -42,7 +42,7 @@ int GetIPCData(LPIPCU pipc, char *sname)
+ 	int server_fd;
+ 	int client_fd;
+ 	char buf[128];
+-	size_t len;
++	socklen_t len;
+ 	short ret = RET_ERROR;
+ 
+ 	if( (server_fd = socket(PF_UNIX, SOCK_STREAM, 0)) < 0 )
+
+--- a/cngpijmnt/src/main.c	2016-11-12 23:39:03.534855723 +0100
++++ b/cngpijmnt/src/main.c	2016-11-12 23:47:02.521847145 +0100
+@@ -308,8 +308,8 @@
+ 					*pResponse;					// Pointer to CUPS IPP response.
+ 	ipp_attribute_t	*pAttribute;				// Pointer to CUPS attributes.
+ 	cups_lang_t		*pLanguage;					// Pointer to language.
+-	char			*pPrinter = NULL;			// Pointer to printer name.
+-	char			*pDUri = NULL;				// Pointer to Device uri.
++	const char			*pPrinter = NULL;			// Pointer to printer name.
++	const char			*pDUri = NULL;				// Pointer to Device uri.
+ 	short			retVal = -1;	// Return value.
+ /*** Parameters end ***/
+ 	
+@@ -321,8 +321,8 @@
+ 	else {
+ 		pRequest = ippNew();
+ 		
+-		pRequest->request.op.operation_id = CUPS_GET_PRINTERS;
+-		pRequest->request.op.request_id   = 1;
++		ippSetOperation(pRequest, CUPS_GET_PRINTERS);
++		ippSetRequestId(pRequest, 1);
+ 		
+ 		pLanguage = bjcupsLangDefault();	// cupsLangDefault() -> bjcupsLangDefault() for cups-1.1.19
+ 		
+@@ -331,29 +331,29 @@
+ 		ippAddString(pRequest, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, NULL);
+ 		
+ 		if ((pResponse = cupsDoRequest(pHTTP, pRequest, "/")) != NULL) {
+-			if (pResponse->request.status.status_code > IPP_OK_CONFLICT) {
++			if (ippGetStatusCode(pResponse) > IPP_OK_CONFLICT) {
+ 				fputs("ERROR: IPP ERROR\n", stderr);
+ 				goto onErr;
+ 			}
+ 			else {
+-				pAttribute = pResponse->attrs;
++				pAttribute = ippFirstAttribute(pResponse);
+ 
+ 				while (pAttribute != NULL) {
+-					while (pAttribute != NULL && pAttribute->group_tag != IPP_TAG_PRINTER) {
+-						pAttribute = pAttribute->next;
++					while (pAttribute != NULL && ippGetGroupTag(pAttribute) != IPP_TAG_PRINTER) {
++						pAttribute = ippNextAttribute(pResponse);
+ 					}
+ 					if (pAttribute == NULL) {
+ 						break;
+ 					}
+ 					
+-					while (pAttribute != NULL && pAttribute->group_tag == IPP_TAG_PRINTER) {
+-						if (strcmp(pAttribute->name, "printer-name") == 0 && pAttribute->value_tag == IPP_TAG_NAME) {
+-							pPrinter = pAttribute->values[0].string.text;
++					while (pAttribute != NULL && ippGetGroupTag(pAttribute) == IPP_TAG_PRINTER) {
++						if (strcmp(ippGetName(pAttribute), "printer-name") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_NAME) {
++							pPrinter = ippGetString(pAttribute, 0, NULL);
+ 						}
+-						if (strcmp(pAttribute->name, "device-uri") == 0 && pAttribute->value_tag == IPP_TAG_URI) {
+-							pDUri = pAttribute->values[0].string.text;
++						if (strcmp(ippGetName(pAttribute), "device-uri") == 0 && ippGetValueTag(pAttribute) == IPP_TAG_URI) {
++							pDUri = ippGetString(pAttribute, 0, NULL);
+ 						}
+-						pAttribute = pAttribute->next;
++						pAttribute = ippNextAttribute(pResponse);
+ 					}
+ 
+ 					if (strcasecmp(pDestName, pPrinter) == 0) {
+@@ -362,7 +362,7 @@
+ 					}
+ 					
+ 					if (pAttribute != NULL)
+-						 pAttribute = pAttribute->next;
++						 pAttribute = ippNextAttribute(pResponse);
+ 				}
+ 			}
+ 			
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch
new file mode 100644
index 0000000000000..92bef72ba0563
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-4-ppd.patch
@@ -0,0 +1,10 @@
+--- a/backend/src/cnij_backend_common.c	2016-11-13 00:08:34.600824006 +0100
++++ a/backend/src/cnij_backend_common.c	2016-11-13 00:08:52.037823694 +0100
+@@ -37,6 +37,7 @@
+ // CUPS Header
+ #include <cups/cups.h>
+ #include <cups/ipp.h>
++#include <cups/ppd.h>
+ 
+ // Header file for CANON
+ #include "cnij_backend_common.h"
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch
new file mode 100644
index 0000000000000..dc85801a256b2
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-5-abi_x86_32.patch
@@ -0,0 +1,45 @@
+--- a/backendnet/configure.in	2014-08-11 08:38:46.034984462 +0200
++++ a/backendnet/configure.in	2014-08-11 08:35:42.902985813 +0200
+@@ -19,7 +19,11 @@
+ AC_DEFINE_UNQUOTED(BJLIB_PATH, "$enable_libpath")
+ AC_SUBST(BJLIB_PATH)
+ 
+-ARC=`getconf LONG_BIT`
++case "$ABI" in
++    x86) ARC=32;;
++    amd64) ARC=64;;
++    *) ARC=`getconf LONG_BIT`;;
++esac
+ AC_SUBST(ARC)
+ 
+ # Checks for programs.
+--- a/cnijfilter/configure.in	2014-08-11 08:39:44.426984031 +0200
++++ a/cnijfilter/configure.in	2014-08-11 08:35:19.788985984 +0200
+@@ -43,7 +43,11 @@
+ esac
+ AC_SUBST(CNCL_LIB_ID)
+ 
+-ARC=`getconf LONG_BIT`
++case "$ABI" in
++    x86) ARC=32;;
++    amd64) ARC=64;;
++    *) ARC=`getconf LONG_BIT`;;
++esac
+ AC_SUBST(ARC)
+ 
+ AC_PROG_CC
+--- a/cnijnpr/configure.in	2014-08-11 08:41:12.712983380 +0200
++++ a/cnijnpr/configure.in	2014-08-11 08:40:44.354983589 +0200
+@@ -37,7 +37,11 @@
+ 
+ CFLAGS="-O2"
+ 
+-ARC=`getconf LONG_BIT`
++case "$ABI" in
++    x86) ARC=32;;
++    amd64) ARC=64;;
++    *) ARC=`getconf LONG_BIT`;;
++esac
+ AC_SUBST(ARC)
+ 
+ AC_OUTPUT(Makefile
diff --git a/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch
new file mode 100644
index 0000000000000..7dba799951141
--- /dev/null
+++ b/pkgs/misc/cups/drivers/cnijfilter_4_00/patches/cnijfilter-4.00-6-headers.patch
@@ -0,0 +1,11 @@
+--- a/cnijnpr/src/cnijnpr.c	2016-11-13 21:51:33.844977618 +0100
++++ a/cnijnpr/src/cnijnpr.c	2016-11-13 21:52:03.129977094 +0100
+@@ -34,6 +34,8 @@
+ #include <sys/ioctl.h>
+ #include <net/if.h>
+ #include <sys/sysctl.h>
++#include <sys/types.h>
++#include <unistd.h>
+ #include <config.h>
+ #include <fcntl.h>
+ 
diff --git a/pkgs/misc/emulators/openmsx/custom-nixos.mk b/pkgs/misc/emulators/openmsx/custom-nixos.mk
new file mode 100644
index 0000000000000..9098762e40d5d
--- /dev/null
+++ b/pkgs/misc/emulators/openmsx/custom-nixos.mk
@@ -0,0 +1,9 @@
+# This file substitutes $sourceRoot/build/custom.mk
+
+VERSION_EXEC:=false
+SYMLINK_FOR_BINARY:=false
+INSTALL_CONTRIB:=true
+INSTALL_BASE:=${out}
+INSTALL_DOC_DIR:=${INSTALL_BASE}/share/doc/openmsx
+INSTALL_SHARE_DIR:=${INSTALL_BASE}/share/openmsx
+INSTALL_BINARY_DIR:=${INSTALL_BASE}/bin
diff --git a/pkgs/misc/emulators/openmsx/default.nix b/pkgs/misc/emulators/openmsx/default.nix
new file mode 100644
index 0000000000000..bb954582de5da
--- /dev/null
+++ b/pkgs/misc/emulators/openmsx/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchFromGitHub, pkgconfig
+, python
+, alsaLib, glew, mesa_noglu, libpng
+, libogg, libtheora, libvorbis
+, SDL, SDL_image, SDL_ttf
+, freetype, tcl, zlib
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "openmsx-${version}";
+  version = "git-2017-11-02";
+
+  src = fetchFromGitHub {
+    owner = "openMSX";
+    repo = "openMSX";
+    rev = "eeb74206ae347a3b17e9b99f91f2b4682c5db22c";
+    sha256 = "170amj7k6wjhwx6psbplqljvckvhxxbv3aw72jrdxl1fb8zlnq3s";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkgconfig python ];
+
+  buildInputs = [ alsaLib glew mesa_noglu libpng
+    libogg libtheora libvorbis freetype
+    SDL SDL_image SDL_ttf tcl zlib ];
+
+  postPatch = ''
+    cp ${./custom-nixos.mk} build/custom.mk
+  '';
+
+  dontAddPrefix = true;
+
+  # Many thanks @mthuurne from OpenMSX project
+  # for providing support to Nixpkgs :)
+  TCL_CONFIG="${tcl}/lib/";
+
+  meta = with stdenv.lib; {
+    description = "A MSX emulator";
+    longDescription = ''
+      OpenMSX is an emulator for the MSX home computer system. Its goal is
+      to emulate all aspects of the MSX with 100% accuracy.
+    '';
+    homepage = https://openmsx.org;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/misc/emulators/retroarch/cores.nix b/pkgs/misc/emulators/retroarch/cores.nix
index c2ec16081e863..ab1e71380c13f 100644
--- a/pkgs/misc/emulators/retroarch/cores.nix
+++ b/pkgs/misc/emulators/retroarch/cores.nix
@@ -26,6 +26,8 @@ let
         --add-flags "-L $COREDIR/${d2u core}_libretro.so $@"
     '';
 
+    enableParallelBuilding = true;
+
     passthru = {
       core = core;
       libretroCore = "/lib/retroarch/cores";
diff --git a/pkgs/misc/emulators/retrofe/default.nix b/pkgs/misc/emulators/retrofe/default.nix
index 5f921c5a92317..ffc494dad4ca9 100644
--- a/pkgs/misc/emulators/retrofe/default.nix
+++ b/pkgs/misc/emulators/retrofe/default.nix
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   postInstall = ''
     wrapProgram "$out/bin/retrofe" \
       --prefix GST_PLUGIN_PATH : "$GST_PLUGIN_SYSTEM_PATH_1_0" \
-      --set    RETROFE_PATH      "\''${RETROFE_PATH:-\$PWD}"
+      --run 'export RETROFE_PATH=''${RETROFE_PATH:-$PWD}'
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/os-specific/darwin/apple-sdk/default.nix b/pkgs/os-specific/darwin/apple-sdk/default.nix
index 9a6624104f455..5a58410ae9261 100644
--- a/pkgs/os-specific/darwin/apple-sdk/default.nix
+++ b/pkgs/os-specific/darwin/apple-sdk/default.nix
@@ -198,23 +198,29 @@ in rec {
   };
 
   overrides = super: {
-    QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: {
-      installPhase = drv.installPhase + ''
-        f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h"
-        substituteInPlace "$f" \
-          --replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage"
-      '';
+    AppKit = stdenv.lib.overrideDerivation super.AppKit (drv: {
+      __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [
+        "/System/Library/PrivateFrameworks/"
+      ];
     });
 
-    CoreServices = stdenv.lib.overrideDerivation super.CoreServices (drv: {
-      __propagatedSandboxProfile = drv.__propagatedSandboxProfile ++ [''
-        (allow mach-lookup (global-name "com.apple.CoreServices.coreservicesd"))
-      ''];
+    CoreMedia = stdenv.lib.overrideDerivation super.CoreMedia (drv: {
+      __propagatedImpureHostDeps = drv.__propagatedImpureHostDeps ++ [
+        "/System/Library/Frameworks/CoreImage.framework"
+      ];
     });
 
     Security = stdenv.lib.overrideDerivation super.Security (drv: {
       setupHook = ./security-setup-hook.sh;
     });
+
+    QuartzCore = stdenv.lib.overrideDerivation super.QuartzCore (drv: {
+      installPhase = drv.installPhase + ''
+        f="$out/Library/Frameworks/QuartzCore.framework/Headers/CoreImage.h"
+        substituteInPlace "$f" \
+          --replace "QuartzCore/../Frameworks/CoreImage.framework/Headers" "CoreImage"
+      '';
+    });
   };
 
   bareFrameworks = stdenv.lib.mapAttrs framework (import ./frameworks.nix {
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix
index 8dcf28a59094a..7fd32a64fe575 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Csu/default.nix
@@ -1,25 +1,23 @@
 { stdenv, appleDerivation }:
 
 appleDerivation {
-  postUnpack = ''
-    substituteInPlace $sourceRoot/Makefile \
-      --replace "/usr/lib" "/lib" \
-      --replace "/usr/local/lib" "/lib" \
-      --replace "/usr/bin" "" \
-      --replace "/bin/" "" \
+  prePatch = ''
+    substituteInPlace Makefile \
+      --replace /usr/lib /lib \
+      --replace /usr/local/lib /lib \
+      --replace /usr/bin "" \
+      --replace /bin/ "" \
       --replace "CC = " "CC = cc #" \
-      --replace "SDK_DIR = " "SDK_DIR = . #"
-  '';
-
-  # Mac OS didn't support rpaths back before 10.5, and this package intentionally builds stubs targeting versions prior to that
-  NIX_DONT_SET_RPATH = "1";
-  NIX_NO_SELF_RPATH  = "1";
+      --replace "SDK_DIR = " "SDK_DIR = . #" \
 
-  installPhase = ''
-    export DSTROOT=$out
-    make install
+    # Mac OS didn't support rpaths back before 10.5, but we don't care about it.
+    substituteInPlace Makefile \
+      --replace -mmacosx-version-min=10.4 -mmacosx-version-min=10.6 \
+      --replace -mmacosx-version-min=10.5 -mmacosx-version-min=10.6
   '';
 
+  installFlags = [ "DSTROOT=$(out)" ];
+
   meta = with stdenv.lib; {
     description = "Apple's common startup stubs for darwin";
     maintainers = with maintainers; [ copumpkin ];
diff --git a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
index 3d7e59f155472..28406c9751dc5 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/Libsystem/default.nix
@@ -23,7 +23,7 @@ appleDerivation rec {
       (cd $dep/include && find . -name '*.h' | cpio -pdm $out/include)
     done
 
-    (cd ${cctools}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o)
+    (cd ${cctools.dev}/include/mach-o && find . -name '*.h' | cpio -pdm $out/include/mach-o)
 
     cat <<EOF > $out/include/TargetConditionals.h
     #ifndef __TARGETCONDITIONALS__
diff --git a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
index 2b31b04204024..20168d24dd712 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/configd/default.nix
@@ -8,10 +8,6 @@ appleDerivation {
 
   propagatedBuildInputs = [ Security ];
 
-  propagatedSandboxProfile = ''
-    (allow mach-lookup (global-name "com.apple.SystemConfiguration.configd"))
-  '';
-
   patchPhase = ''
     HACK=$PWD/hack
     mkdir $HACK
diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
index 0ce9c54e48c4a..2c7da5be6e4c1 100644
--- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
+++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl }:
+{ stdenv, appleDerivation, fetchzip, bootstrap_cmds, bison, flex, gnum4, unifdef, perl, python }:
 
 appleDerivation {
   phases = [ "unpackPhase" "patchPhase" "installPhase" ];
 
-  buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl ];
+  buildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python ];
 
   patchPhase = ''
     substituteInPlace Makefile \
diff --git a/pkgs/os-specific/darwin/binutils/default.nix b/pkgs/os-specific/darwin/binutils/default.nix
index 5fc0db44f860e..8ac93689373d1 100644
--- a/pkgs/os-specific/darwin/binutils/default.nix
+++ b/pkgs/os-specific/darwin/binutils/default.nix
@@ -37,17 +37,8 @@ stdenv.mkDerivation {
       ln -sf "${cctools}/bin/$i" "$out/bin/$i"
     done
 
-    for i in ${stdenv.lib.getDev binutils-raw}/include/*.h; do
-      ln -s "$i" "$out/include/$(basename $i)"
-    done
-
-    for i in ${cctools}/include/*; do
-      ln -s "$i" "$out/include/$(basename $i)"
-    done
-
     # FIXME: this will give us incorrect man pages for bits of cctools
     ln -s ${binutils-raw.out}/share $out/share
-    ln -s ${binutils-raw.out}/lib $out/lib
 
     ln -s ${cctools}/libexec $out/libexec
   '';
diff --git a/pkgs/os-specific/darwin/cctools/port.nix b/pkgs/os-specific/darwin/cctools/port.nix
index 1f2e7c1437803..e08e783398326 100644
--- a/pkgs/os-specific/darwin/cctools/port.nix
+++ b/pkgs/os-specific/darwin/cctools/port.nix
@@ -29,6 +29,8 @@ let
       sha256 = "0l45mvyags56jfi24rawms8j2ihbc45mq7v13pkrrwppghqrdn52";
     };
 
+    outputs = [ "out" "dev" ];
+
     nativeBuildInputs = [ autoconf automake libtool_2 ];
     buildInputs = [ libuuid ] ++
       # Only need llvm and clang if the stdenv isn't already clang-based (TODO: just make a stdenv.cc.isClang)
@@ -39,6 +41,12 @@ let
       ./ld-rpath-nonfinal.patch ./ld-ignore-rpath-link.patch
     ];
 
+    __propagatedImpureHostDeps = [
+      # As far as I can tell, otool from cctools is the only thing that depends on these two, and we should fix them
+      "/usr/lib/libobjc.A.dylib"
+      "/usr/lib/libobjc.dylib"
+    ];
+
     enableParallelBuilding = true;
 
     # TODO(@Ericson2314): Always pass "--target" and always prefix.
diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix
index 8a6eb77e6b1e1..5b0d404faaf02 100644
--- a/pkgs/os-specific/linux/alsa-lib/default.nix
+++ b/pkgs/os-specific/linux/alsa-lib/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "alsa-lib-1.1.4.1";
+  name = "alsa-lib-1.1.5";
 
   src = fetchurl {
     urls = [
      "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2"
      "http://alsa.cybermirror.org/lib/${name}.tar.bz2"
     ];
-    sha256 = "0xjvi381105gldhv0z872a0x58sghznyx19j45lw5iyi2h68gfwi";
+    sha256 = "1rhacnlj0grvfagjx5qzsnbhw7m7lyccghqs4jsv0dnsqv9qmxpl";
   };
 
   patches = [
diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix
index ae0aaa3cb6389..dc11d21ff1cb9 100644
--- a/pkgs/os-specific/linux/alsa-plugins/default.nix
+++ b/pkgs/os-specific/linux/alsa-plugins/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, lib, pkgconfig, alsaLib, libogg, libpulseaudio ? null, libjack2 ? null }:
 
 stdenv.mkDerivation rec {
-  name = "alsa-plugins-1.1.4";
+  name = "alsa-plugins-1.1.5";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.alsa-project.org/pub/plugins/${name}.tar.bz2"
       "http://alsa.cybermirror.org/plugins/${name}.tar.bz2"
     ];
-    sha256 = "12hsvm6rpinjkg06pa9hzndkdrbfw6wk6yk00cm8y1gbv8xiq3ak";
+    sha256 = "073zpgvj4pldmzqq97l40wngvbqnvrkc8yw153mgny9kypwaazbr";
   };
 
   # ToDo: a52, etc.?
diff --git a/pkgs/os-specific/linux/alsa-tools/default.nix b/pkgs/os-specific/linux/alsa-tools/default.nix
index 940dde1f75dd5..d1cae06d7fffc 100644
--- a/pkgs/os-specific/linux/alsa-tools/default.nix
+++ b/pkgs/os-specific/linux/alsa-tools/default.nix
@@ -4,14 +4,14 @@
 
 stdenv.mkDerivation rec {
   name = "alsa-tools-${version}";
-  version = "1.1.3";
+  version = "1.1.5";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.alsa-project.org/pub/tools/${name}.tar.bz2"
       "http://alsa.cybermirror.org/tools/${name}.tar.bz2"
     ];
-    sha256 = "02b75fyfmm9m2iz59d3xa97cas4f697a4pzdxn1i64kjd36iv3yq";
+    sha256 = "0d6m5dm5yskfr6q42cv1ihp5lfgv4a67nj39gpp26ll3vrknag5w";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix
index 4cb4af5ca7240..c9b5b0d2e2dc8 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   name = "alsa-utils-${version}";
-  version = "1.1.4";
+  version = "1.1.5";
 
   src = fetchurl {
     urls = [
       "ftp://ftp.alsa-project.org/pub/utils/${name}.tar.bz2"
       "http://alsa.cybermirror.org/utils/${name}.tar.bz2"
     ];
-    sha256 = "17cxih9ibjp1193dyd79j50pyfa9dvrs6r9kpwrvzicjvr2110x7";
+    sha256 = "1s727md6mb408y2cfwzjkx23abxhampyrjdkgpyygdhxx62x42rj";
   };
 
   patchPhase = ''
diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix
index 8aa1cec9e12f4..fd585515cf02c 100644
--- a/pkgs/os-specific/linux/conky/default.nix
+++ b/pkgs/os-specific/linux/conky/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cmake
+{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, cmake
 
 # dependencies
 , glib, libXinerama
@@ -73,6 +73,16 @@ stdenv.mkDerivation rec {
     sha256 = "15j8h251v9jpdg6h6wn1vb45pkk806pf9s5n3rdrps9r185w8hn8";
   };
 
+  patches = [
+    # Patch to fix compilation on gcc-7 from conky PR
+    # https://github.com/brndnmtthws/conky/pull/402
+    (fetchpatch {
+      name = "gcc7.patch";
+      url = "https://github.com/brndnmtthws/conky/commit/6140122b82d50acc333e5d2a813cc1933ecc6d21.patch";
+      sha256 = "1fblfj1w2kc0gshc2pq9lc1pxxsgmgh8byb1xs2v6amx15kj11k7";
+    })
+  ];
+
   postPatch = ''
     sed -i -e '/include.*CheckIncludeFile)/i include(CheckIncludeFiles)' \
       cmake/ConkyPlatformChecks.cmake
diff --git a/pkgs/os-specific/linux/firmware/fwupd/default.nix b/pkgs/os-specific/linux/firmware/fwupd/default.nix
index 09ca05484f7fb..988f4efb9cdb7 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/default.nix
+++ b/pkgs/os-specific/linux/firmware/fwupd/default.nix
@@ -1,31 +1,56 @@
 { stdenv, fetchurl, gtk_doc, pkgconfig, gobjectIntrospection, intltool
-, libgudev, polkit, appstream-glib, gusb, sqlite, libarchive
-, libsoup, docbook2x, gpgme, libxslt, libelf, libsmbios, efivar
-, fwupdate, libyaml, valgrind, meson, libuuid, pygobject3
-, pillow, ninja, gcab
+, libgudev, polkit, appstream-glib, gusb, sqlite, libarchive, glib_networking
+, libsoup, docbook2x, gpgme, libxslt, libelf, libsmbios, efivar, glibcLocales
+, fwupdate, libyaml, valgrind, meson, libuuid, pygobject3, colord
+, pillow, ninja, gcab, gnutls, python3Packages, wrapGAppsHook
 }:
-let version = "0.9.6";
-in
-  stdenv.mkDerivation
-    { name = "fwupd-${version}";
-      src = fetchurl
-        { url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
-          sha256 = "0h3y4ygckvkjdx7yxwbm273iv84yk37ivlcf4xvq95g64vs8gfhf";
-        };
-      buildInputs =
-        [ gtk_doc pkgconfig gobjectIntrospection intltool libgudev
-          polkit appstream-glib gusb sqlite libarchive libsoup
-          docbook2x libxslt libelf libsmbios fwupdate libyaml valgrind
-          meson gpgme libuuid pygobject3 pillow ninja gcab
-        ];
-      patches = [ ./fix-missing-deps.patch ];
-      preConfigure = ''
-        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${efivar}/include/efivar"
-      '';
-      mesonFlags = [ "-Denable-colorhug=false" "-Denable-man=false" "-Denable-tests=false" "--localstatedir=/var" "-Denable-doc=false" "-Dwith-bootdir=/boot" ];
-      enableParallelBuilding = true;
-      meta =
-        { license = [ stdenv.lib.licenses.gpl2 ];
-          platforms = stdenv.lib.platforms.linux;
-        };
-    }
+let
+  version = "1.0.1";
+in stdenv.mkDerivation {
+  name = "fwupd-${version}";
+  src = fetchurl {
+    url = "https://people.freedesktop.org/~hughsient/releases/fwupd-${version}.tar.xz";
+    sha256 = "1k627rja7df51dkzqvkzgbwrrj4049k6408d01m34n66zwr2fp59";
+  };
+
+  nativeBuildInputs = [
+    meson ninja gtk_doc pkgconfig gobjectIntrospection intltool glibcLocales
+    valgrind gcab docbook2x libxslt pygobject3 python3Packages.pycairo wrapGAppsHook
+  ];
+  buildInputs = [
+    polkit appstream-glib gusb sqlite libarchive libsoup libelf libsmbios fwupdate libyaml
+    libgudev colord gpgme libuuid pillow gnutls glib_networking
+  ];
+
+  LC_ALL = "en_US.UTF-8"; # For po/make-images
+
+  NIX_CFLAGS_COMPILE = [
+    "-I${efivar}/include/efivar"
+    # warning: "__LIBELF_INTERNAL__" is not defined
+    "-Wno-error=undef"
+  ];
+
+  patches = [
+    ./fix-missing-deps.patch
+  ];
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  mesonFlags = [
+    "-Denable-man=false"
+    "-Denable-tests=false"
+    "-Denable-doc=false"
+    "-Dwith-bootdir=/boot"
+    "-Dwith-udevdir=lib/udev"
+    "-Dwith-systemdunitdir=lib/systemd/system"
+    "--localstatedir=/var"
+  ];
+
+  enableParallelBuilding = true;
+  meta = {
+    homepage = https://fwupd.org/;
+    license = [ stdenv.lib.licenses.gpl2 ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch b/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch
index be199227f3f82..46e11952afe0a 100644
--- a/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch
+++ b/pkgs/os-specific/linux/firmware/fwupd/fix-missing-deps.patch
@@ -1,86 +1,99 @@
-diff -Naur fwupd-0.9.6-orig/data/meson.build fwupd-0.9.6/data/meson.build
---- fwupd-0.9.6-orig/data/meson.build	2017-08-03 05:45:02.000000000 -0400
-+++ fwupd-0.9.6/data/meson.build	2017-09-02 19:58:37.324596487 -0400
-@@ -20,7 +20,7 @@
+--- a/data/builder/meson.build
++++ b/data/builder/meson.build
+@@ -1,3 +0,0 @@
+-install_data('README.md',
+-  install_dir : join_paths(get_option('localstatedir'), 'lib', 'fwupd', 'builder')
+-)
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -7,16 +7,12 @@
+   subdir('installed-tests')
+ endif
+ 
+-install_data(['daemon.conf'],
+-  install_dir : join_paths(get_option('sysconfdir'), 'fwupd')
+-)
+-
+ install_data(['org.freedesktop.fwupd.metainfo.xml'],
+   install_dir: join_paths(get_option('datadir'), 'metainfo')
  )
  
- install_data(['90-fwupd-devices.rules'],
--  install_dir : join_paths(udev.get_pkgconfig_variable('udevdir'), 'rules.d')
-+  install_dir : join_paths(get_option('prefix'), 'lib', 'udev', 'rules.d')
+ install_data(['org.freedesktop.fwupd.conf'],
+-  install_dir : join_paths(get_option('sysconfdir'), 'dbus-1', 'system.d')
++  install_dir : join_paths(get_option('prefix'), 'etc', 'dbus-1', 'system.d')
  )
  
- con2 = configuration_data()
-@@ -52,7 +52,7 @@
-     output : 'fwupd-offline-update.service',
-     configuration : con2,
-     install: true,
--    install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
-+    install_dir: join_paths(get_option('prefix'), 'lib', 'systemd', 'system'),
+ install_data(['metadata.xml'],
+--- a/data/pki/meson.build
++++ b/data/pki/meson.build
+@@ -3,13 +3,13 @@
+       'GPG-KEY-Hughski-Limited',
+       'GPG-KEY-Linux-Vendor-Firmware-Service',
+     ],
+-    install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd')
++    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd')
    )
- endif
  
-@@ -63,6 +63,6 @@
-     output : 'fwupd.service',
-     configuration : con2,
-     install: true,
--    install_dir: systemd.get_pkgconfig_variable('systemdsystemunitdir'),
-+    install_dir: join_paths(get_option('prefix'), 'lib', 'systemd', 'system'),
+   install_data([
+       'GPG-KEY-Linux-Vendor-Firmware-Service',
+     ],
+-    install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata')
++    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata')
    )
  endif
-diff -Naur fwupd-0.9.6-orig/libdfu/meson.build fwupd-0.9.6/libdfu/meson.build
---- fwupd-0.9.6-orig/libdfu/meson.build	2017-08-03 05:45:02.000000000 -0400
-+++ fwupd-0.9.6/libdfu/meson.build	2017-09-02 19:58:37.325596508 -0400
-@@ -23,6 +23,10 @@
-   giounix,
-   libm,
-   gusb,
-+  uuid,
-+  libarchive,
-+  soup,
-+  libgcab
- ]
  
- if get_option('enable-libelf')
-diff -Naur fwupd-0.9.6-orig/meson.build fwupd-0.9.6/meson.build
---- fwupd-0.9.6-orig/meson.build	2017-08-03 05:45:02.000000000 -0400
-+++ fwupd-0.9.6/meson.build	2017-09-02 19:59:07.406216716 -0400
-@@ -124,6 +124,7 @@
- if polkit.version().version_compare('>= 0.114')
-   conf.set('HAVE_POLKIT_0_114', '1')
+@@ -17,12 +17,12 @@
+   install_data([
+       'LVFS-CA.pem',
+     ],
+-    install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd')
++    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd')
+   )
+   install_data([
+       'LVFS-CA.pem',
+     ],
+-    install_dir : join_paths(get_option('sysconfdir'), 'pki', 'fwupd-metadata')
++    install_dir : join_paths(get_option('prefix'), 'etc', 'pki', 'fwupd-metadata')
+   )
  endif
-+libgcab = dependency('libgcab-1.0')
- gudev = dependency('gudev-1.0')
- appstream_glib = dependency('appstream-glib', version : '>= 0.6.9')
- gusb = dependency('gusb', version : '>= 0.2.9')
-@@ -200,7 +201,7 @@
-                         'fwupd-plugins-2')
- conf.set_quoted('PLUGINDIR', plugin_dir)
  
--conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
-+conf.set_quoted('SYSCONFDIR', '/etc')
- conf.set_quoted('BINDIR',
-                 join_paths(get_option('prefix'),
-                            get_option('bindir')))
-@@ -227,6 +228,9 @@
- plugin_deps += gmodule
- plugin_deps += gusb
- plugin_deps += soup
-+plugin_deps += libarchive
-+plugin_deps += uuid
-+plugin_deps += libgcab
- 
- subdir('data')
- subdir('docs')
-@@ -255,6 +259,3 @@
-   endif
+--- a/data/remotes.d/meson.build
++++ b/data/remotes.d/meson.build
+@@ -3,7 +3,7 @@
+       'lvfs.conf',
+       'lvfs-testing.conf',
+     ],
+-    install_dir : join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d')
++    install_dir : join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d')
+   )
  endif
  
--if get_option('enable-systemd')
--  meson.add_install_script('meson_post_install.sh', systemd.get_pkgconfig_variable('systemdsystemunitdir'), localstatedir)
--endif
-diff -Naur fwupd-0.9.6-orig/po/make-images.sh fwupd-0.9.6/po/make-images.sh
---- fwupd-0.9.6-orig/po/make-images.sh	2017-08-03 05:45:02.000000000 -0400
-+++ fwupd-0.9.6/po/make-images.sh	2017-09-02 19:58:37.328596570 -0400
+@@ -19,12 +19,12 @@
+   output : 'fwupd.conf',
+   configuration : con2,
+   install: true,
+-  install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'),
++  install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'),
+ )
+ configure_file(
+   input : 'vendor.conf',
+   output : 'vendor.conf',
+   configuration : con2,
+   install: true,
+-  install_dir: join_paths(get_option('sysconfdir'), 'fwupd', 'remotes.d'),
++  install_dir: join_paths(get_option('prefix'), 'etc', 'fwupd', 'remotes.d'),
+ )
+--- a/meson_post_install.sh
++++ b/meson_post_install.sh
+@@ -11,6 +11,4 @@
+     echo 'Updating systemd deps'
+     mkdir -p ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants
+     ln -sf ../fwupd-offline-update.service ${DESTDIR}${SYSTEMDUNITDIR}/system-update.target.wants/fwupd-offline-update.service
+-    echo 'Creating stateful directory'
+-    mkdir -p ${DESTDIR}${LOCALSTATEDIR}/lib/fwupd
+ #fi
+--- a/po/make-images.sh
++++ b/po/make-images.sh
 @@ -7,6 +7,7 @@
  #
  install -m 0755 -d ${MESON_INSTALL_DESTDIR_PREFIX}/share/locale/
@@ -89,26 +102,3 @@ diff -Naur fwupd-0.9.6-orig/po/make-images.sh fwupd-0.9.6/po/make-images.sh
  for x in ${MESON_INSTALL_DESTDIR_PREFIX}/share/locale/*/LC_IMAGES/*.bmp ; do
      gzip -f ${x}
  done
-diff -Naur fwupd-0.9.6-orig/src/meson.build fwupd-0.9.6/src/meson.build
---- fwupd-0.9.6-orig/src/meson.build	2017-08-03 05:45:02.000000000 -0400
-+++ fwupd-0.9.6/src/meson.build	2017-09-02 19:58:37.329596590 -0400
-@@ -24,6 +24,9 @@
-     polkit,
-     soup,
-     sqlite,
-+    uuid,
-+    libarchive,
-+    libgcab
-   ],
-   link_with : fwupd,
-   c_args : [
-@@ -73,6 +76,9 @@
-     gpgme,
-     gpgerror,
-     valgrind,
-+    uuid,
-+    libarchive,
-+    libgcab
-   ],
-   link_with : fwupd,
-   c_args : [
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index b64278ae4ba09..be9be49208a43 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "iproute2-${version}";
-  version = "4.13.0";
+  version = "4.14.1";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/net/iproute2/${name}.tar.xz";
-    sha256 = "0l2w84cwr54gaw3cbxijf614l76hx8mgcz57v81rwl68z3nq3yww";
+    sha256 = "0rq0n7yxb0hmk0s6wx5awzjgf7ikjbibd0a5ix20ldfcmxlc0fnl";
   };
 
   preConfigure = ''
diff --git a/pkgs/os-specific/linux/ipset/default.nix b/pkgs/os-specific/linux/ipset/default.nix
index 93a0f8a4c2909..6039ada44e245 100644
--- a/pkgs/os-specific/linux/ipset/default.nix
+++ b/pkgs/os-specific/linux/ipset/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libmnl }:
 
 stdenv.mkDerivation rec {
-  name = "ipset-6.27";
+  name = "ipset-6.34";
 
   src = fetchurl {
     url = "http://ipset.netfilter.org/${name}.tar.bz2";
-    sha256 = "0ddj66wr0xh9v6ks430l8r80lj2s9qc44d9c2ik48lwm0fl9fj3j";
+    sha256 = "106nv1ngcvap0mqmb6jm07lc1q3w796rkzc1vrfs4yhbcwdq63np";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/kernel/linux-4.13.nix b/pkgs/os-specific/linux/kernel/linux-4.13.nix
index bc940e0bc1bbd..72ae02bbecdef 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.13.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.13.nix
@@ -1,11 +1,11 @@
 { stdenv, hostPlatform, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.13.15";
+  version = "4.13.16";
   extraMeta.branch = "4.13";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1cnixf90pi9xsb8p1sncwcnl5acp8b46xxxmsizk335knmn919g4";
+    sha256 = "0cf7prqzl1ajbgl98w0symdyn0k5wl5xaf1l5ldgy6l083yg69dh";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-4.14.nix b/pkgs/os-specific/linux/kernel/linux-4.14.nix
index 71a9c9322ebd4..127a65b715c2f 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.1";
+  version = "4.14.2";
 
   # 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 = "1rsdrdapjw8lhm8dyckwxfihykirbkincm5k0lwwx1pr09qgdfbg";
+    sha256 = "0k264zxibhldgi9fcax11bjdv89jkdn1nbvvng312j2f19i909p9";
   };
 } // (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 bff438fa0a270..11809364d96c3 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.100";
+  version = "4.4.102";
   extraMeta.branch = "4.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "0kyi3cplkd839alyd6vsw2cqkb523zfsrjb2d6ygcddxqjcwsdlr";
+    sha256 = "1zmaispqs9lw1kyalhln2l53hsg99riisgnmc50qj7cyalmc5qpd";
   };
 } // (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 96fe2223b94eb..3e3626cb39d4b 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.64";
+  version = "4.9.65";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1h1h71nyiwvx2jy3j3yjazya6gz3k47bhm00mm311syaplhp0qhr";
+    sha256 = "15a8a7p6i2dgiglps22cwsy5gsfkc39fy4jzvhjwz8s9fn3p1fi4";
   };
 } // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index 6382b90f16832..e6d5c10341b40 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -2,7 +2,7 @@
 , thin-provisioning-tools, enable_dmeventd ? false }:
 
 let
-  version = "2.02.175";
+  version = "2.02.176";
 in
 
 stdenv.mkDerivation {
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "ftp://sources.redhat.com/pub/lvm2/releases/LVM2.${version}.tgz";
-    sha256 = "0n95cc2b0jb0fh2pd9jyg9ww7lyzpia9n9sryw9f4aq8dpna7dsd";
+    sha256 = "0wx4rvy4frdmb66znh2xms2j2n06sm361ki6l5ks4y1ciii87kny";
   };
 
   configureFlags = [
diff --git a/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch b/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch
new file mode 100644
index 0000000000000..6e14d61370342
--- /dev/null
+++ b/pkgs/servers/monitoring/munin/adding_sconfdir_munin-node.patch
@@ -0,0 +1,41 @@
+commit af5fa3623bb9a73052f9154be4a0f38c60ea42a2
+Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
+Date:   Thu Nov 23 21:21:36 2017 -0500
+
+    node: add --sconfdir to set plugin configuration dir
+
+diff --git a/node/sbin/munin-node b/node/sbin/munin-node
+index 909c8c4e..0ccf3941 100755
+--- a/node/sbin/munin-node
++++ b/node/sbin/munin-node
+@@ -100,9 +100,11 @@ sub parse_args
+     my @ORIG_ARGV  = @ARGV;
+ 
+     my $servicedir_cmdline;
++    my $sconfdir_cmdline;
+     print_usage_and_exit() unless GetOptions(
+         "config=s"     => \$conffile,
+         "servicedir=s" => \$servicedir_cmdline,
++        "sconfdir=s"   => \$sconfdir_cmdline,
+         "debug!"       => \$DEBUG,
+         "pidebug!"     => \$PIDEBUG,
+         "paranoia!"    => \$paranoia,
+@@ -112,6 +114,7 @@ sub parse_args
+ 
+     # We untaint the args brutally, since the sysadm should know what he does
+     $servicedir = $1 if defined $servicedir_cmdline && $servicedir_cmdline =~ m/(.*)/;
++    $sconfdir = $1 if defined $sconfdir_cmdline && $sconfdir_cmdline =~ m/(.*)/;
+ 
+     # Reset ARGV (for HUPing)
+     @ARGV = @ORIG_ARGV;
+@@ -175,6 +178,10 @@ Use E<lt>fileE<gt> as configuration file. [@@CONFDIR@@/munin-node.conf]
+ 
+ Override plugin directory [@@CONFDIR@@/plugins/]
+ 
++=item B<< --sconfdir <dir> >>
++
++Override plugin configuration directory [@@CONFDIR@@/plugin-conf.d/]
++
+ =item B< --[no]paranoia >
+ 
+ Only run plugins owned by root. Check permissions as well. [--noparanoia]
diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix
index 7882572b6c888..98e86bf8e36f2 100644
--- a/pkgs/servers/monitoring/munin/default.nix
+++ b/pkgs/servers/monitoring/munin/default.nix
@@ -3,14 +3,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.33";
+  version = "2.0.34";
   name = "munin-${version}";
 
   src = fetchFromGitHub {
     owner = "munin-monitoring";
     repo = "munin";
     rev = version;
-    sha256 = "0rs05b7926mjd58sdry33i91m1h3v3svl0wg2gmhljl8wqidac5w";
+    sha256 = "0mb5m0nc3nr9781d3s99sjdssmvkv37gxyplzr6d73i4hi31m7fr";
   };
 
   buildInputs = [ 
@@ -67,6 +67,9 @@ stdenv.mkDerivation rec {
 
     # https://github.com/munin-monitoring/munin/pull/134
     ./adding_servicedir_munin-node.patch
+
+    ./adding_sconfdir_munin-node.patch
+    ./preserve_environment.patch
   ];
 
   preBuild = ''
@@ -102,8 +105,8 @@ stdenv.mkDerivation rec {
     find "$out/lib/plugins" -type f -print0 | xargs -0 -L1 \
         sed -i -e "s|/usr/bin/||g" -e "s|/usr/sbin/||g" -e "s|\<bc\>|${bc}/bin/bc|g"
 
-    if test -e $out/nix-support/propagated-native-build-inputs; then
-        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
+    if test -e $out/nix-support/propagated-build-inputs; then
+        ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
     fi
 
     for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
diff --git a/pkgs/servers/monitoring/munin/preserve_environment.patch b/pkgs/servers/monitoring/munin/preserve_environment.patch
new file mode 100644
index 0000000000000..ef66f48ecb422
--- /dev/null
+++ b/pkgs/servers/monitoring/munin/preserve_environment.patch
@@ -0,0 +1,41 @@
+commit d94c29b7397362857b81d8c877a989fdb28490d8
+Author: Kjetil Orbekk <kjetil.orbekk@gmail.com>
+Date:   Tue Nov 21 15:37:42 2017 -0500
+
+    Keep environment variables instead of overwriting them.
+
+diff --git a/common/lib/Munin/Common/Defaults.pm b/common/lib/Munin/Common/Defaults.pm
+index 131f52c0..bbf42697 100644
+--- a/common/lib/Munin/Common/Defaults.pm
++++ b/common/lib/Munin/Common/Defaults.pm
+@@ -71,7 +71,7 @@ sub export_to_environment {
+ 
+     my %defaults = %{$class->get_defaults()};
+     while (my ($k, $v) = each %defaults) {
+-        $ENV{$k} = $v;
++        $ENV{$k} = $ENV{$k} || $v;
+     }
+ 
+     return
+diff --git a/node/lib/Munin/Node/Service.pm b/node/lib/Munin/Node/Service.pm
+index 1b4f6114..be58bd77 100644
+--- a/node/lib/Munin/Node/Service.pm
++++ b/node/lib/Munin/Node/Service.pm
+@@ -122,7 +122,7 @@ sub export_service_environment {
+     # We append the USER to the MUNIN_PLUGSTATE, to avoid CVE-2012-3512
+     my $uid = $self->_resolve_uid($service);
+     my $user = getpwuid($uid);
+-    $ENV{MUNIN_PLUGSTATE} = "$Munin::Common::Defaults::MUNIN_PLUGSTATE/$user";
++    $ENV{MUNIN_PLUGSTATE} = "$ENV{MUNIN_PLUGSTATE}/$user";
+ 
+     # Provide a consistent default state-file.
+     $ENV{MUNIN_STATEFILE} = "$ENV{MUNIN_PLUGSTATE}/$service-$ENV{MUNIN_MASTER_IP}";
+@@ -243,7 +243,7 @@ sub exec_service
+ 
+     # XXX - Create the statedir for the user
+     my $uid = $self->_resolve_uid($service);
+-    Munin::Node::OS->mkdir_subdir("$Munin::Common::Defaults::MUNIN_PLUGSTATE", $uid);
++    Munin::Node::OS->mkdir_subdir("$ENV{MUNIN_PLUGSTATE}", $uid);
+ 
+     $self->change_real_and_effective_user_and_group($service);
+ 
diff --git a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix
index 6b15c165dfdf9..4f9b3a6b443c8 100644
--- a/pkgs/servers/nosql/apache-jena/fuseki-binary.nix
+++ b/pkgs/servers/nosql/apache-jena/fuseki-binary.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
     for i in "$out"/bin/*; do
       wrapProgram "$i" \
         --prefix "PATH" : "${java}/bin/" \
-        --set "FUSEKI_HOME" '"''${FUSEKI_HOME:-'"$out"'}"' \
+        --set-default "FUSEKI_HOME" "$out" \
         ;
     done
   '';
diff --git a/pkgs/servers/nosql/influxdb/default.nix b/pkgs/servers/nosql/influxdb/default.nix
index 5043c36f8c201..972bd53d95ee6 100644
--- a/pkgs/servers/nosql/influxdb/default.nix
+++ b/pkgs/servers/nosql/influxdb/default.nix
@@ -11,6 +11,10 @@ buildGoPackage rec {
     sha256 = "048ap70hdfkxhy0y8q1jsb0lql1i99jnf3cqaqar6qs2ynzsw9hd";
   };
 
+  buildFlagsArray = [ ''-ldflags=
+    -X main.version=${version}
+  '' ];
+
   goPackagePath = "github.com/influxdata/influxdb";
 
   excludedPackages = "test";
diff --git a/pkgs/servers/openafs-client/default.nix b/pkgs/servers/openafs-client/default.nix
index d7ed2849d604a..cb004e15cc7af 100644
--- a/pkgs/servers/openafs-client/default.nix
+++ b/pkgs/servers/openafs-client/default.nix
@@ -22,6 +22,18 @@ stdenv.mkDerivation rec {
       url = "http://git.openafs.org/?p=openafs.git;a=patch;h=c193e5cba18273a062d4162118c7055b54f7eb5e";
       sha256 = "1yc4gygcazwsslf6mzk1ai92as5jbsjv7212jcbb2dw83jydhc09";
     })
+    # linux 4.14
+    (fetchpatch {
+      name = "test-for-__vfs_write-rather-than-__vfs_read.patch";
+      url = "http://git.openafs.org/?p=openafs.git;a=patch;h=929e77a886fc9853ee292ba1aa52a920c454e94b";
+      sha256 = "0g4jxqzvyrjy2q7mhxc5ikhypj3ljw1wri4lipzm66crsvycp9x5";
+    })
+    # linux 4.14
+    (fetchpatch {
+      name = "use-kernel_read-kernel_write-when-__vfs-variants-are-unavailable.patch";
+      url = "http://git.openafs.org/?p=openafs.git;a=patch;h=5ee516b3789d3545f3d78fb3aba2480308359945";
+      sha256 = "1vx55qb120y857mn1l00i58fj9cckschp86ch3g6hqrdc5q5bxv2";
+    })
   ];
 
   preConfigure = ''
diff --git a/pkgs/servers/sql/oracle-xe/default.nix b/pkgs/servers/sql/oracle-xe/default.nix
index e86406cd469cc..9068ca70cc6e0 100644
--- a/pkgs/servers/sql/oracle-xe/default.nix
+++ b/pkgs/servers/sql/oracle-xe/default.nix
@@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
       makeWrapper "$i" "$out/bin/''${i##*/}" \
         --set ORACLE_HOME "$out/libexec/oracle" \
         --set ORACLE_SID XE \
-        --set NLS_LANG '$("'"$out"'/libexec/oracle/bin/nls_lang.sh")' \
+        --run "export NLS_LANG=\$($out/libexec/oracle/bin/nls_lang.sh)" \
         --prefix PATH : "$out/libexec/oracle/bin"
     done
   '';
diff --git a/pkgs/servers/traefik/default.nix b/pkgs/servers/traefik/default.nix
index f1fb1a34fc24a..d0d0efa9aa6de 100644
--- a/pkgs/servers/traefik/default.nix
+++ b/pkgs/servers/traefik/default.nix
@@ -1,24 +1,19 @@
-{ stdenv, buildGoPackage, fetchurl, bash, go-bindata}:
+{ stdenv, buildGoPackage, fetchFromGitHub, bash, go-bindata}:
 
 buildGoPackage rec {
   name = "traefik-${version}";
-  version = "1.3.8";
+  version = "1.4.4";
 
   goPackagePath = "github.com/containous/traefik";
 
-  src = fetchurl {
-    url = "https://github.com/containous/traefik/releases/download/v${version}/traefik-v${version}.src.tar.gz";
-    sha256 = "6fce36dd30bb5ae5f91e69f2950f22fe7a74b920e80c6b441a0721122f6a6174";
+  src = fetchFromGitHub {
+    owner = "containous";
+    repo = "traefik";
+    rev = "v${version}";
+    sha256 = "114861v8kg77zwnf742n25h7c4fly3i52inqx1kcpqs074rqm1wn";
   };
 
   buildInputs = [ go-bindata bash ];
-  unpackPhase = ''
-    runHook preUnpack
-    mkdir traefik
-    tar -C traefik -xvzf $src
-    export sourceRoot="traefik"
-    runHook postUnpack
-  '';
 
   buildPhase = ''
     runHook preBuild
diff --git a/pkgs/servers/web-apps/wordpress/default.nix b/pkgs/servers/web-apps/wordpress/default.nix
index bb07c42b872c6..d8dde97a09699 100644
--- a/pkgs/servers/web-apps/wordpress/default.nix
+++ b/pkgs/servers/web-apps/wordpress/default.nix
@@ -2,8 +2,8 @@
 { fetchFromGitHub, lib } : fetchFromGitHub {
   owner = "WordPress";
   repo = "WordPress";
-  rev = "4.8.3";
-  sha256 = "077bdx22sj29v8q493b49xfzxpc38q45pjhmn4znw2fmkjilih5p";
+  rev = "4.9";
+  sha256 = "1qffh413k8c1mf3jj9hys3a7y1qfjcg2w96w4c9x3ida3lchg7ln";
   meta = {
     homepage = https://wordpress.org;
     description = "WordPress is open source software you can use to create a beautiful website, blog, or app.";
diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh
index fae8bf5a8ce5a..bb3e5ac428328 100644
--- a/pkgs/servers/x11/xorg/builder.sh
+++ b/pkgs/servers/x11/xorg/builder.sh
@@ -16,22 +16,18 @@ postInstall() {
 
     echo "propagating requisites $requires"
 
+    if test -n "$crossConfig"; then
+        local pkgs=("${crossPkgs[@]}")
+    else
+        local pkgs=("${nativePkgs[@]}")
+    fi
     for r in $requires; do
-        if test -n "$crossConfig"; then
-            for p in "${crossPkgs[@]}"; do
-                if test -e $p/lib/pkgconfig/$r.pc; then
-                    echo "  found requisite $r in $p"
-                    propagatedBuildInputs="$propagatedBuildInputs $p"
-                fi
-            done
-        else
-            for p in "${nativePkgs[@]}"; do
-                if test -e $p/lib/pkgconfig/$r.pc; then
-                    echo "  found requisite $r in $p"
-                    propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p"
-                fi
-            done
-        fi
+        for p in "${pkgs[@]}"; do
+            if test -e $p/lib/pkgconfig/$r.pc; then
+                echo "  found requisite $r in $p"
+                propagatedBuildInputs+=" $p"
+            fi
+        done
     done
 }
 
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index a67ca53e1c541..89c903b04a048 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -4,15 +4,15 @@
 # Allow passing in bootstrap files directly so we can test the stdenv bootstrap process when changing the bootstrap tools
 , bootstrapFiles ? let
   fetch = { file, sha256, executable ? true }: import <nix/fetchurl.nix> {
-    url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/10cbca5b30c6cb421ce15139f32ae3a4977292cf/${file}";
+    url = "http://tarballs.nixos.org/stdenv-darwin/x86_64/d5bdfcbfe6346761a332918a267e82799ec954d2/${file}";
     inherit (localSystem) system;
     inherit sha256 executable;
   }; in {
-    sh      = fetch { file = "sh";    sha256 = "0s8a9vpzj6vadq4jmf4r8cargwnsf327hdjydxgqsfxb8y1q39w3"; };
-    bzip2   = fetch { file = "bzip2"; sha256 = "1jqljpjr8mkiv7g5rl5impqx3all8vn1mxxdwa004pr3h48c1zgg"; };
-    mkdir   = fetch { file = "mkdir"; sha256 = "17zsjiwnq07i5r85q1hg7f6cnkcgllwy2amz9klaqwjy4vzz4vwh"; };
-    cpio    = fetch { file = "cpio";  sha256 = "04hrair58dgja6syh442pswiga5an9nl58ls57yknkn2pq51nx9m"; };
-    tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "103833hrci0vwi1gi978hkp69rncicvpdszn87ffpf1cq0jzpa14"; executable = false; };
+    sh      = fetch { file = "sh";    sha256 = "07wm33f1yzfpcd3rh42f8g096k4cvv7g65p968j28agzmm2s7s8m"; };
+    bzip2   = fetch { file = "bzip2"; sha256 = "0y9ri2aprkrp2dkzm6229l0mw4rxr2jy7vvh3d8mxv2698v2kdbm"; };
+    mkdir   = fetch { file = "mkdir"; sha256 = "0sb07xpy66ws6f2jfnpjibyimzb71al8n8c6y4nr8h50al3g90nr"; };
+    cpio    = fetch { file = "cpio";  sha256 = "0r5c54hg678w7zydx27bzl9p3v9fs25y5ix6vdfi1ilqim7xh65n"; };
+    tarball = fetch { file = "bootstrap-tools.cpio.bz2"; sha256 = "18hp5w6klr8g307ap4368r255qpzg9r0vwg9vqvj8f2zy1xilcjf"; executable = false; };
   }
 }:
 
@@ -21,9 +21,11 @@ assert crossSystem == null;
 let
   inherit (localSystem) system platform;
 
-  libSystemProfile = ''
-    (import "${./standard-sandbox.sb}")
-  '';
+  commonImpureHostDeps = [
+    "/bin/sh"
+    "/usr/lib/libSystem.B.dylib"
+    "/usr/lib/system/libunc.dylib" # This dependency is "hidden", so our scanning code doesn't pick it up
+  ];
 in rec {
   commonPreHook = ''
     export NIX_ENFORCE_PURITY="''${NIX_ENFORCE_PURITY-1}"
@@ -37,11 +39,6 @@ in rec {
     export gl_cv_func_getcwd_abort_bug=no
   '';
 
-  # The one dependency of /bin/sh :(
-  binShClosure = ''
-    (allow file-read* (literal "/usr/lib/libncurses.5.4.dylib"))
-  '';
-
   bootstrapTools = derivation rec {
     inherit system;
 
@@ -53,7 +50,7 @@ in rec {
     reexportedLibrariesFile =
       ../../os-specific/darwin/apple-source-releases/Libsystem/reexported_libraries;
 
-    __sandboxProfile = binShClosure + libSystemProfile;
+    __impureHostDeps = commonImpureHostDeps;
   };
 
   stageFun = step: last: {shell             ? "${bootstrapTools}/bin/bash",
@@ -108,8 +105,8 @@ in rec {
         };
 
         # The stdenvs themselves don't use mkDerivation, so I need to specify this here
-        stdenvSandboxProfile = binShClosure + libSystemProfile;
-        extraSandboxProfile  = binShClosure + libSystemProfile;
+        __stdenvImpureHostDeps = commonImpureHostDeps;
+        __extraImpureHostDeps = commonImpureHostDeps;
 
         extraAttrs = {
           inherit platform;
@@ -167,7 +164,7 @@ in rec {
   };
 
   stage1 = prevStage: let
-    persistent = _: _: {};
+    persistent = _: super: { python = super.python.override { configd = null; }; };
   in with prevStage; stageFun 1 prevStage {
     extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\"";
     extraNativeBuildInputs = [];
@@ -317,8 +314,8 @@ in rec {
       export PATH_LOCALE=${pkgs.darwin.locale}/share/locale
     '';
 
-    stdenvSandboxProfile = binShClosure + libSystemProfile;
-    extraSandboxProfile  = binShClosure + libSystemProfile;
+    __stdenvImpureHostDeps = commonImpureHostDeps;
+    __extraImpureHostDeps = commonImpureHostDeps;
 
     initialPath = import ../common-path.nix { inherit pkgs; };
     shell       = "${pkgs.bash}/bin/bash";
@@ -353,7 +350,7 @@ in rec {
       bzip2.bin llvmPackages.llvm llvmPackages.llvm.lib zlib.out zlib.dev libffi.out coreutils ed diffutils gnutar
       gzip ncurses.out ncurses.dev ncurses.man gnused bash gawk
       gnugrep llvmPackages.clang-unwrapped patch pcre.out binutils-raw.out
-      binutils-raw.dev binutils gettext
+      binutils gettext
       cc.expand-response-params
     ]) ++ (with pkgs.darwin; [
       dyld Libsystem CF cctools ICU libiconv locale
@@ -364,6 +361,10 @@ in rec {
         clang = cc;
         llvmPackages = persistent'.llvmPackages // { clang = cc; };
         inherit cc;
+
+        darwin = super.darwin // {
+          xnu = super.darwin.xnu.override { python = super.python.override { configd = null; }; };
+        };
       };
   };
 
diff --git a/pkgs/stdenv/darwin/standard-sandbox.sb b/pkgs/stdenv/darwin/standard-sandbox.sb
deleted file mode 100644
index b87be89f35f21..0000000000000
--- a/pkgs/stdenv/darwin/standard-sandbox.sb
+++ /dev/null
@@ -1,72 +0,0 @@
-(define TMPDIR (param "_GLOBAL_TMP_DIR"))
-
-; obvious
-(allow process-fork)
-
-; allow reading system information like #CPUs, etc.
-(allow sysctl-read)
-
-; IPC
-(allow ipc-posix*)
-
-; Unix sockets
-(allow system-socket)
-
-; all runtime dependencies of libSystem.dylib
-(allow file-read*
-       (literal "/usr/lib/libSystem.dylib")
-       (literal "/usr/lib/libSystem.B.dylib")
-       (literal "/usr/lib/libobjc.A.dylib")
-       (literal "/usr/lib/libobjc.dylib")
-       (literal "/usr/lib/libauto.dylib")
-       (literal "/usr/lib/libc++abi.dylib")
-       (literal "/usr/lib/libc++.1.dylib")
-       (literal "/usr/lib/libDiagnosticMessagesClient.dylib")
-       (subpath "/usr/lib/system"))
-
-; tmp
-(allow file* process-exec (literal "/tmp") (subpath TMPDIR))
-
-; clang likes to read the system version
-(allow file-read* (literal "/System/Library/CoreServices/SystemVersion.plist"))
-
-; used for bootstrap builders
-(allow process-exec* (literal "/bin/sh"))
-
-; without this line clang cannot write to /dev/null, breaking some configure tests
-(allow file-read-metadata (literal "/dev"))
-
-; standard devices
-(allow file*
-       (literal "/dev/null")
-       (literal "/dev/random")
-       (literal "/dev/stdin")
-       (literal "/dev/stdout")
-       (literal "/dev/tty")
-       (literal "/dev/urandom")
-       (literal "/dev/zero")
-       (subpath "/dev/fd"))
-
-; does nothing, but reduces build noise
-(allow file* (literal "/dev/dtracehelper"))
-
-; ICU data and zoneinfo data are hardcoded
-; both are in libicucore and zoneinfo is in libsystem_c as well
-(allow file-read* (subpath "/usr/share/icu") (subpath "/usr/share/zoneinfo"))
-
-; no idea what this is
-(allow file-read-data (literal "/dev/autofs_nowait"))
-
-; lots of autoconf projects want to list this directory
-(allow file-read-metadata (literal "/var") (literal "/private/var/tmp"))
-
-; send signals
-(allow signal (target same-sandbox))
-
-; allow getpwuid (for git and other packages)
-(allow mach-lookup
-       (global-name "com.apple.system.notification_center")
-       (global-name "com.apple.system.opendirectoryd.libinfo"))
-
-; allow networking on localhost
-(allow network* (local ip) (remote unix-socket))
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 02da3829c5ae2..686ed68cedebd 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -239,12 +239,12 @@ isScript() {
 
 # printf unfortunately will print a trailing newline regardless
 printLines() {
-    [[ "$#" -gt 0 ]] || return 0
+    (( "$#" > 0 )) || return 0
     printf '%s\n' "$@"
 }
 
 printWords() {
-    [[ "$#" -gt 0 ]] || return 0
+    (( "$#" > 0 )) || return 0
     printf '%s ' "$@"
 }
 
@@ -302,9 +302,9 @@ runHook addInputsHook
 
 # Recursively find all build inputs.
 findInputs() {
-    local pkg="$1"
-    local var="$2"
-    local propagatedBuildInputsFile="$3"
+    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)
@@ -324,6 +324,22 @@ 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[@]}"
+        done
+    done
+}
+
+# Add package to the future PATH and run setup hooks
+activatePackage() {
+    local pkg="$1"
+
     if [ -f "$pkg" ]; then
         local oldOpts="$(shopt -po nounset)"
         set +u
@@ -341,13 +357,6 @@ findInputs() {
         source "$pkg/nix-support/setup-hook"
         eval "$oldOpts"
     fi
-
-    if [ -f "$pkg/nix-support/$propagatedBuildInputsFile" ]; then
-        local pkgNext
-        for pkgNext in $(< "$pkg/nix-support/$propagatedBuildInputsFile"); do
-            findInputs "$pkgNext" "$var" "$propagatedBuildInputsFile"
-        done
-    fi
 }
 
 declare -a nativePkgs crossPkgs
@@ -357,19 +366,21 @@ if [ -z "${crossConfig:-}" ]; then
     for i in ${nativeBuildInputs:-} ${buildInputs:-} \
              ${defaultNativeBuildInputs:-} ${defaultBuildInputs:-} \
              ${propagatedNativeBuildInputs:-} ${propagatedBuildInputs:-}; do
-        findInputs "$i" nativePkgs propagated-native-build-inputs
+        findInputs "$i" nativePkgs propagated-native-build-inputs propagated-build-inputs
     done
 else
-    for i in ${buildInputs:-} ${defaultBuildInputs:-} ${propagatedBuildInputs:-}; do
-        findInputs "$i" crossPkgs propagated-build-inputs
-    done
-
-    declare -a nativePkgs
     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
+    done
 fi
 
+for i in ${nativePkgs+"${nativePkgs[@]}"} ${crossPkgs+"${crossPkgs[@]}"}; do
+    activatePackage "$i"
+done
+
 
 # Set the relevant environment variables to point to the build inputs
 # found above.
@@ -886,31 +897,19 @@ fixupPhase() {
 
     # Propagate build inputs and setup hook into the development output.
 
-    if [ -z "${crossConfig:-}" ]; then
-        # Not cross-compiling - propagatedBuildInputs are handled identically to propagatedNativeBuildInputs
-        local propagated="$propagatedNativeBuildInputs"
-        if [ -n "${propagatedBuildInputs:-}" ]; then
-            propagated+="${propagated:+ }$propagatedBuildInputs"
-        fi
-        if [ -n "${propagated:-}" ]; then
-            mkdir -p "${!outputDev}/nix-support"
-            # shellcheck disable=SC2086
-            printWords $propagated > "${!outputDev}/nix-support/propagated-native-build-inputs"
-        fi
-    else
-        if [ -n "${propagatedBuildInputs:-}" ]; then
-            mkdir -p "${!outputDev}/nix-support"
-            # shellcheck disable=SC2086
-            printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
-        fi
+    if [ -n "${propagatedBuildInputs:-}" ]; then
+        mkdir -p "${!outputDev}/nix-support"
+        # shellcheck disable=SC2086
+        printWords $propagatedBuildInputs > "${!outputDev}/nix-support/propagated-build-inputs"
+    fi
 
-        if [ -n "${propagatedNativeBuildInputs:-}" ]; then
-            mkdir -p "${!outputDev}/nix-support"
-            # shellcheck disable=SC2086
-            printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
-        fi
+    if [ -n "${propagatedNativeBuildInputs:-}" ]; then
+        mkdir -p "${!outputDev}/nix-support"
+        # shellcheck disable=SC2086
+        printWords $propagatedNativeBuildInputs > "${!outputDev}/nix-support/propagated-native-build-inputs"
     fi
 
+
     if [ -n "${setupHook:-}" ]; then
         mkdir -p "${!outputDev}/nix-support"
         substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
index 90c9d2cef67f2..8a1f7445b30b4 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
@@ -179,7 +179,6 @@ rec {
         for i in as ld ar ranlib nm strip readelf objdump; do
           cp ${binutils.out}/bin/$i $out/bin
         done
-        cp -d ${binutils.lib}/lib/lib*.so* $out/lib
 
         chmod -R u+w $out
 
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix
index c8cddf248ab90..52eea41bdbd76 100644
--- a/pkgs/stdenv/linux/make-bootstrap-tools.nix
+++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -128,7 +128,6 @@ rec {
         for i in as ld ar ranlib nm strip readelf objdump; do
           cp ${binutils.out}/bin/$i $out/bin
         done
-        cp -d ${binutils.lib}/lib/lib*.so* $out/lib
 
         chmod -R u+w $out
 
diff --git a/pkgs/tools/X11/go-sct/default.nix b/pkgs/tools/X11/go-sct/default.nix
index de51e1ad25f5e..aeb4546ff4d3b 100644
--- a/pkgs/tools/X11/go-sct/default.nix
+++ b/pkgs/tools/X11/go-sct/default.nix
@@ -21,6 +21,6 @@ buildGoPackage rec {
     description = "Color temperature setting library and CLI that operates in a similar way to f.lux and Redshift";
     license = licenses.mit;
     maintainers = with maintainers; [ cstrahan ];
-    platforms = platforms.unix;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix
index 0af97dd3b5400..ffcf20d1651b5 100644
--- a/pkgs/tools/filesystems/ceph/generic.nix
+++ b/pkgs/tools/filesystems/ceph/generic.nix
@@ -227,9 +227,9 @@ stdenv.mkDerivation {
     wrapProgram $out/sbin/ceph-create-keys ${wrapArgs}
     wrapProgram $out/sbin/ceph-disk ${wrapArgs}
 
-    # Bring in lib as a native build input
+    # Bring in lib as a run-time dependency
     mkdir -p $out/nix-support
-    echo "$lib" > $out/nix-support/propagated-native-build-inputs
+    echo "$lib" > $out/nix-support/propagated-build-inputs
 
     # Fix the python library loading
     find $lib/lib -name \*.pyc -or -name \*.pyd -exec rm {} \;
diff --git a/pkgs/tools/filesystems/grive/default.nix b/pkgs/tools/filesystems/grive/default.nix
index 4e4a139f9adc9..9f4472c27f19d 100644
--- a/pkgs/tools/filesystems/grive/default.nix
+++ b/pkgs/tools/filesystems/grive/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, binutils }:
+{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, libiberty }:
 
 stdenv.mkDerivation rec {
   version = "0.3.0";
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "11cqfcjl128nfg1rjvpvr9x1x2ch3kyliw4vi14n51zqp82f9ysb";
   };
 
-  buildInputs = [cmake libgcrypt json_c curl expat stdenv binutils boost];
+  buildInputs = [cmake libgcrypt json_c curl expat stdenv libiberty boost];
 
-  # work around new binutils headers, see
-  # http://stackoverflow.com/questions/11748035/binutils-bfd-h-wants-config-h-now
+  # work around new libiberty headers, see
+  # http://stackoverflow.com/questions/11748035/libiberty-bfd-h-wants-config-h-now
   prePatch = ''
     sed -i '1i#define PACKAGE "grive"\n#define PACKAGE_VERSION "${version}"' \
       libgrive/src/bfd/SymbolInfo.cc
diff --git a/pkgs/tools/filesystems/grive2/default.nix b/pkgs/tools/filesystems/grive2/default.nix
index a3ee1b67bab27..f4bb5592abdb8 100644
--- a/pkgs/tools/filesystems/grive2/default.nix
+++ b/pkgs/tools/filesystems/grive2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, binutils }:
+{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, libiberty }:
 
 stdenv.mkDerivation rec {
   version = "0.5.0";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig ];
 
-  buildInputs = [ libgcrypt yajl curl expat stdenv boost binutils ];
+  buildInputs = [ libgcrypt yajl curl expat stdenv boost libiberty ];
 
   meta = with stdenv.lib; {
     description = "A console Google Drive client";
diff --git a/pkgs/tools/graphics/povray/default.nix b/pkgs/tools/graphics/povray/default.nix
index 7284ee95a9097..42ca4cf2e2703 100644
--- a/pkgs/tools/graphics/povray/default.nix
+++ b/pkgs/tools/graphics/povray/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, autoconf, automake, boost
-, zlib, libpng, libjpeg, libtiff
+, zlib, libpng, libjpeg, libtiff, x11, SDL
 }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   };
 
 
-  buildInputs = [ autoconf automake boost zlib libpng libjpeg libtiff ];
+  buildInputs = [ autoconf automake boost zlib libpng libjpeg libtiff x11 SDL ];
 
   # the installPhase wants to put files into $HOME. I let it put the files
   # to $TMPDIR, so they don't get into the $out
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
                  sed -i -e 's/^povgroup.*/povgroup=nogroup/' Makefile.{am,in}
                '';
 
-  configureFlags = [ "COMPILED_BY='nix'" "--with-boost-thread=boost_thread" ];
+  configureFlags = [ "COMPILED_BY='nix'" "--with-boost-thread=boost_thread" "--with-x" ];
 
   enableParallelBuilding = true;
   
diff --git a/pkgs/tools/inputmethods/skk/skk-dicts/default.nix b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix
new file mode 100644
index 0000000000000..cecacd4af9547
--- /dev/null
+++ b/pkgs/tools/inputmethods/skk/skk-dicts/default.nix
@@ -0,0 +1,73 @@
+{ stdenv, fetchurl, skktools }:
+
+let
+  # kana to kanji
+  small = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.S";
+    sha256 = "15kp4iwz58fp1zg0i13x7w9wwm15v8n2hhm0nf2zsl7az5mn5yi4";
+  };
+  medium = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.M";
+    sha256 = "1vhagixhrp9lq5x7dldxcanhznawazp00xivpp1z52kx10lnkmv0";
+  };
+  large = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.L";
+    sha256 = "07cv0j95iajkr48j4ln411vnhl3z93yx96zjc03bgs10dbpagaaz";
+  };
+
+  # english to japanese
+  edict = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.edict";
+    sha256 = "18k8z1wkgwgfwbs6sylf39h1nc1p5l2b00h7mfjlb8p91plkb45w";
+  };
+  # misc
+  assoc = fetchurl {
+    url = "https://raw.githubusercontent.com/skk-dev/dict/f61be71246602a49e9f05ded6ac4f9f82031a521/SKK-JISYO.assoc";
+    sha256 = "12d6xpp1bfin9nwl35ydl5yc6vx0qpwhxss0khi19n1nsbyqnixm";
+  };
+in
+
+stdenv.mkDerivation rec {
+  name = "skk-dicts-unstable-${version}";
+  version = "2017-10-26";
+  srcs = [ small medium large edict assoc ];
+  nativeBuildInputs = [ skktools ];
+
+  phases = [ "installPhase" ];
+  installPhase = ''
+    function dictname() {
+      src=$1
+      name=$(basename $src)          # remove dir name
+      dict=$(echo $name | cut -b34-) # remove sha256 prefix
+      echo $dict
+    }
+    mkdir -p $out/share
+
+    for src in $srcs; do
+      dst=$out/share/$(dictname $src)
+      echo ";;; -*- coding: utf-8 -*-" > $dst  # libskk requires this on the first line
+      iconv -f EUC-JP -t UTF-8 $src |\
+        ${skktools}/bin/skkdic-expr2 >> $dst
+    done
+
+    # combine .L .edict and .assoc for convenience
+    dst=$out/share/SKK-JISYO.combined
+    echo ";;; -*- coding: utf-8 -*-" > $dst
+    ${skktools}/bin/skkdic-expr2 \
+      $out/share/$(dictname ${large}) + \
+      $out/share/$(dictname ${edict}) + \
+      $out/share/$(dictname ${assoc}) >> $dst
+  '';
+
+  meta = {
+    description = "A collection of standard SKK dictionaries";
+    longDescription = ''
+      This package provides a collection of standard kana-to-kanji
+      dictionaries for the SKK Japanese input method.
+    '';
+    homepage = https://github.com/skk-dev/dict;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/misc/ckb/ckb-animations-location.patch b/pkgs/tools/misc/ckb/ckb-animations-location.patch
index 07dcfab86be8b..8e53685e76a61 100644
--- a/pkgs/tools/misc/ckb/ckb-animations-location.patch
+++ b/pkgs/tools/misc/ckb/ckb-animations-location.patch
@@ -1,12 +1,12 @@
 diff --git a/src/ckb/animscript.cpp b/src/ckb/animscript.cpp
-index d0b7f46..d7a3459 100644
+index f49a64c..d7a3459 100644
 --- a/src/ckb/animscript.cpp
 +++ b/src/ckb/animscript.cpp
 @@ -30,7 +30,7 @@ QString AnimScript::path(){
  #ifdef __APPLE__
      return QDir(QApplication::applicationDirPath() + "/../Resources").absoluteFilePath("ckb-animations");
  #else
--    return QDir(QApplication::applicationDirPath()).absoluteFilePath("ckb-animations");
+-    return QDir("/usr/lib").absoluteFilePath("ckb-animations");
 +    return QDir(QApplication::applicationDirPath() + "/../libexec").absoluteFilePath("ckb-animations");
  #endif
  }
diff --git a/pkgs/tools/misc/ckb/default.nix b/pkgs/tools/misc/ckb/default.nix
index 41116288e533f..a0dbc6fd4fe95 100644
--- a/pkgs/tools/misc/ckb/default.nix
+++ b/pkgs/tools/misc/ckb/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, libudev, pkgconfig, qtbase, qmake, zlib }:
 
 stdenv.mkDerivation rec {
-  version = "0.2.6";
-  name = "ckb-${version}";
+  version = "0.2.8";
+  name = "ckb-next-${version}";
 
   src = fetchFromGitHub {
-    owner = "ccMSC";
-    repo = "ckb";
+    owner = "mattanger";
+    repo = "ckb-next";
     rev = "v${version}";
-    sha256 = "04h50qdzsbi77mj62jghr52i35vxvmhnvsb7pdfdq95ryry8bnwm";
+    sha256 = "0b3h1d54mdyfcx46zvsd7dfqf2656h4jjkiw044170gnfdzxjb3w";
   };
 
   buildInputs = [
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Driver and configuration tool for Corsair keyboards and mice";
-    homepage = https://github.com/ccMSC/ckb;
+    homepage = https://github.com/mattanger/ckb-next;
     license = licenses.gpl2;
     platforms = platforms.linux;
     maintainers = with maintainers; [ kierdavis ];
diff --git a/pkgs/tools/misc/diffoscope/default.nix b/pkgs/tools/misc/diffoscope/default.nix
index 3fd5bb7daa61d..5b42c811bd20a 100644
--- a/pkgs/tools/misc/diffoscope/default.nix
+++ b/pkgs/tools/misc/diffoscope/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchgit, python3Packages, docutils
-, acl, apktool, binutils, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc
+, acl, apktool, libbfd, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc
 , e2fsprogs, file, findutils, fontforge-fonttools, fpc, gettext, ghc, ghostscriptX, giflib, gnupg1, gnutar
 , gzip, imagemagick, jdk, libarchive, libcaca, llvm, mono, openssh, pdftk, pgpdump, poppler_utils, sng, sqlite
 , squashfsTools, tcpdump, unoconv, unzip, xxd, xz
@@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec {
   # Still missing these tools: docx2txt enjarify js-beautify oggDump Rscript
   # Also these libraries: python3-guestfs
   pythonPath = with python3Packages; [ debian libarchive-c python_magic tlsh rpm ] ++ [
-      acl binutils bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils
+      acl libbfd bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils
       fontforge-fonttools gettext gnutar gzip libarchive libcaca pgpdump sng sqlite
       squashfsTools unzip xxd xz
     ] ++ lib.optionals enableBloat [
diff --git a/pkgs/tools/misc/hdf5/1_8.nix b/pkgs/tools/misc/hdf5/1_8.nix
new file mode 100644
index 0000000000000..14c8ca234331d
--- /dev/null
+++ b/pkgs/tools/misc/hdf5/1_8.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, fetchurl
+, gcc
+, removeReferencesTo
+, cpp ? false
+, gfortran ? null
+, fortran2003 ? false
+, zlib ? null
+, szip ? null
+, mpi ? null
+, enableShared ? true
+}:
+
+# cpp and mpi options are mutually exclusive
+# (--enable-unsupported could be used to force the build)
+assert !cpp || mpi == null;
+
+# Need a Fortran compiler for Fortran2003 bindings
+assert fortran2003 -> gfortran != null;
+
+# No point splitting version 1.8.18 into multiple outputs.
+# The library /lib/libhdf5.so has a reference to gcc-wrapper
+
+let inherit (stdenv.lib) optional optionals; in
+
+stdenv.mkDerivation rec {
+  version = "1.8.19";
+  name = "hdf5-${version}";
+  src = fetchurl {
+    url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2";
+    sha256 = "0f3jfbqpaaq21ighi40qzs52nb52kc2d2yjk541rjmsx20b3ih2r" ;
+ };
+
+  passthru = {
+    mpiSupport = (mpi != null);
+    inherit mpi;
+  };
+
+  nativeBuildInputs = [ removeReferencesTo ];
+
+  buildInputs = []
+    ++ optional (gfortran != null) gfortran
+    ++ optional (szip != null) szip;
+
+  propagatedBuildInputs = []
+    ++ optional (zlib != null) zlib
+    ++ optional (mpi != null) mpi;
+
+  configureFlags = []
+    ++ optional cpp "--enable-cxx"
+    ++ optional (gfortran != null) "--enable-fortran"
+    ++ optional fortran2003 "--enable-fortran2003"
+    ++ optional (szip != null) "--with-szlib=${szip}"
+    ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
+    ++ optional enableShared "--enable-shared";
+
+  patches = [./bin-mv.patch];
+
+  postInstall = ''
+    find "$out" -type f -exec remove-references-to -t ${stdenv.cc} '{}' +
+  '';
+
+  meta = {
+    description = "Data model, library, and file format for storing and managing data";
+    longDescription = ''
+      HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
+      I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
+      applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
+      applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
+    '';
+    license = stdenv.lib.licenses.free; # BSD-like
+    homepage = https://www.hdfgroup.org/HDF5/;
+    platforms = stdenv.lib.platforms.unix;
+    broken = (gfortran != null) && stdenv.isDarwin;
+  };
+}
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index 1b979bae09004..2c1ba43a55876 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -14,17 +14,14 @@
 # (--enable-unsupported could be used to force the build)
 assert !cpp || mpi == null;
 
-# No point splitting version 1.8.18 into multiple outputs.
-# The library /lib/libhdf5.so has a reference to gcc-wrapper
-
 let inherit (stdenv.lib) optional optionals; in
 
 stdenv.mkDerivation rec {
-  version = "1.8.18";
+  version = "1.10.1";
   name = "hdf5-${version}";
   src = fetchurl {
-    url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.8/${name}/src/${name}.tar.bz2";
-    sha256 = "13542vrnl1p35n8vbq0wzk40vddmm33q5nh04j98c7r1yjnxxih1";
+    url = "https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/${name}/src/${name}.tar.bz2";
+    sha256 = "1wpbi15za7kbsvih88kfcxblw412pjndl16x88dgnqr47piy2p4w";
  };
 
   passthru = {
@@ -59,8 +56,8 @@ stdenv.mkDerivation rec {
     description = "Data model, library, and file format for storing and managing data";
     longDescription = ''
       HDF5 supports an unlimited variety of datatypes, and is designed for flexible and efficient
-      I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing 
-      applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and 
+      I/O and for high volume and complex data. HDF5 is portable and is extensible, allowing
+      applications to evolve in their use of HDF5. The HDF5 Technology suite includes tools and
       applications for managing, manipulating, viewing, and analyzing data in the HDF5 format.
     '';
     license = stdenv.lib.licenses.free; # BSD-like
diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix
index f5a99ba1c71c6..d0cb9a2233668 100644
--- a/pkgs/tools/misc/man-db/default.nix
+++ b/pkgs/tools/misc/man-db/default.nix
@@ -28,6 +28,10 @@ stdenv.mkDerivation rec {
     "--with-systemdtmpfilesdir=\${out}/lib/tmpfiles.d"
   ];
 
+  preConfigure = ''
+    configureFlagsArray+=("--with-sections=1 n l 8 3 0 2 5 4 9 6 7")
+  '';
+
   postInstall = ''
     # apropos/whatis uses program name to decide whether to act like apropos or whatis
     # (multi-call binary). `apropos` is actually just a symlink to whatis. So we need to
diff --git a/pkgs/tools/misc/system-config-printer/default.nix b/pkgs/tools/misc/system-config-printer/default.nix
index 72d45c90f1064..7f584563fa113 100644
--- a/pkgs/tools/misc/system-config-printer/default.nix
+++ b/pkgs/tools/misc/system-config-printer/default.nix
@@ -18,50 +18,47 @@ stdenv.mkDerivation rec {
 
   patches = [ ./detect_serverbindir.patch ];
 
-  buildInputs =
-    [ intltool pkgconfig glib udev libusb1 cups xmlto
-      libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
-      pythonPackages.python pythonPackages.wrapPython
-      libnotify gobjectIntrospection gdk_pixbuf pango atk
-      libgnome_keyring3
-    ];
+  buildInputs = [
+    intltool pkgconfig glib udev libusb1 cups xmlto
+    libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
 
-  nativeBuildInputs = [ wrapGAppsHook ];
+    libnotify gobjectIntrospection gdk_pixbuf pango atk
+    libgnome_keyring3
+
+    (pythonPackages.python.withPackages (ps: with ps; [
+      pycups pycurl dbus-python pygobject3 requests pycairo pysmbc
+    ]))
+  ];
 
-  pythonPath = with pythonPackages;
-    [ pycups pycurl dbus-python pygobject3 requests pycairo pysmbc ];
+  nativeBuildInputs = [ wrapGAppsHook ];
 
-  configureFlags =
-    [ "--with-udev-rules"
-      "--with-udevdir=$(out)/etc/udev"
-      "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
-    ];
+  configureFlags = [
+    "--with-udev-rules"
+    "--with-udevdir=$(out)/etc/udev"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+  ];
 
   stripDebugList = [ "bin" "lib" "etc/udev" ];
 
-  postInstall =
-    ''
-      buildPythonPath "$out $pythonPath"
-      gappsWrapperArgs+=(
-        --prefix PATH : "$program_PATH"
-        --set CUPS_DATADIR "${cups-filters}/share/cups"
-      )
-
-      find $out/share/system-config-printer -name \*.py -type f -perm -0100 -print0 | while read -d "" f; do
-        patchPythonScript "$f"
-      done
+  postInstall = ''
+    gappsWrapperArgs+=(
+      --prefix PATH : "$program_PATH"
+      --prefix PYTHONPATH : "$out/${pythonPackages.python.sitePackages}"
+      --set CUPS_DATADIR "${cups-filters}/share/cups"
+    )
 
-      # The below line will be unneeded when the next upstream release arrives.
-      sed -i -e "s|/usr/local/bin|$out/bin|" "$out/share/dbus-1/services/org.fedoraproject.Config.Printing.service"
+    # The below line will be unneeded when the next upstream release arrives.
+    sed -i -e "s|/usr/local/bin|$out/bin|" \
+      "$out/share/dbus-1/services/org.fedoraproject.Config.Printing.service"
 
-      # Manually expand literal "$(out)", which have failed to expand
-      sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
-          -i "$out/etc/systemd/system/configure-printer@.service"
-    '';
+    # Manually expand literal "$(out)", which have failed to expand
+    sed -e "s|ExecStart=\$(out)|ExecStart=$out|" \
+      -i "$out/etc/systemd/system/configure-printer@.service"
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://cyberelk.net/tim/software/system-config-printer/;
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.gpl2;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/tools/package-management/rpm/default.nix b/pkgs/tools/package-management/rpm/default.nix
index 0e9ef3876d2b9..25fcb8bc27e33 100644
--- a/pkgs/tools/package-management/rpm/default.nix
+++ b/pkgs/tools/package-management/rpm/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, cpio, zlib, bzip2, file, elfutils, libarchive, nspr, nss, popt, db, xz, python, lua, pkgconfig, binutils, autoreconfHook }:
+{ stdenv
+, pkgconfig, autoreconfHook
+, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libarchive, nspr, nss, popt, db, xz, python, lua
+}:
 
 stdenv.mkDerivation rec {
   name = "rpm-${version}";
@@ -15,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ cpio zlib bzip2 file libarchive nspr nss db xz python lua ];
 
   # rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements
-  propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive binutils ];
+  propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive libbfd ];
 
   NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss";
 
diff --git a/pkgs/tools/security/pius/default.nix b/pkgs/tools/security/pius/default.nix
index 5e0c87c2f7d54..908a47e6326f1 100644
--- a/pkgs/tools/security/pius/default.nix
+++ b/pkgs/tools/security/pius/default.nix
@@ -1,29 +1,21 @@
-{ fetchurl, stdenv, python, gnupg }:
+{ fetchFromGitHub, stdenv, pythonPackages, gnupg }:
 
-let version = "2.0.11"; in
-stdenv.mkDerivation {
+let version = "2.2.4"; in
+pythonPackages.buildPythonApplication {
   name = "pius-${version}";
   namePrefix = "";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/pgpius/pius/${version}/pius-${version}.tar.bz2";
-    sha256 = "0pdbyqz6k0bm182cz81ss7yckmpms5qhrrw0wcr4a1srzcjyzf5f";
+  src = fetchFromGitHub {
+    owner = "jaymzh";
+    repo = "pius";
+    rev = "v${version}";
+    sha256 = "1yk6ngpk55yjdnzhm5sj675xbzwp7rir816a3aris647gsph1vlx";
   };
 
-  buildInputs = [ python ];
-
   patchPhase = ''
-    sed -i "pius" -e's|/usr/bin/gpg|${gnupg}/bin/gpg|g'
-  '';
-
-  dontBuild = true;
-
-  installPhase = ''
-    mkdir -p "$out/bin"
-    cp -v pius "$out/bin"
-
-    mkdir -p "$out/doc/pius-${version}"
-    cp -v README "$out/doc/pius-${version}"
+    for file in libpius/constants.py pius-keyring-mgr; do
+      sed -i "$file" -E -e's|/usr/bin/gpg2?|${gnupg}/bin/gpg|g'
+    done
   '';
 
   meta = {
@@ -41,6 +33,6 @@ stdenv.mkDerivation {
     license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.gnu;
-    maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
+    maintainers = with stdenv.lib.maintainers; [ fuuzetsu kierdavis ];
   };
 }
diff --git a/pkgs/tools/security/sbsigntool/default.nix b/pkgs/tools/security/sbsigntool/default.nix
index b66564d58cee8..bcf1a5c1f7926 100644
--- a/pkgs/tools/security/sbsigntool/default.nix
+++ b/pkgs/tools/security/sbsigntool/default.nix
@@ -1,5 +1,7 @@
-{ stdenv, fetchgit, autoconf, automake, utillinux, openssl, libuuid, gnu-efi
-, binutils, pkgconfig, help2man }:
+{ stdenv
+, fetchgit, autoconf, automake, pkgconfig, help2man
+, utillinux, openssl, libuuid, gnu-efi, libbfd
+}:
 
 stdenv.mkDerivation rec {
   name = "sbsigntool-${version}";
@@ -15,8 +17,8 @@ stdenv.mkDerivation rec {
 
   prePatch = "patchShebangs .";
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ autoconf automake utillinux openssl libuuid gnu-efi binutils help2man ];
+  nativeBuildInputs = [ autoconf automake pkgconfig help2man ];
+  buildInputs = [ utillinux openssl libuuid gnu-efi libbfd ];
 
   configurePhase = ''
     substituteInPlace configure.ac --replace "@@NIX_GNUEFI@@" "${gnu-efi}"
diff --git a/pkgs/tools/system/lr/default.nix b/pkgs/tools/system/lr/default.nix
index d638a1c16b5d3..0149f1d91b614 100644
--- a/pkgs/tools/system/lr/default.nix
+++ b/pkgs/tools/system/lr/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "lr-${version}";
-  version = "1.1";
+  version = "1.2";
 
   src = fetchFromGitHub {
     owner = "chneukirchen";
     repo = "lr";
     rev = "v${version}";
-    sha256 = "171h353238s9wmhirvs2yc1151vds83a71p7wgn96wa3jpl248by";
+    sha256 = "1536d723dm50gxgpf8i9yij8mr0csh662ljhs5bmz0945jwfbx4n";
   };
 
   makeFlags = "PREFIX=$(out)";
diff --git a/pkgs/tools/system/minijail/default.nix b/pkgs/tools/system/minijail/default.nix
new file mode 100644
index 0000000000000..c47d40cef2b24
--- /dev/null
+++ b/pkgs/tools/system/minijail/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchgit, libcap }:
+
+stdenv.mkDerivation rec {
+  shortname = "minijail";
+  name = "${shortname}-${version}";
+  version = "android-8.0.0_r34";
+
+  src = fetchgit {
+    url = "https://android.googlesource.com/platform/external/minijail";
+    rev = version;
+    sha256 = "1d0q08cgks6h6ffsw3zw8dz4rm9y2djj2pwwy3xi6flx7vwy0psf";
+  };
+
+  buildInputs = [ libcap ];
+
+  makeFlags = [ "LIBDIR=$(out)/lib" ];
+
+  preConfigure = ''
+    substituteInPlace common.mk --replace /bin/echo echo
+    sed -i '/#include <asm\/siginfo.h>/ d' signal_handler.c
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp -v *.so $out/lib
+    mkdir -p $out/include
+    cp -v libminijail.h $out/include
+    mkdir -p $out/bin
+    cp minijail0 $out/bin
+  '';
+
+  meta = {
+    homepage = https://android.googlesource.com/platform/external/minijail/;
+    description = "Sandboxing library and application using Linux namespaces and capabilities";
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [pcarrier];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix
index 7508b4fc56c4f..1139c49ddf80b 100644
--- a/pkgs/tools/system/pciutils/default.nix
+++ b/pkgs/tools/system/pciutils/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, zlib, kmod, which }:
 
 stdenv.mkDerivation rec {
-  name = "pciutils-3.5.5"; # with database from 2017-07
+  name = "pciutils-3.5.6"; # with database from 2017-07
 
   src = fetchurl {
     url = "mirror://kernel/software/utils/pciutils/${name}.tar.xz";
-    sha256 = "1d62f8fa192f90e61c35a6fc15ff3cb9a7a792f782407acc42ef67817c5939f5";
+    sha256 = "08dvsk1b5m1r7qqzsm849h4glq67mngf8zw7bg0102ff1jwywipk";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix
index 2f37f6394bacd..b11f3cb4b8cde 100644
--- a/pkgs/tools/text/groff/default.nix
+++ b/pkgs/tools/text/groff/default.nix
@@ -5,14 +5,15 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "groff-1.22.3";
+  name = "groff-${version}";
+  version = "1.22.3";
 
   src = fetchurl {
     url = "mirror://gnu/groff/${name}.tar.gz";
     sha256 = "1998v2kcs288d3y7kfxpvl369nqi06zbbvjzafyvyl3pr7bajj1s";
   };
 
-  outputs = [ "out" "man" "doc" "info" ];
+  outputs = [ "out" "man" "doc" "info" "perl" ];
 
   enableParallelBuilding = false;
 
@@ -30,8 +31,7 @@ stdenv.mkDerivation rec {
       --replace "@PNMTOPS_NOSETPAGE@" "${netpbm}/bin/pnmtops -nosetpage"
   '';
 
-  buildInputs = [ ghostscript psutils netpbm ];
-  nativeBuildInputs = [ perl ];
+  buildInputs = [ ghostscript psutils netpbm perl ];
 
   # Builds running without a chroot environment may detect the presence
   # of /usr/X11 in the host system, leading to an impure build of the
@@ -62,6 +62,41 @@ stdenv.mkDerivation rec {
     for f in 'man.local' 'mdoc.local'; do
         cat '${./site.tmac}' >>"$out/share/groff/site-tmac/$f"
     done
+
+    moveToOutput bin/gropdf $perl
+    moveToOutput bin/pdfmom $perl
+    moveToOutput bin/roff2text $perl
+    moveToOutput bin/roff2pdf $perl
+    moveToOutput bin/roff2ps $perl
+    moveToOutput bin/roff2dvi $perl
+    moveToOutput bin/roff2ps $perl
+    moveToOutput bin/roff2html $perl
+    moveToOutput bin/glilypond $perl
+    moveToOutput bin/mmroff $perl
+    moveToOutput bin/roff2x $perl
+    moveToOutput bin/afmtodit $perl
+    moveToOutput bin/gperl $perl
+    moveToOutput bin/chem $perl
+    moveToOutput share/groff/${version}/font/devpdf $perl
+
+    # idk if this is needed, but Fedora does it
+    moveToOutput share/groff/${version}/tmac/pdf.tmac $perl
+
+    moveToOutput bin/gpinyin $perl
+    moveToOutput lib/groff/gpinyin $perl
+    substituteInPlace $perl/bin/gpinyin \
+      --replace $out/lib/groff/gpinyin $perl/lib/groff/gpinyin
+
+    moveToOutput bin/groffer $perl
+    moveToOutput lib/groff/groffer $perl
+    substituteInPlace $perl/bin/groffer \
+      --replace $out/lib/groff/groffer $perl/lib/groff/groffer
+
+    moveToOutput bin/grog $perl
+    moveToOutput lib/groff/grog $perl
+    substituteInPlace $perl/bin/grog \
+      --replace $out/lib/groff/grog $perl/lib/groff/grog
+
   '';
 
   meta = with stdenv.lib; {
@@ -82,5 +117,7 @@ stdenv.mkDerivation rec {
       version gxditview of the X11 xditview previewer, and an
       implementation of the -mm macros.
     '';
+
+    outputsToInstall = [ "out" "perl" ];
   };
 }
diff --git a/pkgs/tools/text/popfile/default.nix b/pkgs/tools/text/popfile/default.nix
index 10b82342051ad..42befa2ce26b2 100644
--- a/pkgs/tools/text/popfile/default.nix
+++ b/pkgs/tools/text/popfile/default.nix
@@ -44,8 +44,8 @@ stdenv.mkDerivation rec {
       wrapProgram "$path" \
         --prefix PERL5LIB : $PERL5LIB:$out/bin \
         --set POPFILE_ROOT $out/bin \
-        --set POPFILE_USER \$\{POPFILE_USER:-\$HOME/.popfile\} \
-        --run "test -d \$POPFILE_USER || mkdir -m 0700 -p \$POPFILE_USER"
+        --run 'export POPFILE_USER=''${POPFILE_USER:-$HOME/.popfile}' \
+        --run 'test -d "$POPFILE_USER" || mkdir -m 0700 -p "$POPFILE_USER"'
     done
   '';
 
diff --git a/pkgs/tools/typesetting/pdf2djvu/default.nix b/pkgs/tools/typesetting/pdf2djvu/default.nix
index e4613802892ee..8474778094069 100644
--- a/pkgs/tools/typesetting/pdf2djvu/default.nix
+++ b/pkgs/tools/typesetting/pdf2djvu/default.nix
@@ -15,8 +15,13 @@ stdenv.mkDerivation rec {
 
   preConfigure = ''
     sed -i 's#\$djvulibre_bin_path#${djvulibre.bin}/bin#g' configure
+
+    # Configure skips the failing check for usability of windres when it is nonempty.
+    unset WINDRES
   '';
 
+  enableParallelBuilding = true;
+
   meta = with stdenv.lib; {
     description = "Creates djvu files from PDF files";
     homepage = https://jwilk.net/software/pdf2djvu;
diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix
index 6b662c56579dd..253248f4cad1c 100644
--- a/pkgs/top-level/aliases.nix
+++ b/pkgs/top-level/aliases.nix
@@ -58,6 +58,7 @@ mapAliases (rec {
   foomatic_filters = foomatic-filters;  # 2016-08
   fuse_exfat = exfat;                   # 2015-09-11
   gettextWithExpat = gettext; # 2016-02-19
+  gdb-multitarget = gdb; # added 2017-11-13
   git-hub = gitAndTools.git-hub; # added 2016-04-29
   googleAuthenticator = google-authenticator; # added 2016-10-16
   grantlee5 = libsForQt5.grantlee;  # added 2015-12-19
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 5d69015b748d6..a584b5e6c85f1 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -77,6 +77,10 @@ with pkgs;
     { deps = [ autoconf automake gettext libtool ]; }
     ../build-support/setup-hooks/autoreconf.sh;
 
+  autoreconfHook264 = makeSetupHook
+    { deps = [ autoconf264 automake111x gettext libtool ]; }
+    ../build-support/setup-hooks/autoreconf.sh;
+
   ensureNewerSourcesHook = { year }: makeSetupHook {}
     (writeScript "ensure-newer-sources-hook.sh" ''
       postUnpackHooks+=(_ensureNewerSources)
@@ -1493,6 +1497,7 @@ with pkgs;
   m17n_lib = callPackage ../tools/inputmethods/m17n-lib { };
 
   skktools = callPackage ../tools/inputmethods/skk/skktools { };
+  skk-dicts = callPackage ../tools/inputmethods/skk/skk-dicts { };
 
   ibus = callPackage ../tools/inputmethods/ibus {
     inherit (gnome3) dconf glib;
@@ -2586,6 +2591,12 @@ with pkgs;
     mpi = null;
   };
 
+  hdf5_1_8 = callPackage ../tools/misc/hdf5/1_8.nix {
+    gfortran = null;
+    szip = null;
+    mpi = null;
+  };
+
   hdf5-mpi = appendToName "mpi" (hdf5.override {
     szip = null;
     mpi = pkgs.openmpi;
@@ -3372,6 +3383,8 @@ with pkgs;
 
   miniball = callPackage ../development/libraries/miniball { };
 
+  minijail = callPackage ../tools/system/minijail { };
+
   minixml = callPackage ../development/libraries/minixml { };
 
   mir-qualia = callPackage ../tools/text/mir-qualia {
@@ -6591,6 +6604,7 @@ with pkgs;
   octaveFull = (lowPrio (callPackage ../development/interpreters/octave {
     qt = qt4;
     overridePlatforms = ["x86_64-linux" "x86_64-darwin"];
+    openblas = if stdenv.isDarwin then openblasCompat else openblas;
   }));
 
   ocropus = callPackage ../applications/misc/ocropus { };
@@ -7707,8 +7721,6 @@ with pkgs;
     inherit (gnu) mig;
   };
 
-  gdb-multitarget = lowPrio (gdb.override { multitarget = true; });
-
   valgrind = callPackage ../development/tools/analysis/valgrind {
     inherit (darwin) xnu bootstrap_cmds cctools;
     llvm = llvm_39;
@@ -7864,6 +7876,10 @@ with pkgs;
 
   belle-sip = callPackage ../development/libraries/belle-sip { };
 
+  libbfd = callPackage ../development/libraries/libbfd { };
+
+  libopcodes = callPackage ../development/libraries/libopcodes { };
+
   bobcat = callPackage ../development/libraries/bobcat { };
 
   boehmgc = callPackage ../development/libraries/boehm-gc { };
@@ -9770,7 +9786,7 @@ with pkgs;
     # the hook to find catalogs is hidden by buildEnv
     postBuild = ''
       mkdir "$out/nix-support"
-      cp '${libxml2.dev}/nix-support/propagated-native-build-inputs' "$out/nix-support/"
+      cp '${libxml2.dev}/nix-support/propagated-build-inputs' "$out/nix-support/"
     '';
   };
 
@@ -10062,6 +10078,8 @@ with pkgs;
 
   olm = callPackage ../development/libraries/olm { };
 
+  oneko = callPackage ../applications/misc/oneko { };   
+
   oniguruma = callPackage ../development/libraries/oniguruma { };
 
   openal = self.openalSoft;
@@ -17875,6 +17893,8 @@ with pkgs;
     boost = boost160;
   };
 
+  freesweep = callPackage ../games/freesweep { };
+
   frotz = callPackage ../games/frotz { };
 
   fsg = callPackage ../games/fsg {
@@ -18073,6 +18093,8 @@ with pkgs;
 
   privateer = callPackage ../games/privateer { };
 
+  pysolfc = callPackage ../games/pysolfc { };
+
   qweechat = callPackage ../applications/networking/irc/qweechat { };
 
   qqwing = callPackage ../games/qqwing { };
@@ -19227,6 +19249,10 @@ with pkgs;
   # this driver ships with pre-compiled 32-bit binary libraries
   cnijfilter_2_80 = callPackage_i686 ../misc/cups/drivers/cnijfilter_2_80 { };
 
+  cnijfilter_4_00 = callPackage ../misc/cups/drivers/cnijfilter_4_00 {
+    libusb = libusb1;
+  };
+
   cnijfilter2 = callPackage ../misc/cups/drivers/cnijfilter2 {
     libusb = libusb1;
   };
@@ -19365,6 +19391,8 @@ with pkgs;
 
   keynav = callPackage ../tools/X11/keynav { };
 
+  kompose = callPackage ../applications/networking/cluster/kompose { };
+
   kops = callPackage ../applications/networking/cluster/kops { };
 
   lilypond = callPackage ../misc/lilypond { guile = guile_1_8; };
@@ -19620,6 +19648,7 @@ with pkgs;
     terraform_0_8
     terraform_0_9
     terraform_0_10
+    terraform_0_11
     ;
 
   # Terraform with all the plugins, both to get Hydra to build all plugins for us and for
@@ -19883,6 +19912,10 @@ with pkgs;
 
   snes9x-gtk = callPackage ../misc/emulators/snes9x-gtk { };
 
+  openmsx = callPackage ../misc/emulators/openmsx {
+    python = python27;
+  };
+
   higan = callPackage ../misc/emulators/higan {
     inherit (gnome2) gtksourceview;
   };
diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix
index ef58b7988dfe7..e3eaa7c7f589b 100644
--- a/pkgs/top-level/lua-packages.nix
+++ b/pkgs/top-level/lua-packages.nix
@@ -655,13 +655,13 @@ let
 
   vicious = stdenv.mkDerivation rec {
     name = "vicious-${version}";
-    version = "2.2.0";
+    version = "2.3.0";
 
     src = fetchFromGitHub {
       owner = "Mic92";
       repo = "vicious";
       rev = "v${version}";
-      sha256 = "0dhy0vklrhqrnmxb9pyqbfvkwwy86lwysk93pzg1j1zwprx366fj";
+      sha256 = "1mrd8c46ljilag8dljvnagaxnjnab8bmg9mcbnwvrivgjzgf6a1k";
     };
 
     buildInputs = [ lua ];
diff --git a/pkgs/top-level/metrics.nix b/pkgs/top-level/metrics.nix
index 2a54566ef4a75..5f61c67b29cc9 100644
--- a/pkgs/top-level/metrics.nix
+++ b/pkgs/top-level/metrics.nix
@@ -19,7 +19,7 @@ runCommand "nixpkgs-metrics"
       shift
 
       echo "running $@"
-      NIX_SHOW_STATS=1 time "$@" > /dev/null 2> stats
+      NIX_SHOW_STATS=1 time "$@" 2>&1 > /dev/null | tee stats
 
       cat stats
 
@@ -40,9 +40,12 @@ runCommand "nixpkgs-metrics"
       echo "$name.values $x" >> $out/nix-support/hydra-metrics
     }
 
-    run nixos.smallContainer nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix -A closures.smallContainer.x86_64-linux
-    run nixos.kde nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix -A closures.kde.x86_64-linux
-    run nixos.lapp nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix -A closures.lapp.x86_64-linux
+    run nixos.smallContainer nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix \
+      -A closures.smallContainer.x86_64-linux --show-trace
+    run nixos.kde nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix \
+      -A closures.kde.x86_64-linux --show-trace
+    run nixos.lapp nix-instantiate --dry-run ${nixpkgs}/nixos/release.nix \
+      -A closures.lapp.x86_64-linux --show-trace
     run nix-env.qa nix-env -f ${nixpkgs} -qa
     run nix-env.qaDrv nix-env -f ${nixpkgs} -qa --drv-path --meta --xml
 
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 620736adfe935..3d70bb0cc2528 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -1394,13 +1394,18 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  CatalystPluginHTMLWidget = buildPerlPackage {
+  CatalystPluginHTMLWidget = buildPerlPackage rec {
     name = "Catalyst-Plugin-HTML-Widget-1.1";
     src = fetchurl {
-      url = mirror://cpan/authors/id/S/SR/SRI/Catalyst-Plugin-HTML-Widget-1.1.tar.gz;
-      sha256 = "1zzyfhmzlqvbwk2w930k3mqk8z1lzhrja9ynx9yfq5gmc8qqg95l";
+      url = "mirror://cpan/authors/id/B/BO/BOBTFISH/${name}.tar.gz";
+      sha256 = "b4a4873162f515ec7cead6272533fc347c34711d138cc4c5e46b63fa2b74feff";
+    };
+    propagatedBuildInputs = [ CatalystRuntime HTMLWidget ];
+    meta = {
+      description = "HTML Widget Catalyst Plugin";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+      broken = true;
     };
-    propagatedBuildInputs = [CatalystRuntime HTMLWidget];
   };
 
   CatalystPluginLogHandler = buildPerlPackage rec {
@@ -2084,30 +2089,30 @@ let self = _self // overrides; _self = with self; {
   };
 
   ClassLoad = buildPerlPackage rec {
-    name = "Class-Load-0.23";
+    name = "Class-Load-0.24";
     src = fetchurl {
       url = "mirror://cpan/authors/id/E/ET/ETHER/${name}.tar.gz";
-      sha256 = "13xjfh4fadq4pkq7fcj42b26544jl7gqdg2y3imnra9fwxwsbg7j";
+      sha256 = "0bb983da46c146534fc77a556d6e40d925142f2eb43103534025ee545265ca36";
     };
-    buildInputs = [ TestFatal TestRequires ];
+    buildInputs = [ TestFatal TestNeeds ];
     propagatedBuildInputs = [ DataOptList ModuleImplementation ModuleRuntime PackageStash TryTiny ];
     meta = {
-      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      homepage = https://github.com/moose/Class-Load;
       description = "A working (require \"Class::Name\") and more";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
     };
   };
 
   ClassLoadXS = buildPerlPackage rec {
-    name = "Class-Load-XS-0.09";
+    name = "Class-Load-XS-0.10";
     src = fetchurl {
       url = "mirror://cpan/authors/id/E/ET/ETHER/${name}.tar.gz";
-      sha256 = "1aivalms81s3a2cj053ncgnmkpgl7vspna8ajlkqir7rdn8kpv5v";
+      sha256 = "5bc22cf536ebfd2564c5bdaf42f0d8a4cee3d1930fc8b44b7d4a42038622add1";
     };
-    buildInputs = [ ModuleImplementation TestFatal TestRequires ];
+    buildInputs = [ ModuleImplementation TestFatal TestNeeds ];
     propagatedBuildInputs = [ ClassLoad ];
     meta = {
-      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      homepage = https://github.com/moose/Class-Load-XS;
       description = "XS implementation of parts of Class::Load";
       license = stdenv.lib.licenses.artistic2;
     };
@@ -10277,6 +10282,7 @@ let self = _self // overrides; _self = with self; {
       sha256 = "8565aff76b3d09084642f3a83c654fb4ced8220e8e19d35c78b661519b4c1be6";
     };
     propagatedBuildInputs = [ URI ];
+    __darwinAllowLocalNetworking = true;
     meta = {
       homepage = https://github.com/libwww-perl/Net-HTTP;
       description = "Low-level HTTP connection (client)";
@@ -10781,6 +10787,7 @@ let self = _self // overrides; _self = with self; {
     };
     buildInputs = [ ModuleBuild TestFatal TestRequires ];
     propagatedBuildInputs = [ ModuleImplementation ];
+    perlPreHook = "export LD=$CC";
     meta = {
       homepage = https://metacpan.org/release/Params-Validate;
       description = "Validate method/function parameters";
@@ -15324,11 +15331,11 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
-  UNIVERSALrequire = buildPerlPackage {
-    name = "UNIVERSAL-require-0.17";
+  UNIVERSALrequire = buildPerlPackage rec {
+    name = "UNIVERSAL-require-0.18";
     src = fetchurl {
-      url = mirror://cpan/authors/id/N/NE/NEILB/UNIVERSAL-require-0.17.tar.gz;
-      sha256 = "5dc9f13f2d2bbdf852387e2a63c0753728c2bea9125dd628c313db3ef66ec4c3";
+      url = "mirror://cpan/authors/id/N/NE/NEILB/${name}.tar.gz";
+      sha256 = "b2a736a87967a143dab58c8a110501d5235bcdd2c8b2a3bfffcd3c0bd06b38ed";
     };
     meta = {
       description = "Require() modules from a variable";
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index ad1d50324f604..90d8c177b1e7b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -31,10 +31,9 @@ let
 
   callPackage = pkgs.newScope self;
 
-  bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
+  namePrefix = python.libPrefix + "-";
 
-  mkPythonDerivation = makeOverridable( callPackage ../development/interpreters/python/mk-python-derivation.nix {
-  });
+  bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { };
 
   # Derivations built with `buildPythonPackage` can already be overriden with `override`, `overrideAttrs`, and `overrideDerivation`.
   # This function introduces `overridePythonAttrs` and it overrides the call to `buildPythonPackage`.
@@ -52,13 +51,20 @@ let
       }
       else ff;
 
-  buildPythonPackage = makeOverridablePythonPackage (callPackage ../development/interpreters/python/build-python-package.nix {
-    inherit mkPythonDerivation;
+  buildPythonPackage = makeOverridablePythonPackage ( makeOverridable (callPackage ../development/interpreters/python/build-python-package.nix {
     inherit bootstrapped-pip;
     flit = self.flit;
-  });
+    # We want Python libraries to be named like e.g. "python3.6-${name}"
+    inherit namePrefix;
+    pythonModule = python;
+  }));
 
-  buildPythonApplication = args: buildPythonPackage ({namePrefix="";} // args );
+  buildPythonApplication = makeOverridablePythonPackage ( makeOverridable (callPackage ../development/interpreters/python/build-python-package.nix {
+    inherit bootstrapped-pip;
+    flit = self.flit;
+    namePrefix = "";
+    pythonModule = false;
+  }));
 
   graphiteVersion = "1.0.2";
 
@@ -80,10 +86,40 @@ let
         else throw "Unsupported kind ${kind}");
     in fetcher (builtins.removeAttrs attrs ["format"]) );
 
+  # Check whether a derivation provides a Python module.
+  hasPythonModule = drv: (hasAttr "pythonModule" drv) && ( (getAttr "pythonModule" drv) == python);
+
+  # Get list of required Python modules given a list of derivations.
+  requiredPythonModules = drvs: let
+    filterNull = list: filter (x: !isNull x) list;
+    conditionalGetRecurse = attr: condition: drv: let f = conditionalGetRecurse attr condition; in
+      (if (condition drv) then unique [drv]++(concatMap f (filterNull(getAttr attr drv))) else []);
+    _required = drv: conditionalGetRecurse "propagatedBuildInputs" hasPythonModule drv;
+  in [python] ++ (unique (concatMap _required (filterNull drvs)));
+
+  # Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations
+  # providing Python modules.
+  makePythonPath = drvs: stdenv.lib.makeSearchPath python.sitePackages (requiredPythonModules drvs);
+
+  # Convert derivation to a Python module.
+  toPythonModule = drv:
+    drv.overrideAttrs( oldAttrs: {
+      # Use passthru in order to prevent rebuilds when possible.
+      passthru = (oldAttrs.passthru or {})// {
+        name = namePrefix + oldAttrs.name;
+        pythonModule = python;
+        pythonPath = [ ]; # Deprecated, for compatibility.
+      };
+    });
+
+  disabledIf = x: drv:
+    if x then throw "${removePrefix namePrefix (drv.pname or drv.name)} not supported for interpreter ${python.executable}" else drv;
+
 in {
 
-  inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k mkPythonDerivation buildPythonPackage buildPythonApplication;
+  inherit python bootstrapped-pip pythonAtLeast pythonOlder isPy26 isPy27 isPy33 isPy34 isPy35 isPy36 isPyPy isPy3k buildPythonPackage buildPythonApplication;
   inherit fetchPypi callPackage;
+  inherit hasPythonModule requiredPythonModules makePythonPath disabledIf;
 
   # helpers
 
@@ -146,6 +182,8 @@ in {
     bap = pkgs.ocamlPackages_4_02.bap;
   };
 
+  bash_kernel = callPackage ../development/python-modules/bash_kernel { };
+
   bayespy = callPackage ../development/python-modules/bayespy { };
 
   bitcoin-price-api = callPackage ../development/python-modules/bitcoin-price-api { };
@@ -154,9 +192,7 @@ in {
 
   breathe = callPackage ../development/python-modules/breathe { };
 
-  browsermob-proxy = if ! isPy3k then
-    callPackage ../development/python-modules/browsermob-proxy {}
-  else throw "browsermob-proxy is not supported for ${python.executable}";
+  browsermob-proxy = disabledIf isPy3k (callPackage ../development/python-modules/browsermob-proxy {});
 
   bugseverywhere = callPackage ../applications/version-management/bugseverywhere {};
 
@@ -222,11 +258,11 @@ in {
 
   pyamf = callPackage ../development/python-modules/pyamf { };
 
-  pyatspi = if isPy3k then callPackage ../development/python-modules/pyatspi { } else throw "pyatspi not supported for interpreter ${python.executable}";
+  pyatspi = disabledIf (!isPy3k) (callPackage ../development/python-modules/pyatspi { });
 
   pycairo = callPackage ../development/python-modules/pycairo { };
 
-  pycangjie = if isPy3k then callPackage ../development/python-modules/pycangjie { } else throw "pycangjie not supported for interpreter ${python.executable}";
+  pycangjie = disabledIf (!isPy3k) (callPackage ../development/python-modules/pycangjie { });
 
   pycrypto = callPackage ../development/python-modules/pycrypto { };
 
@@ -236,7 +272,7 @@ in {
 
   PyChromecast = callPackage ../development/python-modules/pychromecast { };
 
-  pyexiv2 = if (!isPy3k) then callPackage ../development/python-modules/pyexiv2 {} else throw "pyexiv2 not supported for interpreter ${python.executable}";
+  pyexiv2 = disabledIf isPy3k (callPackage ../development/python-modules/pyexiv2 {});
 
   py3exiv2 = callPackage ../development/python-modules/py3exiv2 { };
 
@@ -298,13 +334,13 @@ in {
 
   PyWebDAV = callPackage ../development/python-modules/pywebdav { };
 
-  pyxml = if !isPy3k then callPackage ../development/python-modules/pyxml{ } else throw "pyxml not supported for interpreter ${python.executable}";
+  pyxml = disabledIf isPy3k (callPackage ../development/python-modules/pyxml{ });
 
   relatorio = callPackage ../development/python-modules/relatorio { };
 
   pyzufall = callPackage ../development/python-modules/pyzufall { };
 
-  rhpl = if !isPy3k then callPackage ../development/python-modules/rhpl {} else throw "rhpl not supported for interpreter ${python.executable}";
+  rhpl = disabledIf isPy3k (callPackage ../development/python-modules/rhpl {});
 
   simpleeval = callPackage ../development/python-modules/simpleeval { };
 
@@ -1336,10 +1372,10 @@ in {
 
   # Build boost for this specific Python version
   # TODO: use separate output for libboost_python.so
-  boost = pkgs.boost.override {
+  boost = toPythonModule (pkgs.boost.override {
     inherit (self) python numpy;
     enablePython = true;
-  };
+  });
 
   buttersink = buildPythonPackage rec {
     name = "buttersink-0.6.8";
@@ -3200,15 +3236,15 @@ in {
     propagatedBuildInputs = with self; [ pyusb ];
   };
 
-  opencv = pkgs.opencv.override {
+  opencv = toPythonModule (pkgs.opencv.override {
     enablePython = true;
     pythonPackages = self;
-  };
+  });
 
-  opencv3 = pkgs.opencv3.override {
+  opencv3 = toPythonModule (pkgs.opencv3.override {
     enablePython = true;
     pythonPackages = self;
-  };
+  });
 
   openidc-client = callPackage ../development/python-modules/openidc-client/default.nix {};
 
@@ -4735,13 +4771,11 @@ in {
 
   easy-thumbnails = callPackage ../development/python-modules/easy-thumbnails { };
 
-  eccodes = if (isPy27) then
-      (pkgs.eccodes.overrideAttrs (oldattrs: {
-    name = "${python.libPrefix}-" + oldattrs.name;
-  })).override {
-    enablePython = true;
-    pythonPackages = self;
-  } else throw "eccodes not supported for interpreter ${python.executable}";
+  eccodes = disabledIf (!isPy27)
+    (toPythonModule (pkgs.eccodes.override {
+      enablePython = true;
+      pythonPackages = self;
+    }));
 
   EditorConfig = buildPythonPackage rec {
     name = "EditorConfig-${version}";
@@ -4988,6 +5022,7 @@ in {
     checkPhase = ''
       py.test testing
     '';
+    __darwinAllowLocalNetworking = true;
     meta = {
       description = "Rapid multi-Python deployment";
       license = licenses.gpl2;
@@ -8711,10 +8746,10 @@ in {
 
   folium = callPackage ../development/python-modules/folium { };
 
-  fontforge = pkgs.fontforge.override {
+  fontforge = toPythonModule (pkgs.fontforge.override {
     withPython = true;
     inherit python;
-  };
+  });
 
   fonttools = callPackage ../development/python-modules/fonttools { };
 
@@ -8888,11 +8923,9 @@ in {
     };
   };
 
-  gdal = (pkgs.gdal.overrideDerivation (oldattrs: {
-    name = "${python.libPrefix}-" + oldattrs.name;
-  })).override {
+  gdal = toPythonModule (pkgs.gdal.override {
     pythonPackages = self;
-  };
+  });
 
   gdrivefs = buildPythonPackage rec {
     version = "0.14.8";
@@ -9264,13 +9297,11 @@ in {
     };
   };
 
-  grib-api = if (isPy27) then
-      (pkgs.grib-api.overrideAttrs (oldattrs: {
-    name = "${python.libPrefix}-" + oldattrs.name;
-  })).override {
-    enablePython = true;
-    pythonPackages = self;
-  } else throw "grib-api not supported for interpreter ${python.executable}";
+  grib-api = disabledIf (!isPy27) (toPythonModule
+    (pkgs.grib-api.override {
+      enablePython = true;
+      pythonPackages = self;
+    }));
 
   gspread = buildPythonPackage rec {
     version = "0.2.3";
@@ -10372,14 +10403,14 @@ in {
     inherit (pkgs) libsodium;
   };
 
-  libplist = if isPy3k then throw "libplist not supported for interpreter ${python.executable}" else
-    (pkgs.libplist.override{python2Packages=self; }).py;
+  libplist = disabledIf isPy3k
+    (toPythonModule (pkgs.libplist.override{python2Packages=self; })).py;
 
-  libxml2 = if isPy3k then throw "libxml2 not supported for interpreter ${python.executable}" else
-    (pkgs.libxml2.override{pythonSupport=true; python2=python;}).py;
+  libxml2 = disabledIf isPy3k
+    (toPythonModule (pkgs.libxml2.override{pythonSupport=true; python2=python;})).py;
 
-  libxslt = if isPy3k then throw "libxslt not supported for interpreter ${python.executable}" else
-    (pkgs.libxslt.override{pythonSupport=true; python2=python; inherit (self) libxml2;}).py;
+  libxslt = disabledIf isPy3k
+    (toPythonModule (pkgs.libxslt.override{pythonSupport=true; python2=python; inherit (self) libxml2;})).py;
 
   limnoria = buildPythonPackage rec {
     name = "limnoria-${version}";
@@ -10435,22 +10466,7 @@ in {
     fuse = pkgs.fuse;  # use "real" fuse, not the python module
   };
 
-  locustio = buildPythonPackage rec {
-    name = "locustio-0.7.2";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/l/locustio/${name}.tar.gz";
-      sha256 = "c9ca6fdfe6a6fb187a3d54ddf9b1518196348e8f20537f0a14ca81a264ffafa2";
-    };
-
-    propagatedBuildInputs = [ self.msgpack self.requests self.flask self.gevent self.pyzmq ];
-    buildInputs = [ self.mock self.unittest2 ];
-
-    meta = {
-      homepage = http://locust.io/;
-      description = "A load testing tool";
-    };
-  };
+  locustio = callPackage ../development/python-modules/locustio { };
 
   llvmlite = callPackage ../development/python-modules/llvmlite {llvm=pkgs.llvm_4;};
 
@@ -14047,6 +14063,8 @@ in {
 
     propagatedBuildInputs = with self; [ cryptography pyasn1 ];
 
+    __darwinAllowLocalNetworking = true;
+
     # https://github.com/paramiko/paramiko/issues/449
     doCheck = !(isPyPy || isPy33);
     checkPhase = ''
@@ -14370,43 +14388,7 @@ in {
     };
   };
 
-
-  pexpect = buildPythonPackage rec {
-    version = "4.2.1";
-    name = "pexpect-${version}";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/pexpect/${name}.tar.gz";
-      sha256 = "3d132465a75b57aa818341c6521392a06cc660feb3988d7f1074f39bd23c9a92";
-    };
-
-    # Wants to run pythonin a subprocess
-    doCheck = false;
-
-    propagatedBuildInputs = with self; [ ptyprocess ];
-
-    meta = {
-      homepage = http://www.noah.org/wiki/Pexpect;
-      description = "Automate interactive console applications such as ssh, ftp, etc";
-      license = licenses.mit;
-
-      longDescription = ''
-        Pexpect is similar to the Don Libes "Expect" system, but Pexpect
-        as a different interface that is easier to understand. Pexpect
-        is basically a pattern matching system. It runs programs and
-        watches output. When output matches a given pattern Pexpect can
-        respond as if a human were typing responses. Pexpect can be used
-        for automation, testing, and screen scraping. Pexpect can be
-        used for automating interactive console applications such as
-        ssh, ftp, passwd, telnet, etc. It can also be used to control
-        web applications via "lynx", "w3m", or some other text-based web
-        browser. Pexpect is pure Python. Unlike other Expect-like
-        modules for Python Pexpect does not require TCL or Expect nor
-        does it require C extensions to be compiled. It should work on
-        any platform that supports the standard Python pty module.
-      '';
-    };
-  };
+  pexpect = callPackage ../development/python-modules/pexpect { };
 
   pdfkit = buildPythonPackage rec {
     name = "pdfkit-${version}";
@@ -14850,31 +14832,13 @@ in {
 
   psd-tools = callPackage ../development/python-modules/psd-tools { };
 
-  psutil = buildPythonPackage rec {
-    name = "psutil-${version}";
-    version = "4.3.0";
-
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/psutil/${name}.tar.gz";
-      sha256 = "1w4r09fvn6kd80m5mx4ws1wz100brkaq6hzzpwrns8cgjzjpl6c6";
-    };
-
-    # Certain tests fail due to being in a chroot.
-    # See also the older issue: https://code.google.com/p/psutil/issues/detail?id=434
-    doCheck = false;
+  psutil = callPackage ../development/python-modules/psutil { };
 
-    buildInputs = with self; [ mock ] ++ optionals stdenv.isDarwin [ pkgs.darwin.IOKit ];
-
-    meta = {
-      description = "Process and system utilization information interface for python";
-      homepage = https://github.com/giampaolo/psutil;
-    };
-  };
-
-  psutil_1 = self.psutil.overrideDerivation (self: rec {
-    name = "psutil-1.2.1";
-    src = pkgs.fetchurl {
-      url = "mirror://pypi/p/psutil/${name}.tar.gz";
+  psutil_1 = self.psutil.overrideAttrs (oldAttrs: rec {
+    name = "${oldAttrs.pname}-${version}";
+    version = "1.2.1";
+    src = oldAttrs.src.override {
+      inherit version;
       sha256 = "0ibclqy6a4qmkjhlk3g8jhpvnk0v9aywknc61xm3hfi5r124m3jh";
     };
   });
@@ -16991,9 +16955,8 @@ in {
     };
   };
 
-  qscintilla = if isPy3k || isPyPy
-    then throw "qscintilla-${pkgs.qscintilla.version} not supported for interpreter ${python.executable}"
-    else buildPythonPackage rec {
+  qscintilla = disabledIf (isPy3k || isPyPy)
+    (buildPythonPackage rec {
       # TODO: Qt5 support
       name = "qscintilla-${version}";
       version = pkgs.qscintilla.version;
@@ -17022,7 +16985,7 @@ in {
         maintainers = with maintainers; [ danbst ];
         platforms = platforms.linux;
       };
-    };
+    });
 
 
   qserve = buildPythonPackage rec {
@@ -17170,6 +17133,10 @@ in {
 
   readme_renderer = callPackage ../development/python-modules/readme_renderer { };
 
+  rivet = disabledIf isPy3k (toPythonModule (pkgs.rivet.override {
+    python2 = python;
+  }));
+
   rjsmin = callPackage ../development/python-modules/rjsmin { };
 
   pysolr = buildPythonPackage rec {
@@ -17441,7 +17408,7 @@ in {
 
   rply = callPackage ../development/python-modules/rply/default.nix {};
 
-  rpm = (pkgs.rpm.override{inherit python;});
+  rpm = toPythonModule (pkgs.rpm.override{inherit python;});
 
   rpmfluff = callPackage ../development/python-modules/rpmfluff {};
 
@@ -18143,6 +18110,8 @@ in {
     cudnnSupport = false;
   };
 
+  thespian = callPackage ../development/python-modules/thespian { };
+
   tidylib = buildPythonPackage rec {
     version = "0.2.4";
     name = "pytidylib-${version}";
@@ -22088,7 +22057,7 @@ EOF
   };
 
   # For backwards compatibility. Please use nixpkgs.udiskie instead.
-  udiskie = pkgs.udiskie.override { pythonPackages = self; };
+  udiskie = toPythonModule (pkgs.udiskie.override { pythonPackages = self; });
 
   # Should be bumped along with EFL!
   pythonefl = buildPythonPackage rec {
@@ -24350,9 +24319,8 @@ EOF
   ROPGadget = callPackage ../development/python-modules/ROPGadget { };
 
   # We need "normal" libxml2 and not the python package by the same name.
-  pywbem = if !(isPy36)
-    then callPackage ../development/python-modules/pywbem { libxml2 = pkgs.libxml2; }
-    else throw "pywbem not supported for interpreter ${python.executable}";
+  pywbem = disabledIf isPy36
+    (callPackage ../development/python-modules/pywbem { libxml2 = pkgs.libxml2; });
 
   unicorn = callPackage ../development/python-modules/unicorn { };
 
@@ -24424,8 +24392,8 @@ EOF
 
   zeep = callPackage ../development/python-modules/zeep { };
 
-  zeitgeist = if isPy3k then throw "zeitgeist not supported for interpreter ${python.executable}" else
-    (pkgs.zeitgeist.override{python2Packages=self;}).py;
+  zeitgeist = disabledIf isPy3k
+    (toPythonModule (pkgs.zeitgeist.override{python2Packages=self;})).py;
 
   zeroconf = callPackage ../development/python-modules/zeroconf { };