summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--lib/attrsets.nix5
-rw-r--r--lib/customisation.nix34
-rw-r--r--lib/default.nix2
-rw-r--r--lib/deprecated.nix (renamed from lib/misc.nix)3
-rw-r--r--lib/lists.nix170
-rw-r--r--lib/maintainers.nix3
-rw-r--r--lib/modules.nix111
-rw-r--r--lib/options.nix12
-rw-r--r--lib/strings.nix89
-rw-r--r--lib/trivial.nix2
-rw-r--r--lib/types.nix2
-rw-r--r--nixos/doc/manual/default.nix15
-rw-r--r--nixos/doc/manual/installation/installing-usb.xml4
-rw-r--r--nixos/doc/manual/manual.xml5
-rw-r--r--nixos/doc/manual/release-notes/release-notes.xml14
-rw-r--r--nixos/doc/manual/release-notes/rl-1310.xml12
-rw-r--r--nixos/doc/manual/release-notes/rl-1404.xml12
-rw-r--r--nixos/doc/manual/release-notes/rl-1412.xml12
-rw-r--r--nixos/doc/manual/release-notes/rl-unstable.xml67
-rw-r--r--nixos/lib/build-vms.nix18
-rw-r--r--nixos/modules/installer/cd-dvd/iso-image.nix14
-rw-r--r--nixos/modules/installer/tools/nixos-generate-config.pl3
-rw-r--r--nixos/modules/installer/tools/tools.nix1
-rw-r--r--nixos/modules/misc/version.nix26
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/databases/postgresql.nix7
-rw-r--r--nixos/modules/services/mail/dovecot.nix7
-rw-r--r--nixos/modules/services/misc/gitit.nix11
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix2
-rw-r--r--nixos/modules/services/networking/copy-com.nix106
-rw-r--r--nixos/modules/services/networking/firewall.nix14
-rw-r--r--nixos/modules/services/networking/heyefi.nix82
-rw-r--r--nixos/modules/services/networking/ssh/sshd.nix15
-rw-r--r--nixos/modules/services/scheduling/cron.nix65
-rw-r--r--nixos/modules/services/x11/desktop-managers/gnome3.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/xfce.nix2
-rw-r--r--nixos/modules/services/x11/redshift.nix10
-rw-r--r--nixos/modules/services/x11/window-managers/icewm.nix17
-rw-r--r--nixos/modules/services/x11/window-managers/oroborus.nix25
-rw-r--r--nixos/modules/system/boot/kernel.nix5
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix42
-rw-r--r--nixos/modules/system/boot/loader/grub/install-grub.pl13
-rw-r--r--nixos/release-combined.nix1
-rw-r--r--nixos/tests/printing.nix4
-rw-r--r--pkgs/applications/audio/paprefs/default.nix2
-rw-r--r--pkgs/applications/audio/ponymix/default.nix21
-rw-r--r--pkgs/applications/display-managers/sddm/default.nix2
-rw-r--r--pkgs/applications/editors/eclipse/default.nix76
-rw-r--r--pkgs/applications/editors/ed/default.nix10
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch2
-rw-r--r--pkgs/applications/editors/texmacs/default.nix16
-rw-r--r--pkgs/applications/gis/qgis/default.nix4
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix90
-rw-r--r--pkgs/applications/graphics/apitrace/default.nix9
-rw-r--r--pkgs/applications/graphics/digikam/default.nix4
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix15
-rw-r--r--pkgs/applications/graphics/simple-scan/default.nix4
-rw-r--r--pkgs/applications/misc/cherrytree/default.nix37
-rw-r--r--pkgs/applications/misc/chirp/default.nix41
-rw-r--r--pkgs/applications/misc/direwolf/default.nix36
-rw-r--r--pkgs/applications/misc/electrum/default.nix5
-rw-r--r--pkgs/applications/misc/gnuradio-osmosdr/default.nix2
-rw-r--r--pkgs/applications/misc/gqrx/default.nix6
-rw-r--r--pkgs/applications/misc/gxmessage/default.nix20
-rw-r--r--pkgs/applications/misc/hackrf/default.nix6
-rw-r--r--pkgs/applications/misc/hamster-time-tracker/default.nix46
-rw-r--r--pkgs/applications/misc/multimon-ng/default.nix41
-rw-r--r--pkgs/applications/misc/redshift/default.nix39
-rw-r--r--pkgs/applications/misc/synapse/default.nix34
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/sources.nix16
-rw-r--r--pkgs/applications/networking/browsers/dillo/default.nix8
-rw-r--r--pkgs/applications/networking/browsers/links2/default.nix10
-rw-r--r--pkgs/applications/networking/copy-com/default.nix44
-rw-r--r--pkgs/applications/networking/feedreaders/canto-curses/default.nix4
-rw-r--r--pkgs/applications/networking/feedreaders/canto-daemon/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-mra/default.nix30
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-vk-plugin/default.nix28
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/client.nix30
-rw-r--r--pkgs/applications/networking/irc/sic/default.nix18
-rw-r--r--pkgs/applications/networking/mailreaders/mutt-kz/default.nix4
-rw-r--r--pkgs/applications/networking/remote/putty/default.nix10
-rw-r--r--pkgs/applications/networking/remote/x2goclient/default.nix4
-rw-r--r--pkgs/applications/science/math/ecm/default.nix11
-rw-r--r--pkgs/applications/science/math/lp_solve/default.nix43
-rw-r--r--pkgs/applications/science/misc/openmodelica/default.nix50
-rw-r--r--pkgs/applications/science/misc/openmodelica/fakegit.nix81
-rw-r--r--pkgs/applications/science/misc/openmodelica/src-libs-git.nix71
-rw-r--r--pkgs/applications/science/misc/openmodelica/src-libs-svn.nix5
-rw-r--r--pkgs/applications/science/misc/openmodelica/src-main.nix6
-rwxr-xr-xpkgs/applications/science/misc/openmodelica/update-src-libs-git.sh64
-rwxr-xr-xpkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh50
-rw-r--r--pkgs/applications/version-management/meld/default.nix16
-rw-r--r--pkgs/applications/version-management/peru/default.nix28
-rw-r--r--pkgs/applications/video/bomi/default.nix15
-rw-r--r--pkgs/applications/video/kodi/default.nix14
-rw-r--r--pkgs/applications/video/mpv/default.nix2
-rw-r--r--pkgs/applications/virtualization/bochs/default.nix6
-rw-r--r--pkgs/applications/virtualization/remotebox/default.nix30
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix3
-rw-r--r--pkgs/applications/window-managers/compiz/default.nix3
-rw-r--r--pkgs/applications/window-managers/icewm/default.nix44
-rw-r--r--pkgs/applications/window-managers/oroborus/default.nix27
-rw-r--r--pkgs/applications/window-managers/qtile/default.nix47
-rw-r--r--pkgs/applications/window-managers/qtile/restart_executable.patch12
-rw-r--r--pkgs/build-support/rust/default.nix2
-rw-r--r--pkgs/build-support/setup-hooks/wrap-gapps-hook.sh33
-rw-r--r--pkgs/data/documentation/man-pages/default.nix4
-rw-r--r--pkgs/data/fonts/dejavu-fonts/default.nix10
-rw-r--r--pkgs/data/fonts/font-awesome-ttf/default.nix2
-rw-r--r--pkgs/data/fonts/pecita/default.nix4
-rw-r--r--pkgs/data/misc/geolite-legacy/default.nix32
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix3
-rw-r--r--pkgs/desktops/gnome-3/3.16/apps/file-roller/default.nix7
-rw-r--r--pkgs/desktops/gnome-3/3.16/apps/gnome-clocks/default.nix12
-rw-r--r--pkgs/desktops/gnome-3/3.16/apps/gnome-documents/default.nix15
-rw-r--r--pkgs/desktops/gnome-3/3.16/apps/gnome-music/default.nix18
-rw-r--r--pkgs/desktops/gnome-3/3.16/apps/gnome-photos/default.nix15
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/adwaita-icon-theme/default.nix5
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/gnome-online-accounts/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/gnome-session/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/gnome-themes-standard/default.nix6
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/grilo/default.nix2
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/grilo/setup-hook.sh7
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/libpeas/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/3.16/default.nix18
-rw-r--r--pkgs/desktops/gnome-3/3.16/games/iagno/default.nix31
-rw-r--r--pkgs/desktops/gnome-3/3.16/games/lightsoff/default.nix31
-rw-r--r--pkgs/desktops/gnome-3/3.16/games/swell-foop/default.nix31
-rw-r--r--pkgs/desktops/kde-4.14/kde-workspace.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix5
-rw-r--r--pkgs/development/compilers/ghc/nokinds.nix6
-rw-r--r--pkgs/development/compilers/haxe/default.nix4
-rw-r--r--pkgs/development/compilers/llvm/3.6/clang/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.6/default.nix8
-rw-r--r--pkgs/development/compilers/llvm/3.6/libc++/default.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.6/libc++abi.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.6/lldb.nix2
-rw-r--r--pkgs/development/compilers/llvm/3.6/llvm.nix2
-rw-r--r--pkgs/development/compilers/mezzo/default.nix22
-rw-r--r--pkgs/development/compilers/openjdk/JDK-8074312-hotspot.patch11
-rw-r--r--pkgs/development/compilers/openjdk/openjdk8.nix23
-rw-r--r--pkgs/development/compilers/smlnj/default.nix14
-rw-r--r--pkgs/development/eclipse/ecj/default.nix6
-rw-r--r--pkgs/development/guile-modules/guile-gnome/default.nix44
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix9
-rw-r--r--pkgs/development/haskell-modules/configuration-ghc-7.10.x.nix8
-rw-r--r--pkgs/development/haskell-modules/configuration-ghc-head.nix10
-rw-r--r--pkgs/development/haskell-modules/gnuplot-fix-new-time.patch60
-rw-r--r--pkgs/development/haskell-modules/hackage-packages.nix1484
-rw-r--r--pkgs/development/interpreters/php/5.4.nix4
-rw-r--r--pkgs/development/interpreters/php/5.5.nix4
-rw-r--r--pkgs/development/interpreters/php/5.6.nix4
-rw-r--r--pkgs/development/libraries/bobcat/default.nix4
-rw-r--r--pkgs/development/libraries/boost/1.58.nix40
-rw-r--r--pkgs/development/libraries/cppzmq/default.nix8
-rw-r--r--pkgs/development/libraries/dbus/default.nix4
-rw-r--r--pkgs/development/libraries/double-conversion/default.nix4
-rw-r--r--pkgs/development/libraries/exempi/default.nix4
-rw-r--r--pkgs/development/libraries/expat/CVE-2015-1283.patch77
-rw-r--r--pkgs/development/libraries/expat/default.nix2
-rw-r--r--pkgs/development/libraries/folly/default.nix4
-rw-r--r--pkgs/development/libraries/freetds/default.nix7
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/default.nix4
-rw-r--r--pkgs/development/libraries/gettext/default.nix4
-rw-r--r--pkgs/development/libraries/gnutls/generic.nix22
-rw-r--r--pkgs/development/libraries/gtk+/3.x.nix4
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix4
-rw-r--r--pkgs/development/libraries/libaacs/default.nix6
-rw-r--r--pkgs/development/libraries/libarchive/default.nix4
-rw-r--r--pkgs/development/libraries/libbluray/default.nix6
-rw-r--r--pkgs/development/libraries/libchardet/default.nix2
-rw-r--r--pkgs/development/libraries/libdmtx/default.nix4
-rw-r--r--pkgs/development/libraries/libdrm/default.nix8
-rw-r--r--pkgs/development/libraries/libiberty/default.nix4
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix2
-rw-r--r--pkgs/development/libraries/libraw/default.nix4
-rw-r--r--pkgs/development/libraries/librsvg/default.nix6
-rw-r--r--pkgs/development/libraries/libsoup/default.nix4
-rw-r--r--pkgs/development/libraries/libva/default.nix4
-rw-r--r--pkgs/development/libraries/lightning/default.nix16
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/mesa/dlopen-absolute-paths.diff25
-rw-r--r--pkgs/development/libraries/mpfr/default.nix15
-rw-r--r--pkgs/development/libraries/mpfr/upstream.patch1699
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix4
-rw-r--r--pkgs/development/libraries/openexr/default.nix2
-rw-r--r--pkgs/development/libraries/poppler/default.nix4
-rw-r--r--pkgs/development/libraries/ppl/default.nix6
-rw-r--r--pkgs/development/libraries/ppl/ppl-cstddef.patch238
-rw-r--r--pkgs/development/libraries/ppl/upstream-based.patch42
-rw-r--r--pkgs/development/libraries/protobuf/3.0.nix12
-rw-r--r--pkgs/development/libraries/qpdf/default.nix4
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix13
-rw-r--r--pkgs/development/libraries/ti-rpc/fix_missing_rpc_get_default_domain.patch88
-rw-r--r--pkgs/development/libraries/vaapi-intel/default.nix4
-rw-r--r--pkgs/development/libraries/xapian/default.nix4
-rw-r--r--pkgs/development/libraries/xlslib/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/csv/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/fileutils/default.nix14
-rw-r--r--pkgs/development/ocaml-modules/macaque/default.nix10
-rw-r--r--pkgs/development/ocaml-modules/mysql/default.nix2
-rw-r--r--pkgs/development/perl-modules/DBD-Pg/default.nix2
-rw-r--r--pkgs/development/python-modules/buildout-nix/default.nix6
-rw-r--r--pkgs/development/python-modules/buildout-nix/nix.patch49
-rw-r--r--pkgs/development/r-modules/default.nix14
-rw-r--r--pkgs/development/tools/analysis/flow/default.nix4
-rw-r--r--pkgs/development/tools/apktool/default.nix2
-rw-r--r--pkgs/development/tools/guile/g-wrap/default.nix9
-rw-r--r--pkgs/development/tools/misc/dfu-util/default.nix31
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix6
-rw-r--r--pkgs/development/tools/misc/swig/2.x.nix25
-rw-r--r--pkgs/development/tools/misc/swig/3.x.nix25
-rw-r--r--pkgs/development/tools/omniorb/default.nix22
-rw-r--r--pkgs/development/tools/parsing/flexc++/default.nix4
-rw-r--r--pkgs/development/web/iojs/default.nix4
-rw-r--r--pkgs/games/adom/default.nix27
-rw-r--r--pkgs/games/crawl/default.nix1
-rw-r--r--pkgs/games/minecraft/default.nix11
-rw-r--r--pkgs/games/nethack/default.nix92
-rw-r--r--pkgs/games/steam/chrootenv.nix6
-rw-r--r--pkgs/games/the-powder-toy/default.nix1
-rw-r--r--pkgs/games/unnethack/default.nix53
-rw-r--r--pkgs/misc/cups/default.nix4
-rw-r--r--pkgs/misc/drivers/hplip/default.nix153
-rw-r--r--pkgs/misc/emulators/stella/default.nix7
-rw-r--r--pkgs/misc/ghostscript/default.nix2
-rw-r--r--pkgs/misc/themes/vertex/default.nix33
-rw-r--r--pkgs/os-specific/linux/android-udev-rules/default.nix4
-rw-r--r--pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix20
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix18
-rw-r--r--pkgs/os-specific/linux/jfbview/default.nix5
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.18.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-4.1.nix4
-rw-r--r--pkgs/os-specific/linux/mcelog/default.nix4
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/beta.nix6
-rwxr-xr-xpkgs/os-specific/linux/nvidia-x11/builder-legacy340.sh6
-rwxr-xr-xpkgs/os-specific/linux/nvidia-x11/builder.sh12
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix6
-rw-r--r--pkgs/os-specific/linux/perf-tools/default.nix6
-rw-r--r--pkgs/os-specific/linux/spl/git.nix13
-rw-r--r--pkgs/os-specific/linux/v4l2loopback/default.nix6
-rw-r--r--pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch31
-rw-r--r--pkgs/os-specific/linux/zfs/generic.nix6
-rw-r--r--pkgs/os-specific/linux/zfs/git.nix13
-rw-r--r--pkgs/servers/ftp/vsftpd/default.nix4
-rw-r--r--pkgs/servers/http/apache-httpd/2.2.nix4
-rw-r--r--pkgs/servers/http/apache-httpd/2.4.nix4
-rw-r--r--pkgs/servers/nosql/rethinkdb/default.nix27
-rw-r--r--pkgs/servers/nosql/riak/2.1.1.nix2
-rw-r--r--pkgs/servers/rpcbind/default.nix7
-rw-r--r--pkgs/servers/sql/mariadb/default.nix3
-rw-r--r--pkgs/servers/sql/postgresql/9.0.x.nix34
-rw-r--r--pkgs/servers/sql/postgresql/9.1.x.nix42
-rw-r--r--pkgs/servers/sql/postgresql/9.2.x.nix40
-rw-r--r--pkgs/servers/sql/postgresql/9.3.x.nix44
-rw-r--r--pkgs/servers/sql/postgresql/9.4.x.nix45
-rw-r--r--pkgs/servers/sql/postgresql/default.nix91
-rw-r--r--pkgs/servers/uwsgi/default.nix4
-rw-r--r--pkgs/servers/x11/xorg/default.nix34
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix22
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.7.list10
-rw-r--r--pkgs/servers/x11/xorg/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch65
-rw-r--r--pkgs/servers/x11/xorg/xkeyboard-config-eo.patch71
-rw-r--r--pkgs/tools/X11/xdg-utils/default.nix2
-rw-r--r--pkgs/tools/admin/awscli/default.nix12
-rw-r--r--pkgs/tools/backup/borg/default.nix27
-rw-r--r--pkgs/tools/compression/xdelta/default.nix4
-rw-r--r--pkgs/tools/filesystems/ceph/0.80.nix4
-rw-r--r--pkgs/tools/filesystems/ceph/0.94.nix8
-rw-r--r--pkgs/tools/filesystems/ceph/boost-158.patch27
-rw-r--r--pkgs/tools/filesystems/ceph/dev.nix3
-rw-r--r--pkgs/tools/filesystems/ceph/generic.nix7
-rw-r--r--pkgs/tools/filesystems/ceph/git.nix9
-rw-r--r--pkgs/tools/graphics/dmtx-utils/default.nix4
-rw-r--r--pkgs/tools/graphics/imgurbash/default.nix27
-rw-r--r--pkgs/tools/misc/file/default.nix4
-rw-r--r--pkgs/tools/misc/fzf/default.nix33
-rw-r--r--pkgs/tools/misc/profile-cleaner/default.nix4
-rw-r--r--pkgs/tools/misc/sdl-jstest/default.nix6
-rw-r--r--pkgs/tools/misc/wyrd/default.nix4
-rw-r--r--pkgs/tools/networking/dhcpcd/default.nix6
-rw-r--r--pkgs/tools/networking/horst/default.nix32
-rw-r--r--pkgs/tools/networking/i2p/default.nix15
-rw-r--r--pkgs/tools/networking/i2p/i2p.patch39
-rw-r--r--pkgs/tools/networking/ipv6calc/default.nix25
-rw-r--r--pkgs/tools/networking/netsniff-ng/default.nix4
-rw-r--r--pkgs/tools/networking/zerotierone/default.nix2
-rw-r--r--pkgs/tools/package-management/nix/default.nix2
-rw-r--r--pkgs/tools/package-management/nixops/default.nix2
-rw-r--r--pkgs/tools/package-management/nixops/unstable.nix9
-rw-r--r--pkgs/tools/security/sudo/default.nix4
-rw-r--r--pkgs/tools/system/facter/default.nix23
-rw-r--r--pkgs/tools/system/stress-ng/default.nix4
-rw-r--r--pkgs/tools/system/thermald/default.nix4
-rw-r--r--pkgs/tools/text/colordiff/default.nix7
-rw-r--r--pkgs/tools/text/groff/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix220
-rw-r--r--pkgs/top-level/go-packages.nix1173
-rw-r--r--pkgs/top-level/perl-packages.nix10
-rw-r--r--pkgs/top-level/python-packages.nix112
302 files changed, 6929 insertions, 3242 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix
index cb4091b916c5..20be2002402c 100644
--- a/lib/attrsets.nix
+++ b/lib/attrsets.nix
@@ -6,7 +6,6 @@ with {
   inherit (import ./default.nix) fold;
   inherit (import ./strings.nix) concatStringsSep;
   inherit (import ./lists.nix) concatMap concatLists all deepSeqList;
-  inherit (import ./misc.nix) maybeAttr;
 };
 
 rec {
@@ -76,7 +75,7 @@ rec {
        => { foo = 1; }
   */
   filterAttrs = pred: set:
-    listToAttrs (fold (n: ys: let v = set.${n}; in if pred n v then [(nameValuePair n v)] ++ ys else ys) [] (attrNames set));
+    listToAttrs (concatMap (name: let v = set.${name}; in if pred name v then [(nameValuePair name v)] else []) (attrNames set));
 
 
   /* foldAttrs: apply fold functions to values grouped by key. Eg accumulate values as list:
@@ -86,7 +85,7 @@ rec {
   foldAttrs = op: nul: list_of_attrs:
     fold (n: a:
         fold (name: o:
-          o // (listToAttrs [{inherit name; value = op n.${name} (maybeAttr name nul a); }])
+          o // (listToAttrs [{inherit name; value = op n.${name} (a.${name} or nul); }])
         ) a (attrNames n)
     ) {} list_of_attrs;
 
diff --git a/lib/customisation.nix b/lib/customisation.nix
index 91a25055df29..eaec46276b2b 100644
--- a/lib/customisation.nix
+++ b/lib/customisation.nix
@@ -1,6 +1,8 @@
 let
+
   lib = import ./default.nix;
   inherit (builtins) attrNames isFunction;
+
 in
 
 rec {
@@ -49,10 +51,6 @@ rec {
        else { }));
 
 
-  # usage: (you can use override multiple times)
-  # let d = makeOverridable stdenv.mkDerivation { name = ..; buildInputs; }
-  #     noBuildInputs = d.override { buildInputs = []; }
-  #     additionalBuildInputs = d.override ( args : args // { buildInputs = args.buildInputs ++ [ additional ]; } )
   makeOverridable = f: origArgs:
     let
       ff = f origArgs;
@@ -60,24 +58,16 @@ rec {
     in
       if builtins.isAttrs ff then (ff //
         { override = newArgs: makeOverridable f (overrideWith newArgs);
-          deepOverride = newArgs:
-            makeOverridable f (lib.overrideExisting (lib.mapAttrs (deepOverrider newArgs) origArgs) newArgs);
           overrideDerivation = fdrv:
             makeOverridable (args: overrideDerivation (f args) fdrv) origArgs;
         })
       else if builtins.isFunction ff then
         { override = newArgs: makeOverridable f (overrideWith newArgs);
           __functor = self: ff;
-          deepOverride = throw "deepOverride not yet supported for functors";
           overrideDerivation = throw "overrideDerivation not yet supported for functors";
         }
       else ff;
 
-  deepOverrider = newArgs: name: x: if builtins.isAttrs x then (
-    if x ? deepOverride then (x.deepOverride newArgs) else
-    if x ? override then (x.override newArgs) else
-    x) else x;
-
 
   /* Call the package function in the file `fn' with the required
     arguments automatically.  The function is called with the
@@ -102,12 +92,28 @@ rec {
   */
   callPackageWith = autoArgs: fn: args:
     let
-      f    = if builtins.isFunction fn then fn else import fn;
+      f = if builtins.isFunction fn then fn else import fn;
       auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
     in makeOverridable f (auto // args);
 
 
-  /* Add attributes to each output of a derivation without changing the derivation itself */
+  /* Like callPackage, but for a function that returns an attribute
+     set of derivations. The override function is added to the
+     individual attributes. */
+  callPackagesWith = autoArgs: fn: args:
+    let
+      f = if builtins.isFunction fn then fn else import fn;
+      auto = builtins.intersectAttrs (builtins.functionArgs f) autoArgs;
+      finalArgs = auto // args;
+      pkgs = f finalArgs;
+      mkAttrOverridable = name: pkg: pkg // {
+        override = newArgs: mkAttrOverridable name (f (finalArgs // newArgs)).${name};
+      };
+    in lib.mapAttrs mkAttrOverridable pkgs;
+
+
+  /* Add attributes to each output of a derivation without changing
+     the derivation itself. */
   addPassthru = drv: passthru:
     let
       outputs = drv.outputs or [ "out" ];
diff --git a/lib/default.nix b/lib/default.nix
index 4b6027c437be..cd0d8161c8cb 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -11,7 +11,7 @@ let
   types = import ./types.nix;
   meta = import ./meta.nix;
   debug = import ./debug.nix;
-  misc = import ./misc.nix;
+  misc = import ./deprecated.nix;
   maintainers = import ./maintainers.nix;
   platforms = import ./platforms.nix;
   systems = import ./systems.nix;
diff --git a/lib/misc.nix b/lib/deprecated.nix
index fd20ce25010c..3646f9e032a1 100644
--- a/lib/misc.nix
+++ b/lib/deprecated.nix
@@ -29,7 +29,6 @@ rec {
                           } ));
 	withStdOverrides = base // {
 	   override = base.passthru.function;
-	   deepOverride = a : (base.passthru.function ((lib.mapAttrs (lib.deepOverrider a) base.passthru.args) // a));
 	   } ;
         in
 	withStdOverrides;
@@ -203,8 +202,6 @@ rec {
     in
       work startSet [] [];
 
-  genericClosure = builtins.genericClosure or lazyGenericClosure;
-
   innerModifySumArgs = f: x: a: b: if b == null then (f a b) // x else 
         innerModifySumArgs f x (a // b);
   modifySumArgs = f: x: innerModifySumArgs f x {};
diff --git a/lib/lists.nix b/lib/lists.nix
index fa8cbddfd943..3bcf366f0c27 100644
--- a/lib/lists.nix
+++ b/lib/lists.nix
@@ -4,7 +4,7 @@ with import ./trivial.nix;
 
 rec {
 
-  inherit (builtins) head tail length isList elemAt concatLists filter elem;
+  inherit (builtins) head tail length isList elemAt concatLists filter elem genList;
 
 
   # Create a list consisting of a single element.  `singleton x' is
@@ -38,16 +38,24 @@ rec {
     in foldl' (length list - 1);
 
 
-  # map with index: `imap (i: v: "${v}-${toString i}") ["a" "b"] ==
-  # ["a-1" "b-2"]'
-  imap = f: list:
-    let
-      len = length list;
-      imap' = n:
-        if n == len
-          then []
-          else [ (f (n + 1) (elemAt list n)) ] ++ imap' (n + 1);
-    in imap' 0;
+  # Strict version of foldl.
+  foldl' = builtins.foldl' or foldl;
+
+
+  # Map with index: `imap (i: v: "${v}-${toString i}") ["a" "b"] ==
+  # ["a-1" "b-2"]'. FIXME: why does this start to count at 1?
+  imap =
+    if builtins ? genList then
+      f: list: genList (n: f (n + 1) (elemAt list n)) (length list)
+    else
+      f: list:
+      let
+        len = length list;
+        imap' = n:
+          if n == len
+            then []
+            else [ (f (n + 1) (elemAt list n)) ] ++ imap' (n + 1);
+      in imap' 0;
 
 
   # Map and concatenate the result.
@@ -59,7 +67,7 @@ rec {
   # == [1 2 3 4 5]' and `flatten 1 == [1]'.
   flatten = x:
     if isList x
-    then fold (x: y: (flatten x) ++ y) [] x
+    then foldl' (x: y: x ++ (flatten y)) [] x
     else [x];
 
 
@@ -86,17 +94,17 @@ rec {
 
   # Return true iff function `pred' returns true for at least element
   # of `list'.
-  any = pred: fold (x: y: if pred x then true else y) false;
+  any = builtins.any or (pred: fold (x: y: if pred x then true else y) false);
 
 
   # Return true iff function `pred' returns true for all elements of
   # `list'.
-  all = pred: fold (x: y: if pred x then y else false) true;
+  all = builtins.all or (pred: fold (x: y: if pred x then y else false) true);
 
 
   # Count how many times function `pred' returns true for the elements
   # of `list'.
-  count = pred: fold (x: c: if pred x then c + 1 else c) 0;
+  count = pred: foldl' (c: x: if pred x then c + 1 else c) 0;
 
 
   # Return a singleton list or an empty list, depending on a boolean
@@ -116,10 +124,17 @@ rec {
 
 
   # Return a list of integers from `first' up to and including `last'.
-  range = first: last:
-    if last < first
-    then []
-    else [first] ++ range (first + 1) last;
+  range =
+    if builtins ? genList then
+      first: last:
+        if first > last
+        then []
+        else genList (n: first + n) (last - first + 1)
+    else
+      first: last:
+        if last < first
+        then []
+        else [first] ++ range (first + 1) last;
 
 
   # Partition the elements of a list in two lists, `right' and
@@ -132,30 +147,37 @@ rec {
     ) { right = []; wrong = []; };
 
 
-  zipListsWith = f: fst: snd:
-    let
-      len1 = length fst;
-      len2 = length snd;
-      len = if len1 < len2 then len1 else len2;
-      zipListsWith' = n:
-        if n != len then
-          [ (f (elemAt fst n) (elemAt snd n)) ]
-          ++ zipListsWith' (n + 1)
-        else [];
-    in zipListsWith' 0;
+  zipListsWith =
+    if builtins ? genList then
+      f: fst: snd: genList (n: f (elemAt fst n) (elemAt snd n)) (min (length fst) (length snd))
+    else
+      f: fst: snd:
+      let
+        len = min (length fst) (length snd);
+        zipListsWith' = n:
+          if n != len then
+            [ (f (elemAt fst n) (elemAt snd n)) ]
+            ++ zipListsWith' (n + 1)
+          else [];
+      in zipListsWith' 0;
 
   zipLists = zipListsWith (fst: snd: { inherit fst snd; });
 
 
-  # Reverse the order of the elements of a list.  FIXME: O(n^2)!
-  reverseList = fold (e: acc: acc ++ [ e ]) [];
+  # Reverse the order of the elements of a list.
+  reverseList =
+    if builtins ? genList then
+      xs: let l = length xs; in genList (n: elemAt xs (l - n - 1)) l
+    else
+      fold (e: acc: acc ++ [ e ]) [];
 
 
   # Sort a list based on a comparator function which compares two
   # elements and returns true if the first argument is strictly below
   # the second argument.  The returned list is sorted in an increasing
   # order.  The implementation does a quick-sort.
-  sort = strictLess: list:
+  sort = builtins.sort or (
+    strictLess: list:
     let
       len = length list;
       first = head list;
@@ -169,31 +191,50 @@ rec {
       pivot = pivot' 1 { left = []; right = []; };
     in
       if len < 2 then list
-      else (sort strictLess pivot.left) ++  [ first ] ++  (sort strictLess pivot.right);
+      else (sort strictLess pivot.left) ++  [ first ] ++  (sort strictLess pivot.right));
 
 
   # Return the first (at most) N elements of a list.
-  take = count: list:
-    let
-      len = length list;
-      take' = n:
-        if n == len || n == count
-          then []
-        else
-          [ (elemAt list n) ] ++ take' (n + 1);
-    in take' 0;
+  take =
+    if builtins ? genList then
+      count: sublist 0 count
+    else
+      count: list:
+        let
+          len = length list;
+          take' = n:
+            if n == len || n == count
+              then []
+            else
+              [ (elemAt list n) ] ++ take' (n + 1);
+        in take' 0;
 
 
   # Remove the first (at most) N elements of a list.
-  drop = count: list:
-    let
-      len = length list;
-      drop' = n:
-        if n == -1 || n < count
-          then []
-        else
-          drop' (n - 1) ++ [ (elemAt list n) ];
-    in drop' (len - 1);
+  drop =
+    if builtins ? genList then
+      count: list: sublist count (length list) list
+    else
+      count: list:
+        let
+          len = length list;
+          drop' = n:
+            if n == -1 || n < count
+              then []
+            else
+              drop' (n - 1) ++ [ (elemAt list n) ];
+        in drop' (len - 1);
+
+
+  # Return a list consisting of at most ‘count’ elements of ‘list’,
+  # starting at index ‘start’.
+  sublist = start: count: list:
+    let len = length list; in
+    genList
+      (n: elemAt list (n + start))
+      (if start >= len then 0
+       else if start + count > len then len - start
+       else count);
 
 
   # Return the last element of a list.
@@ -205,25 +246,13 @@ rec {
   init = list: assert list != []; take (length list - 1) list;
 
 
-  # Zip two lists together.
-  zipTwoLists = xs: ys:
-    let
-      len1 = length xs;
-      len2 = length ys;
-      len = if len1 < len2 then len1 else len2;
-      zipTwoLists' = n:
-        if n != len then
-          [ { first = elemAt xs n; second = elemAt ys n; } ]
-          ++ zipTwoLists' (n + 1)
-        else [];
-    in zipTwoLists' 0;
-
-
   deepSeqList = xs: y: if any (x: deepSeq x false) xs then y else y;
 
+
   crossLists = f: foldl (fs: args: concatMap (f: map f args) fs) [f];
 
-  # Remove duplicate elements from the list
+
+  # Remove duplicate elements from the list. O(n^2) complexity.
   unique = list:
     if list == [] then
       []
@@ -233,9 +262,12 @@ rec {
         xs = unique (drop 1 list);
       in [x] ++ remove x xs;
 
-  # Intersects list 'e' and another list
+
+  # Intersects list 'e' and another list. O(nm) complexity.
   intersectLists = e: filter (x: elem x e);
 
-  # Subtracts list 'e' from another list
+
+  # Subtracts list 'e' from another list. O(nm) complexity.
   subtractLists = e: filter (x: !(elem x e));
+
 }
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index 0c76df9c0449..7aca12522d1e 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -70,6 +70,7 @@
   davidrusu = "David Rusu <davidrusu.me@gmail.com>";
   dbohdan = "Danyil Bohdan <danyil.bohdan@gmail.com>";
   DerGuteMoritz = "Moritz Heidkamp <moritz@twoticketsplease.de>";
+  desiderius = "Didier J. Devroye <didier@devroye.name>";
   devhell = "devhell <\"^\"@regexmail.net>";
   dezgeg = "Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>";
   dmalikov = "Dmitry Malikov <malikov.d.y@gmail.com>";
@@ -129,6 +130,7 @@
   jwiegley = "John Wiegley <johnw@newartisans.com>";
   jwilberding = "Jordan Wilberding <jwilberding@afiniate.com>";
   jzellner = "Jeff Zellner <jeffz@eml.cc>";
+  kamilchm = "Kamil Chmielewski <kamil.chm@gmail.com>";
   kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
   koral = "Koral <koral@mailoo.org>";
   kovirobi = "Kovacsics Robert <kovirobi@gmail.com>";
@@ -147,6 +149,7 @@
   ludo = "Ludovic Courtès <ludo@gnu.org>";
   madjar = "Georges Dubus <georges.dubus@compiletoi.net>";
   magnetophon = "Bart Brouns <bart@magnetophon.nl>";
+  mahe = "Matthias Herrmann <matthias.mh.herrmann@gmail.com>";
   malyn = "Michael Alyn Miller <malyn@strangeGizmo.com>";
   manveru = "Michael Fellinger <m.fellinger@gmail.com>";
   marcweber = "Marc Weber <marco-oweber@gmx.de>";
diff --git a/lib/modules.nix b/lib/modules.nix
index ea600127617b..d7037abfbef0 100644
--- a/lib/modules.nix
+++ b/lib/modules.nix
@@ -76,8 +76,8 @@ rec {
           else yieldConfig (prefix ++ [n]) v) set) ["_definedNames"];
         in
         if options._module.check.value && set ? _definedNames then
-          fold (m: res:
-            fold (name: res:
+          foldl' (res: m:
+            foldl' (res: name:
               if set ? ${name} then res else throw "The option `${showOption (prefix ++ [name])}' defined in `${m.file}' does not exist.")
               res m.names)
             res set._definedNames
@@ -182,18 +182,18 @@ rec {
         let
           loc = prefix ++ [name];
           # Get all submodules that declare ‘name’.
-          decls = concatLists (map (m:
+          decls = concatMap (m:
             if m.options ? ${name}
               then [ { inherit (m) file; options = m.options.${name}; } ]
               else []
-            ) options);
+            ) options;
           # Get all submodules that define ‘name’.
-          defns = concatLists (map (m:
+          defns = concatMap (m:
             if m.config ? ${name}
               then map (config: { inherit (m) file; inherit config; })
                 (pushDownProperties m.config.${name})
               else []
-            ) configs);
+            ) configs;
           nrOptions = count (m: isOption m.options) decls;
           # Extract the definitions for this loc
           defns' = map (m: { inherit (m) file; value = m.config.${name}; })
@@ -225,7 +225,7 @@ rec {
      'opts' is a list of modules.  Each module has an options attribute which
      correspond to the definition of 'loc' in 'opt.file'. */
   mergeOptionDecls = loc: opts:
-    fold (opt: res:
+    foldl' (res: opt:
       if opt.options ? default && res ? default ||
          opt.options ? example && res ? example ||
          opt.options ? description && res ? description ||
@@ -251,7 +251,7 @@ rec {
             else if opt.options ? options then map (coerceOption opt.file) options' ++ res.options
             else res.options;
         in opt.options // res //
-          { declarations = [opt.file] ++ res.declarations;
+          { declarations = res.declarations ++ [opt.file];
             options = submodules;
           }
     ) { inherit loc; declarations = []; options = []; } opts;
@@ -264,55 +264,59 @@ rec {
       defs' = (optional (opt ? default)
         { file = head opt.declarations; value = mkOptionDefault opt.default; }) ++ defs;
 
-      # Handle properties, check types, and merge everything together
-      inherit (mergeDefinitions loc opt.type defs') isDefined defsFinal mergedValue;
-      files = map (def: def.file) defsFinal;
-      merged =
-        if isDefined then mergedValue
-        else throw "The option `${showOption loc}' is used but not defined.";
-
-      # Finally, apply the ‘apply’ function to the merged
-      # value.  This allows options to yield a value computed
-      # from the definitions.
-      value = (opt.apply or id) merged;
+      # Handle properties, check types, and merge everything together.
+      res = mergeDefinitions loc opt.type defs';
+
+      # Check whether the option is defined, and apply the ‘apply’
+      # function to the merged value.  This allows options to yield a
+      # value computed from the definitions.
+      value =
+        if !res.isDefined then
+          throw "The option `${showOption loc}' is used but not defined."
+        else if opt ? apply then
+          opt.apply res.mergedValue
+        else
+          res.mergedValue;
+
     in opt //
       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
         definitions = map (def: def.value) defsFinal;
-        inherit isDefined files;
+        files = map (def: def.file) res.defsFinal;
+        inherit (res) isDefined;
       };
 
-    # Merge definitions of a value of a given type
-    mergeDefinitions = loc: type: defs: rec {
-      defsFinal =
-        let
-          # Process mkMerge and mkIf properties
-          processIfAndMerge = defs: concatMap (m:
-            map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value)
-          ) defs;
-
-          # Process mkOverride properties
-          processOverride = defs: filterOverrides defs;
-
-          # Sort mkOrder properties
-          processOrder = defs:
-            # Avoid sorting if we don't have to.
-            if any (def: def.value._type or "" == "order") defs
-            then sortProperties defs
-            else defs;
-        in
-          processOrder (processOverride (processIfAndMerge defs));
-
-        # Type-check the remaining definitions, and merge them
-        mergedValue = fold (def: res:
-          if type.check def.value then res
-          else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.name}.")
-          (type.merge loc defsFinal) defsFinal;
-
-        isDefined = defsFinal != [];
-        optionalValue =
-          if isDefined then { value = mergedValue; }
-          else {};
-    };
+  # Merge definitions of a value of a given type.
+  mergeDefinitions = loc: type: defs: rec {
+    defsFinal =
+      let
+        # Process mkMerge and mkIf properties.
+        defs' = concatMap (m:
+          map (value: { inherit (m) file; inherit value; }) (dischargeProperties m.value)
+        ) defs;
+
+        # Process mkOverride properties.
+        defs'' = filterOverrides defs';
+
+        # Sort mkOrder properties.
+        defs''' =
+          # Avoid sorting if we don't have to.
+          if any (def: def.value._type or "" == "order") defs''
+          then sortProperties defs''
+          else defs'';
+      in defs''';
+
+    # Type-check the remaining definitions, and merge them.
+    mergedValue = foldl' (res: def:
+      if type.check def.value then res
+      else throw "The option value `${showOption loc}' in `${def.file}' is not a ${type.name}.")
+      (type.merge loc defsFinal) defsFinal;
+
+    isDefined = defsFinal != [];
+
+    optionalValue =
+      if isDefined then { value = mergedValue; }
+      else {};
+  };
 
   /* Given a config set, expand mkMerge properties, and push down the
      other properties into the children.  The result is a list of
@@ -383,8 +387,7 @@ rec {
     let
       defaultPrio = 100;
       getPrio = def: if def.value._type or "" == "override" then def.value.priority else defaultPrio;
-      min = x: y: if x < y then x else y;
-      highestPrio = fold (def: prio: min (getPrio def) prio) 9999 defs;
+      highestPrio = foldl' (prio: def: min (getPrio def) prio) 9999 defs;
       strip = def: if def.value._type or "" == "override" then def // { value = def.value.content; } else def;
     in concatMap (def: if getPrio def == highestPrio then [(strip def)] else []) defs;
 
diff --git a/lib/options.nix b/lib/options.nix
index bfc5b5fa2ae8..5c543f56bcf3 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -4,7 +4,6 @@ let lib = import ./default.nix; in
 
 with import ./trivial.nix;
 with import ./lists.nix;
-with import ./misc.nix;
 with import ./attrsets.nix;
 with import ./strings.nix;
 
@@ -53,8 +52,8 @@ rec {
     if length list == 1 then head list
     else if all isFunction list then x: mergeDefaultOption loc (map (f: f x) list)
     else if all isList list then concatLists list
-    else if all isAttrs list then fold lib.mergeAttrs {} list
-    else if all isBool list then fold lib.or false list
+    else if all isAttrs list then foldl' lib.mergeAttrs {} list
+    else if all isBool list then foldl' lib.or false list
     else if all isString list then lib.concatStrings list
     else if all isInt list && all (x: x == head list) list then head list
     else throw "Cannot merge definitions of `${showOption loc}' given in ${showFiles (getFiles defs)}.";
@@ -68,7 +67,7 @@ rec {
   /* "Merge" option definitions by checking that they all have the same value. */
   mergeEqualOption = loc: defs:
     if defs == [] then abort "This case should never happen."
-    else fold (def: val:
+    else foldl' (val: def:
       if def.value != val then
         throw "The option `${showOption loc}' has conflicting definitions, in ${showFiles (getFiles defs)}."
       else
@@ -83,7 +82,7 @@ rec {
   optionAttrSetToDocList = optionAttrSetToDocList' [];
 
   optionAttrSetToDocList' = prefix: options:
-    fold (opt: rest:
+    concatMap (opt:
       let
         docOption = rec {
           name = showOption opt.loc;
@@ -101,8 +100,7 @@ rec {
           let ss = opt.type.getSubOptions opt.loc;
           in if ss != {} then optionAttrSetToDocList' opt.loc ss else [];
       in
-        # FIXME: expensive, O(n^2)
-        [ docOption ] ++ subOptions ++ rest) [] (collect isOption options);
+        [ docOption ] ++ subOptions) (collect isOption options);
 
 
   /* This function recursively removes all derivation attributes from
diff --git a/lib/strings.nix b/lib/strings.nix
index d9f7f6c2db81..bac03c9d7ad9 100644
--- a/lib/strings.nix
+++ b/lib/strings.nix
@@ -8,11 +8,15 @@ in
 
 rec {
 
-  inherit (builtins) stringLength substring head tail isString;
+  inherit (builtins) stringLength substring head tail isString replaceStrings;
 
 
   # Concatenate a list of strings.
-  concatStrings = lib.fold (x: y: x + y) "";
+  concatStrings =
+    if builtins ? concatStringsSep then
+      builtins.concatStringsSep ""
+    else
+      lib.foldl' (x: y: x + y) "";
 
 
   # Map a function over a list and concatenate the resulting strings.
@@ -25,14 +29,13 @@ rec {
   intersperse = separator: list:
     if list == [] || length list == 1
     then list
-    else [(head list) separator]
-         ++ (intersperse separator (tail list));
+    else tail (lib.concatMap (x: [separator x]) list);
 
 
   # Concatenate a list of strings with a separator between each element, e.g.
   # concatStringsSep " " ["foo" "bar" "xyzzy"] == "foo bar xyzzy"
-  concatStringsSep = separator: list:
-    concatStrings (intersperse separator list);
+  concatStringsSep = builtins.concatStringsSep or (separator: list:
+    concatStrings (intersperse separator list));
 
   concatMapStringsSep = sep: f: list: concatStringsSep sep (map f list);
   concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap f list);
@@ -61,13 +64,13 @@ rec {
 
   # Determine whether a string has given prefix/suffix.
   hasPrefix = pref: str:
-    eqStrings (substring 0 (stringLength pref) str) pref;
+    substring 0 (stringLength pref) str == pref;
   hasSuffix = suff: str:
     let
       lenStr = stringLength str;
       lenSuff = stringLength suff;
     in lenStr >= lenSuff &&
-       eqStrings (substring (lenStr - lenSuff) lenStr str) suff;
+       substring (lenStr - lenSuff) lenStr str == suff;
 
 
   # Convert a string to a list of characters (i.e. singleton strings).
@@ -76,36 +79,31 @@ rec {
   # will likely be horribly inefficient; Nix is not a general purpose
   # programming language.  Complex string manipulations should, if
   # appropriate, be done in a derivation.
-  stringToCharacters = s: let l = stringLength s; in
-    if l == 0
-    then []
-    else map (p: substring p 1 s) (lib.range 0 (l - 1));
+  stringToCharacters = s:
+    map (p: substring p 1 s) (lib.range 0 (stringLength s - 1));
 
 
-  # Manipulate a string charcater by character and replace them by strings
-  # before concatenating the results.
+  # Manipulate a string charactter by character and replace them by
+  # strings before concatenating the results.
   stringAsChars = f: s:
     concatStrings (
       map f (stringToCharacters s)
     );
 
 
-  # same as vim escape function.
-  # Each character contained in list is prefixed by "\"
-  escape = list : string :
-    stringAsChars (c: if lib.elem c list then "\\${c}" else c) string;
+  # Escape occurrence of the elements of ‘list’ in ‘string’ by
+  # prefixing it with a backslash. For example, ‘escape ["(" ")"]
+  # "(foo)"’ returns the string ‘\(foo\)’.
+  escape = list: replaceChars list (map (c: "\\${c}") list);
 
 
-  # still ugly slow. But more correct now
-  # [] for zsh
+  # Escape all characters that have special meaning in the Bourne shell.
   escapeShellArg = lib.escape (stringToCharacters "\\ ';$`()|<>\t*[]");
 
 
-  # replace characters by their substitutes.  This function is equivalent to
-  # the `tr' command except that one character can be replace by multiple
-  # ones.  e.g.,
-  # replaceChars ["<" ">"] ["&lt;" "&gt;"] "<foo>" returns "&lt;foo&gt;".
-  replaceChars = del: new: s:
+  # Obsolete - use replaceStrings instead.
+  replaceChars = builtins.replaceStrings or (
+    del: new: s:
     let
       substList = lib.zipLists del new;
       subst = c:
@@ -115,26 +113,23 @@ rec {
         else
           found.snd;
     in
-      stringAsChars subst s;
+      stringAsChars subst s);
 
 
-  # Case conversion utilities
+  # Case conversion utilities.
   lowerChars = stringToCharacters "abcdefghijklmnopqrstuvwxyz";
   upperChars = stringToCharacters "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
   toLower = replaceChars upperChars lowerChars;
   toUpper = replaceChars lowerChars upperChars;
 
-  # Appends string context from another string
-  addContextFrom = a: b: substring 0 0 a + b;
 
-  # Compares strings not requiring context equality
-  # Obviously, a workaround but works on all Nix versions
-  eqStrings = a: b: addContextFrom b a == addContextFrom a b;
+  # Appends string context from another string.
+  addContextFrom = a: b: substring 0 0 a + b;
 
 
-  # Cut a string with a separator and produces a list of strings which were
-  # separated by this separator. e.g.,
-  # `splitString "." "foo.bar.baz"' returns ["foo" "bar" "baz"].
+  # Cut a string with a separator and produces a list of strings which
+  # were separated by this separator; e.g., `splitString "."
+  # "foo.bar.baz"' returns ["foo" "bar" "baz"].
   splitString = _sep: _s:
     let
       sep = addContextFrom _s _sep;
@@ -177,7 +172,7 @@ rec {
       sufLen = stringLength suf;
       sLen = stringLength s;
     in
-      if sufLen <= sLen && eqStrings suf (substring (sLen - sufLen) sufLen s) then
+      if sufLen <= sLen && suf == substring (sLen - sufLen) sufLen s then
         substring 0 (sLen - sufLen) s
       else
         s;
@@ -196,21 +191,22 @@ rec {
 
 
   # Extract name with version from URL. Ask for separator which is
-  # supposed to start extension
-  nameFromURL = url: sep: let
-    components = splitString "/" url;
-    filename = lib.last components;
-    name = builtins.head (splitString sep filename);
-  in
-  assert ! eqStrings name filename;
-  name;
+  # supposed to start extension.
+  nameFromURL = url: sep:
+    let
+      components = splitString "/" url;
+      filename = lib.last components;
+      name = builtins.head (splitString sep filename);
+    in assert name !=  filename; name;
 
 
   # Create an --{enable,disable}-<feat> string that can be passed to
   # standard GNU Autoconf scripts.
   enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
 
-  # Create a fixed width string with additional prefix to match required width
+
+  # Create a fixed width string with additional prefix to match
+  # required width.
   fixedWidthString = width: filler: str:
     let
       strw = lib.stringLength str;
@@ -219,6 +215,7 @@ rec {
       assert strw <= width;
       if strw == width then str else filler + fixedWidthString reqWidth filler str;
 
-  # Format a number adding leading zeroes up to fixed width
+
+  # Format a number adding leading zeroes up to fixed width.
   fixedWidthNumber = width: n: fixedWidthString width "0" (toString n);
 }
diff --git a/lib/trivial.nix b/lib/trivial.nix
index 8addde1b86cd..9fd5a7e1c57c 100644
--- a/lib/trivial.nix
+++ b/lib/trivial.nix
@@ -22,7 +22,7 @@ rec {
   inherit (builtins)
     pathExists readFile isBool isFunction
     isInt add sub lessThan
-    seq deepSeq;
+    seq deepSeq genericClosure;
 
   # Return the Nixpkgs version number.
   nixpkgsVersion =
diff --git a/lib/types.nix b/lib/types.nix
index 0a54a5598f14..49f24b022de9 100644
--- a/lib/types.nix
+++ b/lib/types.nix
@@ -88,7 +88,7 @@ rec {
     attrs = mkOptionType {
       name = "attribute set";
       check = isAttrs;
-      merge = loc: fold (def: mergeAttrs def.value) {};
+      merge = loc: foldl' (res: def: mergeAttrs res def.value) {};
     };
 
     # derivation is a reserved keyword.
diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix
index fdfeb5ca07c1..419df915e6a4 100644
--- a/nixos/doc/manual/default.nix
+++ b/nixos/doc/manual/default.nix
@@ -61,6 +61,16 @@ let
       echo "${version}" > version
     '';
 
+  toc = builtins.toFile "toc.xml"
+    ''
+      <toc role="chunk-toc">
+        <d:tocentry xmlns:d="http://docbook.org/ns/docbook" linkend="book-nixos-manual"><?dbhtml filename="index.html"?>
+          <d:tocentry linkend="ch-options"><?dbhtml filename="options.html"?></d:tocentry>
+          <d:tocentry linkend="ch-release-notes"><?dbhtml filename="release-notes.html"?></d:tocentry>
+        </d:tocentry>
+      </toc>
+    '';
+
 in rec {
 
   # The NixOS options in JSON format.
@@ -113,9 +123,10 @@ in rec {
         --param chunk.section.depth 0 \
         --param chunk.first.sections 1 \
         --param use.id.as.filename 1 \
-        --stringparam generate.toc "book toc chapter toc appendix toc" \
+        --stringparam generate.toc "book toc appendix toc" \
+        --stringparam chunk.toc ${toc} \
         --nonet --xinclude --output $dst/ \
-        ${docbook5_xsl}/xml/xsl/docbook/xhtml/chunkfast.xsl ./manual.xml
+        ${docbook5_xsl}/xml/xsl/docbook/xhtml/chunktoc.xsl ./manual.xml
 
       mkdir -p $dst/images/callouts
       cp ${docbook5_xsl}/xml/xsl/docbook/images/callouts/*.gif $dst/images/callouts/
diff --git a/nixos/doc/manual/installation/installing-usb.xml b/nixos/doc/manual/installation/installing-usb.xml
index 97e3d2eaa1c0..5def6e8753fe 100644
--- a/nixos/doc/manual/installation/installing-usb.xml
+++ b/nixos/doc/manual/installation/installing-usb.xml
@@ -6,8 +6,8 @@
 
 <title>Booting from a USB Drive</title>
 
-<para>For systems without CD drive, the NixOS livecd can be booted from
-a usb stick. For non-UEFI installations,
+<para>For systems without CD drive, the NixOS live CD can be booted from
+a USB stick. For non-UEFI installations,
 <link xlink:href="http://unetbootin.sourceforge.net/">unetbootin</link>
 will work. For UEFI installations, you should mount the ISO, copy its contents
 verbatim to your drive, then either:
diff --git a/nixos/doc/manual/manual.xml b/nixos/doc/manual/manual.xml
index f6aedfd6b668..736d1d4eff71 100644
--- a/nixos/doc/manual/manual.xml
+++ b/nixos/doc/manual/manual.xml
@@ -2,7 +2,7 @@
       xmlns:xlink="http://www.w3.org/1999/xlink"
       xmlns:xi="http://www.w3.org/2001/XInclude"
       version="5.0"
-      xml:id="NixOSManual">
+      xml:id="book-nixos-manual">
   
   <info>
     <title>NixOS Manual</title>
@@ -33,11 +33,12 @@
   <xi:include href="administration/running.xml" />
   <!-- <xi:include href="userconfiguration.xml" /> -->
   <xi:include href="development/development.xml" />
-  <xi:include href="release-notes/release-notes.xml" />
 
   <appendix xml:id="ch-options">
     <title>Configuration Options</title>
     <xi:include href="options-db.xml" />
   </appendix>
 
+  <xi:include href="release-notes/release-notes.xml" />
+
 </book>
diff --git a/nixos/doc/manual/release-notes/release-notes.xml b/nixos/doc/manual/release-notes/release-notes.xml
index a988a5b0199c..70cd2d6070b5 100644
--- a/nixos/doc/manual/release-notes/release-notes.xml
+++ b/nixos/doc/manual/release-notes/release-notes.xml
@@ -1,19 +1,17 @@
-<part   xmlns="http://docbook.org/ns/docbook"
-        xmlns:xlink="http://www.w3.org/1999/xlink"
-        xmlns:xi="http://www.w3.org/2001/XInclude"
-        version="5.0"
-        xml:id="ch-release-notes">
+<appendix xmlns="http://docbook.org/ns/docbook"
+          xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:xi="http://www.w3.org/2001/XInclude"
+          version="5.0"
+          xml:id="ch-release-notes">
 
 <title>Release Notes</title>
 
-<partintro>
 <para>This section lists the release notes for each stable version of NixOS
 and current unstable revision.</para>
-</partintro>
 
 <xi:include href="rl-unstable.xml" />
 <xi:include href="rl-1412.xml" />
 <xi:include href="rl-1404.xml" />
 <xi:include href="rl-1310.xml" />
 
-</part>
+</appendix>
diff --git a/nixos/doc/manual/release-notes/rl-1310.xml b/nixos/doc/manual/release-notes/rl-1310.xml
index 234fb5a643f6..583912d70738 100644
--- a/nixos/doc/manual/release-notes/rl-1310.xml
+++ b/nixos/doc/manual/release-notes/rl-1310.xml
@@ -1,11 +1,11 @@
-<chapter xmlns="http://docbook.org/ns/docbook"
-        xmlns:xlink="http://www.w3.org/1999/xlink"
-        xmlns:xi="http://www.w3.org/2001/XInclude"
-        version="5.0"
-        xml:id="sec-release-13.10">
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-13.10">
 
 <title>Release 13.10 (“Aardvark”, 2013/10/31)</title>
 
 <para>This is the first stable release branch of NixOS.</para>
 
-</chapter>
\ No newline at end of file
+</section>
diff --git a/nixos/doc/manual/release-notes/rl-1404.xml b/nixos/doc/manual/release-notes/rl-1404.xml
index 74af1ed12741..36f67ed88b0b 100644
--- a/nixos/doc/manual/release-notes/rl-1404.xml
+++ b/nixos/doc/manual/release-notes/rl-1404.xml
@@ -1,8 +1,8 @@
-<chapter xmlns="http://docbook.org/ns/docbook"
-        xmlns:xlink="http://www.w3.org/1999/xlink"
-        xmlns:xi="http://www.w3.org/2001/XInclude"
-        version="5.0"
-        xml:id="sec-release-14.04">
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-14.04">
 
 <title>Release 14.04 (“Baboon”, 2014/04/30)</title>
 
@@ -157,4 +157,4 @@ networking.firewall.enable = false;
 
 </para>
 
-</chapter>
\ No newline at end of file
+</section>
diff --git a/nixos/doc/manual/release-notes/rl-1412.xml b/nixos/doc/manual/release-notes/rl-1412.xml
index 36ae48af7592..42b51cd4a8ef 100644
--- a/nixos/doc/manual/release-notes/rl-1412.xml
+++ b/nixos/doc/manual/release-notes/rl-1412.xml
@@ -1,8 +1,8 @@
-<chapter xmlns="http://docbook.org/ns/docbook"
-        xmlns:xlink="http://www.w3.org/1999/xlink"
-        xmlns:xi="http://www.w3.org/2001/XInclude"
-        version="5.0"
-        xml:id="sec-release-14.12">
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-14.12">
 
 <title>Release 14.12 (“Caterpillar”, 2014/12/30)</title>
 
@@ -174,4 +174,4 @@ now.</para></listitem>
 
 </para>
 
-</chapter>
+</section>
diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml
index 0b7750b0591d..abfd417c53a7 100644
--- a/nixos/doc/manual/release-notes/rl-unstable.xml
+++ b/nixos/doc/manual/release-notes/rl-unstable.xml
@@ -1,10 +1,10 @@
-<chapter xmlns="http://docbook.org/ns/docbook"
-        xmlns:xlink="http://www.w3.org/1999/xlink"
-        xmlns:xi="http://www.w3.org/2001/XInclude"
-        version="5.0"
-        xml:id="sec-release-unstable">
+<section xmlns="http://docbook.org/ns/docbook"
+         xmlns:xlink="http://www.w3.org/1999/xlink"
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         version="5.0"
+         xml:id="sec-release-unstable">
 
-<title>Unstable revision</title>
+<title>Release 15.07 (“Dingo”, 2015/07/??)</title>
 
 <para>In addition to numerous new and upgraded packages, this release has the following highlights:
 
@@ -36,12 +36,12 @@
 
 </para>
 
-<para>Following new services were added since the last release:
+<para>The following new services were added since the last release:
 
 <itemizedlist>
 <listitem><para><literal>brltty</literal></para></listitem>
 <listitem><para><literal>marathon</literal></para></listitem>
-<listitem><para><literal>Tvheadend</literal></para></listitem>
+<listitem><para><literal>tvheadend</literal></para></listitem>
 </itemizedlist>
 </para>
 
@@ -50,6 +50,30 @@ following incompatible changes:
 
 <itemizedlist>
 
+<listitem><para><command>sshd</command> no longer supports DSA and ECDSA
+host keys by default. If you have existing systems with such host keys
+and want to continue to use them, please set
+
+<programlisting>
+system.stateVersion = "14.12";
+</programlisting>
+
+(The new option <option>system.stateVersion</option> ensures that
+certain configuration changes that could break existing systems (such
+as the <command>sshd</command> host key setting) will maintain
+compatibility with the specified NixOS release.)</para></listitem>
+
+<listitem><para><command>cron</command> is no longer enabled by
+default, unless you have a non-empty
+<option>services.cron.systemCronJobs</option>. To force
+<command>cron</command> to be enabled, set
+<option>services.cron.enable = true</option>.</para></listitem>
+
+<listitem><para>Nix now requires binary caches to be cryptographically
+signed. If you have unsigned binary caches that you want to continue
+to use, you should set <option>nix.requireSignedBinaryCaches =
+false</option>.</para></listitem>
+
 <listitem><para>Steam now doesn't need root rights to work. Instead of using
 <literal>*-steam-chrootenv</literal>, you should now just run <literal>steam</literal>.
 <literal>steamChrootEnv</literal> package was renamed to <literal>steam</literal>,
@@ -65,20 +89,6 @@ was accordingly renamed to <literal>electron</literal>
 </para></listitem>
 
 <listitem>
-    <para>
-        The default <literal>NIX_PATH</literal> for NixOS now includes
-        <literal>/nix/var/nix/profiles/per-user/root/channels</literal>, so it's
-        easy to add custom channels.
-    </para>
-    <para>
-        Moreover, whenever a <command>nixos-rebuild &lt;action&gt;
-        --upgrade</command> is issued, every channel that includes a file
-        called <filename>.update-on-nixos-rebuild</filename> will be upgraded
-        alongside of the <literal>nixos</literal> channel.
-    </para>
-</listitem>
-
-<listitem>
   <para>
 	The CUPS printing service has been updated to version <literal>2.0.2</literal>.
 	Furthermore its systemd service has been renamed to <literal>cups.service</literal>.
@@ -92,15 +102,6 @@ was accordingly renamed to <literal>electron</literal>
 
 <listitem>
   <para>
-    HPLIP (printer, scanner, and fax drivers for HP devices) has
-    been updated to version <literal>3.15.4</literal>. This release
-    adds support for the <literal>arm6l-linux</literal> and
-    <literal>arm7l-linux</literal> platforms.
-  </para>
-</listitem>
-
-<listitem>
-  <para>
     Haskell packages can no longer be found by name, i.e. the commands
     <literal>nix-env -qa cabal-install</literal> and <literal>nix-env -i
     ghc</literal> will fail, even though we <emphasis>do</emphasis> ship
@@ -124,7 +125,7 @@ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA haskellPackages.cabal-install
 
 <listitem>
   <para>
-    Previous versions of NixOS come with a feature called
+    Previous versions of NixOS came with a feature called
     <literal>ghc-wrapper</literal>, a small wrapper script that allows
     GHC to transparently pick up on libraries installed in the user's
     profile. This feature has been deprecated;
@@ -181,4 +182,4 @@ nix-env -f &quot;&lt;nixpkgs&gt;&quot; -iA haskellPackages.cabal-install
 </itemizedlist>
 </para>
 
-</chapter>
+</section>
diff --git a/nixos/lib/build-vms.nix b/nixos/lib/build-vms.nix
index d0c9e7c6d236..01d6b21bba90 100644
--- a/nixos/lib/build-vms.nix
+++ b/nixos/lib/build-vms.nix
@@ -41,22 +41,22 @@ rec {
 
       machines = attrNames nodes;
 
-      machinesNumbered = zipTwoLists machines (range 1 254);
+      machinesNumbered = zipLists machines (range 1 254);
 
-      nodes_ = flip map machinesNumbered (m: nameValuePair m.first
+      nodes_ = flip map machinesNumbered (m: nameValuePair m.fst
         [ ( { config, pkgs, nodes, ... }:
             let
-              interfacesNumbered = zipTwoLists config.virtualisation.vlans (range 1 255);
-              interfaces = flip map interfacesNumbered ({ first, second }:
-                nameValuePair "eth${toString second}" { ip4 =
-                  [ { address = "192.168.${toString first}.${toString m.second}";
+              interfacesNumbered = zipLists config.virtualisation.vlans (range 1 255);
+              interfaces = flip map interfacesNumbered ({ fst, snd }:
+                nameValuePair "eth${toString snd}" { ip4 =
+                  [ { address = "192.168.${toString fst}.${toString m.snd}";
                       prefixLength = 24;
                   } ];
                 });
             in
             { key = "ip-address";
               config =
-                { networking.hostName = m.first;
+                { networking.hostName = m.fst;
 
                   networking.interfaces = listToAttrs interfaces;
 
@@ -76,11 +76,11 @@ rec {
 
                   virtualisation.qemu.options =
                     flip map interfacesNumbered
-                      ({ first, second }: qemuNICFlags second first m.second);
+                      ({ fst, snd }: qemuNICFlags snd fst m.snd);
                 };
             }
           )
-          (getAttr m.first nodes)
+          (getAttr m.fst nodes)
         ] );
 
     in listToAttrs nodes_;
diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix
index c9abff2ecfc0..fa9cc6fa20b9 100644
--- a/nixos/modules/installer/cd-dvd/iso-image.nix
+++ b/nixos/modules/installer/cd-dvd/iso-image.nix
@@ -30,8 +30,7 @@ let
   #   * COM32 entries (chainload, reboot, poweroff) are not recognized. They
   #     result in incorrect boot entries.
 
-  baseIsolinuxCfg =
-    ''
+  baseIsolinuxCfg = ''
     SERIAL 0 38400
     TIMEOUT ${builtins.toString syslinuxTimeout}
     UI vesamenu.c32
@@ -44,7 +43,7 @@ let
     LINUX /boot/bzImage
     APPEND init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}
     INITRD /boot/initrd
-    '';
+  '';
 
   isolinuxMemtest86Entry = ''
     LABEL memtest
@@ -55,12 +54,12 @@ let
 
   isolinuxCfg = baseIsolinuxCfg + (optionalString config.boot.loader.grub.memtest86.enable isolinuxMemtest86Entry);
 
-  # The efi boot image
+  # The EFI boot image.
   efiDir = pkgs.runCommand "efi-directory" {} ''
     mkdir -p $out/EFI/boot
     cp -v ${pkgs.gummiboot}/lib/gummiboot/gummiboot${targetArch}.efi $out/EFI/boot/boot${targetArch}.efi
     mkdir -p $out/loader/entries
-    echo "title NixOS LiveCD" > $out/loader/entries/nixos-livecd.conf
+    echo "title NixOS Live CD" > $out/loader/entries/nixos-livecd.conf
     echo "linux /boot/bzImage" >> $out/loader/entries/nixos-livecd.conf
     echo "initrd /boot/initrd" >> $out/loader/entries/nixos-livecd.conf
     echo "options init=${config.system.build.toplevel}/init ${toString config.boot.kernelParams}" >> $out/loader/entries/nixos-livecd.conf
@@ -218,6 +217,8 @@ in
     system.boot.loader.kernelFile = "bzImage";
     environment.systemPackages = [ pkgs.grub2 pkgs.grub2_efi pkgs.syslinux ];
 
+    boot.consoleLogLevel = mkDefault 7;
+
     # In stage 1 of the boot, mount the CD as the root FS by label so
     # that we don't need to know its device.  We pass the label of the
     # root filesystem on the kernel command line, rather than in
@@ -229,6 +230,7 @@ in
     boot.kernelParams =
       [ "root=LABEL=${config.isoImage.volumeID}"
         "boot.shell_on_fail"
+        "nomodeset"
       ];
 
     fileSystems."/" =
@@ -268,6 +270,8 @@ in
 
     boot.initrd.availableKernelModules = [ "squashfs" "iso9660" "usb-storage" ];
 
+    boot.blacklistedKernelModules = [ "nouveau" ];
+
     boot.initrd.kernelModules = [ "loop" ];
 
     # Closures to be copied to the Nix store on the CD, namely the init
diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl
index 187ea7635eb5..9010478662cc 100644
--- a/nixos/modules/installer/tools/nixos-generate-config.pl
+++ b/nixos/modules/installer/tools/nixos-generate-config.pl
@@ -544,6 +544,9 @@ $bootLoaderConfig
   #   uid = 1000;
   # };
 
+  # The NixOS release to be compatible with for stateful data such as databases.
+  system.stateVersion = "@nixosRelease@";
+
 }
 EOF
     } else {
diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix
index 99a74b6d59ed..61744c39d601 100644
--- a/nixos/modules/installer/tools/tools.nix
+++ b/nixos/modules/installer/tools/tools.nix
@@ -40,6 +40,7 @@ let
     src = ./nixos-generate-config.pl;
     path = [ pkgs.btrfsProgs ];
     perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl";
+    inherit (config.system) nixosRelease;
   };
 
   nixos-option = makeProg {
diff --git a/nixos/modules/misc/version.nix b/nixos/modules/misc/version.nix
index 5afdcf214f27..8a52df42dd80 100644
--- a/nixos/modules/misc/version.nix
+++ b/nixos/modules/misc/version.nix
@@ -6,12 +6,35 @@ with lib;
 
   options = {
 
+    system.stateVersion = mkOption {
+      type = types.str;
+      default = config.system.nixosRelease;
+      description = ''
+        Every once in a while, a new NixOS release may change
+        configuration defaults in a way incompatible with stateful
+        data. For instance, if the default version of PostgreSQL
+        changes, the new version will probably be unable to read your
+        existing databases. To prevent such breakage, you can set the
+        value of this option to the NixOS release with which you want
+        to be compatible. The effect is that NixOS will option
+        defaults corresponding to the specified release (such as using
+        an older version of PostgreSQL).
+      '';
+    };
+
     system.nixosVersion = mkOption {
       internal = true;
       type = types.str;
       description = "NixOS version.";
     };
 
+    system.nixosRelease = mkOption {
+      internal = true;
+      type = types.str;
+      default = readFile "${toString pkgs.path}/.version";
+      description = "NixOS release.";
+    };
+
     system.nixosVersionSuffix = mkOption {
       internal = true;
       type = types.str;
@@ -41,8 +64,7 @@ with lib;
 
   config = {
 
-    system.nixosVersion =
-      mkDefault (readFile "${toString pkgs.path}/.version" + config.system.nixosVersionSuffix);
+    system.nixosVersion = mkDefault (config.system.nixosRelease + config.system.nixosVersionSuffix);
 
     system.nixosVersionSuffix =
       let suffixFile = "${toString pkgs.path}/.version-suffix"; in
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 7e2c42f2b8c1..c56e6a82e831 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -288,6 +288,7 @@
   ./services/networking/gogoclient.nix
   ./services/networking/gvpe.nix
   ./services/networking/haproxy.nix
+  ./services/networking/heyefi.nix
   ./services/networking/hostapd.nix
   ./services/networking/i2pd.nix
   ./services/networking/i2p.nix
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index 97927055ce37..bae088c6610e 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -154,6 +154,12 @@ in
 
   config = mkIf config.services.postgresql.enable {
 
+    services.postgresql.package =
+      # Note: when changing the default, make it conditional on
+      # ‘system.stateVersion’ to maintain compatibility with existing
+      # systems!
+      mkDefault pkgs.postgresql94;
+
     services.postgresql.authentication = mkAfter
       ''
         # Generated file; do not edit!
@@ -207,6 +213,7 @@ in
 
         serviceConfig =
           { ExecStart = "@${postgresql}/bin/postgres postgres ${toString flags}";
+            ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
             User = "postgres";
             Group = "postgres";
             PermissionsStartOnly = true;
diff --git a/nixos/modules/services/mail/dovecot.nix b/nixos/modules/services/mail/dovecot.nix
index 50ff1b38db12..fca0d2a7f616 100644
--- a/nixos/modules/services/mail/dovecot.nix
+++ b/nixos/modules/services/mail/dovecot.nix
@@ -10,7 +10,7 @@ let
     ''
       base_dir = /var/run/dovecot2/
 
-      protocols = ${optionalString cfg.enableImap "imap"} ${optionalString cfg.enablePop3 "pop3"}
+      protocols = ${optionalString cfg.enableImap "imap"} ${optionalString cfg.enablePop3 "pop3"} ${optionalString cfg.enableLmtp "lmtp"}
     ''
     + (if cfg.sslServerCert!="" then
     ''
@@ -70,6 +70,11 @@ in
         description = "Start the IMAP listener (when Dovecot is enabled).";
       };
 
+      enableLmtp = mkOption {
+        default = false;
+        description = "Start the LMTP listener (when Dovecot is enabled).";
+      };
+
       user = mkOption {
         default = "dovecot2";
         description = "Dovecot user name.";
diff --git a/nixos/modules/services/misc/gitit.nix b/nixos/modules/services/misc/gitit.nix
index 56e735d7356b..72b706ddc5ae 100644
--- a/nixos/modules/services/misc/gitit.nix
+++ b/nixos/modules/services/misc/gitit.nix
@@ -40,7 +40,6 @@ let
       };
 
       haskellPackages = mkOption {
-        default = pkgs.haskellPackages;
         defaultText = "pkgs.haskellPackages";
         example = literalExample "pkgs.haskell.packages.ghc784";
         description = "haskellPackages used to build gitit and plugins.";
@@ -143,7 +142,6 @@ let
 
       staticDir = mkOption {
         type = types.path;
-        default = gititShared + "/data/static";
         description = ''
           Specifies the path of the static directory (containing javascript,
           css, and images).  If it does not exist, gitit will create it and
@@ -214,7 +212,6 @@ let
 
       templatesDir = mkOption {
         type = types.path;
-        default = gititShared + "/data/templates";
         description = ''
           Specifies the path of the directory containing page templates.  If it
           does not exist, gitit will create it with default templates.  Users
@@ -296,7 +293,6 @@ let
 
       plugins = mkOption {
         type = types.path;
-        default = gititShared + "/plugins/Dot.hs";
         description = ''
           Specifies a list of plugins to load.  Plugins may be specified either
           by their path or by their module name.  If the plugin name starts
@@ -608,6 +604,13 @@ in
 
   config = mkIf cfg.enable {
 
+    services.gitit = {
+      haskellPackages = mkDefault pkgs.haskellPackages;
+      staticDir = gititShared + "/data/static";
+      templatesDir = gititShared + "/data/templates";
+      plugins = gititShared + "/plugins/Dot.hs";
+    };
+
     users.extraUsers.gitit = {
       group = config.users.extraGroups.gitit.name;
       description = "Gitit user";
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index b5a8a7df9fca..49286f512bb9 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -254,7 +254,7 @@ in
 
       requireSignedBinaryCaches = mkOption {
         type = types.bool;
-        default = false;
+        default = true;
         description = ''
           If enabled, Nix will only download binaries from binary
           caches if they are cryptographically signed with any of the
diff --git a/nixos/modules/services/networking/copy-com.nix b/nixos/modules/services/networking/copy-com.nix
index 36bd29109b8a..69a41ab97963 100644
--- a/nixos/modules/services/networking/copy-com.nix
+++ b/nixos/modules/services/networking/copy-com.nix
@@ -1,53 +1,53 @@
-{ config, lib, pkgs, ... }:

-

-with lib;

-

-let

-  

-  cfg = config.services.copy-com;

-

-in 

-

-{

-  options = {

-

-    services.copy-com = {

-	  

-	  enable = mkOption {

-          default = false;

-          description = "

-            Enable the copy.com client.

-

-            The first time copy.com is run, it needs to be configured. Before enabling run 

-            copy_console manually.

-          ";

-      };

-

-      user = mkOption {

-        description = "The user for which copy should run.";

-      };

-

-      debug = mkOption {

-        default = false;

-        description = "Output more.";

-      };

-	  };

-  };

-

-  config = mkIf cfg.enable {

-    environment.systemPackages = [ pkgs.postfix ];

-

-    systemd.services."copy-com-${cfg.user}" = {

-      description = "Copy.com Client";

-      after = [ "network.target" "local-fs.target" ];

-      wantedBy = [ "multi-user.target" ];

-      serviceConfig = {

-        ExecStart = "${pkgs.copy-com}/bin/copy_console ${if cfg.debug then "-consoleOutput -debugToConsole=dirwatch,path-watch,csm_path,csm -debug -console" else ""}";

-        User = "${cfg.user}";

-      };

-

-    };

-  };

-

-}

-

+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.services.copy-com;
+
+in
+
+{
+  options = {
+
+    services.copy-com = {
+
+	  enable = mkOption {
+          default = false;
+          description = "
+            Enable the Copy.com client.
+            NOTE: before enabling the client for the first time, it must be
+            configured by first running CopyConsole (command line) or CopyAgent
+            (graphical) as the appropriate user.
+          ";
+      };
+
+      user = mkOption {
+        description = "The user for which the Copy.com client should be run.";
+      };
+
+      debug = mkOption {
+        default = false;
+        description = "Output more (debugging) messages to the console.";
+      };
+	  };
+  };
+
+  config = mkIf cfg.enable {
+    environment.systemPackages = [ pkgs.postfix ];
+
+    systemd.services."copy-com-${cfg.user}" = {
+      description = "Copy.com client";
+      after = [ "network.target" "local-fs.target" ];
+      wantedBy = [ "multi-user.target" ];
+      serviceConfig = {
+        ExecStart = "${pkgs.copy-com}/bin/CopyConsole ${if cfg.debug then "-consoleOutput -debugToConsole=dirwatch,path-watch,csm_path,csm -debug -console" else ""}";
+        User = "${cfg.user}";
+      };
+
+    };
+  };
+
+}
+
diff --git a/nixos/modules/services/networking/firewall.nix b/nixos/modules/services/networking/firewall.nix
index 40681f5b957a..a61f0250ef8b 100644
--- a/nixos/modules/services/networking/firewall.nix
+++ b/nixos/modules/services/networking/firewall.nix
@@ -420,6 +420,16 @@ in
         '';
     };
 
+    networking.firewall.extraPackages = mkOption {
+      default = [ ];
+      example = [ pkgs.ipset ];
+      description =
+        ''
+          Additional packages to be included in the environment of the system
+          as well as the path of networking.firewall.extraCommands.
+        '';
+    };
+
     networking.firewall.extraStopCommands = mkOption {
       type = types.lines;
       default = "";
@@ -443,7 +453,7 @@ in
 
     networking.firewall.trustedInterfaces = [ "lo" ];
 
-    environment.systemPackages = [ pkgs.iptables pkgs.ipset ];
+    environment.systemPackages = [ pkgs.iptables ] ++ cfg.extraPackages;
 
     boot.kernelModules = map (x: "nf_conntrack_${x}") cfg.connectionTrackingModules;
     boot.extraModprobeConfig = optionalString (!cfg.autoLoadConntrackHelpers) ''
@@ -462,7 +472,7 @@ in
       before = [ "network-pre.target" ];
       after = [ "systemd-modules-load.service" ];
 
-      path = [ pkgs.iptables pkgs.ipset ];
+      path = [ pkgs.iptables ] ++ cfg.extraPackages;
 
       # FIXME: this module may also try to load kernel modules, but
       # containers don't have CAP_SYS_MODULE. So the host system had
diff --git a/nixos/modules/services/networking/heyefi.nix b/nixos/modules/services/networking/heyefi.nix
new file mode 100644
index 000000000000..fc2b5a848578
--- /dev/null
+++ b/nixos/modules/services/networking/heyefi.nix
@@ -0,0 +1,82 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.services.heyefi;
+in
+
+{
+
+  ###### interface
+
+  options = {
+
+    services.heyefi = {
+
+      enable = mkEnableOption "heyefi";
+
+      cardMacaddress = mkOption {
+        default = "";
+        description = ''
+          An Eye-Fi card MAC address.
+          '';
+      };
+
+      uploadKey = mkOption {
+        default = "";
+        description = ''
+          An Eye-Fi card's upload key.
+          '';
+      };
+
+      uploadDir = mkOption {
+        example = "/home/username/pictures";
+        description = ''
+          The directory to upload the files to.
+          '';
+      };
+
+      user = mkOption {
+        default = "root";
+        description = ''
+          heyefi will be run under this user (user must exist,
+          this can be your user name).
+        '';
+      };
+
+    };
+
+  };
+
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+
+    systemd.services.heyefi =
+      {
+        description = "heyefi service";
+        after = [ "network.target" ];
+        wantedBy = [ "multi-user.target" ];
+        serviceConfig = {
+          User = "${cfg.user}";
+          Restart = "always";
+          ExecStart = "${pkgs.heyefi}/bin/heyefi";
+        };
+
+      };
+
+    environment.etc."heyefi/heyefi.config".text =
+      ''
+        # /etc/heyefi/heyefi.conf: DO NOT EDIT -- this file has been generated automatically.
+        cards = [["${config.services.heyefi.cardMacaddress}","${config.services.heyefi.uploadKey}"]]
+        upload_dir = "${toString config.services.heyefi.uploadDir}"
+      '';
+
+    environment.systemPackages = [ pkgs.heyefi ];
+
+  };
+
+}
diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix
index 4be2b5fe0c0c..1c428ceddfd2 100644
--- a/nixos/modules/services/networking/ssh/sshd.nix
+++ b/nixos/modules/services/networking/ssh/sshd.nix
@@ -184,16 +184,11 @@ in
       hostKeys = mkOption {
         type = types.listOf types.attrs;
         default =
-          [ { path = "/etc/ssh/ssh_host_dsa_key";
-              type = "dsa";
-            }
-            { path = "/etc/ssh/ssh_host_ecdsa_key";
-              type = "ecdsa";
-              bits = 521;
-            }
-            { path = "/etc/ssh/ssh_host_ed25519_key";
-              type = "ed25519";
-            }
+          [ { type = "rsa"; bits = 4096; path = "/etc/ssh/ssh_host_rsa_key"; }
+            { type = "ed25519"; path = "/etc/ssh/ssh_host_ed25519_key"; }
+          ] ++ optionals (!versionAtLeast config.system.stateVersion "15.07")
+          [ { type = "dsa"; path = "/etc/ssh/ssh_host_dsa_key"; }
+            { type = "ecdsa"; bits = 521; path = "/etc/ssh/ssh_host_ecdsa_key"; }
           ];
         description = ''
           NixOS can automatically generate SSH host keys.  This option
diff --git a/nixos/modules/services/scheduling/cron.nix b/nixos/modules/services/scheduling/cron.nix
index 1f42086dc1ec..02d80a77da50 100644
--- a/nixos/modules/services/scheduling/cron.nix
+++ b/nixos/modules/services/scheduling/cron.nix
@@ -4,8 +4,6 @@ with lib;
 
 let
 
-  inherit (config.services) jobsTags;
-
   # Put all the system cronjobs together.
   systemCronJobsFile = pkgs.writeText "system-crontab"
     ''
@@ -25,9 +23,9 @@ let
     sendmailPath = "/var/setuid-wrappers/sendmail";
   };
 
-  allFiles = map (f: "\"${f}\"") (
-    [ "${systemCronJobsFile}" ] ++ config.services.cron.cronFiles
-  );
+  allFiles =
+    optional (config.services.cron.systemCronJobs != []) systemCronJobsFile
+    ++ config.services.cron.cronFiles;
 
 in
 
@@ -91,36 +89,49 @@ in
 
   ###### implementation
 
-  config = mkIf (config.services.cron.enable && allFiles != []) {
+  config = mkMerge [
 
-    security.setuidPrograms = [ "crontab" ];
+    { services.cron.enable = mkDefault (allFiles != []); }
 
-    environment.systemPackages = [ cronNixosPkg ];
+    (mkIf (config.services.cron.enable) {
 
-    systemd.services.cron =
-      { description = "Cron Daemon";
+      security.setuidPrograms = [ "crontab" ];
 
-        wantedBy = [ "multi-user.target" ];
+      environment.systemPackages = [ cronNixosPkg ];
 
-        preStart =
-          ''
-            rm -f /etc/crontab
-            cat ${toString allFiles} > /etc/crontab
-            chmod 0600 /etc/crontab
+      environment.etc.crontab =
+        { source = pkgs.runCommand "crontabs" { inherit allFiles; }
+            ''
+              touch $out
+              for i in $allFiles; do
+                cat "$i" >> $out
+              done
+            '';
+          mode = "0600"; # Cron requires this.
+        };
 
-            mkdir -m 710 -p /var/cron
+      systemd.services.cron =
+        { description = "Cron Daemon";
 
-            # By default, allow all users to create a crontab.  This
-            # is denoted by the existence of an empty cron.deny file.
-            if ! test -e /var/cron/cron.allow -o -e /var/cron/cron.deny; then
-                touch /var/cron/cron.deny
-            fi
-          '';
+          wantedBy = [ "multi-user.target" ];
 
-        restartTriggers = [ config.environment.etc.localtime.source ];
-        serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n";
-      };
+          preStart =
+            ''
+              mkdir -m 710 -p /var/cron
 
-  };
+              # By default, allow all users to create a crontab.  This
+              # is denoted by the existence of an empty cron.deny file.
+              if ! test -e /var/cron/cron.allow -o -e /var/cron/cron.deny; then
+                  touch /var/cron/cron.deny
+              fi
+            '';
+
+          restartTriggers = [ config.environment.etc.localtime.source ];
+          serviceConfig.ExecStart = "${cronNixosPkg}/bin/cron -n";
+        };
+
+    })
+
+  ];
 
 }
diff --git a/nixos/modules/services/x11/desktop-managers/gnome3.nix b/nixos/modules/services/x11/desktop-managers/gnome3.nix
index cf6d2cab3492..01ab086b0925 100644
--- a/nixos/modules/services/x11/desktop-managers/gnome3.nix
+++ b/nixos/modules/services/x11/desktop-managers/gnome3.nix
@@ -40,7 +40,7 @@ in {
       example = literalExample "[ pkgs.gnome3.gpaste ]";
       description = "Additional list of packages to be added to the session search path.
                      Useful for gnome shell extensions or gsettings-conditionated autostart.";
-      apply = list: list ++ [ gnome3.gnome_shell ]; 
+      apply = list: list ++ [ gnome3.gnome_shell gnome3.gnome-shell-extensions ];
     };
 
     environment.gnome3.packageSet = mkOption {
diff --git a/nixos/modules/services/x11/desktop-managers/xfce.nix b/nixos/modules/services/x11/desktop-managers/xfce.nix
index fce5bf11f053..88eefa13de35 100644
--- a/nixos/modules/services/x11/desktop-managers/xfce.nix
+++ b/nixos/modules/services/x11/desktop-managers/xfce.nix
@@ -62,7 +62,7 @@ in
         pkgs.xfce.xfwm4
         # This supplies some "abstract" icons such as
         # "utilities-terminal" and "accessories-text-editor".
-        pkgs.gnome.gnomeicontheme
+        pkgs.gnome3.defaultIconTheme
         pkgs.desktop_file_utils
         pkgs.xfce.libxfce4ui
         pkgs.xfce.garcon
diff --git a/nixos/modules/services/x11/redshift.nix b/nixos/modules/services/x11/redshift.nix
index 99d19f6ab151..4f39e05f0f8d 100644
--- a/nixos/modules/services/x11/redshift.nix
+++ b/nixos/modules/services/x11/redshift.nix
@@ -47,6 +47,13 @@ in {
         type = types.str;
       };
     };
+
+    services.redshift.extraOptions = mkOption {
+      type = types.listOf types.str;
+      default = [];
+      example = [ "-v" "-m randr" ];
+      description = "Additional command-line arguments to pass to the redshift(1) command";
+    };
   };
 
   config = mkIf cfg.enable {
@@ -59,7 +66,8 @@ in {
         ${pkgs.redshift}/bin/redshift \
           -l ${cfg.latitude}:${cfg.longitude} \
           -t ${toString cfg.temperature.day}:${toString cfg.temperature.night} \
-          -b ${toString cfg.brightness.day}:${toString cfg.brightness.night}
+          -b ${toString cfg.brightness.day}:${toString cfg.brightness.night} \
+          ${lib.strings.concatStringsSep " " cfg.extraOptions}
       '';
       environment = { DISPLAY = ":0"; };
       serviceConfig.Restart = "always";
diff --git a/nixos/modules/services/x11/window-managers/icewm.nix b/nixos/modules/services/x11/window-managers/icewm.nix
index 36028da453a5..9a3e80221890 100644
--- a/nixos/modules/services/x11/window-managers/icewm.nix
+++ b/nixos/modules/services/x11/window-managers/icewm.nix
@@ -3,29 +3,16 @@
 with lib;
 
 let
-
   cfg = config.services.xserver.windowManager.icewm;
-
 in
-
 {
-
   ###### interface
-
   options = {
-
-    services.xserver.windowManager.icewm.enable = mkOption {
-      default = false;
-      description = "Enable the IceWM window manager.";
-    };
-
+    services.xserver.windowManager.icewm.enable = mkEnableOption "oroborus";
   };
 
-
   ###### implementation
-
   config = mkIf cfg.enable {
-
     services.xserver.windowManager.session = singleton
       { name = "icewm";
         start =
@@ -36,7 +23,5 @@ in
       };
 
     environment.systemPackages = [ pkgs.icewm ];
-
   };
-
 }
diff --git a/nixos/modules/services/x11/window-managers/oroborus.nix b/nixos/modules/services/x11/window-managers/oroborus.nix
new file mode 100644
index 000000000000..bd7e3396864b
--- /dev/null
+++ b/nixos/modules/services/x11/window-managers/oroborus.nix
@@ -0,0 +1,25 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.xserver.windowManager.oroborus;
+in
+{
+  ###### interface
+  options = {
+    services.xserver.windowManager.oroborus.enable = mkEnableOption "oroborus";
+  };
+
+  ###### implementation
+  config = mkIf cfg.enable {
+    services.xserver.windowManager.session = singleton {
+      name = "oroborus";
+      start = ''
+        ${pkgs.oroborus}/bin/oroborus &
+        waitPID=$!
+      '';
+    };
+    environment.systemPackages = [ pkgs.oroborus ];
+  };
+}
diff --git a/nixos/modules/system/boot/kernel.nix b/nixos/modules/system/boot/kernel.nix
index 63a095be6311..ae868219aa42 100644
--- a/nixos/modules/system/boot/kernel.nix
+++ b/nixos/modules/system/boot/kernel.nix
@@ -49,9 +49,8 @@ in
       type = types.int;
       default = 4;
       description = ''
-        The kernel console log level.  Only log messages with a
-        priority numerically less than this will appear on the
-        console.
+        The kernel console log level.  Log messages with a priority
+        numerically less than this will not appear on the console.
       '';
     };
 
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index c7cf712e3c2b..0b349749244f 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -10,7 +10,7 @@ let
 
   realGrub = if cfg.version == 1 then pkgs.grub
     else if cfg.zfsSupport then pkgs.grub2.override { zfsSupport = true; }
-    else if cfg.enableTrustedboot then pkgs.trustedGrub
+    else if cfg.enableTrustedBoot then pkgs.trustedGrub
            else pkgs.grub2;
 
   grub =
@@ -112,7 +112,7 @@ in
         description = ''
           The devices on which the boot loader, GRUB, will be
           installed. Can be used instead of <literal>device</literal> to
-          install grub into multiple devices (e.g., if as softraid arrays holding /boot).
+          install GRUB onto multiple devices.
         '';
       };
 
@@ -135,8 +135,8 @@ in
             example = "/boot1";
             type = types.str;
             description = ''
-              The path to the boot directory where grub will be written. Generally
-              this boot parth should double as an efi path.
+              The path to the boot directory where GRUB will be written. Generally
+              this boot path should double as an EFI path.
             '';
           };
 
@@ -166,7 +166,7 @@ in
             example = [ "/dev/sda" "/dev/sdb" ];
             type = types.listOf types.str;
             description = ''
-              The path to the devices which will have the grub mbr written.
+              The path to the devices which will have the GRUB MBR written.
               Note these are typically device paths and not paths to partitions.
             '';
           };
@@ -197,7 +197,7 @@ in
         type = types.lines;
         description = ''
           Additional bash commands to be run at the script that
-          prepares the grub menu entries.
+          prepares the GRUB menu entries.
         '';
       };
 
@@ -276,7 +276,7 @@ in
         example = "1024x768";
         type = types.str;
         description = ''
-          The gfxmode to pass to grub when loading a graphical boot interface under efi.
+          The gfxmode to pass to GRUB when loading a graphical boot interface under EFI.
         '';
       };
 
@@ -285,7 +285,7 @@ in
         example = "auto";
         type = types.str;
         description = ''
-          The gfxmode to pass to grub when loading a graphical boot interface under bios.
+          The gfxmode to pass to GRUB when loading a graphical boot interface under BIOS.
         '';
       };
 
@@ -330,10 +330,10 @@ in
         type = types.addCheck types.str
           (type: type == "uuid" || type == "label" || type == "provided");
         description = ''
-          Determines how grub will identify devices when generating the
+          Determines how GRUB will identify devices when generating the
           configuration file. A value of uuid / label signifies that grub
           will always resolve the uuid or label of the device before using
-          it in the configuration. A value of provided means that grub will
+          it in the configuration. A value of provided means that GRUB will
           use the device name as show in <command>df</command> or
           <command>mount</command>. Note, zfs zpools / datasets are ignored
           and will always be mounted using their labels.
@@ -344,7 +344,7 @@ in
         default = false;
         type = types.bool;
         description = ''
-          Whether grub should be build against libzfs.
+          Whether GRUB should be build against libzfs.
           ZFS support is only available for GRUB v2.
           This option is ignored for GRUB v1.
         '';
@@ -354,7 +354,7 @@ in
         default = false;
         type = types.bool;
         description = ''
-          Whether grub should be build with EFI support.
+          Whether GRUB should be build with EFI support.
           EFI support is only available for GRUB v2.
           This option is ignored for GRUB v1.
         '';
@@ -364,16 +364,16 @@ in
         default = false;
         type = types.bool;
         description = ''
-          Enable support for encrypted partitions. Grub should automatically
+          Enable support for encrypted partitions. GRUB should automatically
           unlock the correct encrypted partition and look for filesystems.
         '';
       };
 
-      enableTrustedboot = mkOption {
+      enableTrustedBoot = mkOption {
         default = false;
         type = types.bool;
         description = ''
-          Enable trusted boot. Grub will measure all critical components during
+          Enable trusted boot. GRUB will measure all critical components during
           the boot process to offer TCG (TPM) support.
         '';
       };
@@ -429,7 +429,7 @@ in
       assertions = [
         {
           assertion = !cfg.zfsSupport || cfg.version == 2;
-          message = "Only grub version 2 provides zfs support";
+          message = "Only GRUB version 2 provides ZFS support";
         }
         {
           assertion = cfg.mirroredBoots != [ ];
@@ -441,19 +441,19 @@ in
           message = "You cannot have duplicated devices in mirroredBoots";
         }
         {
-          assertion = !cfg.enableTrustedboot || cfg.version == 2;
+          assertion = !cfg.enableTrustedBoot || cfg.version == 2;
           message = "Trusted GRUB is only available for GRUB 2";
         }
         {
-          assertion = !cfg.efiSupport || !cfg.enableTrustedboot;
+          assertion = !cfg.efiSupport || !cfg.enableTrustedBoot;
           message = "Trusted GRUB does not have EFI support";
         }
         {
-          assertion = !cfg.zfsSupport || !cfg.enableTrustedboot;
+          assertion = !cfg.zfsSupport || !cfg.enableTrustedBoot;
           message = "Trusted GRUB does not have ZFS support";
         }
         {
-          assertion = !cfg.enableTrustedboot;
+          assertion = !cfg.enableTrustedBoot;
           message = "Trusted GRUB can break your system. Remove assertion if you want to test trustedGRUB nevertheless.";
         }
       ] ++ flip concatMap cfg.mirroredBoots (args: [
@@ -471,7 +471,7 @@ in
         }
       ] ++ flip map args.devices (device: {
         assertion = device == "nodev" || hasPrefix "/" device;
-        message = "Grub devices must be absolute paths, not ${dev} in ${args.path}";
+        message = "GRUB devices must be absolute paths, not ${dev} in ${args.path}";
       }));
     })
 
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl
index 34bff727b73a..af39e50ff72d 100644
--- a/nixos/modules/system/boot/loader/grub/install-grub.pl
+++ b/nixos/modules/system/boot/loader/grub/install-grub.pl
@@ -237,6 +237,7 @@ else {
         $conf .= "
             " . $grubStore->search;
     }
+    # FIXME: should use grub-mkconfig.
     $conf .= "
         " . $grubBoot->search . "
         if [ -s \$prefix/grubenv ]; then
@@ -245,14 +246,12 @@ else {
 
         # ‘grub-reboot’ sets a one-time saved entry, which we process here and
         # then delete.
-        if [ \"\${saved_entry}\" ]; then
-          # The next line *has* to look exactly like this, otherwise KDM's
-          # reboot feature won't work properly with GRUB 2.
+        if [ \"\${next_entry}\" ]; then
+          # FIXME: KDM expects the next line to be present.
           set default=\"\${saved_entry}\"
-          set saved_entry=
-          set prev_saved_entry=
-          save_env saved_entry
-          save_env prev_saved_entry
+          set default=\"\${next_entry}\"
+          set next_entry=
+          save_env next_entry
           set timeout=1
         else
           set default=$defaultEntry
diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix
index 52a1dcf99325..be8df4f4a2c6 100644
--- a/nixos/release-combined.nix
+++ b/nixos/release-combined.nix
@@ -52,7 +52,6 @@ in rec {
         (all nixos.tests.firefox)
         (all nixos.tests.firewall)
         (all nixos.tests.gnome3)
-        (all nixos.tests.installer.grub1)
         (all nixos.tests.installer.lvm)
         (all nixos.tests.installer.luksroot)
         (all nixos.tests.installer.separateBoot)
diff --git a/nixos/tests/printing.nix b/nixos/tests/printing.nix
index b1c2e74136ce..0db9a529644b 100644
--- a/nixos/tests/printing.nix
+++ b/nixos/tests/printing.nix
@@ -60,8 +60,8 @@ import ./make-test.nix ({pkgs, ... }: {
       $client->succeed("lpq") =~ /DeskjetRemote is ready.*no entries/s or die;
 
       # Test printing various file types.
-      foreach my $file ("${pkgs.groff}/share/doc/*/examples/mom/penguin.pdf",
-                        "${pkgs.groff}/share/doc/*/meref.ps",
+      foreach my $file ("${pkgs.groff.doc}/share/doc/*/examples/mom/penguin.pdf",
+                        "${pkgs.groff.doc}/share/doc/*/meref.ps",
                         "${pkgs.cups}/share/doc/cups/images/cups.png",
                         "${pkgs.pcre}/share/doc/pcre/pcre.txt")
       {
diff --git a/pkgs/applications/audio/paprefs/default.nix b/pkgs/applications/audio/paprefs/default.nix
index 06b4b44b5963..b026d8b9e6a6 100644
--- a/pkgs/applications/audio/paprefs/default.nix
+++ b/pkgs/applications/audio/paprefs/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
       dialog for the PulseAudio sound server.
     '';
 
-    homepage = http://freedesktop.org/software/pulseaudio/paprefs/ ;
+    homepage = http://freedesktop.org/software/pulseaudio/paprefs/;
 
     license = licenses.gpl2Plus;
 
diff --git a/pkgs/applications/audio/ponymix/default.nix b/pkgs/applications/audio/ponymix/default.nix
new file mode 100644
index 000000000000..0b5947e16f40
--- /dev/null
+++ b/pkgs/applications/audio/ponymix/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, libpulseaudio, libnotify, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "ponymix-${version}";
+  version = "4";
+  src = fetchurl {
+    url = "http://code.falconindy.com/archive/ponymix/${name}.tar.xz";
+    sha256 = "008pk3sqc8955k2f502z1syzv43a4q0yk5ws69lgpqfsy1mzki2d";
+  };
+
+  buildInputs = [ libpulseaudio libnotify ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  postPatch = ''substituteInPlace Makefile --replace "\$(DESTDIR)/usr" "$out"'';
+
+  meta = {
+    description = "CLI PulseAudio Volume Control";
+    homepage = "http://github.com/falconindy/ponymix";
+    license = "mit";
+  };
+}
diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix
index 73a188af0cf5..ad2c885e4966 100644
--- a/pkgs/applications/display-managers/sddm/default.nix
+++ b/pkgs/applications/display-managers/sddm/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "QML based X11 display manager";
-    homepage = http://launchpad.net/lightdm;
+    homepage = https://github.com/sddm/sddm;
     platforms = platforms.linux;
     maintainers = with maintainers; [ abbradar ];
   };
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index d2e6116fec72..3ec498973219 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -70,12 +70,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
           md5 = "54e2ce0660b2b1b0eb4267acf70ea66d";
         }
       else
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
           md5 = "bde55a2354dc224cf5f26e5320e72dac";
         };
   };
@@ -88,12 +88,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-x86_64.tar.gz;
           sha256 = "0dfcfadcd6337c897fbfd5b292de481931dfce12d43289ecb93691fd27dd47f4";
         }
       else
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk.tar.gz;
           sha256 = "1bh8ykliqr8wbciv13vpiy50rvm7yszk7y8dslr796dbwhi5b1cj";
         };
   };
@@ -120,12 +120,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk-x86_64.tar.gz;
           sha1 = "6f914e11fa15a900c46825e4aa8299afd76e7e65";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz;
           sha1 = "1156e4bc0253ae3a3a4e54839e4944dc64d3108f";
         };
   };
@@ -136,12 +136,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
           sha1 = "e96f5f006298f68476f4a15a2be8589158d5cc61";
         }
       else
         fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk.tar.gz;
           sha1 = "696377895bb26445de39d82a916b7e69edb1d939";
         };
   };
@@ -151,11 +151,11 @@ in {
     description = "Eclipse Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk-x86_64.tar.gz;
           sha256 = "0nf4nv7awhp1k8b1hjb7chpjyjrqnyszsjbc4dlk9phpjv3j4wg5";
         };
       "i686-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops/R-3.7.2-201202080800/eclipse-SDK-3.7.2-linux-gtk.tar.gz;
           sha256 = "1isn7i45l9kyn2yx6vm88jl1gnxph8ynank0aaa218cg8kdygk7j";
         };
     };
@@ -167,12 +167,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
           sha256 = "14ppc9g9igzvj1pq7jl01vwhzb66nmzbl9wsdl1sf3xnwa9wnqk3";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk.tar.gz;
           sha256 = "1cvg1vgyazrkinwzlvlf0dpl197p4784752srqybqylyj5psdi3b";
         };
   };
@@ -183,12 +183,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz;
           sha256 = "1qq04926pf7v9sf3s0z53zvlbl1j0rmmjmbmhqi49473fnjikh7y";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/technology/epp/downloads/release/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk.tar.gz;
           sha256 = "1a4s9qlhfpfpdhvffyglnfdr3dq5r2ywcxqywhqi95yhq5nmsgyk";
         };
   };
@@ -199,12 +199,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk-x86_64.tar.gz;
           sha256 = "16zhjm6bx78263b1clg75kfiliahkhwg0k116vp9fj039nlpc30l";
         }
       else
         fetchurl {
-          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/kepler/SR2/eclipse-cpp-kepler-SR2-linux-gtk.tar.gz;
           sha256 = "0d6jlj7hwz8blx6csrlyi2h2prql0wckbh7ihwjmgclwpcpj84g6";
         };
   };
@@ -215,16 +215,32 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk-x86_64.tar.gz;
           md5 = "b0a6ee33e8108a7ff4682ab911271b04";
         }
       else
         fetchurl {
-          url = http://www.mirrorservice.org/sites/download.eclipse.org/eclipseMirror/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/luna/R/eclipse-cpp-luna-R-linux-gtk.tar.gz;
           md5 = "5000f93cecf6ef9af112f0df6e8c87f3";
         };
   };
 
+  eclipse_cpp_45 = buildEclipse {
+    name = "eclipse-cpp-4.5";
+    description = "Eclipse IDE for C/C++ Developers, Mars release";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/mars/R/eclipse-cpp-mars-R-linux-gtk-x86_64.tar.gz;
+          sha1 = "11f9583e23ae68eb675107e6c9acc48e0a2520ae";
+        }
+      else if stdenv.system == "i686-linux" then
+        fetchurl {
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/technology/epp/downloads/release/mars/R/eclipse-cpp-mars-R-linux-gtk.tar.gz;
+          sha1 = "45dddb8c8f2ec79b7e25cc13d93785863ffe4791";
+        }
+      else throw "Unsupported system: ${stdenv.system}";
+  };
 
   eclipse_sdk_421 = buildEclipse {
     name = "eclipse-sdk-4.2.1";
@@ -232,12 +248,12 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz;
           sha256 = "1mlyy90lk08lb2971ynglgi3nqvqfq1k70md2kb39jk160wd1xrk";
         }
       else
         fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk.tar.gz;
           sha256 = "1av6qm9wkbyk123qqf38f0jq4jv2bj9wp6fmpnl55zg6qr463c1w";
         };
     };
@@ -247,11 +263,11 @@ in {
     description = "Eclipse Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz;
           sha256 = "0ysa6ymk4h3k1vn59dc909iy197kmx132671kbzfwbim87jmgnqb";
         };
       "i686-linux" = fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.2.2-201302041200/eclipse-SDK-4.2.2-linux-gtk.tar.gz;
           sha256 = "038yibbrcia38wi72qrdl03g7l35mpvl5nxdfdnvpqxrkfffb826";
         };
     };
@@ -262,11 +278,11 @@ in {
     description = "Eclipse Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk-x86_64.tar.gz;
           sha256 = "0ncm56ylwxw9z8rk8ccgva68c2yr9yrf1kcr1zkgw6p87xh1yczd";
         };
       "i686-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk.tar.gz;
           sha256 = "1zxsh838khny7mvl01h28xna6xdh01yi4mvls28zj22v0340lgsg";
         };
     };
@@ -277,11 +293,11 @@ in {
     description = "Eclipse Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk-x86_64.tar.gz;
           sha256 = "14hdkijsjq0hhzi9ijpwjjkhz7wm0pry86l3dniy5snlh3l5bsb2";
         };
       "i686-linux" = fetchurl {
-          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4-201406061215/eclipse-SDK-4.4-linux-gtk.tar.gz;
           sha256 = "0hjc4zrsmik6vff851p0a4ydnx99840j2xrx8348kk6h0af8vx6z";
         };
     };
@@ -292,12 +308,12 @@ in {
     description = "Eclipse Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz;
           sha256 = "0g00alsixfaakmn4khr0m9fxvkrbhbg6qqfa27xr6a9np6gzg98l";
 
         };
       "i686-linux" = fetchurl {
-          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk.tar.gz;
           sha256 = "1hacyjjwhhxi7r3xyhpqgjqpd5r0irw9bfkalz5s5l6shb0lq4i7";
         };
     };
@@ -308,12 +324,12 @@ in {
     description = "Eclipse Mars Classic";
     sources = {
       "x86_64-linux" = fetchurl {
-          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk-x86_64.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk-x86_64.tar.gz;
           sha256 = "0vfql4gh263ms8bg7sgn05gnjajplx304cn3nr03jlacgr3pkarf";
 
         };
       "i686-linux" = fetchurl {
-          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk.tar.gz;
+          url = http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/eclipse/downloads/drops4/R-4.5-201506032000/eclipse-SDK-4.5-linux-gtk.tar.gz;
           sha256 = "0xv66l6hdlvxpswcqrsh398wg6xhy30f833dr7jvvz45s5437hm3";
         };
     };
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index bccd7754efbd..1bff18185f1e 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,14 +1,16 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "ed-1.10";
+  name = "ed-1.12";
 
   src = fetchurl {
     # gnu only provides *.lz tarball, which is unfriendly for stdenv bootstrapping
     #url = "mirror://gnu/ed/${name}.tar.gz";
-    url = "http://pkgs.fedoraproject.org/repo/extras/ed/${name}.tar.bz2"
-      + "/38204d4c690a17a989e802ba01b45e98/${name}.tar.bz2";
-    sha256 = "16qvshl8470f3znjfrrci3lzllqkzc6disk5kygzsg9hh4f6wysq";
+    # When updating, please make sure the sources pulled match those upstream by
+    # Unpacking both tarballs and running `find . -type f -exec sha256sum \{\} \; | sha256sum`
+    # in the resulting directory
+    url = "http://fossies.org/linux/privat/${name}.tar.gz";
+    sha256 = "111ci6x43bcmylqhrzr32l0q8pplmpb4kiq5pb6cyp0yxkb2dhgj";
   };
 
   /* FIXME: Tests currently fail on Darwin:
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index 5d6d576af8ea..487fccfa90de 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -7,8 +7,8 @@
 , withGTK2 ? true, gtk2
 }:
 
-assert (libXft != null) -> libpng != null;	# probably a bug
-assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise
+assert (libXft != null) -> libpng != null;      # probably a bug
+assert stdenv.isDarwin -> libXaw != null;       # fails to link otherwise
 assert withGTK2 -> withX || stdenv.isDarwin;
 assert withGTK3 -> withX || stdenv.isDarwin;
 assert withGTK2 -> !withGTK3 && gtk2 != null;
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix
index 96d7619d387b..815863ac6da1 100644
--- a/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/4.3pre.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake, enableDoc ? false }:
 
 stdenv.mkDerivation (rec {
-  name = "ProofGeneral-4.3pre131011";
+  name = "ProofGeneral-4.3pre150313";
 
   src = fetchurl {
-    url = http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.3pre131011.tgz;
-    sha256 = "0104iy2xik5npkdg9p2ir6zqyrmdc93azrgm3ayvg0z76vmnb816";
+    url = "http://proofgeneral.inf.ed.ac.uk/releases/${name}.tgz";
+    sha256 = "1jq5ykkk14xr5qcn4kyxmi5ls0fibr0y47gfygzm1mzrfvz9aw3f";
   };
 
   sourceRoot = name;
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch b/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch
index c733911118de..704e4b6c8c7a 100644
--- a/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/pg.patch
@@ -7,7 +7,7 @@ diff -r c7d8bfff4c0a bin/proofgeneral
  if [ -z "$PGHOME" ] || [ ! -d "$PGHOME" ]; then
 -    # default relative to this script, otherwise PGHOMEDEFAULT
 -    MYDIR="`readlink --canonicalize "$0" | sed -ne 's,/bin/proofgeneral$,,p'`"
--    if [ -d "$MYDIR" ]; then
+-    if [ -d "$MYDIR/generic" ]; then
 -	PGHOME="$MYDIR"
 -    elif [ -d "$PGHOMEDEFAULT" ]; then
 +    if [ -d "$PGHOMEDEFAULT" ]; then
diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix
index a258b6341057..e415239d76fb 100644
--- a/pkgs/applications/editors/texmacs/default.nix
+++ b/pkgs/applications/editors/texmacs/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, guile, libX11, libXext, xmodmap, which, makeWrapper, freetype,
+{stdenv, fetchurl, guile_1_8, qt4, zlib, xmodmap, which, makeWrapper, freetype,
  tex ? null,
  aspell ? null,
  ghostscriptX ? null,
@@ -9,7 +9,7 @@
 
 let 
   pname = "TeXmacs";
-  version = "1.0.7.11";
+  version = "1.99.2";
   extraFontsSrc = fetchurl {
     url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-extra-fonts-1.0-noarch.tar.gz";
     sha256 = "0hylgjmd95y9yahbblmawkkw0i71vb145xxv2xqrmff81301n6k7";
@@ -39,11 +39,11 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.texmacs.org/pub/${pname}/targz/${name}-src.tar.gz";
-    sha256 = "0x1r9417dzbrxf785faq1vjszqdj94ig2lzwm8sd92bxcxr6knfa";
+    url = "http://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-${version}-src.tar.gz";
+    sha256 = "0l48g9746igiaxw657shm8g3xxk565vzsviajlrxqyljbh6py0fs";
   };
 
-  buildInputs = [ guile libX11 libXext makeWrapper ghostscriptX freetype ];
+  buildInputs = [ guile_1_8 qt4 makeWrapper ghostscriptX freetype ];
 
   patchPhase = (if tex == null then ''
     gunzip < ${fullFontsSrc} | (cd TeXmacs && tar xvf -)
@@ -66,6 +66,12 @@ stdenv.mkDerivation rec {
         (if tex == null then "" else "${tex}/bin:") +
         "${xmodmap}/bin:${which}/bin";
 
+  postFixup = ''
+    bin="$out/libexec/TeXmacs/bin/texmacs.bin"
+    rpath=$(patchelf --print-rpath "$bin")
+    patchelf --set-rpath "$rpath:${zlib}/lib" "$bin"
+  '';
+
   meta = {
     description = "WYSIWYW editing platform with special features for scientists";
     longDescription =
diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix
index 08e804b7ae93..bda364cb26f4 100644
--- a/pkgs/applications/gis/qgis/default.nix
+++ b/pkgs/applications/gis/qgis/default.nix
@@ -2,7 +2,7 @@
   pyqt4, qwt, fcgi, pythonPackages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "qgis-2.8.2";
+  name = "qgis-2.10.1";
 
   buildInputs = [ gdal qt4 flex bison proj geos x11 sqlite gsl pyqt4 qwt qscintilla
     fcgi libspatialindex libspatialite postgresql ] ++
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://qgis.org/downloads/${name}.tar.bz2";
-    sha256 = "fd3c01e48224f611c3bb279b0af9cc1dff3844cdc93f7b45e4f37cf8f350bc4b";
+    sha256 = "79119b54642edaffe3cda513531eb7b81913e013954a49c6d3b21c8b00143307";
   };
 
   postInstall = ''
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index 7ae24b38c01c..683e2721d876 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -1,11 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, libtool
-, libcl ? null, perl ? null, jemalloc ? null, bzip2 ? null, zlib ? null
-, libX11 ? null, libXext ? null, libXt ? null, dejavu_fonts ? null, fftw ? null
-, libfpx ? null, djvulibre ? null, fontconfig ? null, freetype ? null
-, ghostscript ? null, graphviz ? null, jbigkit ? null, libjpeg ? null
-, lcms2 ? null, openjpeg ? null, liblqr1 ? null, xz ? null, openexr ? null
-, pango ? null, libpng ? null, librsvg ? null, libtiff ? null, libwebp ? null
-, libxml2 ? null
+{ lib, stdenv, fetchurl, pkgconfig, libtool
+, bzip2, zlib, libX11, libXext, libXt, fontconfig, freetype, ghostscript, libjpeg
+, lcms2, openexr, libpng, librsvg, libtiff, libxml2
 }:
 
 let
@@ -17,15 +12,8 @@ let
     else if stdenv.system == "x86_64-linux" || stdenv.system == "x86_64-darwin" then "x86-64"
     else throw "ImageMagick is not supported on this platform.";
 
-  mkFlag = trueStr: falseStr: cond: val: "--${if cond then trueStr else falseStr}-${val}";
-  mkWith = mkFlag "with" "without";
-  mkEnable = mkFlag "enable" "disable";
-
-  hasX11 = libX11 != null && libXext != null && libXt != null;
-
 in
 
-with stdenv.lib;
 stdenv.mkDerivation rec {
   name = "imagemagick-${version}";
 
@@ -34,62 +22,26 @@ stdenv.mkDerivation rec {
     sha256 = "03lvj6rxv16xk0dpsbzvm2gq5bggkwff9wqbpkq0znihzijpax1j";
   };
 
-  enableParallelBuilding = true;
+  outputs = [ "out" "doc" ];
 
-  configureFlags = [
-    (mkEnable (libcl != null)        "opencl")
-    (mkWith   true                   "modules")
-    (mkWith   true                   "gcc-arch=${arch}")
-    #(mkEnable true                   "hdri") This breaks some dependencies
-    (mkWith   (perl != null)         "perl")
-    (mkWith   (jemalloc != null)     "jemalloc")
-    (mkWith   true                   "frozenpaths")
-    (mkWith   (bzip2 != null)        "bzlib")
-    (mkWith   hasX11                 "x")
-    (mkWith   (zlib != null)         "zlib")
-    (mkWith   false                  "dps")
-    (mkWith   (fftw != null)         "fftw")
-    (mkWith   (libfpx != null)       "fpx")
-    (mkWith   (djvulibre != null)    "djvu")
-    (mkWith   (fontconfig != null)   "fontconfig")
-    (mkWith   (freetype != null)     "freetype")
-    (mkWith   (ghostscript != null)  "gslib")
-    (mkWith   (graphviz != null)     "gvc")
-    (mkWith   (jbigkit != null)      "jbig")
-    (mkWith   (libjpeg != null)      "jpeg")
-    (mkWith   (lcms2 != null)        "lcms2")
-    (mkWith   false                  "lcms")
-    (mkWith   (openjpeg != null)     "openjp2")
-    (mkWith   (liblqr1 != null)      "lqr")
-    (mkWith   (xz != null)           "lzma")
-    (mkWith   (openexr != null)      "openexr")
-    (mkWith   (pango != null)        "pango")
-    (mkWith   (libpng != null)       "png")
-    (mkWith   (librsvg != null)      "rsvg")
-    (mkWith   (libtiff != null)      "tiff")
-    (mkWith   (libwebp != null)      "webp")
-    (mkWith   (libxml2 != null)      "xml")
-  ] ++ optional (dejavu_fonts != null) "--with-dejavu-font-dir=${dejavu_fonts}/share/fonts/truetype/"
-    ++ optional (ghostscript != null) "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts/";
-
-  buildInputs = [
-    pkgconfig libtool libcl perl jemalloc bzip2 zlib libX11 libXext libXt fftw
-    libfpx djvulibre fontconfig freetype ghostscript graphviz jbigkit libjpeg
-    lcms2 openjpeg liblqr1 xz openexr pango libpng librsvg libtiff libwebp
-    libxml2
-  ];
+  enableParallelBuilding = true;
 
-  propagatedBuildInputs = []
-    ++ (stdenv.lib.optional (lcms2 != null) lcms2)
-    ++ (stdenv.lib.optional (liblqr1 != null) liblqr1)
-    ++ (stdenv.lib.optional (fftw != null) fftw)
-    ++ (stdenv.lib.optional (libtool != null) libtool)
-    ++ (stdenv.lib.optional (jemalloc != null) jemalloc)
-    ++ (stdenv.lib.optional (libXext != null) libXext)
-    ++ (stdenv.lib.optional (libX11 != null) libX11)
-    ++ (stdenv.lib.optional (libXt != null) libXt)
-    ++ (stdenv.lib.optional (bzip2 != null) bzip2)
-    ;
+  configureFlags =
+    [ "--with-frozenpaths" ]
+    ++ [ "--with-gcc-arch=${arch}" ]
+    ++ lib.optional (librsvg != null) "--with-rsvg"
+    ++ lib.optionals (ghostscript != null)
+      [ "--with-gs-font-dir=${ghostscript}/share/ghostscript/fonts"
+        "--with-gslib"
+      ];
+
+  buildInputs =
+    [ pkgconfig libtool zlib fontconfig freetype ghostscript libjpeg
+      openexr libpng librsvg libtiff libxml2
+    ];
+
+  propagatedBuildInputs =
+    [ bzip2 freetype libjpeg libX11 libXext libXt lcms2 ];
 
   postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
 
diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix
index 8e546652f852..cd107a6d279d 100644
--- a/pkgs/applications/graphics/apitrace/default.nix
+++ b/pkgs/applications/graphics/apitrace/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchFromGitHub, cmake, python, libX11, qt4 }:
+{ stdenv, fetchFromGitHub, cmake, libX11, procps, python, qt5 }:
 
-let version = "6.1"; in
+let version = "7.0"; in
 stdenv.mkDerivation {
   name = "apitrace-${version}";
 
   src = fetchFromGitHub {
-    sha256 = "1v38111ljd35v5sahshs3inhk6nsv7rxh4r0ck8k0njkwzlx2yqk";
+    sha256 = "0nn3z7i6cd4zkmms6jpp1v2q194gclbs06v0f5hyiwcsqaxzsg5b";
     rev = version;
     repo = "apitrace";
     owner = "apitrace";
   };
 
-  buildInputs = [ python libX11 qt4 ];
+  buildInputs = [ libX11 procps python qt5.base ];
   nativeBuildInputs = [ cmake ];
 
   buildPhase = ''
@@ -20,6 +20,7 @@ stdenv.mkDerivation {
   '';
 
   meta = with stdenv.lib; {
+    inherit version;
     homepage = https://apitrace.github.io;
     description = "Tools to trace OpenGL, OpenGL ES, Direct3D, and DirectDraw APIs";
     license = licenses.mit;
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index f86d3056db95..cfc15ed87bf2 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -6,11 +6,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "digikam-4.10.0";
+  name = "digikam-4.11.0";
 
   src = fetchurl {
     url = "http://download.kde.org/stable/digikam/${name}.tar.bz2";
-    sha256 = "4207e68b6221307111b66bb69485d3e88150df95dae014a99f6f161a3da0c725";
+    sha256 = "1nak3w0717fpbpmklzd3xkkbp2mwi44yxnc789wzmi9d8z9n3jwh";
   };
 
   nativeBuildInputs = [ cmake automoc4 pkgconfig ];
diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index e1eb7bb5a7b7..e2cc0ec5c01e 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -1,22 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, autoconf, automake, gtk, libpng, exiv2
-, lcms, intltool, gettext, fbida
+{ stdenv, fetchurl, pkgconfig, gtk, libpng, exiv2
+, lcms, intltool, gettext, libchamplain, fbida
 }:
 
 stdenv.mkDerivation rec {
   name = "geeqie-${version}";
-  version = "1.2";
+  version = "1.1"; # Don't upgrade to 1.2; see fee59b1235e658954b207ff6679264654c4708d2.
 
   src = fetchurl {
-    url = "mirror://debian/pool/main/g/geeqie/geeqie_${version}.orig.tar.gz";
-    sha256 = "0wkcpyh3f6ig36x1q6h9iqgq225w37visip48m72j8rpghmv1rn3";
+    url = "mirror://sourceforge/geeqie/${name}.tar.gz";
+    sha256 = "1kzy39z9505xkayyx7rjj2wda76xy3ch1s5z35zn8yli54ffhi2m";
   };
 
-  preConfigure = "./autogen.sh";
-
   configureFlags = [ "--enable-gps" ];
 
   buildInputs = [
-    pkgconfig autoconf automake gtk libpng exiv2 lcms intltool gettext
+    pkgconfig gtk libpng exiv2 lcms intltool gettext
+    #libchamplain
   ];
 
   postInstall = ''
diff --git a/pkgs/applications/graphics/simple-scan/default.nix b/pkgs/applications/graphics/simple-scan/default.nix
index 744f789e55ca..954b2e02136d 100644
--- a/pkgs/applications/graphics/simple-scan/default.nix
+++ b/pkgs/applications/graphics/simple-scan/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cairo, colord, glib, gtk3, intltool, itstool, libxml2
 , makeWrapper, pkgconfig, saneBackends, systemd, vala }:
 
-let version = "3.17.3"; in
+let version = "3.17.4"; in
 stdenv.mkDerivation rec {
   name = "simple-scan-${version}";
 
   src = fetchurl {
-    sha256 = "1kb2xk4vr2nab3hfjfnfyapv2z65h99c3g7mfkmanzrng5xwrj8q";
+    sha256 = "1pslbv45g01g039zj2b01k08f763kkhzqw8wwz7yh27m7bjllnx6";
     url = "https://launchpad.net/simple-scan/3.17/${version}/+download/${name}.tar.xz";
   };
 
diff --git a/pkgs/applications/misc/cherrytree/default.nix b/pkgs/applications/misc/cherrytree/default.nix
index eb73f48559a6..97b67a3ae332 100644
--- a/pkgs/applications/misc/cherrytree/default.nix
+++ b/pkgs/applications/misc/cherrytree/default.nix
@@ -1,18 +1,24 @@
 { stdenv, fetchurl, python, pythonPackages, gettext, pygtksourceview, sqlite }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "cherrytree-0.35.8";
+
+  name = "cherrytree-${version}";
+  version = "0.35.9";
 
   src = fetchurl {
     url = "http://www.giuspen.com/software/${name}.tar.xz";
-    sha256 = "0vqc1idzd73f4q5f4zwwypj4jiivwnb4y0r3041h2pm08y1wgsd8";
+    sha256 = "14yahp0y13z3xkpwvprm7q9x3rj6jbzi0bryqlsn3bbafdq7wnac";
   };
 
-  propagatedBuildInputs = [ pythonPackages.sqlite3 ];
+  propagatedBuildInputs = with pythonPackages;
+  [ sqlite3 ];
 
-  buildInputs = with pythonPackages; [ python gettext wrapPython pygtk dbus pygtksourceview ];
+  buildInputs = with pythonPackages;
+  [ python gettext wrapPython pygtk dbus pygtksourceview ];
 
-  pythonPath = with pythonPackages; [ pygtk dbus pygtksourceview ];
+  pythonPath = with pythonPackages;
+  [ pygtk dbus pygtksourceview ];
 
   patches = [ ./subprocess.patch ];
 
@@ -27,10 +33,21 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  meta = {
-    description = "A hierarchical note taking application, featuring rich text and syntax highlighting, storing data in a single xml or sqlite file";
+  meta = { 
+    description = "An hierarchical note taking application";
+    longDescription = ''
+      Cherrytree is an hierarchical note taking application,
+      featuring rich text, syntax highlighting and powerful search
+      capabilities. It organizes all information in units called
+      "nodes", as in a tree, and can be very useful to store any piece
+      of information, from tables and links to pictures and even entire
+      documents. All those little bits of information you have scattered
+      around your hard drive can be conveniently placed into a
+      Cherrytree document where you can easily find it.
+    ''; 
     homepage = http://www.giuspen.com/cherrytree;
-    license = stdenv.lib.licenses.gpl3;
-    platforms = with stdenv.lib.platforms; linux;
-  };
+    license = licenses.gpl3;
+    platforms = platforms.linux; 
+    maintainers = [ maintainers.AndersonTorres ]; 
+  }; 
 }
diff --git a/pkgs/applications/misc/chirp/default.nix b/pkgs/applications/misc/chirp/default.nix
new file mode 100644
index 000000000000..2b92dc8d19e9
--- /dev/null
+++ b/pkgs/applications/misc/chirp/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, libxml2Python, libxslt, makeWrapper
+, python, pyserial, pygtk
+}:
+let
+  version = "0.4.1";
+in
+stdenv.mkDerivation rec {
+  name = "chirp-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "http://chirp.danplanet.com/download/0.4.1/chirp-${version}.tar.gz";
+    sha256 = "17iihghqjprn2hld193qw0yl1kkrf6m0fp57l7ibkflxr0nnb7cc";
+  };
+
+  buildInputs = [
+    makeWrapper
+    pyserial pygtk libxml2Python libxslt pyserial
+  ];
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/chirp
+    cp -r . $out/share/chirp/
+    ln -s $out/share/chirp/chirpw $out/bin/chirpw
+
+    for file in "$out"/bin/*; do
+      wrapProgram "$file" \
+        --prefix PYTHONPATH : $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A free, open-source tool for programming your amateur radio.";
+    homepage = http://chirp.danplanet.com/;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.the-kenny ];
+  };
+}
diff --git a/pkgs/applications/misc/direwolf/default.nix b/pkgs/applications/misc/direwolf/default.nix
new file mode 100644
index 000000000000..fc8d0ec36c85
--- /dev/null
+++ b/pkgs/applications/misc/direwolf/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, unzip, alsaLib }:
+let
+  version = "1.2";
+in
+stdenv.mkDerivation rec {
+  name = "direwolf-${version}";
+  inherit version;
+
+  src = fetchurl {
+    url = "http://home.comcast.net/~wb2osz/Version%201.2/direwolf-${version}-src.zip";
+    sha256 = "0csl6harx7gmjmamxy0ylzhbamppphffisk8j33dc6g08k6rc77f";
+  };
+
+  buildInputs = [
+    unzip alsaLib
+  ];
+
+  patchPhase = ''
+    substituteInPlace Makefile.linux \
+      --replace "/usr/local" "$out" \
+      --replace "/usr/share" "$out/share"
+  '';
+
+  preInstall = ''
+    mkdir -p $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A Soundcard Packet TNC, APRS Digipeater, IGate, APRStt gateway.";
+    # On the page: This page will be disappearing on October 8, 2015.
+    homepage = https://home.comcast.net/~wb2osz/site/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.the-kenny ];
+  };
+}
diff --git a/pkgs/applications/misc/electrum/default.nix b/pkgs/applications/misc/electrum/default.nix
index b910b1796a3e..7aff57a6af93 100644
--- a/pkgs/applications/misc/electrum/default.nix
+++ b/pkgs/applications/misc/electrum/default.nix
@@ -2,11 +2,11 @@
 
 buildPythonPackage rec {
   name = "electrum-${version}";
-  version = "2.3.2";
+  version = "2.4";
 
   src = fetchurl {
     url = "https://download.electrum.org/Electrum-${version}.tar.gz";
-    sha256 = "0idqm77d5rbwpw14wqg4ysvbjyqjw7zlqfcdxniy74i2qwz163bi";
+    sha256 = "0z5ksr1wlywl4bpvxjmmqnsk7jh1jfjdz9lsjkhf2j391jx0wz9q";
   };
 
   propagatedBuildInputs = with pythonPackages; [
@@ -16,6 +16,7 @@ buildPythonPackage rec {
     protobuf
     pyasn1
     pyasn1-modules
+    pycrypto
     pyqt4
     qrcode
     requests
diff --git a/pkgs/applications/misc/gnuradio-osmosdr/default.nix b/pkgs/applications/misc/gnuradio-osmosdr/default.nix
index 360d98537ccf..5fc6eb2c2744 100644
--- a/pkgs/applications/misc/gnuradio-osmosdr/default.nix
+++ b/pkgs/applications/misc/gnuradio-osmosdr/default.nix
@@ -30,6 +30,6 @@ stdenv.mkDerivation rec {
     homepage = http://sdr.osmocom.org/trac/wiki/GrOsmoSDR;
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
-    maintainers = [ maintainers.bjornfor ];
+    maintainers = with maintainers; [ bjornfor the-kenny ];
   };
 }
diff --git a/pkgs/applications/misc/gqrx/default.nix b/pkgs/applications/misc/gqrx/default.nix
index 440d2b790c21..d3e61da4fab0 100644
--- a/pkgs/applications/misc/gqrx/default.nix
+++ b/pkgs/applications/misc/gqrx/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, qt4, gnuradio, boost, gnuradio-osmosdr
 # drivers (optional):
-, rtl-sdr
+, rtl-sdr, hackrf
 , pulseaudioSupport ? true, libpulseaudio
 }:
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    qt4 gnuradio boost gnuradio-osmosdr rtl-sdr
+    qt4 gnuradio boost gnuradio-osmosdr rtl-sdr hackrf
   ] ++ stdenv.lib.optionals pulseaudioSupport [ libpulseaudio ];
 
   configurePhase = ''qmake PREFIX="$out"'';
@@ -42,6 +42,6 @@ stdenv.mkDerivation rec {
     # it's currently unknown which version of the BSD license that is.
     license = licenses.gpl3Plus;
     platforms = platforms.linux;  # should work on Darwin / OS X too
-    maintainers = [ maintainers.bjornfor ];
+    maintainers = with maintainers; [ bjornfor the-kenny ];
   };
 }
diff --git a/pkgs/applications/misc/gxmessage/default.nix b/pkgs/applications/misc/gxmessage/default.nix
new file mode 100644
index 000000000000..ce8109717d44
--- /dev/null
+++ b/pkgs/applications/misc/gxmessage/default.nix
@@ -0,0 +1,20 @@
+{stdenv, fetchurl, gnome3, intltool, pkgconfig, texinfo}:
+
+stdenv.mkDerivation rec {
+  name = "gxmessage-${version}";
+  version = "3.4.3";
+
+  src = fetchurl {
+    url = "http://homepages.ihug.co.nz/~trmusson/stuff/${name}.tar.gz";
+    sha256 = "db4e1655fc58f31e5770a17dfca4e6c89028ad8b2c8e043febc87a0beedeef05";
+  };
+
+  buildInputs = [ intltool gnome3.gtk pkgconfig texinfo ];
+  meta = {
+    description = "a GTK enabled dropin replacement for xmessage";
+    homepage = "http://homepages.ihug.co.nz/~trmusson/programs.html#gxmessage";
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [jfb];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/hackrf/default.nix b/pkgs/applications/misc/hackrf/default.nix
index 806392f717fc..b815884a29cb 100644
--- a/pkgs/applications/misc/hackrf/default.nix
+++ b/pkgs/applications/misc/hackrf/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   name = "hackrf-${version}";
-  version = "2014.08.1";
+  version = "2015.07.2";
 
   src = fetchgit {
     url = "git://github.com/mossmann/hackrf";
     rev = "refs/tags/v${version}";
-    sha256 = "1f3mmzyn6qqbl02h6dkz0zybppihqgpdxjgqmkb1pn3i0d98ydb3";
+    sha256 = "0wa4m0kdq8q2ib724w8ry8shmmm1liaaawhjygrjx6zxz9jxr3vm";
   };
 
   buildInputs = [
@@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
     homepage = http://greatscottgadgets.com/hackrf/;
     license = licenses.gpl2;
     platforms = platforms.linux;
-    maintainers = [ maintainers.sjmackenzie ];
+    maintainers = with maintainers; [ sjmackenzie the-kenny ];
   };
 }
diff --git a/pkgs/applications/misc/hamster-time-tracker/default.nix b/pkgs/applications/misc/hamster-time-tracker/default.nix
new file mode 100644
index 000000000000..3a94456e6cc7
--- /dev/null
+++ b/pkgs/applications/misc/hamster-time-tracker/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchzip, buildPythonPackage, docbook2x, libxslt, gnome_doc_utils
+, intltool, dbus_glib, pygobject, pygtk, pyxdg, gnome_python, dbus, sqlite3
+}:
+
+# TODO: Add optional dependency 'wnck', for "workspace tracking" support. Fixes
+# this message:
+#
+#   WARNING:root:Could not import wnck - workspace tracking will be disabled
+
+buildPythonPackage rec {
+  name = "hamster-time-tracker-1.04";
+  namePrefix = "";
+
+  src = fetchzip {
+    name = "${name}-src";
+    url = "https://github.com/projecthamster/hamster/archive/${name}.tar.gz";
+    sha256 = "1a85rcg561792kdyv744cgzw7mmpmgv6d6li1sijfdpqa1ninf8g";
+  };
+
+  buildInputs = [ docbook2x libxslt gnome_doc_utils intltool dbus_glib ];
+
+  propagatedBuildInputs = [ pygobject pygtk pyxdg gnome_python dbus sqlite3 ];
+
+  configurePhase = ''
+    python waf configure --prefix="$out"
+  '';
+  
+  buildPhase = ''
+    python waf build
+  '';
+
+  installPhase = ''
+    python waf install
+  '';
+
+  # error: invalid command 'test'
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Time tracking application";
+    homepage = https://projecthamster.wordpress.com/;
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/misc/multimon-ng/default.nix b/pkgs/applications/misc/multimon-ng/default.nix
new file mode 100644
index 000000000000..794746653f75
--- /dev/null
+++ b/pkgs/applications/misc/multimon-ng/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchFromGitHub, qt4, libpulseaudio }:
+let
+  version = "1.0.0";
+in
+stdenv.mkDerivation {
+  name = "multimon-ng-${version}";
+
+  src = fetchFromGitHub {
+    owner = "EliasOenal";
+    repo = "multimon-ng";
+    rev = "4cc984f35f859539c94aa56d3fc6218a6de51148";
+    sha256 = "12z6f0ra2k0qh56pcvnwvlxd3msvr6yr97jvs7w5kf42jqbxdsga";
+  };
+
+  buildInputs = [ qt4 libpulseaudio ];
+
+  preBuild = "qmake multimon-ng.pro";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp multimon-ng $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Multimon is a digital baseband audio protocol decoder.";
+    longDescription = ''
+      multimon-ng a fork of multimon, a digital baseband audio
+      protocol decoder for common signaling modes in commercial and
+      amateur radio data services. It decodes the following digital
+      transmission modes:
+
+      POCSAG512 POCSAG1200 POCSAG2400 EAS UFSK1200 CLIPFSK AFSK1200
+      AFSK2400 AFSK2400_2 AFSK2400_3 HAPN4800 FSK9600 DTMF ZVEI1 ZVEI2
+      ZVEI3 DZVEI PZVEI EEA EIA CCIR MORSE CW
+    '';
+    homepage = "https://github.com/EliasOenal/multimon-ng";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ the-kenny ];
+  };
+}
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index 244464130bea..dc799bd6ff52 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -1,7 +1,16 @@
-{ fetchurl, stdenv, gettext, geoclue, intltool, makeWrapper
-, pkgconfig , python, pygobject3, pyxdg }:
+{ fetchurl, stdenv, gettext, intltool, pkgconfig, makeWrapper
+, geoclue, python, pygobject3, pyxdg
+, libdrm, libX11, libxcb, libXxf86vm
+, guiSupport ? true
+, drmSupport ? true
+, randrSupport ? true
+, vidModeSupport ? true
+}:
 
-let version = "1.10"; in
+let
+  version = "1.10";
+  mkFlag = flag: name: if flag then "--enable-${name}" else "--disable-${name}";
+in
 stdenv.mkDerivation {
   name = "redshift-${version}";
   src = fetchurl {
@@ -9,19 +18,29 @@ stdenv.mkDerivation {
     url = "https://github.com/jonls/redshift/releases/download/v${version}/redshift-${version}.tar.xz";
   };
 
-  buildInputs = [
-    gettext intltool makeWrapper pkgconfig python pygobject3 pyxdg
+  buildInputs = [ geoclue ]
+    ++ stdenv.lib.optional guiSupport [ python pygobject3 pyxdg ]
+    ++ stdenv.lib.optional drmSupport [ libdrm ]
+    ++ stdenv.lib.optional randrSupport [ libxcb ]
+    ++ stdenv.lib.optional vidModeSupport [ libX11 libXxf86vm ];
+  nativeBuildInputs = [ gettext intltool makeWrapper pkgconfig ];
+
+  configureFlags = [
+    (mkFlag guiSupport "gui")
+    (mkFlag drmSupport "drm")
+    (mkFlag randrSupport "randr")
+    (mkFlag vidModeSupport "vidmode")
   ];
 
-  preInstall = ''
+  preInstall = stdenv.lib.optionalString guiSupport ''
     substituteInPlace src/redshift-gtk/redshift-gtk python \
       --replace "/usr/bin/env python3" "${python}/bin/${python.executable}"
   '';
-/*
-  postInstall = ''
-    wrapProgram "$out/bin/redshift-gtk" --prefix PYTHONPATH : $PYTHONPATH
+
+  postInstall = stdenv.lib.optionalString guiSupport ''
+    wrapProgram "$out/bin/redshift-gtk" --prefix PYTHONPATH : "$PYTHONPATH"
   '';
-*/
+
   meta = with stdenv.lib; {
     inherit version;
     description = "Gradually change screen color temperature";
diff --git a/pkgs/applications/misc/synapse/default.nix b/pkgs/applications/misc/synapse/default.nix
new file mode 100644
index 000000000000..8086e8ca56d4
--- /dev/null
+++ b/pkgs/applications/misc/synapse/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, intltool, pkgconfig, glib, libnotify, gtk3, libgee
+, keybinder3, json_glib, zeitgeist, vala
+}:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "synapse-0.2.99.1";
+
+  src = fetchurl {
+    url = "https://launchpad.net/synapse-project/0.3/0.2.99.1/+download/${name}.tar.xz";
+    sha256 = "846d8a5130580bb47c754bb7f20dc76311e589c00a18b02370a5d78b52409220";
+  };
+
+  buildInputs = [
+    intltool pkgconfig glib libnotify gtk3 libgee keybinder3 json_glib zeitgeist 
+    vala
+  ];
+
+  meta = { 
+      longDescription = ''
+        Semantic launcher written in Vala that you can use to start applications 
+        as well as find and access relevant documents and files by making use of 
+        the Zeitgeist engine
+      '';
+      description = ''
+        Semantic launcher to start applications and find relevant files
+      '';
+      homepage = https://launchpad.net/synapse-project;
+      license = stdenv.lib.licenses.gpl3;
+      maintainers = with stdenv.lib.maintainers; mahe;
+      platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/chromium/source/sources.nix b/pkgs/applications/networking/browsers/chromium/source/sources.nix
index 6b2f542f34fd..f6d663fcd148 100644
--- a/pkgs/applications/networking/browsers/chromium/source/sources.nix
+++ b/pkgs/applications/networking/browsers/chromium/source/sources.nix
@@ -1,10 +1,10 @@
 # This file is autogenerated from update.sh in the parent directory.
 {
   dev = {
-    version = "45.0.2454.7";
-    sha256 = "19xjdp0zxr96r2fx9wf30wldalrh393p2dhqwp2n1m751vizbj5s";
-    sha256bin32 = "1id1z3m0pc2lxh4lp9r6babh098gfyz4dda931yjkxhzb9rw1v0d";
-    sha256bin64 = "1sksf651z1sqgh9pwdm5dksqnb0lzhwabxj3myg4w5kxi8s4pi8l";
+    version = "45.0.2454.15";
+    sha256 = "1zg562cpn9ddai92jdjg3frhmvbhbkf71ysprwqa3rgbg6w8ipzj";
+    sha256bin32 = "1fcwzwb6zq7ld7fs0iws0d9jmxhjhdax4y744dx4d7bc77357x3m";
+    sha256bin64 = "0273dy5b1r9s9g8ixrafnxm8jnn4ha36r3b3ckdabm9y4pqwx54s";
   };
   beta = {
     version = "44.0.2403.89";
@@ -13,9 +13,9 @@
     sha256bin64 = "0kvrpqy3fpfzchly65nrh8z2z2i49xpa3pm2k7k18sn0x4bycji0";
   };
   stable = {
-    version = "44.0.2403.89";
-    sha256 = "161shml5w2i0crl57hkfnizgmii6d70lxxg4rjxmays8g6lrmpds";
-    sha256bin32 = "09a1k0xxmp6v1nfnngfkhv9vilnwvqlbgfsisbhwdnkk86pnv7r4";
-    sha256bin64 = "1i7ylif5vd0yj0gddl2kv87gh3vgzvzmz91rrrs9za2bkf2gkf0p";
+    version = "44.0.2403.107";
+    sha256 = "0w9xk2jrpp98fgszswr5jc0g5ggpm8rfxqzxa8402n7iwkxlyqyh";
+    sha256bin32 = "0x4j5ggb2dh56lz5fg2h79lvp92rgsk59gi5h3ml678vcghzyfvn";
+    sha256bin64 = "0nhm9783b314dmicqky3424ak4z6xhb6rjia12pq2ajddz9qj9rj";
   };
 }
diff --git a/pkgs/applications/networking/browsers/dillo/default.nix b/pkgs/applications/networking/browsers/dillo/default.nix
index 6760e123ccb5..a54e5e0c3701 100644
--- a/pkgs/applications/networking/browsers/dillo/default.nix
+++ b/pkgs/applications/networking/browsers/dillo/default.nix
@@ -6,18 +6,16 @@
 , libXcursor, libXi, libXinerama }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.4.1";
+  version = "3.0.5";
   name = "dillo-${version}";
 
   src = fetchurl {
     url = "http://www.dillo.org/download/${name}.tar.bz2";
-    sha256 = "0iw617nnrz3541jkw5blfdlk4x8jxb382pshi8nfc7xd560c95zd";
+    sha256 = "12ql8n1lypv3k5zqgwjxlw1md90ixz3ag6j1gghfnhjq3inf26yv";
   };
 
   buildInputs = with stdenv.lib;
-    [ fltk openssl libjpeg libpng libXcursor libXi libXinerama ];
-
-  nativeBuildInputs = [ perl ];
+  [ perl fltk openssl libjpeg libpng libXcursor libXi libXinerama ];
 
   configureFlags =  "--enable-ssl";
 
diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix
index 9b9d9ab6db17..dcc61d4061dd 100644
--- a/pkgs/applications/networking/browsers/links2/default.nix
+++ b/pkgs/applications/networking/browsers/links2/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl
-, gpm, openssl, pkgconfig # Misc.
-, libpng, libjpeg, libtiff # graphic formats
+, gpm, openssl, pkgconfig, libev # Misc.
+, libpng, libjpeg, libtiff, librsvg # graphic formats
 , bzip2, zlib, xz # Transfer encodings
 , enableFB ? true
 , enableDirectFB ? false, directfb
@@ -8,16 +8,16 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.8";
+  version = "2.10";
   name = "links2-${version}";
 
   src = fetchurl {
     url = "${meta.homepage}/download/links-${version}.tar.bz2";
-    sha256 = "15h07498z52jfdahzgvkphg1f7qvxnpbyfn2xmsls0d2dwwdll3r";
+    sha256 = "0lqxg55sp1kphl7ykm2km0s2vsn92a0gmlgypmkqb984r060n3l4";
   };
 
   buildInputs =
-    [ libpng libjpeg libtiff gpm openssl xz bzip2 zlib ]
+    [ libev librsvg libpng libjpeg libtiff gpm openssl xz bzip2 zlib ]
     ++ stdenv.lib.optionals enableX11 [ libX11 libXau libXt ]
     ++ stdenv.lib.optional enableDirectFB [ directfb ];
 
diff --git a/pkgs/applications/networking/copy-com/default.nix b/pkgs/applications/networking/copy-com/default.nix
index 9ef8caafa98d..3a3cf4df2840 100644
--- a/pkgs/applications/networking/copy-com/default.nix
+++ b/pkgs/applications/networking/copy-com/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, coreutils, fetchurl, patchelf, gcc }:
+{ stdenv, fetchurl, patchelf, fontconfig, freetype
+, gcc, glib, libICE, libSM, libX11, libXext, libXrender }:
 
 let
   arch = if stdenv.system == "x86_64-linux" then "x86_64"
@@ -13,45 +14,54 @@ let
 
   appdir = "opt/copy";
   
+  libPackages = [ fontconfig freetype gcc.cc glib libICE libSM libX11 libXext
+    libXrender ];
+  libPaths = stdenv.lib.concatStringsSep ":"
+    (map (path: "${path}/lib") libPackages);
+
 in stdenv.mkDerivation {
   
-  name = "copy-com-1.47.0410";
+  name = "copy-com-3.2.01.0481";
 
   src = fetchurl {
     # Note: copy.com doesn't version this file. Annoying.
     url = "https://copy.com/install/linux/Copy.tgz";
-    sha256 = "a48c69f6798f888617cfeef5359829e619057ae0e6edf3940b4ea6c81131012a";
+    sha256 = "0bpphm71mqpaiygs57kwa23nli0qm64fvgl1qh7fkxyqqabh4g7k";
   };
 
-  buildInputs = [ coreutils patchelf ];
+  nativeBuildInputs = [ patchelf ];
 
   phases = "unpackPhase installPhase";
 
   installPhase = ''
     mkdir -p $out/opt
     cp -r ${arch} "$out/${appdir}"
-    ensureDir "$out/bin"
-    ln -s "$out/${appdir}/CopyConsole" "$out/bin/copy_console"
-    ln -s "$out/${appdir}/CopyAgent" "$out/bin/copy_agent"
-    ln -s "$out/${appdir}/CopyCmd" "$out/bin/copy_cmd"
-    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
-      "$out/${appdir}/CopyConsole"
-
-    RPATH=${gcc.cc}/lib:$out/${appdir}
-    echo "updating rpaths to: $RPATH"
-    find "$out/${appdir}" -type f -a -perm +0100 \
-      -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
 
+    mkdir -p "$out/bin"
+    for binary in Copy{Agent,Console,Cmd}; do
+      binary="$out/${appdir}/$binary"
+      ln -sv "$binary" "$out/bin"
+      patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} "$binary"
+    done
 
+    # Older versions of this package happily installed broken copies of
+    # anything other than CopyConsole - which was then also mangled to
+    # copy_console for some reason. Keep backwards compatibility (only
+    # for CopyConsole) for now; the NixOS service is already fixed.
+    ln -sv "$out/bin"/{CopyConsole,copy_console}
 
+    RPATH=${libPaths}:$out/${appdir}
+    echo "Updating rpaths to $RPATH in:"
+    find "$out/${appdir}" -type f -a -perm +0100 \
+      -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
   '';
 
   meta = {
     homepage = http://copy.com;
-    description = "Copy.com Client";
+    description = "Copy.com graphical & command-line clients";
     # Closed Source unfortunately.
     license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ nathan-gs ];
+    maintainers = with stdenv.lib.maintainers; [ nathan-gs nckx ];
     # NOTE: Copy.com itself only works on linux, so this is ok.
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/applications/networking/feedreaders/canto-curses/default.nix b/pkgs/applications/networking/feedreaders/canto-curses/default.nix
index a73cf63e76b9..8db1dac3b4b6 100644
--- a/pkgs/applications/networking/feedreaders/canto-curses/default.nix
+++ b/pkgs/applications/networking/feedreaders/canto-curses/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, python34Packages, readline, ncurses, canto-daemon }:
 
 python34Packages.buildPythonPackage rec {
-  version = "0.9.4";
+  version = "0.9.6";
   name = "canto-curses-${version}";
 
   src = fetchFromGitHub {
     owner = "themoken";
     repo = "canto-curses";
     rev = "v${version}";
-    sha256 = "0g1ckcb9xcfb0af17zssiqcrfry87agx578vd40nb6gbw90ql4fn";
+    sha256 = "0hxzpx314cflxq68gswjf2vrqf1z1ci9mxhxgwrk7sa6di86ygy0";
   };
 
   buildInputs = [ readline ncurses canto-daemon ];
diff --git a/pkgs/applications/networking/feedreaders/canto-daemon/default.nix b/pkgs/applications/networking/feedreaders/canto-daemon/default.nix
index 63fefae9dfe1..0de38c259a34 100644
--- a/pkgs/applications/networking/feedreaders/canto-daemon/default.nix
+++ b/pkgs/applications/networking/feedreaders/canto-daemon/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, python34Packages, }:
 
 python34Packages.buildPythonPackage rec {
-  version = "0.9.3";
+  version = "0.9.5";
   name = "canto-daemon-${version}";
   namePrefix = "";
 
@@ -9,7 +9,7 @@ python34Packages.buildPythonPackage rec {
     owner = "themoken";
     repo = "canto-next";
     rev = "v${version}";
-    sha256 = "1x875qdyhab89nwwa2bzbfvcrkx34zwyy8dlbxm8wg3vz9b78l61";
+    sha256 = "1ycwrg5n2il833mdxgzz07r0vb4rxz89rk5c6l9g5x33ifinykdq";
   };
 
   propagatedBuildInputs = with python34Packages; [ feedparser ];
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-mra/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-mra/default.nix
new file mode 100644
index 000000000000..ba7396db9d67
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/pidgin-mra/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, pkgconfig, pidgin } :
+
+let
+  version = "54b2992";
+in
+stdenv.mkDerivation rec {
+  name = "pidgin-mra-${version}";
+
+  src = fetchgit {
+    url = "https://github.com/dreadatour/pidgin-mra";
+    rev = "${version}";
+    sha256 = "1nhfx9gi5lhh2xjr9rw600bb53ly2nwiqq422vc0f297qkm1q9y0";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ pidgin ];
+
+  preConfigure = ''
+    sed -i 's|-I/usr/include/libpurple|$(shell pkg-config --cflags purple)|' Makefile
+    export DESTDIR=$out
+    export LIBDIR=/lib
+    export DATADIR=/share
+  '';
+
+  meta = {
+    homepage = https://github.com/dreadatour/pidgin-mra;
+    description = "Mail.ru Agent plugin for Pidgin / libpurple";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-vk-plugin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-vk-plugin/default.nix
new file mode 100644
index 000000000000..0a96d8749aef
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/purple-vk-plugin/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchhg, pidgin, cmake, libxml2 } :
+
+let
+  version = "40ddb6d";
+in
+stdenv.mkDerivation rec {
+  name = "purple-vk-plugin-${version}";
+
+  src = fetchhg {
+    url = "https://bitbucket.org/olegoandreev/purple-vk-plugin";
+    rev = "${version}";
+    sha256 = "02p57fgx8ml00cbrb4f280ak2802svz80836dzk9f1zwm1bcr2qc";
+  };
+
+  buildInputs = [ pidgin cmake libxml2 ];
+
+  preConfigure = ''
+    sed -i -e 's|DESTINATION.*PURPLE_PLUGIN_DIR}|DESTINATION lib/purple-2|' CMakeLists.txt
+  '';
+
+  cmakeFlags = "-DCMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT=1";
+
+  meta = {
+    homepage = https://bitbucket.org/olegoandreev/purple-vk-plugin;
+    description = "Vk (russian social network) plugin for Pidgin / libpurple";
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
index 51707d2dca65..13798061b71b 100644
--- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, makeWrapper, zlib, glib, libpng, freetype, xorg
-, fontconfig, xlibs, qt5, xkeyboard_config, alsaLib, libpulseaudio ? null
-, libredirect, quazip, less, which
+{ stdenv, fetchurl, makeWrapper, makeDesktopItem, zlib, glib, libpng, freetype
+, xorg, fontconfig, xlibs, qt5, xkeyboard_config, alsaLib, libpulseaudio ? null
+, libredirect, quazip, less, which, unzip
 }:
 
 let
@@ -15,6 +15,16 @@ let
       xlibs.libxcb fontconfig xorg.libXext xorg.libX11 alsaLib qt5.base libpulseaudio
     ];
 
+  desktopItem = makeDesktopItem {
+    name = "teamspeak";
+    exec = "ts3client";
+    icon = "teamspeak";
+    comment = "The TeamSpeak voice communication tool";
+    desktopName = "TeamSpeak";
+    genericName = "TeamSpeak";
+    categories = "Network";
+  };
+
 in
 
 stdenv.mkDerivation rec {
@@ -33,7 +43,13 @@ stdenv.mkDerivation rec {
                 else "1b3nbvfpd8lx3dig8z5yk6zjkbmsy6y938dhj1f562wc8adixciz";
   };
 
-  buildInputs = [ makeWrapper less which ];
+  # grab the plugin sdk for the desktop icon
+  pluginsdk = fetchurl {
+    url = "http://dl.4players.de/ts/client/pluginsdk/pluginsdk_3.0.16.zip";
+    sha256 = "1qpqpj3r21wff3ly9ail4l6b57pcqycsh2hca926j14sdlvpv7kl";
+  };
+
+  buildInputs = [ makeWrapper less which unzip ];
 
   unpackPhase =
     ''
@@ -62,6 +78,12 @@ stdenv.mkDerivation rec {
       mkdir -p $out/lib/teamspeak
       mv * $out/lib/teamspeak/
 
+      # Make a desktop item
+      mkdir -p $out/share/applications/ $out/share/icons/
+      unzip ${pluginsdk}
+      cp pluginsdk/docs/client_html/images/logo.png $out/share/icons/teamspeak.png
+      cp ${desktopItem}/share/applications/* $out/share/applications/
+
       # Make a symlink to the binary from bin.
       mkdir -p $out/bin/
       ln -s $out/lib/teamspeak/ts3client $out/bin/ts3client
diff --git a/pkgs/applications/networking/irc/sic/default.nix b/pkgs/applications/networking/irc/sic/default.nix
new file mode 100644
index 000000000000..fef2b6c4cac6
--- /dev/null
+++ b/pkgs/applications/networking/irc/sic/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "sic-${version}";
+  version = "1.2";
+
+  makeFlags = "PREFIX=$out";
+  src = fetchurl {
+    url = "http://dl.suckless.org/tools/sic-${version}.tar.gz";
+    sha256 = "ac07f905995e13ba2c43912d7a035fbbe78a628d7ba1c256f4ca1372fb565185";
+  };
+
+  meta = {
+    description = "Simple IRC client";
+    homepage = http://tools.suckless.org/sic/;
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/mutt-kz/default.nix b/pkgs/applications/networking/mailreaders/mutt-kz/default.nix
index a162df9f33b2..5cd0ef9f7a44 100644
--- a/pkgs/applications/networking/mailreaders/mutt-kz/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt-kz/default.nix
@@ -16,14 +16,14 @@ assert saslSupport -> cyrus_sasl != null;
 assert gpgmeSupport -> gpgme != null;
 
 let
-  version = "1.5.23.1-rc1";
+  version = "1.5.23.1";
 in
 stdenv.mkDerivation rec {
   name = "mutt-kz-${version}";
 
   src = fetchurl {
     url = "https://github.com/karelzak/mutt-kz/archive/v${version}.tar.gz";
-    sha256 = "1m4bnn8psyrx2wy8ribannmp5qf75lv1gz116plji2z37z015zny";
+    sha256 = "01k4hrf8x2100pcqnrm61mm1x0pqi2kr3rx22k5hwvbs1wh8zyhz";
   };
 
   buildInputs = with stdenv.lib;
diff --git a/pkgs/applications/networking/remote/putty/default.nix b/pkgs/applications/networking/remote/putty/default.nix
index fe89ce61604e..dda847fde079 100644
--- a/pkgs/applications/networking/remote/putty/default.nix
+++ b/pkgs/applications/networking/remote/putty/default.nix
@@ -1,20 +1,20 @@
 { stdenv, fetchurl, ncurses, gtk, pkgconfig, autoconf, automake, perl, halibut, libtool }:
 
 stdenv.mkDerivation rec {
-  version = "0.64";
+  version = "0.65";
   name = "putty-${version}";
 
   src = fetchurl {
     url = "http://the.earth.li/~sgtatham/putty/latest/${name}.tar.gz";
-    sha256 = "089qbzd7w51sc9grm2x3lcbj61jdqsnakb4j4gnf6i2131xcjiia";
+    sha256 = "180ccrsyh775hdmxqdnbclfbvsfdp2zk3gsadpa53sj497yw2hym";
   };
 
   preConfigure = ''
     perl mkfiles.pl
     ( cd doc ; make );
-    sed '/AM_PATH_GTK(/d' -i unix/configure.ac
-    sed '/AC_OUTPUT/iAM_PROG_CC_C_O' -i unix/configure.ac
-    sed '/AC_OUTPUT/iAM_PROG_AR' -i unix/configure.ac
+    sed -e '/AM_PATH_GTK(/d' \
+        -e '/AC_OUTPUT/iAM_PROG_CC_C_O' \
+        -e '/AC_OUTPUT/iAM_PROG_AR' -i configure.ac
     ./mkauto.sh
     cd unix
   '';
diff --git a/pkgs/applications/networking/remote/x2goclient/default.nix b/pkgs/applications/networking/remote/x2goclient/default.nix
index 30e40a965f70..eaa1c5e318aa 100644
--- a/pkgs/applications/networking/remote/x2goclient/default.nix
+++ b/pkgs/applications/networking/remote/x2goclient/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, cups, libssh, libXpm, nxproxy, openldap, makeWrapper, qt4 }:
 
-let version = "4.0.4.0"; in
+let version = "4.0.5.0"; in
 stdenv.mkDerivation rec {
   name = "x2goclient-${version}";
 
   src = fetchurl {
     url = "http://code.x2go.org/releases/source/x2goclient/${name}.tar.gz";
-    sha256 = "0mqn4nvq2w7qja5i4vx9fg2spwzl01p0hmfwbjb0mzir03hmrl46";
+    sha256 = "18a2pszh0nq2ir64a1ah1mlzddn4qcd12b339bv30n0y1ir92bi4";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/science/math/ecm/default.nix b/pkgs/applications/science/math/ecm/default.nix
index 5d378a48dd9e..53b289983a4a 100644
--- a/pkgs/applications/science/math/ecm/default.nix
+++ b/pkgs/applications/science/math/ecm/default.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl, gmp}:
+{ stdenv, fetchurl, gmp, m4 }:
 
 let
   pname = "ecm";
-  version = "6.2.3";
+  version = "6.4.4";
   name = "${pname}-${version}";
 in
 
@@ -10,11 +10,11 @@ stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-      url = https://gforge.inria.fr/frs/download.php/22124/ecm-6.2.3.tar.gz;
-      sha256 = "1iwwhbz5vwl7j6dyh292hahc8yy16pq9mmm7mxy49zhxd81vy08p";
+      url = http://gforge.inria.fr/frs/download.php/file/32159/ecm-6.4.4.tar.gz;
+      sha256 = "0v5h2nicz9yx78c2d72plbhi30iq4nxbvphja1s9501db4aah4y8";
     };
 
-  buildInputs = [ gmp ];
+  buildInputs = [ m4 gmp ];
 
   doCheck = true;
 
@@ -23,5 +23,6 @@ stdenv.mkDerivation {
     license = stdenv.lib.licenses.gpl2Plus;
     homepage = http://ecm.gforge.inria.fr/;
     maintainers = [ stdenv.lib.maintainers.roconnor ];
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/science/math/lp_solve/default.nix b/pkgs/applications/science/math/lp_solve/default.nix
new file mode 100644
index 000000000000..09af2d708c96
--- /dev/null
+++ b/pkgs/applications/science/math/lp_solve/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+
+  name = "lp_solve-${version}";
+  version = "5.5.2.0";
+
+  src = fetchurl {
+    url = "http://sourceforge.net/projects/lpsolve/files/lpsolve/${version}/lp_solve_${version}_source.tar.gz";
+    sha256 = "176c7f023mb6b8bfmv4rfqnrlw88lsg422ca74zjh19i2h5s69sq";
+  };
+
+  buildCommand = ''
+    . $stdenv/setup
+    tar xvfz $src
+    (
+    cd lp_solve*/lpsolve55
+    bash ccc
+    mkdir -pv $out/lib
+    cp -v bin/*/* $out/lib
+    )
+    (
+    cd lp_solve*/lp_solve
+    bash ccc
+    mkdir -pv $out/bin
+    cp -v bin/*/* $out/bin
+    )
+    (
+    mkdir -pv $out/include
+    cp -v lp_solve*/*.h $out/include
+    )
+  '';
+
+  meta = with stdenv.lib; {
+    description = "lp_solve is a Mixed Integer Linear Programming (MILP) solver.";
+    homepage    = "http://lpsolve.sourceforge.net";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ smironov ];
+    platforms   = platforms.unix;
+  };
+
+}
+
diff --git a/pkgs/applications/science/misc/openmodelica/default.nix b/pkgs/applications/science/misc/openmodelica/default.nix
new file mode 100644
index 000000000000..3741187067dd
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/default.nix
@@ -0,0 +1,50 @@
+{stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
+hwloc, jre, liblapack, blas, hdf5, expat, ncurses, readline, qt4, webkit, which,
+lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
+doxygen, boost, openscenegraph, gnome, pangox_compat, xlibs, git, bash, gtk, makeWrapper }:
+
+let
+
+  fakegit = import ./fakegit.nix {inherit stdenv fetchgit fetchsvn bash;} ;
+
+in
+
+stdenv.mkDerivation {
+  name = "openmodelica";
+
+  src = fetchgit (import ./src-main.nix);
+
+  buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
+    hwloc jre liblapack blas hdf5 expat ncurses readline qt4 webkit which
+    lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison
+    doxygen boost openscenegraph gnome.gtkglext pangox_compat xlibs.libXmu
+    git gtk makeWrapper];
+
+  patchPhase = ''
+    cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh
+    cp -fv ${fakegit}/bin/checkout-svn.sh libraries/checkout-svn.sh
+  '';
+
+  configurePhase = ''
+    autoconf
+    ./configure CC=${clang}/bin/clang CXX=${clang}/bin/clang++ --prefix=$out
+  '';
+
+  postFixup = ''
+    for e in $(cd $out/bin && ls); do
+      wrapProgram $out/bin/$e \
+        --prefix PATH : "${gnumake}/bin" \
+        --prefix LIBRARY_PATH : "${liblapack}/lib:${blas}/lib"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "OpenModelica is an open-source Modelica-based modeling and simulation environment";
+    homepage    = "https://openmodelica.org";
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ smironov ];
+    platforms   = platforms.linux;
+  };
+}
+
+
diff --git a/pkgs/applications/science/misc/openmodelica/fakegit.nix b/pkgs/applications/science/misc/openmodelica/fakegit.nix
new file mode 100644
index 000000000000..de69626cd3ee
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/fakegit.nix
@@ -0,0 +1,81 @@
+{stdenv, fetchgit, fetchsvn, bash } :
+
+let
+  mkscript = path : text : ''
+    mkdir -pv `dirname ${path}`
+    cat > ${path} <<"EOF"
+    #!${bash}/bin/bash
+    ME=`basename ${path}`
+    ${text}
+    EOF
+    sed -i "s@%out@$out@g" ${path}
+    chmod +x ${path}
+  '';
+  
+  hashname = r: let
+    rpl = stdenv.lib.replaceChars [":" "/"] ["_" "_"];
+  in
+    (rpl r.url) + "-" + (rpl r.rev);
+
+in
+
+stdenv.mkDerivation {
+  name = "fakegit";
+
+  buildCommand = ''
+    mkdir -pv $out/repos
+    ${stdenv.lib.concatMapStrings
+       (r : ''
+        cp -r ${fetchgit r} $out/repos/${hashname r}
+       ''
+       ) (import ./src-libs-git.nix)
+    }
+
+    ${mkscript "$out/bin/checkout-git.sh" ''
+      if test "$#" -ne 4; then
+        echo "Usage: $0 DESTINATION URL GITBRANCH HASH"
+        exit 1
+      fi
+      DEST=$1
+      URL=`echo $2 | tr :/ __`
+      GITBRANCH=$3
+      REVISION=$4
+
+      L=`echo $REVISION | wc -c`
+      if expr $L '<' 10 >/dev/null; then
+        REVISION=refs/tags/$REVISION
+      fi
+
+      REVISION=`echo $REVISION | tr :/ __`
+
+      rm -rf $DEST
+      mkdir -pv $DEST
+      echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2
+      cp -r %out/repos/$URL-$REVISION/* $DEST
+      chmod u+w -R $DEST
+    ''}
+
+    ${stdenv.lib.concatMapStrings
+       (r : ''
+        cp -r ${fetchsvn r} $out/repos/${hashname r}
+       ''
+       ) (import ./src-libs-svn.nix)
+    }
+
+    ${mkscript "$out/bin/checkout-svn.sh" ''
+      if test "$#" -ne 3; then
+        echo "Usage: $0 DESTINATION URL REVISION"
+        exit 1
+      fi
+      DEST=$1
+      URL=`echo $2 | tr :/ __`
+      REVISION=`echo $4 | tr :/ __`
+
+      rm -rf $DEST
+      mkdir -pv $DEST
+      echo "FAKE COPY %out/repos/$URL-$REVISION $DEST"
+      cp -r %out/repos/$URL-$REVISION/* $DEST
+      chmod u+w -R $DEST
+    ''}
+  '';
+}
diff --git a/pkgs/applications/science/misc/openmodelica/src-libs-git.nix b/pkgs/applications/science/misc/openmodelica/src-libs-git.nix
new file mode 100644
index 000000000000..aae5ab321fbe
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/src-libs-git.nix
@@ -0,0 +1,71 @@
+[
+{ url = "https://github.com/modelica-3rdparty/ADGenKinetics.git"; rev = "42428db6e84bcde28543a3bba9bccee581309bb1"; sha256="14l005jwj1wz35gq8xlbzfz0bpsx99rs4q3dxkfh76yhnv1jh9h3"; }
+{ url = "https://github.com/modelica-3rdparty/ADMSL.git"; rev = "ed0305603f86b46d9af03e7d37dcb8b6704915b4"; sha256="15b0nqxyh8444az56ydjn594jikdl1ina5wamabk3nzm1yx218cl"; }
+{ url = "https://github.com/iea-annex60/modelica-annex60.git"; rev = "8015a01591bb24d219f57e7b69cdfcde66e39b47"; sha256="05k4pa007a6p628fq1xac0cfv8g8dnpy2bgy8h99rqpmlaa072z7"; }
+{ url = "https://github.com/OpenModelica/BioChem.git"; rev = "b5f3cb999f3cfad2bbb6fb429b496f61ecf2f628"; sha256="1l52dg888vwx4668spn59hqvfkpl9g06g8n2cdxiap7lvsyh6w9x"; }
+{ url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256="1i9cmiy1ya04h2ld0gy0x2gvdrfksl66fmcrgdm1vpsnbb6pviv9"; }
+{ url = "https://github.com/modelica-3rdparty/BondLib.git"; rev = "df7a40fe612617da22e27d39edfa4b27d65f23d0"; sha256="005djwxd568zyk3ndss9hv165dci9x0dgjmcdjhnqmsap3w83hlz"; }
+{ url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "fed013cdeec0fb9552964376b575a8e3635539ab"; sha256="020hm2q65d5iv3h8b3lhgl6j930vi2pbh4lvxv3b3k7i9z02q43a"; }
+{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "ef89361cc8673b077b9221efbf78aa63b4d7babd"; sha256="04gclknhl2f5z7w9fsbhwawisd0ibmvwpplx0siqwzvjx7nsmdg4"; }
+{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "444aa231f423b8d04225bf8672e3212d089fbfe4"; sha256="0q754mlkwqj0jcqsmxksvcz4ak2i86f9s41fhffh5jvra27cvq01"; }
+{ url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "aa2642608e587ddb6897e8c3ffabb3aa099510bd"; sha256="0y46spcb6rw0jpj4v20nlw8xlvi5kypij46f1msvwgr7dfgy4gl4"; }
+{ url = "https://github.com/modelica-3rdparty/ComplexLib.git"; rev = "0b78942ee4fa95ae71347a0d552dd869fdf4c708"; sha256="18llf5ccrq3b0f4cjznfycskwf78pik8370xv45w9gb51gamszrn"; }
+{ url = "https://github.com/lochel/ConPNlib.git"; rev = "bbf6e9711665d55e5a8cf2f7235fa013c2315104"; sha256="0g3ll44sn2ff14qxwdyakw9h5b8b7vzabxp8cb8km16wcdqzgcxx"; }
+{ url = "https://github.com/modelica-3rdparty/DESLib.git"; rev = "7a473d8d16b118c3ea05761c6f43b17fd9838e4e"; sha256="19f2121n8rdc9svcjk8irivsd9wqcb9ai9jx72s2r85fkbvm8jc3"; }
+{ url = "https://github.com/modelica-3rdparty/ExtendedPetriNets.git"; rev = "2f4eac0651c1ab0ed56b75ec61424e0ef15181d3"; sha256="0wwj756pg33qwb90ycbfkrk5xsiwsbrqvq3i16i4pisi21vl6jk9"; }
+{ url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "396164fa708cc7c7e64da55ac0b3cba23939f790"; sha256="09052qmv91a9wawsl93b5b3q47awrxhnsbb9mrv39kpnwygfh7dq"; }
+{ url = "https://github.com/modelica/ExternalMedia.git"; rev = "1b77869b31dc3509defeccb1236db4b05d2f6f5b"; sha256="05sszn4bn8r78syydyjq8csn9xv4az56mm9lrarqykqdh78pvlqp"; }
+{ url = "https://github.com/kdavies4/FCSys.git"; rev = "cb4b17f34313b9d8f2d4223d5365684b4dc1ab65"; sha256="114p7ja6b3fwlkvkkjhbx78fxc7v4af2sbs783hkdga86m1v4ib6"; }
+{ url = "https://github.com/modelica-3rdparty/FastBuildings.git"; rev = "1f5cfebc2f42c13e272bff639ffa3449d5740bf7"; sha256="0sry1n2pliddz0pjv8dp899fx98f16n1arc8zvq36k5grvi52fby"; }
+{ url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "10c226b7e5b2af901b356ac437c90d6616a6e9a4"; sha256="0a9j18qjwigq11nghl97syxa9bscs1aj6vwpkldh50csnj5h6g2s"; }
+{ url = "https://github.com/modelica-3rdparty/FuzzyControl.git"; rev = "19ff67ff129a440482cc85f216f287b05ea6ec0d"; sha256="0ijcqns7pijsavijn4wlrdsz64k5ks626sly7r28wvrk9af2m2cx"; }
+{ url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "e54fcd0e436d65c85de6c6b935983e363cdc9f6c"; sha256="05afh0379fx4mjjn7jb8j5p4am6qi62hjxvasb38b6fcp9rnysn4"; }
+{ url = "https://github.com/modelica-3rdparty/IdealizedContact.git"; rev = "8ebac550d913f6d2b3af4d1aea5044e72c7eb6b0"; sha256="03gh2a7hf44clshwkiyz786w847hmyr3bicdqd9969fbirgcqn6m"; }
+{ url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "6a2414307d5998c6d081efe803c2b575a532b3ba"; sha256="09la9h07x8bkh7zhrwykgj1467qdryjvxhvnnm8qvsim0dl9inc4"; }
+{ url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "1e91a5dcaa662cd30c5b09a9d0267289703f933b"; sha256="12094fqmwi65h0mc65b96krbj6b8dgn6jiww3fnv6khglb21kwvd"; }
+{ url = "https://github.com/modelica/Modelica.git"; rev = "refs/tags/v1.6"; sha256="106w83ylgbxf63wr7p9z5q8vqz2qcsaw0zwaad7d3saq6rdbj30c"; }
+{ url = "https://github.com/modelica/Modelica.git"; rev = "d442bcd461b8db9873e33b6141bdbd37bcff9de8"; sha256="1icnd0fxix5khnsvdhy7kmzn6lnqkggbvfrbln98a2h5zqd6s32w"; }
+{ url = "https://github.com/modelica/Modelica.git"; rev = "af2a3e1597d648d6826665c89cf9eaf5c2a632bc"; sha256="0ryk0iwakdazhsjqvan41w6f9bvgl329zkqchcdg6nkidiigziwh"; }
+{ url = "https://github.com/modelica/Modelica.git"; rev = "48943d87db45a6c312b5a5789d384acde44a934b"; sha256="1hi2vkpmx734baa9m1lqzallcykhh3snd68r387gndiv96f6zx3n"; }
+{ url = "https://github.com/modelica/Modelica.git"; rev = "164af873cc5955c50f9592a7d2f3c155f703849c"; sha256="071svqwd72sy85sngbg5r22ab693c0gw2xx29gk1sqrk2nchmvia"; }
+{ url = "https://github.com/OpenModelica/modelica3d.git"; rev = "daf5669b03ad33fc6999671d1c0e7521134a282b"; sha256="1scs6v2cp2r4jz4diszwbqf9kvzf49pid50dmpsz0gfhx06j9y2v"; }
+{ url = "https://github.com/modelica-deprecated/ModelicaAdditions.git"; rev = "568db43766186826b880f9d4bfafeff25cc2c4ab"; sha256="1py5i3afxdvz1dmxxwb2mqj8kyzdhg4jnnqwl8h50akizg4i49pl"; }
+{ url = "https://github.com/xogeny/ModelicaBook.git"; rev = "0e670cfae4db653bd34ea777d6b56423e9be2c9f"; sha256="0lxh08w6nii4p5yk7c0xmfi5y4xkjkzz4hirr3kqdhdfybcwq824"; }
+{ url = "https://github.com/modelica-compliance/compliance.git"; rev = "ca5092c14bb7af4507a10700ee49181a3a3ee199"; sha256="12ja6dhwlbq412kxjdviypgchipxpsg8l0sf6r17g6lbsi19i2b6"; }
+{ url = "https://github.com/modelica-3rdparty/ModelicaDEVS.git"; rev = "a987aa9552fbbe71b2ee2e8c28958f9d213087ae"; sha256="0qcw7vw28xadim0h8kr2km09d8vdj05ibdpzcnpny9n43pm9s5hx"; }
+{ url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "db912ba7e1317b8f6a776ccf9a19f69c77a9c477"; sha256="052h2lr7xgfag5fks19wbldqmb985kxlc5fzysl7c9w3fnijp0ml"; }
+{ url = "https://github.com/modelica/Modelica_EnergyStorages.git"; rev = "9f057365232364e31a31a8e525f96284b98c7de3"; sha256="195m5b3z8qgg9kih9zsdx1h8zgrm37q63890r59akka05a97j48h"; }
+{ url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "18916fdc485285baab12481701b53d4eb606a3f1"; sha256="0fhvdwcgk8q3z1a98l2bxv8a6dysrs4ll6xfyzpni7yq8gp4mg4q"; }
+{ url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "d0f5ee57bc7b639738e88026674a87343b33dbe1"; sha256="0l75v4d0fgf07ify0h3skh4y9pfw9gxh9hbj1lbsdgglmzlrcvbg"; }
+{ url = "https://github.com/modelica-3rdparty/MotorcycleDynamics.git"; rev = "2be2667f9936d88ffb9b8a8246c5af9ccb0b307f"; sha256="0jazwmpqpyhhgs9qdn9drmplgp2yjs0ky7wll5x9929dkgy80m6x"; }
+{ url = "https://github.com/modelica-3rdparty/NCLib.git"; rev = "ed3d72f176ac6b7031ce73be9d80101141e74a69"; sha256="1pbpv8w1lsa9vdwp7qbih8iim91ms22b01wz376b548d0x2r95la"; }
+{ url = "https://github.com/modelica-3rdparty/NeuralNetwork.git"; rev = "c44e4d1fe97fd4f86dafcd05ad3713692e3f1806"; sha256="0s1v8k71zq1s9gjlvi3zr23nwfknp4x17cxm64a0y3vsi3kahj2s"; }
+{ url = "https://github.com/DLR-SR/Noise.git"; rev = "9b57476845539e56769cf76ea0fe7bf3c7eb5d11"; sha256="0icrb63f6dm4gww2nyby9i7s7qxvhvialp36xzcgmi7nlq7crjr2"; }
+{ url = "https://github.com/modelica-3rdparty/ObjectStab.git"; rev = "2a723e0b223af50f4ffdd62f8ac901e0f87b9323"; sha256="1b6zi27slzzfbkmbcqxygsn5i5w0zkq0hfrfb72vf7mbgz07j19j"; }
+{ url = "https://github.com/cparedis/OpenHydraulics.git"; rev = "d3173d1f06f7d14c9d7c41769f143617ff03a3ad"; sha256="1hn5rcnmzcbiaqdnxfn02wddmrpj9bcdi9p680f31hbh3vb0i3r6"; }
+{ url = "https://github.com/lochel/PNlib.git"; rev = "44c7d277980b7a88b449b72edec0a56416b40fa9"; sha256="026wdhbxnzarmj8gw0as70vj8f1gwc51z38hjqpswxkl0xd6mfvp"; }
+{ url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "49d59060f6e5b4cb68560c6d7467e84ea4318056"; sha256="0klqs2axjm3s780sq4plq4wmbf9mszz2jmq9fprgxy9pw7iszbhc"; }
+{ url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "d998a1b27355e83d2ff4849d71281a919a3234aa"; sha256="0vyq6mninn38wy2d60rk753xbkfqim2y6y31py7kq2mm170jfqf4"; }
+{ url = "https://github.com/modelica/PowerSystems.git"; rev = "7b551888089277a0dd979db636d47aba0279e8f0"; sha256="0y13f1nllc7riksnly25wmmp6mc30c1b48dbq2lr1nag6yg3blwm"; }
+{ url = "https://github.com/modelica/PowerSystems.git"; rev = "3abd48aa53bbcd3f3e2ddfa2371680febf8baf48"; sha256="1nr2nbpaxywk8cpwnk9rr2zr87mm2gb9b4plqipjdlrrkjlk9fka"; }
+{ url = "https://github.com/modelica-3rdparty/PraxisSimulationstechnik.git"; rev = "f7db177786f84033f3a50b7474988b190a1dfb46"; sha256="08bdm7k7w35kg9gkrvcn382zkwf5h3iwkkx60d5fj64j5d5klray"; }
+{ url = "https://github.com/modelica-3rdparty/QCalc.git"; rev = "af6c34dda691a9bdf7ca1de10650974b2d5cecf5"; sha256="0p0zhl27cnr492byrzib0dyn7zp5yb7wcr0spv10ngm6j90cij6y"; }
+{ url = "https://github.com/modelica-3rdparty/QSSFluidFlow.git"; rev = "d84a2c107132f2cd47ea3c3751238d69e4b1f64b"; sha256="02cdvv33pi0qlmg8n401s4cxf59l9b4ff4ixf7gwn4w4n1y9bw0g"; }
+{ url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "655ac1a22aa6deb04ea8e3869dd0aa9fb9540754"; sha256="19crf8pl9vpqq3pq1rhcbl49kkmnm4jrzpwrpqp8qc6dj8096za4"; }
+{ url = "https://github.com/modelica-3rdparty/ScalableTestSuite.git"; rev = "c6319908d45ac97ffb10e96cd42654bce36ffb97"; sha256="1g79d88bfmzcqvaghyyj86ajs38v0qnmjxbj8d53yp6nmgnaasx5"; }
+{ url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "22e1874ef9ad46156617817c67a4fb1238621bf5"; sha256="0nwb7apayk7ba9iv27yv67wi4b934dy57kkvn0acxy393jhd8jqd"; }
+{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "73a3bfc6d2ddd72165bb0f3e7e9df48b643a5ed0"; sha256="0mvrkpkmr0bx2cvsb23syg7cs8k6a15vjf4n1hivdcigq4x8g2nc"; }
+{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "5ef2e38b64ff481801c0db19d52f0bef21f85f77"; sha256="1llnpl2x1g28gari1rk34hdnnwf7a4fwwxlf7i18d8bl1vsrfaja"; }
+{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "2bd9e367baaa8d44946897c3c3a32a4050ad2a2a"; sha256="1shm9blpn9m87ci6wwkinpmihr1fik9j0a0pj2nxy0cjrr2jzbn4"; }
+{ url = "https://github.com/modelica-3rdparty/Spot.git"; rev = "2f74417f1681570900a1ed373dcbe4b42634ec7b"; sha256="0k5h2k6x98zvvsafpw7y16xs9d6lxz0csa0mlm4wwggaywadn255"; }
+{ url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "c58a26dc3e62a50e64fd336dc4aa499b2d5ad314"; sha256="0ra3a2vgqmry92kmm060gfa41mrpkgbs4swzl78ih3icawfzjz8q"; }
+{ url = "https://github.com/modelica-3rdparty/ThermoPower.git"; rev = "e012268625dd1645fe5570cf31d64129d83a8192"; sha256="1rlkli48kc9hnkplgb0bjkb6ajn7agiw4yh9l5sfvlv7k7k2gc8l"; }
+{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "d4f9c3ed35f7520f82439eb6e9f4057ae0f82b73"; sha256="0hxbn26g479qkr6rrglx9ljdxnpzd5ll1sf2v08skghrdjjb8jcx"; }
+{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "51e7ea2d2e121ee640e7897335c294923f8eaeb0"; sha256="0l11mzjkaxndsqrnnr0z7qvk08svv229119qkm81yb53ich9wnyw"; }
+{ url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "ad956a35643d53e207ee126d67ea1f3f38337a39"; sha256="0g90cqwjpi06gn7vca5kqnz56im76s2hrdqjhsj2bl43rza8mhr0"; }
+{ url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "90ff44ac791ba5ed98444c8597efbd2a2af01cad"; sha256="1icrn0y389rhxmf6i0mnsfgw9v9j5innpkz3q069rfm2ji268b12"; }
+{ url = "https://github.com/xogeny/XogenyTest.git"; rev = "9b98981e8ff0f440dd319d1a806e1fd2f0ab3436"; sha256="18glaxrlxfml26w7ljlf0yj3ah1fnhpbg01py28nplsgnrfwfwqj"; }
+{ url = "https://github.com/modelica-3rdparty/msgpack-modelica.git"; rev = "6ce2ca600c4902038c0f20b43ed442f1ee204310"; sha256="01x5a9y11yf62sc0j2y49yxwm24imj2lfl3z5mwvi9038gwn0lkx"; }
+{ url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "3d2cc8272abfbc4b667d8868f851bf3e11c6f00e"; sha256="194810a4rn0flxgirrlnxsbxarnm97309dkp1w7nva9zv1q3wj7h"; }
+{ url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "7817cd703b88fc1f433269d32c31e75eb50a21c6"; sha256="1plkxkx51f9yi99ysarmx2ymldizvyr0m66k996y5lj5h81jv8a8"; }
+]
diff --git a/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix b/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix
new file mode 100644
index 000000000000..244da64fb4e6
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix
@@ -0,0 +1,5 @@
+[
+{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/InstantaneousSymmetricalComponents"; rev = "7978"; sha256="0f100c7bz4ai3ryhpkbbszw8z6mykvg40p03ic92n2qq58wjk37z"; }
+{ url = "https://svn.modelica.org/projects/Modelica_EmbeddedSystems/trunk/Modelica_StateGraph2"; rev = "8121"; sha256="1cys57nc1yzkr5admc139qs5pa48rj3g69pb3j3s9xcmpd483hzp"; }
+{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/Modelica_PowerFlow/trunk"; rev = "3174"; sha256="0yviw1b8psn8vfyl4q1naylak3lcqi2q1bqplqg3gg9iw4aiymxl"; }
+]
diff --git a/pkgs/applications/science/misc/openmodelica/src-main.nix b/pkgs/applications/science/misc/openmodelica/src-main.nix
new file mode 100644
index 000000000000..16910675a05b
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/src-main.nix
@@ -0,0 +1,6 @@
+{
+  url = "https://openmodelica.org/git-readonly/OpenModelica.git";
+  fetchSubmodules = true;
+  rev = "8c5d48eb31a638d5220621b20377bfe6f9e9535e";
+  sha256 = "15r0qpvnsb9a7nw3bh5n9r770ngd7p5py0ld2jy5mc4llaslkpa5";
+}
diff --git a/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh b/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh
new file mode 100755
index 000000000000..481a89796415
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+CWD=`pwd`
+
+chko() { (
+T=`mktemp -d`
+trap "rm -rf $T" EXIT INT PIPE
+cd $T
+cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit `cat $CWD/src-main.nix`
+EOF
+nix-build check.nix
+cat result/libraries/Makefile.libs
+) }
+
+getsha256() { (
+T=`mktemp -d`
+trap "rm -rf $T" EXIT INT PIPE
+cd $T
+
+L=`echo $2 | wc -c`
+if expr $L '<' 10 >/dev/null; then
+T=`echo $2 | sed 's@"\(.*\)"@"refs/tags/\1"@'`
+cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit {
+  url = $1;
+  rev = $T;
+  sha256 = "0000000000000000000000000000000000000000000000000000";
+}
+EOF
+SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
+echo "{ url = $1; rev = $T; sha256=\"$SHA\"; }"
+else
+cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit {
+  url = $1;
+  rev = $2;
+  sha256 = "0000000000000000000000000000000000000000000000000000";
+}
+EOF
+SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
+echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }"
+fi
+
+# nix-build check.nix
+) }
+
+OUT=src-libs-git.nix
+
+echo '[' > $OUT
+
+chko |
+grep checkout-git.sh |
+tr \' \" |
+while read NM TGT URL BR REV ; do
+  echo Trying $TGT $URL $REV >&2
+  getsha256 $URL $REV >> $OUT || exit 1
+done
+
+echo ']' >> $OUT
+
diff --git a/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh b/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh
new file mode 100755
index 000000000000..972bc7d61f13
--- /dev/null
+++ b/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh
@@ -0,0 +1,50 @@
+#!/bin/sh
+
+CWD=`pwd`
+
+chko() { (
+T=`mktemp -d`
+trap "rm -rf $T" EXIT INT PIPE
+cd $T
+cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit `cat $CWD/src-main.nix`
+EOF
+nix-build check.nix
+cat result/libraries/Makefile.libs
+) }
+
+getsha256() { (
+T=`mktemp -d`
+trap "rm -rf $T" EXIT INT PIPE
+cd $T
+
+L=`echo $2 | wc -c`
+cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchsvn {
+  url = $1;
+  rev = $2;
+  sha256 = "0000000000000000000000000000000000000000000000000000";
+}
+EOF
+SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
+echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }"
+
+# nix-build check.nix
+) }
+
+OUT=src-libs-svn.nix
+
+echo '[' > $OUT
+
+chko |
+grep checkout-svn.sh |
+tr \' \" |
+while read NM TGT URL REV ; do
+  echo Trying $TGT $URL $REV >&2
+  getsha256 $URL $REV >> $OUT || exit 1
+done
+
+echo ']' >> $OUT
+
diff --git a/pkgs/applications/version-management/meld/default.nix b/pkgs/applications/version-management/meld/default.nix
index 2a69d1406699..2f7c4af0024f 100644
--- a/pkgs/applications/version-management/meld/default.nix
+++ b/pkgs/applications/version-management/meld/default.nix
@@ -1,12 +1,11 @@
 { stdenv, fetchurl, itstool, buildPythonPackage, python27, intltool, makeWrapper
 , libxml2, pygobject3, gobjectIntrospection, gtk3, gnome3, pycairo, cairo
-, hicolor_icon_theme
 }:
 
 
 let
-  minor = "3.12";
-  version = "${minor}.3";
+  minor = "3.14";
+  version = "${minor}.0";
 in
 
 buildPythonPackage rec {
@@ -15,13 +14,13 @@ buildPythonPackage rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/meld/${minor}/meld-${version}.tar.xz";
-    sha256 = "1zg6qhm53j0vxmjj3pcj2hwi8c12dxzmlh98zks0jnwhqv2p4dfv";
+    sha256 = "0g0h9wdr6nqdalqkz4r037569apw253cklwr17x0zjc7nwv2j3j3";
   };
 
   buildInputs = [
     python27 intltool makeWrapper itstool libxml2
     gnome3.gtksourceview gnome3.gsettings_desktop_schemas pycairo cairo
-    hicolor_icon_theme
+    gnome3.defaultIconTheme
   ];
   propagatedBuildInputs = [ gobjectIntrospection pygobject3 gtk3 ];
 
@@ -41,18 +40,19 @@ buildPythonPackage rec {
   preFixup = ''
     wrapProgram $out/bin/meld \
       --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share"
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:$out/share" \
+      --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
   '';
 
   patchPhase = ''
-    sed -e 's,#!.*,#!${python27}/bin/python27,' -i bin/meld
+    patchShebangs bin/meld
   '';
 
   pythonPath = [ gtk3 ];
 
   meta = with stdenv.lib; {
     description = "Visual diff and merge tool";
-    homepage = http://meld.sourceforge.net;
+    homepage = http://meldmerge.org/;
     license = stdenv.lib.licenses.gpl2;
     platforms = platforms.linux ++ stdenv.lib.platforms.darwin;
   };
diff --git a/pkgs/applications/version-management/peru/default.nix b/pkgs/applications/version-management/peru/default.nix
new file mode 100644
index 000000000000..d97aee233883
--- /dev/null
+++ b/pkgs/applications/version-management/peru/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, python3Packages }:
+
+let 
+  version = "0.2.3"; 
+in
+
+python3Packages.buildPythonPackage rec {
+  
+  # Do not prefix name with python specific version identifier.
+  namePrefix = "";
+
+  name = "peru-${version}";
+
+  src = fetchFromGitHub {
+    owner = "buildinspace";
+    repo = "peru";
+    rev = "${version}";
+    sha256 = "04bnaly50qmzkj0shdag94n8vr3ggarlqdny5zdb8nh31fqgln8b";
+  };
+
+  pythonPath = with python3Packages; [ pyyaml docopt ];
+
+  meta = {
+    homepage = https://github.com/buildinspace/peru;
+    description = "A tool for including other people's code in your projects";
+    license = stdenv.lib.licenses.mit;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/video/bomi/default.nix b/pkgs/applications/video/bomi/default.nix
index 2f0c3070921a..da07458f4f64 100644
--- a/pkgs/applications/video/bomi/default.nix
+++ b/pkgs/applications/video/bomi/default.nix
@@ -26,28 +26,23 @@ assert pulseSupport -> libpulseaudio != null;
 assert cddaSupport -> libcdda != null;
 assert youtubeSupport -> youtube-dl != null;
 
-let
-  waf = fetchurl {
-    url = http://ftp.waf.io/pub/release/waf-1.8.4;
-    sha256 = "1a7skwgpl91adhcwlmdr76xzdpidh91hvcmj34zz6548bpx3a87h";
-  };
-
+let qtPath = makeSearchPath "lib/qt5/qml" [ qt5.declarative qt5.quickcontrols ];
 in
 
 stdenv.mkDerivation rec {
   name = "bomi-${version}";
-  version = "0.9.10";
+  version = "0.9.11";
 
   src = fetchFromGitHub {
     owner = "xylosper";
     repo = "bomi";
     rev = "v${version}";
-    sha256 = "1c7497gks7yxzfy6jx77vn9zs2pdq7y6l9w61miwnkdm91093n17";
+    sha256 = "0a7n46gn3n5098lxxvl3s29s8jlkzss6by9074jx94ncn9cayf2h";
   };
 
   buildInputs = with stdenv.lib;
                 [ libX11 libxcb mesa
-                  qt5.base qt5.x11extras qt5.declarative qt5.quickcontrols
+                  qt5.base qt5.x11extras
                   ffmpeg
                   libchardet
                   mpg123
@@ -72,13 +67,13 @@ stdenv.mkDerivation rec {
   '';
 
   preBuild = ''
-    install -m755 ${waf} src/mpv/waf
     patchShebangs src/mpv/waf
     patchShebangs build-mpv
   '';
 
   postInstall = ''
     wrapProgram $out/bin/bomi \
+      --set QML2_IMPORT_PATH ${qtPath} \
       ${optionalString youtubeSupport "--prefix PATH ':' '${youtube-dl}/bin'"}
   '';
 
diff --git a/pkgs/applications/video/kodi/default.nix b/pkgs/applications/video/kodi/default.nix
index cd24f2bfc2a4..30eac05c234a 100644
--- a/pkgs/applications/video/kodi/default.nix
+++ b/pkgs/applications/video/kodi/default.nix
@@ -37,18 +37,18 @@ assert cecSupport   -> libcec != null;
 assert rtmpSupport  -> rtmpdump != null;
 
 let
-  rel = "Helix";
-  ffmpeg_2_4_6 = fetchurl {
-    url = "https://github.com/xbmc/FFmpeg/archive/2.4.6-${rel}.tar.gz";
-    sha256 = "1kxp2z2zgcbplm5398zrfgwcfacfzvbg9y9wwrmm8vgwfmj32wh8";
+  rel = "Isengard";
+  ffmpeg_2_6_3 = fetchurl {
+    url = "https://github.com/xbmc/FFmpeg/archive/2.6.3-${rel}.tar.gz";
+    sha256 = "129nwrj9i758vz9xakpp68sm1l7z4in0krq6ayyqnpsnm54r9xlc";
   };
 in stdenv.mkDerivation rec {
     name = "kodi-" + version;
-    version = "14.2";
+    version = "15.0";
 
     src = fetchurl {
       url = "https://github.com/xbmc/xbmc/archive/${version}-${rel}.tar.gz";
-      sha256 = "1x37l8db6xrvdw933p804lnwvkcm4vdb9gm5i6vmz4ha8f88bjyr";
+      sha256 = "1zqdmqffjfr5219cvpbvq9v1z5p5pzi2m9xs9lzk4jz7rxrs3nr7";
     };
 
     buildInputs = [
@@ -86,7 +86,7 @@ in stdenv.mkDerivation rec {
         --replace 'usr/share/zoneinfo' 'etc/zoneinfo'
       substituteInPlace tools/depends/target/ffmpeg/autobuild.sh \
         --replace "/bin/bash" "${bash}/bin/bash -ex"
-      cp ${ffmpeg_2_4_6} tools/depends/target/ffmpeg/ffmpeg-2.4.6-${rel}.tar.gz
+      cp ${ffmpeg_2_6_3} tools/depends/target/ffmpeg/ffmpeg-2.6.3-${rel}.tar.gz
     '';
 
     preConfigure = ''
diff --git a/pkgs/applications/video/mpv/default.nix b/pkgs/applications/video/mpv/default.nix
index 1be0f5b9e0ae..5ac70413d164 100644
--- a/pkgs/applications/video/mpv/default.nix
+++ b/pkgs/applications/video/mpv/default.nix
@@ -12,7 +12,7 @@
 , bluraySupport ? true, libbluray ? null
 , speexSupport ? true, speex ? null
 , theoraSupport ? true, libtheora ? null
-, jackaudioSupport ? true, libjack2 ? null
+, jackaudioSupport ? false, libjack2 ? null
 , pulseSupport ? true, libpulseaudio ? null
 , bs2bSupport ? true, libbs2b ? null
 # For screenshots
diff --git a/pkgs/applications/virtualization/bochs/default.nix b/pkgs/applications/virtualization/bochs/default.nix
index 914114467e67..b876403d6327 100644
--- a/pkgs/applications/virtualization/bochs/default.nix
+++ b/pkgs/applications/virtualization/bochs/default.nix
@@ -4,7 +4,7 @@
 , docbook_xml_dtd_45, docbook_xsl
 , sdlSupport ? true, SDL2 ? null
 , termSupport ? true , ncurses ? null
-, wxSupport ? false, wxGTK ? null # Warning! Broken
+, wxSupport ? true, wxGTK ? null
 # Optional, undocumented dependencies
 , wgetSupport ? false, wget ? null
 , curlSupport ? false, curl ? null
@@ -19,11 +19,11 @@ assert curlSupport -> (curl != null);
 stdenv.mkDerivation rec {
 
   name = "bochs-${version}";
-  version = "2.6.7";
+  version = "2.6.8";
 
   src = fetchurl {
     url = "http://downloads.sourceforge.net/project/bochs/bochs/${version}/${name}.tar.gz";
-    sha256 = "10l2pgzwnmng0rd44kqv7y46nwpcc18j53h3kf3dlqlnd7mlwdd4";
+    sha256 = "1kl5cmbz6qgg33j5vv9898nzdppp1rqgy24r5pv762aaj7q0ww3r";
   };
 
   # The huge list of configurable options
diff --git a/pkgs/applications/virtualization/remotebox/default.nix b/pkgs/applications/virtualization/remotebox/default.nix
index 14adddf8d1b8..e07f8d5b92c9 100644
--- a/pkgs/applications/virtualization/remotebox/default.nix
+++ b/pkgs/applications/virtualization/remotebox/default.nix
@@ -1,40 +1,44 @@
-{ stdenv, fetchurl, perl, perlPackages }:
+{ stdenv, fetchurl, makeWrapper, perl, perlPackages }:
 
-stdenv.mkDerivation rec {
-  version = "1.9";
+let version = "2.0"; in
+stdenv.mkDerivation {
   name = "remotebox-${version}";
 
   src = fetchurl {
-    url = "${meta.homepage}/downloads/RemoteBox-${version}.tar.bz2";
-    sha256 = "0vsfz2qmha9nz60fyksgqqyrw4lz9z2d5isnwqc6afn8z3i1qmkp";
+    url = "http://remotebox.knobgoblin.org.uk/downloads/RemoteBox-${version}.tar.bz2";
+    sha256 = "0c73i53wdjd2m2sdgq3r3xp30irxh5z5rak2rk79yb686s6bv759";
   };
 
-  buildInputs = [ perl perlPackages.Gtk2 perlPackages.SOAPLite ];
+  buildInputs = with perlPackages; [ perl Glib Gtk2 Pango SOAPLite ];
+  nativeBuildInputs = [ makeWrapper ];
 
   installPhase = ''
-    mkdir -p $out/bin
-    cp -a docs/ share/ $out
+    mkdir -pv $out/bin
 
     substituteInPlace remotebox --replace "\$Bin/" "\$Bin/../"
-    install -t $out/bin remotebox
+    install -v -t $out/bin remotebox
+    wrapProgram $out/bin/remotebox --prefix PERL5LIB : $PERL5LIB
 
-    mkdir -p $out/share/applications
-    cp -p packagers-readme/*.desktop $out/share/applications
+    cp -av docs/ share/ $out
+
+    mkdir -pv $out/share/applications
+    cp -pv packagers-readme/*.desktop $out/share/applications
   '';
 
   meta = with stdenv.lib; {
+    inherit version;
     description = "VirtualBox client with remote management";
     homepage = http://remotebox.knobgoblin.org.uk/;
     license = licenses.gpl2Plus;
     longDescription = ''
       VirtualBox is traditionally considered to be a virtualization solution
-      aimed at the desktop.  While it is certainly possible to install
+      aimed at the desktop. While it is certainly possible to install
       VirtualBox on a server, it offers few remote management features beyond
       using the vboxmanage command line.
       RemoteBox aims to fill this gap by providing a graphical VirtualBox
       client which is able to manage a VirtualBox server installation.
     '';
     maintainers = with maintainers; [ nckx ];
-    platforms = with platforms; all;
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 3250dc419d1e..9112337d0a46 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -98,7 +98,10 @@ in stdenv.mkDerivation {
       src/apps/adpctl/VBoxNetAdpCtl.cpp
   '';
 
+  # first line: ugly hack, and it isn't yet clear why it's a problem
   configurePhase = ''
+    NIX_CFLAGS_COMPILE=$(echo "$NIX_CFLAGS_COMPILE" | sed 's,\-isystem ${stdenv.cc.libc}/include,,g')
+
     cat >> LocalConfig.kmk <<LOCAL_CONFIG
     VBOX_WITH_TESTCASES            :=
     VBOX_WITH_TESTSUITE            :=
diff --git a/pkgs/applications/window-managers/compiz/default.nix b/pkgs/applications/window-managers/compiz/default.nix
index 6b9a579a08ba..977409d0ef1e 100644
--- a/pkgs/applications/window-managers/compiz/default.nix
+++ b/pkgs/applications/window-managers/compiz/default.nix
@@ -50,6 +50,9 @@ stdenv.mkDerivation rec {
       --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages"
   '';
 
+  # automatic moving fails, perhaps due to having two $out/lib*/pkgconfig
+  dontMoveLib64 = true;
+
   meta = {
     description = "Compoziting window manager";
     homepage = "http://launchpad.net/compiz/";
diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix
index f3d88c55c589..b1b63df574a0 100644
--- a/pkgs/applications/window-managers/icewm/default.nix
+++ b/pkgs/applications/window-managers/icewm/default.nix
@@ -1,35 +1,39 @@
-{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, freetype
-, fontconfig, xlibs, automake, pkgconfig, gdk_pixbuf }:
+{ stdenv, fetchurl, cmake, gettext
+, libjpeg, libtiff, libungif, libpng, imlib, expat
+, freetype, fontconfig, pkgconfig, gdk_pixbuf
+, mkfontdir, libX11, libXft, libXext, libXinerama
+, libXrandr, libICE, libSM, libXpm, libXdmcp, libxcb
+, libpthreadstubs }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "icewm-1.3.8";
+  name = "icewm-${version}";
+  version = "1.3.10";
 
   buildInputs =
-    [ gettext libjpeg libtiff libungif libpng
-      xlibs.libX11 xlibs.libXft xlibs.libXext xlibs.libXinerama xlibs.libXrandr
-      xlibs.libICE xlibs.libSM freetype fontconfig
-      pkgconfig gdk_pixbuf
-    ];
+  [ cmake gettext libjpeg libtiff libungif libpng imlib expat
+    freetype fontconfig pkgconfig gdk_pixbuf mkfontdir libX11
+    libXft libXext libXinerama libXrandr libICE libSM libXpm
+    libXdmcp libxcb libpthreadstubs ];
 
   src = fetchurl {
-    url = "mirror://sourceforge/icewm/${name}.tar.gz";
-    sha256 = "066d1mw0vm9ygxnyxksfi6k4vzclvnlkvj04pj3kbcmv1fg8sn0p";
+    url = "https://github.com/bbidulock/icewm/archive/${version}.tar.gz";
+    sha256 = "01i7a21gf810spmzjx32dxsmx4527qivs744rhvhaw4gr00amrns";
   };
 
-  NIX_LDFLAGS = "-lfontconfig";
-
-  # The fuloong2f is not supported by 1.3.6 still
-  #
-  # Don't know whether 1.3.7 supports fuloong2f and don't know how to test it
-  # on x86_64 hardware. So I left this 'cp' -- urkud
-
   preConfigure = ''
-    cp -v ${automake}/share/automake*/config.{sub,guess} .
+    export cmakeFlags="-DPREFIX=$out"
   '';
 
   meta = {
-    description = "A window manager for the X Window System";
+    description = "A simple, lightweight X window manager";
+    longDescription = ''
+      IceWM is a window manager for the X Window System. The goal of
+      IceWM is speed, simplicity, and not getting in the user's way.
+    '';
     homepage = http://www.icewm.org/;
-    platforms = stdenv.lib.platforms.unix;
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/window-managers/oroborus/default.nix b/pkgs/applications/window-managers/oroborus/default.nix
new file mode 100644
index 000000000000..226b33be0603
--- /dev/null
+++ b/pkgs/applications/window-managers/oroborus/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig
+, freetype, fribidi
+, libSM, libICE, libXt, libXaw, libXmu
+, libXext, libXft, libXpm, libXrandr
+, libXrender, xextproto, libXinerama }:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+
+  name = "oroborus-${version}";
+  version = "2.0.20";
+
+  buildInputs = [ pkgconfig freetype fribidi libSM libICE libXt libXaw libXmu libXext libXft libXpm libXrandr libXrender xextproto libXinerama ];
+
+  src = fetchurl {
+    url = "http://ftp.debian.org/debian/pool/main/o/oroborus/oroborus_${version}.tar.gz";
+    sha256 = "12bvk8x8rfnymbfbwmdcrd9g8m1zxbcq7rgvfdkjr0gnpi0aa82j";
+  };
+
+  meta = {
+    description = "A really minimalistic X window manager";
+    homepage = http://www.oroborus.org/;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix
new file mode 100644
index 000000000000..39d942362be1
--- /dev/null
+++ b/pkgs/applications/window-managers/qtile/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, buildPythonPackage, python27Packages, pkgs }:
+
+buildPythonPackage rec {
+  name = "qtile-${version}";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "qtile";
+    repo = "qtile";
+    rev = "v${version}";
+    sha256 = "1g02lvk2cqy6w6y6nw6dnsmy4i9k4fyawyibpkf0a7a1nfrd6a99";
+  };
+
+  patches = [ ./restart_executable.patch ];
+
+  postPatch = ''
+    substituteInPlace libqtile/manager.py --subst-var-by out $out
+  '';
+
+  buildInputs = [ pkgs.pkgconfig pkgs.glib pkgs.xlibs.libxcb pkgs.cairo pkgs.pango python27Packages.xcffib ];
+
+  cairocffi-xcffib = python27Packages.cairocffi.override {
+    LD_LIBRARY_PATH = "${pkgs.xlibs.libxcb}/lib:${pkgs.cairo}/lib";
+    pythonPath = [ python27Packages.xcffib ];
+  };
+
+  pythonPath = with python27Packages; [ xcffib cairocffi-xcffib trollius readline ];
+
+  LD_LIBRARY_PATH = "${pkgs.xlibs.libxcb}/lib:${pkgs.cairo}/lib";
+
+  postInstall = ''
+    wrapProgram $out/bin/qtile \
+      --prefix LD_LIBRARY_PATH : ${pkgs.xlibs.libxcb}/lib \
+      --prefix LD_LIBRARY_PATH : ${pkgs.glib}/lib \
+      --prefix LD_LIBRARY_PATH : ${pkgs.cairo}/lib \
+      --prefix LD_LIBRARY_PATH : ${pkgs.pango}/lib
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.qtile.org/;
+    license = licenses.mit;
+    description = "A small, flexible, scriptable tiling window manager written in Python";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ kamilchm ];
+  };
+}
+
diff --git a/pkgs/applications/window-managers/qtile/restart_executable.patch b/pkgs/applications/window-managers/qtile/restart_executable.patch
new file mode 100644
index 000000000000..a1e74a575d9e
--- /dev/null
+++ b/pkgs/applications/window-managers/qtile/restart_executable.patch
@@ -0,0 +1,12 @@
+diff -ruP a/libqtile/manager.py b/libqtile/manager.py
+--- a/libqtile/manager.py	2015-07-26 21:26:16.947976520 +0200
++++ b/libqtile/manager.py	2015-07-26 21:37:45.581316712 +0200
+@@ -1262,7 +1262,7 @@
+         argv = [s for s in argv if not s.startswith('--with-state')]
+         argv.append('--with-state=' + buf.getvalue().decode())
+ 
+-        self.cmd_execute(sys.executable, argv)
++        self.cmd_execute("@out@/bin/qtile", argv[1:])
+ 
+     def cmd_spawn(self, cmd):
+         """
diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix
index cd19782e6115..c23581d96019 100644
--- a/pkgs/build-support/rust/default.nix
+++ b/pkgs/build-support/rust/default.nix
@@ -44,7 +44,7 @@ in stdenv.mkDerivation (args // {
     export CARGO_HOME="$(realpath deps)"
 
     # Let's find out which $indexHash cargo uses for file:///dev/null
-    (cd $sourceRoot && cargo fetch &>/dev/null)
+    (cd $sourceRoot && cargo fetch &>/dev/null) || true
     cd deps
     indexHash="$(basename $(echo registry/index/*))"
 
diff --git a/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
new file mode 100644
index 000000000000..4b1a9527b110
--- /dev/null
+++ b/pkgs/build-support/setup-hooks/wrap-gapps-hook.sh
@@ -0,0 +1,33 @@
+gappsWrapperArgs=()
+
+wrapGAppsHook() {
+  if [ -n "$GDK_PIXBUF_MODULE_FILE" ]; then
+    gappsWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE")
+  fi
+
+  if [ -n "$XDG_ICON_DIRS" ]; then
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS")
+  fi
+
+  if [ -n "$GSETTINGS_SCHEMAS_PATH" ]; then
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH")
+  fi
+
+  if [ -d "$prefix/share" ]; then
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "$out/share")
+  fi
+
+  for v in $wrapPrefixVariables GST_PLUGIN_SYSTEM_PATH_1_0 GI_TYPELIB_PATH GRL_PLUGIN_PATH; do
+    eval local dummy="\$$v"
+    gappsWrapperArgs+=(--prefix $v : "$dummy")
+  done
+
+  if [ -z "$dontWrapGApps" ]; then
+    for i in $prefix/bin/* $prefix/libexec/*; do
+      echo "Wrapping app $i"
+      wrapProgram "$i" "${gappsWrapperArgs[@]}"
+    done
+  fi
+}
+
+fixupOutputHooks+=(wrapGAppsHook)
diff --git a/pkgs/data/documentation/man-pages/default.nix b/pkgs/data/documentation/man-pages/default.nix
index 14cd41adbec0..71fca096c58c 100644
--- a/pkgs/data/documentation/man-pages/default.nix
+++ b/pkgs/data/documentation/man-pages/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
-let version = "4.00"; in
+let version = "4.01"; in
 stdenv.mkDerivation rec {
   name = "man-pages-${version}";
 
   src = fetchurl {
     url = "mirror://kernel/linux/docs/man-pages/${name}.tar.xz";
-    sha256 = "18zb1g12s15sanffh0sykmmyx0j176pp7q1xxs0gk0imgvmn8hj4";
+    sha256 = "116jp2rnsdlnb3cwnbfp0g053frcmchndwyrj714swl1lgabb56i";
   };
 
   makeFlags = "MANDIR=$(out)/share/man";
diff --git a/pkgs/data/fonts/dejavu-fonts/default.nix b/pkgs/data/fonts/dejavu-fonts/default.nix
index 21028ee0b32a..728cb4445399 100644
--- a/pkgs/data/fonts/dejavu-fonts/default.nix
+++ b/pkgs/data/fonts/dejavu-fonts/default.nix
@@ -30,13 +30,11 @@ stdenv.mkDerivation rec {
     ln -s ${unicodeData} resources/UnicodeData.txt
     ln -s ${blocks} resources/Blocks.txt
   '';
-  installPhase = '' 
+  installPhase = ''
     mkdir -p $out/share/fonts/truetype
-    for i in $(find build -name '*.ttf'); do 
-        cp $i $out/share/fonts/truetype; 
+    for i in $(find build -name '*.ttf'); do
+        cp $i $out/share/fonts/truetype;
     done;
-    mkdir -p $out/share/dejavu-fonts
-    cp -r build/* $out/share/dejavu-fonts
   '';
 }
-  
+
diff --git a/pkgs/data/fonts/font-awesome-ttf/default.nix b/pkgs/data/fonts/font-awesome-ttf/default.nix
index 7e07ec8a37c3..ed91713d03ad 100644
--- a/pkgs/data/fonts/font-awesome-ttf/default.nix
+++ b/pkgs/data/fonts/font-awesome-ttf/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://fortawesome.github.io/Font-Awesome/assets/${name}.zip";
-    sha256 = "018syfvkj01jym60mpys93xv84ky9l2x90gprnm9npzwkw5169jc";
+    sha256 = "0wg9q6mq026jjw1bsyj9b5dgba7bb4h7i9xiwgsfckd412xpsbzd";
   };
 
   buildCommand = ''
diff --git a/pkgs/data/fonts/pecita/default.nix b/pkgs/data/fonts/pecita/default.nix
index d83d9afcdfdd..a64512af8459 100644
--- a/pkgs/data/fonts/pecita/default.nix
+++ b/pkgs/data/fonts/pecita/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "pecita-${version}";
-  version = "1.1";
+  version = "5.0";
 
   src = fetchurl {
     url = "http://pecita.eu/b/Pecita.otf";
-    sha256 = "07krzpbmc5yhfbf3aklv1f150i2g1spaan9girmg3189jsn6qw6p";
+    sha256 = "1smf1mqciwavf29lwgzjam3xb37bwxp6wf6na4c9xv6islidsrd9";
   };
 
   phases = ["installPhase"];
diff --git a/pkgs/data/misc/geolite-legacy/default.nix b/pkgs/data/misc/geolite-legacy/default.nix
index ae7b344ff0e7..df9458903d36 100644
--- a/pkgs/data/misc/geolite-legacy/default.nix
+++ b/pkgs/data/misc/geolite-legacy/default.nix
@@ -1,29 +1,35 @@
 { stdenv, fetchurl }:
 
 let
-  fetchDB = name: sha256: fetchurl {
-    inherit sha256;
-    url = "https://geolite.maxmind.com/download/geoip/database/${name}";
+  fetchDB = src: name: sha256: fetchurl {
+    inherit name sha256;
+    url = "https://geolite.maxmind.com/download/geoip/database/${src}";
   };
 
   # Annoyingly, these files are updated without a change in URL. This means that
   # builds will start failing every month or so, until the hashes are updated.
-  version = "2015-07-08";
+  version = "2015-07-25";
 in
 stdenv.mkDerivation {
   name = "geolite-legacy-${version}";
 
-  srcGeoIP = fetchDB "GeoLiteCountry/GeoIP.dat.gz"
-    "0c6jcmlgkybsqiwqwa21igjazf95dj38mn516cqqqfdg7ciaj1d5";
-  srcGeoIPv6 = fetchDB "GeoIPv6.dat.gz"
-    "1vi82p41vas18yp17yk236pn1xamsi9662aav79fa0hm43i3ydx3";
-  srcGeoLiteCity = fetchDB "GeoLiteCity.dat.xz"
+  srcGeoIP = fetchDB
+    "GeoLiteCountry/GeoIP.dat.gz" "GeoIP.dat.gz"
+    "1yacbh8qcakmnpipscdh99vmsm0874g2gkq8gp8hjgkgi0zvcsnz";
+  srcGeoIPv6 = fetchDB
+    "GeoIPv6.dat.gz" "GeoIPv6.dat.gz"
+    "038ll8142svhyffxxrg0isrr16rjbz0cnkhd14mck77f1v8z01y5";
+  srcGeoLiteCity = fetchDB
+    "GeoLiteCity.dat.xz" "GeoIPCity.dat.xz"
     "0x5ihg7qikzc195nix9r0izvbdnj4hy4rznvaxk56rf8yqcigdyv";
-  srcGeoLiteCityv6 = fetchDB "GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz"
-    "0xjzg76vdsayxyy1yyw64w781vad4c9nbhw61slh2qmazdr360g9";
-  srcGeoIPASNum = fetchDB "asnum/GeoIPASNum.dat.gz"
+  srcGeoLiteCityv6 = fetchDB
+    "GeoLiteCityv6-beta/GeoLiteCityv6.dat.gz" "GeoIPCityv6.dat.gz"
+    "0j5dq06pjrh6d94wczsg6qdys4v164nvp2a7qqrg8w4knh94qp6n";
+  srcGeoIPASNum = fetchDB
+    "asnum/GeoIPASNum.dat.gz" "GeoIPASNum.dat.gz"
     "18kxswr0b5klimfpj1zhxipvyvrljvcywic4jc1ggcr44lf4hj9w";
-  srcGeoIPASNumv6 = fetchDB "asnum/GeoIPASNumv6.dat.gz"
+  srcGeoIPASNumv6 = fetchDB
+    "asnum/GeoIPASNumv6.dat.gz" "GeoIPASNumv6.dat.gz"
     "0asnmmirridiy57zm0kccb7g8h7ndliswfv3yfk7zm7dk98njnxs";
 
   meta = with stdenv.lib; {
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
index 315f6ff9c5a9..dd7e269f94e5 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
@@ -11,6 +11,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig intltool iconnamingutils gtk ];
 
+  # remove a tree of dirs with no files within
+  postInstall = '' rm -r "$out/share/locale" '';
+
   meta = {
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/desktops/gnome-3/3.16/apps/file-roller/default.nix b/pkgs/desktops/gnome-3/3.16/apps/file-roller/default.nix
index d36162e13c2a..926464ff7be4 100644
--- a/pkgs/desktops/gnome-3/3.16/apps/file-roller/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/apps/file-roller/default.nix
@@ -1,5 +1,6 @@
-{ stdenv, fetchurl, glib, pkgconfig, gnome3, intltool, itstool, libxml2, libarchive
-, attr, bzip2, acl, makeWrapper, librsvg, gdk_pixbuf, hicolor_icon_theme }:
+{ stdenv, fetchurl, glib, pkgconfig, gnome3, intltool, itstool, libxml2
+, libarchive, attr, bzip2, acl, makeWrapper, librsvg, gdk_pixbuf
+, hicolor_icon_theme, openssl }:
 
 stdenv.mkDerivation rec {
   name = "file-roller-${version}";
@@ -16,7 +17,7 @@ stdenv.mkDerivation rec {
   # it tries to create {nautilus}/lib/nautilus/extensions-3.0/libnautilus-fileroller.so
 
   buildInputs = [ glib pkgconfig gnome3.gtk intltool itstool libxml2 libarchive
-                  hicolor_icon_theme gnome3.adwaita-icon-theme
+                  hicolor_icon_theme gnome3.adwaita-icon-theme openssl
                   attr bzip2 acl gdk_pixbuf librsvg makeWrapper ];
 
   preFixup = ''
diff --git a/pkgs/desktops/gnome-3/3.16/apps/gnome-clocks/default.nix b/pkgs/desktops/gnome-3/3.16/apps/gnome-clocks/default.nix
index 8bdfcfd9f887..b1a57b9e68d4 100644
--- a/pkgs/desktops/gnome-3/3.16/apps/gnome-clocks/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/apps/gnome-clocks/default.nix
@@ -1,7 +1,7 @@
 { stdenv, intltool, fetchurl, libgweather, libnotify
 , pkgconfig, gtk3, glib, hicolor_icon_theme, gsound
 , makeWrapper, itstool, libcanberra_gtk3, libtool
-, gnome3, librsvg, gdk_pixbuf, geoclue2 }:
+, gnome3, librsvg, gdk_pixbuf, geoclue2, wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
   name = "gnome-clocks-${gnome3.version}.1";
@@ -13,23 +13,15 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  propagatedUserEnvPkgs = [ gnome3.gnome_themes_standard ];
-
   buildInputs = [ pkgconfig gtk3 glib intltool itstool libcanberra_gtk3
                   gnome3.gsettings_desktop_schemas makeWrapper
                   gdk_pixbuf gnome3.adwaita-icon-theme librsvg
                   gnome3.gnome_desktop gnome3.geocode_glib geoclue2
                   libgweather libnotify libtool gsound
-                  hicolor_icon_theme gnome3.adwaita-icon-theme ];
+                  hicolor_icon_theme wrapGAppsHook ];
 
   enableParallelBuilding = true;
 
-  preFixup = ''
-    wrapProgram "$out/bin/gnome-clocks" \
-      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
-      --prefix XDG_DATA_DIRS : "${gnome3.gnome_themes_standard}/share:$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
-  '';
-
   meta = with stdenv.lib; {
     homepage = https://wiki.gnome.org/Apps/Clocks;
     description = "Clock application designed for GNOME 3";
diff --git a/pkgs/desktops/gnome-3/3.16/apps/gnome-documents/default.nix b/pkgs/desktops/gnome-3/3.16/apps/gnome-documents/default.nix
index 50fff0cd1d2e..7ca61f92d8a0 100644
--- a/pkgs/desktops/gnome-3/3.16/apps/gnome-documents/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/apps/gnome-documents/default.nix
@@ -3,7 +3,7 @@
 , makeWrapper, itstool, libxslt, webkitgtk
 , gnome3, librsvg, gdk_pixbuf, libsoup, docbook_xsl
 , gobjectIntrospection, json_glib
-, gmp, desktop_file_utils }:
+, gmp, desktop_file_utils, wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
   name = "gnome-documents-${gnome3.version}.0";
@@ -24,21 +24,14 @@ stdenv.mkDerivation rec {
                   libsoup webkitgtk gjs gobjectIntrospection gnome3.rest
                   gnome3.tracker gnome3.libgdata gnome3.gnome_online_accounts
                   gnome3.gnome_desktop gnome3.libzapojit json_glib
-                  hicolor_icon_theme gnome3.adwaita-icon-theme ];
+                  wrapGAppsHook ];
 
   enableParallelBuilding = true;
 
-  preFixup =
-    ''
+  preFixup = ''
     substituteInPlace $out/bin/gnome-documents --replace gapplication "${glib}/bin/gapplication"
 
-    for f in $out/bin/* $out/libexec/*; do
-      wrapProgram "$f" \
-        --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
-        --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-        --prefix XDG_DATA_DIRS : "${gnome3.gnome_themes_standard}/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
-        --run "if [ -z \"\$XDG_CACHE_DIR\" ]; then XDG_CACHE_DIR=\$HOME/.cache; fi; if [ -w \"\$XDG_CACHE_DIR/..\" ]; then mkdir -p \"\$XDG_CACHE_DIR/gnome-documents\"; fi"
-    done
+    gappsWrapperArgs+=(--run 'if [ -z "$XDG_CACHE_DIR" ]; then XDG_CACHE_DIR=$HOME/.cache; fi; if [ -w "$XDG_CACHE_DIR/.." ]; then mkdir -p "$XDG_CACHE_DIR/gnome-documents"; fi')
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/desktops/gnome-3/3.16/apps/gnome-music/default.nix b/pkgs/desktops/gnome-3/3.16/apps/gnome-music/default.nix
index 31ee8a7230c1..4cb466fa482b 100644
--- a/pkgs/desktops/gnome-3/3.16/apps/gnome-music/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/apps/gnome-music/default.nix
@@ -1,5 +1,5 @@
 { stdenv, intltool, fetchurl, gdk_pixbuf, tracker
-, python3, libxml2, python3Packages, libnotify
+, python3, libxml2, python3Packages, libnotify, wrapGAppsHook
 , pkgconfig, gtk3, glib, hicolor_icon_theme, cairo
 , makeWrapper, itstool, gnome3, librsvg, gst_all_1 }:
 
@@ -15,24 +15,16 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig gtk3 glib intltool itstool gnome3.libmediaart
                   gdk_pixbuf gnome3.adwaita-icon-theme librsvg python3
-                  gnome3.grilo libxml2 python3Packages.pygobject3 libnotify
+                  gnome3.grilo gnome3.grilo-plugins libxml2 python3Packages.pygobject3 libnotify
                   python3Packages.pycairo python3Packages.dbus gnome3.totem-pl-parser
                   gst_all_1.gstreamer gst_all_1.gst-plugins-base
                   gst_all_1.gst-plugins-good gst_all_1.gst-plugins-bad
-                  hicolor_icon_theme gnome3.adwaita-icon-theme
+                  hicolor_icon_theme gnome3.adwaita-icon-theme wrapGAppsHook
                   gnome3.gsettings_desktop_schemas makeWrapper tracker ];
 
-  enableParallelBuilding = true;
+  wrapPrefixVariables = [ "PYTHONPATH" ];
 
-  preFixup = ''
-    wrapProgram "$out/bin/gnome-music" \
-      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
-      --prefix XDG_DATA_DIRS : "${gnome3.gnome_themes_standard}/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH" \
-      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
-      --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0" \
-      --prefix GRL_PLUGIN_PATH : "${gnome3.grilo-plugins}/lib/grilo-0.2" \
-      --prefix PYTHONPATH : "$PYTHONPATH"
-  '';
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     homepage = https://wiki.gnome.org/Apps/Music;
diff --git a/pkgs/desktops/gnome-3/3.16/apps/gnome-photos/default.nix b/pkgs/desktops/gnome-3/3.16/apps/gnome-photos/default.nix
index fba1a541812c..6d9598ee3691 100644
--- a/pkgs/desktops/gnome-3/3.16/apps/gnome-photos/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/apps/gnome-photos/default.nix
@@ -1,7 +1,7 @@
 { stdenv, intltool, fetchurl, exempi, libxml2
 , pkgconfig, gtk3, glib, hicolor_icon_theme
 , makeWrapper, itstool, gegl, babl, lcms2
-, desktop_file_utils, gmp, libmediaart
+, desktop_file_utils, gmp, libmediaart, wrapGAppsHook
 , gnome3, librsvg, gdk_pixbuf, libexif }:
 
 stdenv.mkDerivation rec {
@@ -14,8 +14,6 @@ stdenv.mkDerivation rec {
 
   # doCheck = true;
 
-  propagatedUserEnvPkgs = [ gnome3.gnome_themes_standard ];
-
   NIX_CFLAGS_COMPILE = "-I${gnome3.glib}/include/gio-unix-2.0";
 
   buildInputs = [ pkgconfig gtk3 glib intltool itstool gegl babl gnome3.libgdata
@@ -24,16 +22,7 @@ stdenv.mkDerivation rec {
                   gnome3.gfbgraph gnome3.grilo-plugins gnome3.grilo
                   gnome3.gnome_online_accounts gnome3.gnome_desktop
                   lcms2 libexif gnome3.tracker libxml2 desktop_file_utils
-                  hicolor_icon_theme gnome3.adwaita-icon-theme ];
-
-  preFixup = ''
-    for f in $out/bin/* $out/libexec/*; do
-      wrapProgram "$f" \
-        --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
-        --prefix GRL_PLUGIN_PATH : "${gnome3.grilo-plugins}/lib/grilo-0.2" \
-        --prefix XDG_DATA_DIRS : "${gnome3.gnome_themes_standard}/share:$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
-    done
-  '';
+                  wrapGAppsHook ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/desktops/gnome-3/3.16/core/adwaita-icon-theme/default.nix b/pkgs/desktops/gnome-3/3.16/core/adwaita-icon-theme/default.nix
index a445ff73608b..eb210f1bb5bd 100644
--- a/pkgs/desktops/gnome-3/3.16/core/adwaita-icon-theme/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/adwaita-icon-theme/default.nix
@@ -13,9 +13,12 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ hicolor_icon_theme ];
 
   buildInputs = [ gdk_pixbuf librsvg ];
-  
+
   nativeBuildInputs = [ pkgconfig intltool iconnamingutils gtk ];
 
+  # remove a tree of dirs with no files within
+  postInstall = '' rm -r "$out/locale" '';
+
   meta = with stdenv.lib; {
     platforms = platforms.linux;
     maintainers = [ maintainers.lethalman ];
diff --git a/pkgs/desktops/gnome-3/3.16/core/gnome-online-accounts/default.nix b/pkgs/desktops/gnome-3/3.16/core/gnome-online-accounts/default.nix
index 8e0c17096420..0040b03b36ae 100644
--- a/pkgs/desktops/gnome-3/3.16/core/gnome-online-accounts/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/gnome-online-accounts/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, glib, libxslt, gtk, makeWrapper
 , webkitgtk, json_glib, rest, libsecret, dbus_glib, gnome_common
 , telepathy_glib, intltool, dbus_libs, icu, autoreconfHook
-, libsoup, docbook_xsl_ns, docbook_xsl, gnome3
+, libsoup, docbook_xsl_ns, docbook_xsl, gnome3, hicolor_icon_theme
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig glib libxslt gtk webkitgtk json_glib rest gnome_common makeWrapper
                   libsecret dbus_glib telepathy_glib intltool icu libsoup autoreconfHook
-                  docbook_xsl_ns docbook_xsl ];
+                  docbook_xsl_ns docbook_xsl hicolor_icon_theme ];
 
   preFixup = ''
     for f in "$out/libexec/"*; do
diff --git a/pkgs/desktops/gnome-3/3.16/core/gnome-session/default.nix b/pkgs/desktops/gnome-3/3.16/core/gnome-session/default.nix
index 63fea43baedf..7bb769df2e94 100644
--- a/pkgs/desktops/gnome-3/3.16/core/gnome-session/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/gnome-session/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, pkgconfig, gnome3, glib, dbus_glib, json_glib, upower
-, libxslt, intltool, makeWrapper, systemd, xorg }:
+, libxslt, intltool, makeWrapper, systemd, xorg, hicolor_icon_theme }:
 
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = with gnome3;
     [ pkgconfig glib gnome_desktop gtk dbus_glib json_glib libxslt 
-      gnome3.gnome_settings_daemon xorg.xtrans
+      gnome3.gnome_settings_daemon xorg.xtrans hicolor_icon_theme
       gsettings_desktop_schemas upower intltool gconf makeWrapper systemd ];
 
   preFixup = ''
diff --git a/pkgs/desktops/gnome-3/3.16/core/gnome-themes-standard/default.nix b/pkgs/desktops/gnome-3/3.16/core/gnome-themes-standard/default.nix
index 6e98b9817c1e..48ea2809bcf5 100644
--- a/pkgs/desktops/gnome-3/3.16/core/gnome-themes-standard/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/gnome-themes-standard/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, intltool, gtk3, gnome3, librsvg, pkgconfig, pango, atk, gtk2, gdk_pixbuf }:
+{ stdenv, fetchurl, intltool, gtk3, gnome3, librsvg, pkgconfig, pango, atk, gtk2
+, gdk_pixbuf, hicolor_icon_theme }:
 
 stdenv.mkDerivation rec {
   name = "gnome-themes-standard-${gnome3.version}.0";
@@ -7,7 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "0kyrbfrgl6g6wm6zpllldz36fclvl8vwmn1snwk18kf7f6ncpsac";
   };
   
-  buildInputs = [ intltool gtk3 librsvg pkgconfig pango atk gtk2 gdk_pixbuf ];
+  buildInputs = [ intltool gtk3 librsvg pkgconfig pango atk gtk2 gdk_pixbuf
+                  hicolor_icon_theme ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/desktops/gnome-3/3.16/core/grilo/default.nix b/pkgs/desktops/gnome-3/3.16/core/grilo/default.nix
index a9be29f2b0ed..18551aae8b9e 100644
--- a/pkgs/desktops/gnome-3/3.16/core/grilo/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/grilo/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "11bvc7rsrjjwz8hp67p3fn8zmywrpawrcbi3vgw8b0dwa0sndd2m";
   };
 
+  setupHook = ./setup-hook.sh;
+
   configureFlags = [ "--enable-grl-pls" "--enable-grl-net" ];
 
   preConfigure = ''
diff --git a/pkgs/desktops/gnome-3/3.16/core/grilo/setup-hook.sh b/pkgs/desktops/gnome-3/3.16/core/grilo/setup-hook.sh
new file mode 100644
index 000000000000..bc93dddec386
--- /dev/null
+++ b/pkgs/desktops/gnome-3/3.16/core/grilo/setup-hook.sh
@@ -0,0 +1,7 @@
+make_grilo_find_plugins() {
+    if [ -d "$1"/lib/grilo-0.2 ]; then
+        addToSearchPath GRL_PLUGIN_PATH "$1/lib/grilo-0.2"
+    fi
+}
+
+envHooks+=(make_grilo_find_plugins)
diff --git a/pkgs/desktops/gnome-3/3.16/core/libpeas/default.nix b/pkgs/desktops/gnome-3/3.16/core/libpeas/default.nix
index e59d81f3c1d4..2b5b5f308ab4 100644
--- a/pkgs/desktops/gnome-3/3.16/core/libpeas/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/libpeas/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, intltool
-, glib, gtk3, gobjectIntrospection, python, pygobject3
+, glib, gtk3, gobjectIntrospection, python, pygobject3, hicolor_icon_theme
 }:
 
 let
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs =  [
    intltool pkgconfig
-   glib gtk3 gobjectIntrospection python pygobject3
+   glib gtk3 gobjectIntrospection python pygobject3 hicolor_icon_theme
   ];
 
   src = fetchurl {
diff --git a/pkgs/desktops/gnome-3/3.16/default.nix b/pkgs/desktops/gnome-3/3.16/default.nix
index cc825f0cc6c5..ee56b6211c8f 100644
--- a/pkgs/desktops/gnome-3/3.16/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/default.nix
@@ -20,20 +20,24 @@ let
     gtk3 # for gtk-update-icon-cache
     glib_networking gvfs dconf gnome-backgrounds gnome_control_center
     gnome-menus gnome_settings_daemon gnome_shell
-    gnome_themes_standard defaultIconTheme
+    gnome_themes_standard defaultIconTheme gnome-shell-extensions
+    pkgs.hicolor_icon_theme
   ];
 
   optionalPackages = with gnome3; [ baobab empathy eog epiphany evince
     gucharmap nautilus totem vino yelp gnome-bluetooth
     gnome-calculator gnome-contacts gnome-font-viewer gnome-screenshot
-    gnome-shell-extensions gnome-system-log gnome-system-monitor
+    gnome-system-log gnome-system-monitor
     gnome_terminal gnome-user-docs bijiben evolution file-roller gedit
     gnome-clocks gnome-music gnome-tweak-tool gnome-photos
     nautilus-sendto dconf-editor vinagre
   ];
 
-  inherit (pkgs) libsoup glib gtk2 webkitgtk24x gtk3 gtkmm3 libcanberra;
+  gamesPackages = with gnome3; [ swell-foop lightsoff iagno ];
+
+  inherit (pkgs) glib gtk2 webkitgtk24x gtk3 gtkmm3 libcanberra;
   inherit (pkgs.gnome2) ORBit2;
+  libsoup = pkgs.libsoup.override { gnomeSupport = true; };
   orbit = ORBit2;
   gnome3 = self // { recurseForDerivations = false; };
   clutter = pkgs.clutter_1_22;
@@ -279,6 +283,14 @@ let
 
   gdl = callPackage ./devtools/gdl { };
 
+#### Games
+
+  iagno = callPackage ./games/iagno { };
+
+  lightsoff = callPackage ./games/lightsoff { };
+
+  swell-foop = callPackage ./games/swell-foop { };
+
 #### Misc -- other packages on http://ftp.gnome.org/pub/GNOME/sources/
 
   california = callPackage ./misc/california { };
diff --git a/pkgs/desktops/gnome-3/3.16/games/iagno/default.nix b/pkgs/desktops/gnome-3/3.16/games/iagno/default.nix
new file mode 100644
index 000000000000..90d31eaa5cf0
--- /dev/null
+++ b/pkgs/desktops/gnome-3/3.16/games/iagno/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, gtk3, gnome3, gdk_pixbuf, librsvg, makeWrapper
+, intltool, itstool, libcanberra_gtk3, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "iagno-${gnome3.version}.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/iagno/${gnome3.version}/${name}.tar.xz";
+    sha256 = "0pg4sx277idfab3qxxn8c7r6gpdsdw5br0x7fxhxqascvvx8my1k";
+  };
+
+  buildInputs = [ pkgconfig gtk3 gnome3.defaultIconTheme gdk_pixbuf librsvg
+                  libxml2 libcanberra_gtk3 makeWrapper itstool intltool ];
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    wrapProgram "$out/bin/iagno" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:$out/share" \
+      --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://wiki.gnome.org/Apps/Iagno;
+    description = "Computer version of the game Reversi, more popularly called Othello";
+    maintainers = with maintainers; [ lethalman ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/gnome-3/3.16/games/lightsoff/default.nix b/pkgs/desktops/gnome-3/3.16/games/lightsoff/default.nix
new file mode 100644
index 000000000000..e24f90812c0b
--- /dev/null
+++ b/pkgs/desktops/gnome-3/3.16/games/lightsoff/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, gtk3, gnome3, gdk_pixbuf, librsvg, makeWrapper
+, intltool, itstool, clutter, clutter_gtk, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "lightsoff-${gnome3.version}.1.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/lightsoff/${gnome3.version}/${name}.tar.xz";
+    sha256 = "00a2jv7wr6fxrzk7avwa0wspz429ad7ri7v95jv31nqn5q73y4c0";
+  };
+
+  buildInputs = [ pkgconfig gtk3 gnome3.defaultIconTheme gdk_pixbuf librsvg
+                  libxml2 clutter clutter_gtk makeWrapper itstool intltool ];
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    wrapProgram "$out/bin/lightsoff" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:$out/share" \
+      --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://wiki.gnome.org/Apps/Lightsoff;
+    description = "Puzzle game, where the objective is to turn off all of the tiles on the board";
+    maintainers = with maintainers; [ lethalman ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/gnome-3/3.16/games/swell-foop/default.nix b/pkgs/desktops/gnome-3/3.16/games/swell-foop/default.nix
new file mode 100644
index 000000000000..4afe66ee5450
--- /dev/null
+++ b/pkgs/desktops/gnome-3/3.16/games/swell-foop/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, gtk3, gnome3, gdk_pixbuf, librsvg, makeWrapper
+, clutter, clutter_gtk, intltool, itstool, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "swell-foop-${gnome3.version}.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/swell-foop/${gnome3.version}/${name}.tar.xz";
+    sha256 = "0bhjmjcjsqdb89shs0ygi6ps5hb3lk8nhrbjnsjk4clfqbw0jzwf";
+  };
+
+  buildInputs = [ pkgconfig gtk3 gnome3.defaultIconTheme gdk_pixbuf librsvg
+                  makeWrapper itstool intltool clutter clutter_gtk libxml2 ];
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    wrapProgram "$out/bin/swell-foop" \
+      --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
+      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH:$out/share" \
+      --prefix GIO_EXTRA_MODULES : "${gnome3.dconf}/lib/gio/modules"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://wiki.gnome.org/Apps/Swell%20Foop";
+    description = "Puzzle game, previously known as Same GNOME";
+    maintainers = with maintainers; [ lethalman ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/kde-4.14/kde-workspace.nix b/pkgs/desktops/kde-4.14/kde-workspace.nix
index c3af4f714427..75863e1fe99b 100644
--- a/pkgs/desktops/kde-4.14/kde-workspace.nix
+++ b/pkgs/desktops/kde-4.14/kde-workspace.nix
@@ -13,7 +13,7 @@ kde {
       xorg.libxkbfile xorg.libXcomposite  xorg.libXtst
       xorg.libXdamage xorg.libXft
 
-      python boost qjson lm_sensors gpsd libraw1394 pciutils udev
+      python boost qjson lm_sensors /* gpsd */ libraw1394 pciutils udev
       akonadi pam libusb1 libqalculate kdepimlibs  prison
       kactivities
     ];
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 9069387762fd..cf67d880a2cf 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -61,7 +61,10 @@ let version = "4.9.3";
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
-    enableParallelBuilding = true;
+    # Builds of gfortran have failed with strange errors that we cannot reproduce
+    # (http://hydra.nixos.org/build/23951123). Our best guess is that the build
+    # system has bugs that are exposed by compiling with multiple threads.
+    enableParallelBuilding = !langFortran;
 
     patches = [ ]
       ++ optional enableParallelBuilding ../parallel-bconfig.patch
diff --git a/pkgs/development/compilers/ghc/nokinds.nix b/pkgs/development/compilers/ghc/nokinds.nix
index 1adb4207f059..98e18706a16c 100644
--- a/pkgs/development/compilers/ghc/nokinds.nix
+++ b/pkgs/development/compilers/ghc/nokinds.nix
@@ -27,14 +27,14 @@ let
 in
 
 stdenv.mkDerivation rec {
-  version = "7.11.20150703";
+  version = "7.11.20150718";
   name = "ghc-nokinds-${version}";
-  rev = "887170ac254aaacc2d5e29f2565ac61522fd8f61";
+  rev = "4cb79c85a4976c509a65a8638899391a60cd0962";
 
   src = fetchgit {
     url = "https://github.com/goldfirere/ghc.git";
     inherit rev;
-    sha256 = "010x9ckig76sz97s2ss1j1sf70czqx1cn39nj4xbh49m8n2zvsqf";
+    sha256 = "1pyz459hs189bw2jaz7k2j2r53nc1vfa4q3zd3zz1zm0h14lsmlv";
   };
 
   postUnpack = ''
diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix
index d9c9f91df6a1..41c7a476b27b 100644
--- a/pkgs/development/compilers/haxe/default.nix
+++ b/pkgs/development/compilers/haxe/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchgit, ocaml, zlib, neko }:
+{ stdenv, fetchgit, ocaml, zlib, neko, camlp4 }:
 
 stdenv.mkDerivation {
   name = "haxe-3.1.3";
 
-  buildInputs = [ocaml zlib neko];
+  buildInputs = [ocaml zlib neko camlp4];
 
   src = fetchgit {
     url = "https://github.com/HaxeFoundation/haxe.git";
diff --git a/pkgs/development/compilers/llvm/3.6/clang/default.nix b/pkgs/development/compilers/llvm/3.6/clang/default.nix
index 93c45c4efb46..2827e0739030 100644
--- a/pkgs/development/compilers/llvm/3.6/clang/default.nix
+++ b/pkgs/development/compilers/llvm/3.6/clang/default.nix
@@ -6,7 +6,7 @@ in stdenv.mkDerivation {
   name = "clang-${version}";
 
   unpackPhase = ''
-    unpackFile ${fetch "cfe" "1myssbxlyln0nggfz04nfrbzdckljksmaxp82nq7hrmqjc62vybl"}
+    unpackFile ${fetch "cfe" "1wwr8s6lzr324hv4s1k6na4j5zv6n9kdhi14s4kb9b13d93814df"}
     mv cfe-${version}.src clang
     sourceRoot=$PWD/clang
     unpackFile ${clang-tools-extra_src}
diff --git a/pkgs/development/compilers/llvm/3.6/default.nix b/pkgs/development/compilers/llvm/3.6/default.nix
index d95ffe473262..c99070ba383f 100644
--- a/pkgs/development/compilers/llvm/3.6/default.nix
+++ b/pkgs/development/compilers/llvm/3.6/default.nix
@@ -1,8 +1,8 @@
-{ pkgs, newScope, stdenv, isl, fetchurl, overrideCC, wrapCC }:
+{ newScope, stdenv, isl, fetchurl, overrideCC, wrapCC }:
 let
   callPackage = newScope (self // { inherit stdenv isl version fetch; });
 
-  version = "3.6.1";
+  version = "3.6.2";
 
   fetch = fetch_v version;
   fetch_v = ver: name: sha256: fetchurl {
@@ -10,8 +10,8 @@ let
     inherit sha256;
   };
 
-  compiler-rt_src = fetch "compiler-rt" "17v4gf4y5krgkrd12r95hfxbw5q4c4jlf3513kqlfq5yfw663gzw";
-  clang-tools-extra_src = fetch "clang-tools-extra" "1dljzdk2jmrwyh8z92rljxl9wzdggp74i9f6g8aajl6mf3c71vpl";
+  compiler-rt_src = fetch "compiler-rt" "11qx8d3pbfqjaj2x207pvlvzihbs1z2xbw4crpz7aid6h1yz6bqg";
+  clang-tools-extra_src = fetch "clang-tools-extra" "1ssgs1108gnsggyx9wcl4hmq196f5ix0y1j7ygfh3xcqsckwc3ka";
 
   self = {
     llvm = callPackage ./llvm.nix {
diff --git a/pkgs/development/compilers/llvm/3.6/libc++/default.nix b/pkgs/development/compilers/llvm/3.6/libc++/default.nix
index d83ca83bbae8..81c1d96afc89 100644
--- a/pkgs/development/compilers/llvm/3.6/libc++/default.nix
+++ b/pkgs/development/compilers/llvm/3.6/libc++/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libc++-${version}";
 
-  src = fetch "libcxx" "1yf0ns4cvvirp1ml5a8h29lysnw5c23715b09x68v5zkxhxnap2s";
+  src = fetch "libcxx" "10cbgi1nfksjrlgvbsx8pkcqxsgkszdqy5cj2zgwj2c2yi9d9wsj";
 
   # instead of allowing libc++ to link with /usr/lib/libc++abi.dylib,
   # force it to link with our copy
diff --git a/pkgs/development/compilers/llvm/3.6/libc++abi.nix b/pkgs/development/compilers/llvm/3.6/libc++abi.nix
index 53a01c95c8a7..8979ce314c89 100644
--- a/pkgs/development/compilers/llvm/3.6/libc++abi.nix
+++ b/pkgs/development/compilers/llvm/3.6/libc++abi.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "libc++abi-${version}";
 
-  src = fetch "libcxxabi" "0pgimy1b5vj4favzdz2830n917fyz65hm3khdgkbgnfs43s8g0xw";
+  src = fetch "libcxxabi" "16xh54rlnbip4f2bwwbdm1sd6bkqky35jgp7fndnns0llpjqrd3g";
 
   buildInputs = [ cmake ] ++ stdenv.lib.optional (!stdenv.isDarwin) libunwind;
 
diff --git a/pkgs/development/compilers/llvm/3.6/lldb.nix b/pkgs/development/compilers/llvm/3.6/lldb.nix
index 334810917fa8..cee99bbbdea6 100644
--- a/pkgs/development/compilers/llvm/3.6/lldb.nix
+++ b/pkgs/development/compilers/llvm/3.6/lldb.nix
@@ -15,7 +15,7 @@
 stdenv.mkDerivation {
   name = "lldb-${version}";
 
-  src = fetch "lldb" "1fmaz7zcc1f54ns4x8rx9nvhh4pyrhbz103bl02sv1cfwxj5ryyf";
+  src = fetch "lldb" "1a93cpmlcnpyglgcyfjb3n7c33683wfhwzn36azpv6wicimwj3cl";
 
   patchPhase = ''
     sed -i 's|/usr/bin/env||' \
diff --git a/pkgs/development/compilers/llvm/3.6/llvm.nix b/pkgs/development/compilers/llvm/3.6/llvm.nix
index 2d6f29aacea0..d757b9314c35 100644
--- a/pkgs/development/compilers/llvm/3.6/llvm.nix
+++ b/pkgs/development/compilers/llvm/3.6/llvm.nix
@@ -15,7 +15,7 @@
 }:
 
 let
-  src = fetch "llvm" "0ypwcqrld91jn0zz4mkdksl2mbb0ds9lh5gf0xkbb81sj4awc01g";
+  src = fetch "llvm" "153vcvj8gvgwakzr4j0kndc0b7wn91c2g1vy2vg24s6spxcc23gn";
 in stdenv.mkDerivation rec {
   name = "llvm-${version}";
 
diff --git a/pkgs/development/compilers/mezzo/default.nix b/pkgs/development/compilers/mezzo/default.nix
index 183640f5985d..a0fe441b1538 100644
--- a/pkgs/development/compilers/mezzo/default.nix
+++ b/pkgs/development/compilers/mezzo/default.nix
@@ -1,16 +1,30 @@
-{stdenv, fetchurl, ocaml, findlib, menhir, yojson, ulex, pprint, fix, functory}:
+{ stdenv, fetchFromGitHub, ocaml, findlib, menhir, yojson, ulex, pprint, fix, functory }:
+
+let
+  check-ocaml-version = with stdenv.lib; versionAtLeast (getVersion ocaml);
+in
+
+assert check-ocaml-version "4";
 
 stdenv.mkDerivation {
 
   name = "mezzo-0.0.m8";
 
-  src = fetchurl {
-    url = https://github.com/protz/mezzo/archive/m8.tar.gz;
-    sha256 = "17mfapgqp8ssa5x9blv72zg9l561zbiwv3ikwi6nl9dd36lwkkc6";
+  src = fetchFromGitHub {
+    owner = "protz";
+    repo = "mezzo";
+    rev = "m8";
+    sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
   };
 
   buildInputs = [ ocaml findlib yojson menhir ulex pprint fix functory ];
 
+  # Sets warning 3 as non-fatal
+  prePatch = stdenv.lib.optionalString (check-ocaml-version "4.02") ''
+    substituteInPlace myocamlbuild.pre.ml \
+    --replace '@1..3' '@1..2+3'
+  '';
+
   createFindlibDestdir = true;
 
   postInstall = ''
diff --git a/pkgs/development/compilers/openjdk/JDK-8074312-hotspot.patch b/pkgs/development/compilers/openjdk/JDK-8074312-hotspot.patch
deleted file mode 100644
index 85722a1d365b..000000000000
--- a/pkgs/development/compilers/openjdk/JDK-8074312-hotspot.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -r 61edd5c7412e make/linux/Makefile
---- a/hotspot/make/linux/Makefile	Mon Mar 02 18:12:06 2015 +0000
-+++ b/hotspot/make/linux/Makefile	Tue Mar 03 15:58:13 2015 +0100
-@@ -233,7 +233,7 @@
- # Solaris 2.5.1, 2.6).
- # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
-
--SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3%
-+SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 3% 4%
- OS_VERSION := $(shell uname -r)
- EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
diff --git a/pkgs/development/compilers/openjdk/openjdk8.nix b/pkgs/development/compilers/openjdk/openjdk8.nix
index 530391c8e7d6..8afa770cdb27 100644
--- a/pkgs/development/compilers/openjdk/openjdk8.nix
+++ b/pkgs/development/compilers/openjdk/openjdk8.nix
@@ -3,42 +3,42 @@
 
 , minimal ? false } :
 let
-  update = "40";
-  build = "27";
-  baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u40";
+  update = "60";
+  build = "24";
+  baseurl = "http://hg.openjdk.java.net/jdk8u/jdk8u";
   repover = "jdk8u${update}-b${build}";
   paxflags = if stdenv.isi686 then "msp" else "m";
   jdk8 = fetchurl {
              url = "${baseurl}/archive/${repover}.tar.gz";
-             sha256 = "0ra05jngvvy2g1da5b9anrp86m812g2wlkxpijc82kxv6c3h6g28";
+             sha256 = "1gxfyz5kdl3xgfmn6gr65hj66zh5p67y1g0hxdbps1h8gcc6iqwp";
           };
   langtools = fetchurl {
              url = "${baseurl}/langtools/archive/${repover}.tar.gz";
-             sha256 = "0r9zdq13kgqqm8rgr36qf03h23psxcwzvdqffsncd4jvbfap3n5f";
+             sha256 = "0a8kmfcnw92hvhivmpa9g22k1lvcr64zjw7x1gjj1j6zx7r579ck";
           };
   hotspot = fetchurl {
              url = "${baseurl}/hotspot/archive/${repover}.tar.gz";
-             sha256 = "07v3z38v5fdsx3g28c4pkdq76cdmnc4qflf1wb3lz46lhy230hkd";
+             sha256 = "0k68wqwg5fz8i2za9dg2zfx4db5zcbls31vk2abrqrwp31ik0y4y";
           };
   corba = fetchurl {
              url = "${baseurl}/corba/archive/${repover}.tar.gz";
-             sha256 = "0y20468f2yi14lijbd732f2mlgrn718pyfji3279l2rm4ad7r7pl";
+             sha256 = "0rc8m5jrwjzrbxnzbhxjm265z23ky6v11g8sgcb6flr0l636fwvn";
           };
   jdk = fetchurl {
              url = "${baseurl}/jdk/archive/${repover}.tar.gz";
-             sha256 = "1sgfxmkq6z3vj9yq9kszr42b1ijvsknlss353jpcmyr1lljhyvfg";
+             sha256 = "11c90zz728p30zc6zas9ip67n9sd09i0v6afxs608k9s451057wr";
           };
   jaxws = fetchurl {
              url = "${baseurl}/jaxws/archive/${repover}.tar.gz";
-             sha256 = "08p3657d0871pz0g5fg157az9q38r5h2zs49dm7512sc9qrn5c06";
+             sha256 = "15pzczqwrr47qv51bsisjylilhljban8938n1436hsjd5k1dhhwn";
           };
   jaxp = fetchurl {
              url = "${baseurl}/jaxp/archive/${repover}.tar.gz";
-             sha256 = "1f1vlrvlvnjbyh8d168smizvmkcm076zc496sxk6njqamby16ip2";
+             sha256 = "0gcc7pb07yl76drcynpz5gjjv3y6s1c0k4kfp9fayha5f624k1fb";
           };
   nashorn = fetchurl {
              url = "${baseurl}/nashorn/archive/${repover}.tar.gz";
-             sha256 = "1llf3l4483kd8m1a77n7y9fgvm6fa63nim3qhp5z4gnw68ldbhra";
+             sha256 = "00g849wwqxljqpml6r7rv3pscj0ma0jaamyvxsxlfxbqvwid93ai";
           };
   openjdk8 = stdenv.mkDerivation {
     name = "openjdk-8u${update}b${build}";
@@ -66,7 +66,6 @@ let
       ./fix-java-home-jdk8.patch
       ./read-truststore-from-env-jdk8.patch
       ./currency-date-range-jdk8.patch
-      ./JDK-8074312-hotspot.patch
     ];
 
     preConfigure = ''
diff --git a/pkgs/development/compilers/smlnj/default.nix b/pkgs/development/compilers/smlnj/default.nix
index a2b8d4f63b98..e4d4dc1ae10c 100644
--- a/pkgs/development/compilers/smlnj/default.nix
+++ b/pkgs/development/compilers/smlnj/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, darwin }:
 let
   version = "110.78";
   baseurl = "http://smlnj.cs.uchicago.edu/dist/working/${version}";
@@ -34,7 +34,15 @@ in stdenv.mkDerivation {
   patchPhase = ''
     sed -i '/PATH=/d' config/_arch-n-opsys base/runtime/config/gen-posix-names.sh
     echo SRCARCHIVEURL="file:/$TMP" > config/srcarchiveurl
-  '';
+  '' + stdenv.lib.optionalString stdenv.isDarwin (with darwin; ''
+    sed -i '/^[[:space:]]*\*x86-darwin\*)$/,/^[[:space:]]*\*) ;;/ c\
+\  \*x86-darwin\*)\
+\    INCLFILE=${osx_sdk}/Developer/SDKs/${osx_sdk.name}/usr/include/unistd.h\
+\    ;;\
+\  \*) ;;
+' base/runtime/config/gen-posix-names.sh
+    sed -i 's|^AS =\([[:space:]]*\)/usr/bin/as|AS =\1as|' base/runtime/objs/mk.x86-darwin
+  '');
 
   unpackPhase = ''
     for s in $sources; do
@@ -64,7 +72,7 @@ in stdenv.mkDerivation {
     description = "Standard ML of New Jersey, a compiler";
     homepage    = http://smlnj.org;
     license     = licenses.bsd3;
-    platforms   = [ "i686-linux" ];
+    platforms   = [ "i686-linux" ] ++ platforms.darwin;
     maintainers = with maintainers; [ thoughtpolice ];
   };
 }
diff --git a/pkgs/development/eclipse/ecj/default.nix b/pkgs/development/eclipse/ecj/default.nix
index 19ec3a3a2fb5..b6bee8aead02 100644
--- a/pkgs/development/eclipse/ecj/default.nix
+++ b/pkgs/development/eclipse/ecj/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, ant, jdk, makeWrapper }:
+{ stdenv, fetchurl, unzip, ant, jdk7, makeWrapper }:
 
 let
   version = "3.7.2";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0swyysbyfmv068x8q1c5jqpwk5zb4xahg17aypx5rwb660f8fpbm";
   };
 
-  buildInputs = [ unzip ant jdk makeWrapper ];
+  buildInputs = [ unzip ant jdk7 makeWrapper ];
 
   unpackPhase = ''
     mkdir "${name}"
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     cp -v *.jar $out/share/java
 
     mkdir -pv $out/bin
-    makeWrapper ${jdk.jre}/bin/java $out/bin/ecj \
+    makeWrapper ${jdk7.jre}/bin/java $out/bin/ecj \
       --add-flags "-cp $out/share/java/ecj.jar org.eclipse.jdt.internal.compiler.batch.Main"
 
     # Add a setup hook that causes Ant to use the ECJ.
diff --git a/pkgs/development/guile-modules/guile-gnome/default.nix b/pkgs/development/guile-modules/guile-gnome/default.nix
index e2392773de7e..24928fc067fd 100644
--- a/pkgs/development/guile-modules/guile-gnome/default.nix
+++ b/pkgs/development/guile-modules/guile-gnome/default.nix
@@ -1,21 +1,39 @@
-{ fetchurl, stdenv, guile, guile_lib, gwrap
+{ fetchgit, stdenv, guile, guile_lib, gwrap
 , pkgconfig, gconf, glib, gnome_vfs, gtk
-, libglade, libgnome, libgnomecanvas, libgnomeui, pango, guileCairo }:
+, libglade, libgnome, libgnomecanvas, libgnomeui
+, pango, guileCairo, autoconf, automake, texinfo }:
 
 stdenv.mkDerivation rec {
-  name = "guile-gnome-platform-2.16.1";
+  name = "guile-gnome-platform-20150123";
 
-  src = fetchurl {
-    url = "mirror://gnu/guile-gnome/guile-gnome-platform/${name}.tar.gz";
-    sha256 = "0yy5f4c78jlakxi2bwgh3knc2szw26hg68xikyaza2iim39mc22c";
+  src = fetchgit {
+    url = "git://git.sv.gnu.org/guile-gnome.git";
+    rev = "0fcbe69797b9501b8f1283a78eb92bf43b08d080";
+    sha256 = "1vqlzb356ggmp8jh833gksg59c53vbmmhycbcf52qj0fdz09mpb5";
   };
 
-  buildInputs =
-    [ guile gwrap
-      pkgconfig gconf glib gnome_vfs gtk libglade libgnome libgnomecanvas
-      libgnomeui pango guileCairo
-    ]
-    ++ stdenv.lib.optional doCheck guile_lib;
+  buildInputs = [
+    autoconf
+    automake
+    texinfo
+    guile
+    gwrap
+    pkgconfig
+    gconf
+    glib
+    gnome_vfs
+    gtk
+    libglade
+    libgnome
+    libgnomecanvas
+    libgnomeui
+    pango
+    guileCairo
+  ] ++ stdenv.lib.optional doCheck guile_lib;
+
+  preConfigure = ''
+      ./autogen.sh
+  '';
 
   # The test suite tries to open an X display, which fails.
   doCheck = false;
@@ -35,6 +53,6 @@ stdenv.mkDerivation rec {
 
     license = stdenv.lib.licenses.gpl2Plus;
 
-    maintainers = [ ];
+    maintainers = [ stdenv.lib.maintainers.taktoa ];
   };
 }
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index 837fa79859d4..30c5912a5a88 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -21,6 +21,8 @@ self: super: {
   options = dontCheck super.options;
   statistics = dontCheck super.statistics;
   text = dontCheck super.text;
+  c2hs = dontCheck super.c2hs;
+  mockery = dontCheck super.mockery;
 
   # The package doesn't compile with ruby 1.9, which is our default at the moment.
   hruby = super.hruby.override { ruby = pkgs.ruby_2_1; };
@@ -221,7 +223,7 @@ self: super: {
       });
 
   # Does not compile: "fatal error: ieee-flpt.h: No such file or directory"
-  base_4_8_0_0 = markBroken super.base_4_8_0_0;
+  base_4_8_1_0 = markBroken super.base_4_8_1_0;
 
   # Obsolete: https://github.com/massysett/prednote/issues/1.
   prednote-test = markBrokenVersion "0.26.0.4" super.prednote-test;
@@ -825,6 +827,7 @@ self: super: {
 
   # Won't compile with recent versions of QuickCheck.
   testpack = markBroken super.testpack;
+  inilist = dontCheck super.inilist;
   MissingH = dontCheck super.MissingH;
 
   # Obsolete for GHC versions after GHC 6.10.x.
@@ -869,6 +872,7 @@ self: super: {
   # This package can't be built on non-Windows systems.
   Win32 = overrideCabal super.Win32 (drv: { broken = !pkgs.stdenv.isCygwin; });
   inline-c-win32 = dontDistribute super.inline-c-win32;
+  Southpaw = dontDistribute super.Southpaw;
 
   # Doesn't work with recent versions of mtl.
   cron-compat = markBroken super.cron-compat;
@@ -891,4 +895,7 @@ self: super: {
   # Hydra no longer allows building texlive packages.
   lhs2tex = dontDistribute super.lhs2tex;
 
+  # https://ghc.haskell.org/trac/ghc/ticket/9825
+  vimus = overrideCabal super.vimus (drv: { broken = pkgs.stdenv.isLinux && pkgs.stdenv.isi686; });
+
 }
diff --git a/pkgs/development/haskell-modules/configuration-ghc-7.10.x.nix b/pkgs/development/haskell-modules/configuration-ghc-7.10.x.nix
index ca7c0f56bc17..e9f2219f07e4 100644
--- a/pkgs/development/haskell-modules/configuration-ghc-7.10.x.nix
+++ b/pkgs/development/haskell-modules/configuration-ghc-7.10.x.nix
@@ -117,9 +117,6 @@ self: super: {
     sha256 = "1vn3xm38v2f4lzyzkadvq322f3s2yf8c88v56wpdpzfxmvlzaqr8";
   });
 
-  # Already applied in darcs repository.
-  gnuplot = appendPatch super.gnuplot ./gnuplot-fix-new-time.patch;
-
   ghcjs-prim = self.callPackage ({ mkDerivation, fetchgit, primitive }: mkDerivation {
     pname = "ghcjs-prim";
     version = "0.1.0.0";
@@ -147,11 +144,6 @@ self: super: {
     prePatch = "sed -i 's|4\.8|4.9|' diagrams-core.cabal";
   });
 
-  misfortune = appendPatch super.misfortune (pkgs.fetchpatch {
-    url = "https://github.com/mokus0/misfortune/commit/9e0a38cf8d59a0de9ae1156034653f32099610e4.patch";
-    sha256 = "01m1l199ihq85j9pyc3n0wqv1z4my453hhhcvg3yz3gpz3lf224r";
-  });
-
   timezone-series = doJailbreak super.timezone-series;
   timezone-olson = doJailbreak super.timezone-olson;
   libmpd = dontCheck super.libmpd;
diff --git a/pkgs/development/haskell-modules/configuration-ghc-head.nix b/pkgs/development/haskell-modules/configuration-ghc-head.nix
index 37cb69160b06..0eff5705805c 100644
--- a/pkgs/development/haskell-modules/configuration-ghc-head.nix
+++ b/pkgs/development/haskell-modules/configuration-ghc-head.nix
@@ -53,16 +53,6 @@ self: super: {
   # https://github.com/haskell-suite/haskell-src-exts/issues/224
   haskell-src-exts = dontCheck super.haskell-src-exts;
 
-  mono-traversable = appendPatch super.mono-traversable (pkgs.fetchpatch {
-    url = "https://github.com/snoyberg/mono-traversable/pull/77.patch";
-    sha256 = "1qrvrh3cqfkymi5yb9y9z88rq4n7ag0ac2k00mcnqh4dz1vh4fg1";
-  });
-  yesod-auth = appendPatch super.yesod-auth (pkgs.fetchpatch {
-    url = "https://github.com/yesodweb/yesod/pull/1006.patch";
-    sha256 = "0l6wjj8cfz6jy6j92kywsccafyffhlm5240q82bzirb278adqvar";
-    stripLen = 1;
-  });
-
   # Setup: At least the following dependencies are missing: base <4.8
   hspec-expectations = overrideCabal super.hspec-expectations (drv: {
     patchPhase = "sed -i -e 's|base < 4.8|base|' hspec-expectations.cabal";
diff --git a/pkgs/development/haskell-modules/gnuplot-fix-new-time.patch b/pkgs/development/haskell-modules/gnuplot-fix-new-time.patch
deleted file mode 100644
index 1b4a60e59418..000000000000
--- a/pkgs/development/haskell-modules/gnuplot-fix-new-time.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -ru3 gnuplot-0.5.3.1-old/gnuplot.cabal gnuplot-0.5.3.1/gnuplot.cabal
---- gnuplot-0.5.3.1-old/gnuplot.cabal	2015-04-17 22:25:06.561715968 +0300
-+++ gnuplot-0.5.3.1/gnuplot.cabal	2015-04-17 22:27:07.610913755 +0300
-@@ -75,7 +75,7 @@
- 
- Library
-   Build-Depends:
--    filepath >=1.1 && <1.4,
-+    filepath >=1.1 && <1.5,
-     temporary >=1.1 && <1.3,
-     array >=0.1 && <0.6,
-     containers >=0.1 && <0.6,
-@@ -83,12 +83,11 @@
-     data-accessor-transformers >=0.2.1 && <0.3,
-     data-accessor >=0.2.2 && <0.3,
-     transformers >=0.3 && <0.5,
--    deepseq >=1.0 && <1.4
-+    deepseq >=1.0 && <1.5
-   If flag(splitBase)
-     Build-Depends:
--      process >=1.0,
--      time >=1.1,
--      old-locale >=1.0,
-+      process >=1.0 && <1.3,
-+      time >=1.1 && <1.6,
-       base >=2 && <5
-   Else
-     Build-Depends:
-diff -ru3 gnuplot-0.5.3.1-old/src/Graphics/Gnuplot/Time.hs gnuplot-0.5.3.1/src/Graphics/Gnuplot/Time.hs
---- gnuplot-0.5.3.1-old/src/Graphics/Gnuplot/Time.hs	2015-04-17 22:25:06.560715975 +0300
-+++ gnuplot-0.5.3.1/src/Graphics/Gnuplot/Time.hs	2015-04-17 22:27:49.872542430 +0300
-@@ -1,7 +1,6 @@
- module Graphics.Gnuplot.Time where
- 
--import System.Locale (defaultTimeLocale, )
--import Data.Time.Format (FormatTime, formatTime, )
-+import Data.Time.Format (FormatTime, formatTime, defaultTimeLocale, )
- import Data.Tuple.HT (mapFst, )
- 
- {- |
-diff -ru3 gnuplot-0.5.3.1-old/src/Graphics/Gnuplot/Value/Tuple.hs gnuplot-0.5.3.1/src/Graphics/Gnuplot/Value/Tuple.hs
---- gnuplot-0.5.3.1-old/src/Graphics/Gnuplot/Value/Tuple.hs	2015-04-17 22:25:06.560715975 +0300
-+++ gnuplot-0.5.3.1/src/Graphics/Gnuplot/Value/Tuple.hs	2015-04-17 22:28:24.426238829 +0300
-@@ -9,7 +9,6 @@
-    ColumnCount(ColumnCount),
-    ) where
- 
--import System.Locale (defaultTimeLocale, )
- import qualified Data.Time as Time
- 
- import Data.Word (Word8, Word16, Word32, Word64, )
-@@ -82,7 +81,7 @@
- instance C Time.Day where
-    text d = text $ Time.UTCTime d 0
- instance C Time.UTCTime where
--   text = singleton . showString . Time.formatTime defaultTimeLocale "%s"
-+   text = singleton . showString . Time.formatTime Time.defaultTimeLocale "%s"
- 
- 
- instance (C a, C b) => C (a,b) where
diff --git a/pkgs/development/haskell-modules/hackage-packages.nix b/pkgs/development/haskell-modules/hackage-packages.nix
index 3d5a00e2d8c9..622ebfa74738 100644
--- a/pkgs/development/haskell-modules/hackage-packages.nix
+++ b/pkgs/development/haskell-modules/hackage-packages.nix
@@ -7354,6 +7354,7 @@ self: {
          http-types httpd-shed HUnit mtl network network-uri pureMD5 split
          test-framework test-framework-hunit wai warp
        ];
+       jailbreak = true;
        homepage = "https://github.com/haskell/HTTP";
        description = "A library for client-side HTTP";
        license = stdenv.lib.licenses.bsd3;
@@ -8143,10 +8144,9 @@ self: {
     ({ mkDerivation, array, base, containers, StateVar, transformers }:
      mkDerivation {
        pname = "Hipmunk";
-       version = "5.2.0.16";
-       sha256 = "0jnidzky0004xh1yzkcg41df21vbvqhk075d183jv6iwjiljsh3s";
+       version = "5.2.0.17";
+       sha256 = "1yxs1v9pzb35g3zlvycsx762dk8swrbry7ajr50zlq667j20n4a8";
        buildDepends = [ array base containers StateVar transformers ];
-       jailbreak = true;
        homepage = "https://github.com/meteficha/Hipmunk";
        description = "A Haskell binding for Chipmunk";
        license = "unknown";
@@ -10851,18 +10851,19 @@ self: {
 
   "Network-NineP" = callPackage
     ({ mkDerivation, base, binary, bytestring, containers, convertible
-     , monad-loops, mstate, mtl, network, NineP, regex-posix, stateref
-     , transformers
+     , exceptions, monad-loops, monad-peel, mstate, mtl, network, NineP
+     , regex-posix, stateref, transformers
      }:
      mkDerivation {
        pname = "Network-NineP";
-       version = "0.3.0";
-       sha256 = "02igsbmhkpkaxdpdhkl6vb7kzryhg7p5bb59irykz0dkg095wr89";
+       version = "0.4.0";
+       sha256 = "1h6p1p16wvsi6pjpz2xdvbljd394bzpqqfiah7aq9d7f7zh7hzid";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
-         base binary bytestring containers convertible monad-loops mstate
-         mtl network NineP regex-posix stateref transformers
+         base binary bytestring containers convertible exceptions
+         monad-loops monad-peel mstate mtl network NineP regex-posix
+         stateref transformers
        ];
        description = "High-level abstraction over 9P protocol";
        license = "unknown";
@@ -13968,6 +13969,24 @@ self: {
        license = "GPL";
      }) {};
 
+  "Southpaw" = callPackage
+    ({ mkDerivation, ALUT, base, bytestring, cairo, containers
+     , filepath, GLFW-b, gtk3, JuicyPixels, OpenAL, OpenGL, vector
+     , Win32
+     }:
+     mkDerivation {
+       pname = "Southpaw";
+       version = "0.1.0.2";
+       sha256 = "1zijb1b6ryrmq2230i1fr7iqz8iax9f2rwpy75fkggiknrd4xnpq";
+       buildDepends = [
+         ALUT base bytestring cairo containers filepath GLFW-b gtk3
+         JuicyPixels OpenAL OpenGL vector Win32
+       ];
+       jailbreak = true;
+       description = "Assorted utility modules";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "SpaceInvaders" = callPackage
     ({ mkDerivation, array, base, HGL, random, Yampa }:
      mkDerivation {
@@ -17236,15 +17255,14 @@ self: {
      }:
      mkDerivation {
        pname = "active";
-       version = "0.2.0.3";
-       sha256 = "18z6gki5bjr4847r90aw89j8gkfs0w9dv1w2na4msd36i3jym3sc";
+       version = "0.2.0.4";
+       sha256 = "1xm2y8knqhd883c41194h323vchv4hx57wl32l9f64kf7gdglag0";
        buildDepends = [
          base lens linear semigroupoids semigroups vector
        ];
        testDepends = [
          base lens linear QuickCheck semigroupoids semigroups vector
        ];
-       jailbreak = true;
        description = "Abstractions for animation";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -18116,8 +18134,8 @@ self: {
     ({ mkDerivation, array, base, containers, mtl, random, vector }:
      mkDerivation {
        pname = "aivika";
-       version = "4.2";
-       sha256 = "0pg1wqssqqdjd0cafimsy8ibmxfyjk16w10ibkj13a6ggzfn75j1";
+       version = "4.3";
+       sha256 = "01vcjc6i040lp92xhxma6sp3iffam9d7nxqch6i64pajvd8cq97j";
        buildDepends = [ array base containers mtl random vector ];
        homepage = "http://github.com/dsorokin/aivika";
        description = "A multi-paradigm simulation library";
@@ -18147,8 +18165,8 @@ self: {
      }:
      mkDerivation {
        pname = "aivika-experiment-cairo";
-       version = "3.1";
-       sha256 = "0b4nwzrkpxhiwph93zvyk8bi9770bsdnhxkzhbri3l0zsm9250kz";
+       version = "4.3.1";
+       sha256 = "0p54ssbl0ack51gwlj962x45954v4h22mqq6zqa5r8xrbcig2pdb";
        buildDepends = [
          aivika-experiment aivika-experiment-chart base Chart Chart-cairo
        ];
@@ -18164,8 +18182,8 @@ self: {
      }:
      mkDerivation {
        pname = "aivika-experiment-chart";
-       version = "4.2";
-       sha256 = "15aqq8mmjybi7kkrfsmablf7ymi328p9y6nsr8pc7sv144fadaf0";
+       version = "4.3.1";
+       sha256 = "18fagq4ddvqzi6r0c850yassgncicqy0plasfn262fmhgwflpa8n";
        buildDepends = [
          aivika aivika-experiment array base Chart colour containers
          data-default-class filepath lens mtl split
@@ -18181,8 +18199,8 @@ self: {
      }:
      mkDerivation {
        pname = "aivika-experiment-diagrams";
-       version = "3.1";
-       sha256 = "1vjis6184cvw7jzg8a3nvs0d0sv30d6qx598phcq9ncs3bmh9h3f";
+       version = "4.3.1";
+       sha256 = "1plb44bcjnawg3fsb9crmlyzwzyiz802ldsk559ni9sb590ywr7n";
        buildDepends = [
          aivika-experiment aivika-experiment-chart base Chart Chart-diagrams
          containers filepath
@@ -19452,23 +19470,24 @@ self: {
   "amqp" = callPackage
     ({ mkDerivation, base, binary, bytestring, clock, connection
      , containers, data-binary-ieee754, hspec, hspec-expectations
-     , monad-control, network, network-uri, split, text, vector, xml
+     , monad-control, network, network-uri, split, stm, text, vector
+     , xml
      }:
      mkDerivation {
        pname = "amqp";
-       version = "0.12.3";
-       sha256 = "17kvhn6s3grv5ygswkk0x8qclr8j4nxgv04z9q6wac9vydjsaz8m";
+       version = "0.13.0";
+       sha256 = "1qnknyk8xizq5i94s9zv7prqqcpccigc92c6jqqh82y2yqz5xnjj";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
          base binary bytestring clock connection containers
-         data-binary-ieee754 monad-control network network-uri split text
-         vector xml
+         data-binary-ieee754 monad-control network network-uri split stm
+         text vector xml
        ];
        testDepends = [
          base binary bytestring clock connection containers
          data-binary-ieee754 hspec hspec-expectations network network-uri
-         split text vector
+         split stm text vector
        ];
        homepage = "https://github.com/hreinhardt/amqp";
        description = "Client library for AMQP servers (currently only RabbitMQ)";
@@ -19971,23 +19990,22 @@ self: {
      }) {};
 
   "api-builder" = callPackage
-    ({ mkDerivation, aeson, attoparsec, base, bifunctors, bytestring
-     , Cabal, containers, either, hspec, HTTP, http-client, http-conduit
-     , http-types, text, transformers
+    ({ mkDerivation, aeson, base, bifunctors, bytestring, Cabal
+     , containers, hspec, HTTP, http-client, http-client-tls
+     , http-conduit, http-types, text, transformers
      }:
      mkDerivation {
        pname = "api-builder";
-       version = "0.7.4.0";
-       sha256 = "0af0ld0rlrpvbl4iw3g5n5bjij5z5jq2sbd9fqila5891qkvb30d";
+       version = "0.10.0.0";
+       sha256 = "0pzbp0grmnrc48h1cbsxsxzyjgnxzmf4d6cfi53ccq0v3yfybw9v";
        buildDepends = [
-         aeson attoparsec base bifunctors bytestring either HTTP http-client
-         http-conduit http-types text transformers
+         aeson base bifunctors bytestring HTTP http-client http-client-tls
+         http-types text transformers
        ];
        testDepends = [
          aeson base bytestring Cabal containers hspec http-conduit text
          transformers
        ];
-       jailbreak = true;
        homepage = "https://github.com/intolerable/api-builder";
        description = "Library for easily building REST API wrappers in Haskell";
        license = stdenv.lib.licenses.bsd3;
@@ -22116,15 +22134,15 @@ self: {
 
   "aur" = callPackage
     ({ mkDerivation, aeson, aeson-pretty, base, filepath, lens
-     , lens-aeson, mtl, text, vector, wreq-sb
+     , lens-aeson, mtl, text, vector, wreq
      }:
      mkDerivation {
        pname = "aur";
-       version = "2.0.4";
-       sha256 = "1f6j85nz1mb9cn4l4pqv6jcx42m6rp8fj1g4xrfp8k2y9yyx7hjn";
+       version = "3.0.0";
+       sha256 = "1sf76lysp8xchym78ha4glrw11hxic5g684mm8h6w0n05x1ywxcn";
        buildDepends = [
          aeson aeson-pretty base filepath lens lens-aeson mtl text vector
-         wreq-sb
+         wreq
        ];
        homepage = "https://github.com/fosskers/haskell-aur";
        description = "Access metadata from the Arch Linux User Repository";
@@ -23125,8 +23143,8 @@ self: {
      }:
      mkDerivation {
        pname = "bake";
-       version = "0.3";
-       sha256 = "0h0byqv9m0jp5awbjcad0gggbgp66qqws6qvyfxwzk5jgwdifa0k";
+       version = "0.4";
+       sha256 = "1xxv78i2q9hiw30vkbcx09nabqv88g3a6k872ckm9wk8isrnw2zz";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -23439,12 +23457,12 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
-  "base_4_8_0_0" = callPackage
+  "base_4_8_1_0" = callPackage
     ({ mkDerivation, ghc-prim, rts }:
      mkDerivation {
        pname = "base";
-       version = "4.8.0.0";
-       sha256 = "1mf5s7niw0zmm1db7sr6kdpln8drcy77fn44h6sspima8flwcp44";
+       version = "4.8.1.0";
+       sha256 = "0rwya445hvnnzj3x5gsrmr72kr3yspd6w9mypxkrxxg19zfazjaj";
        buildDepends = [ ghc-prim rts ];
        description = "Basic libraries";
        license = stdenv.lib.licenses.bsd3;
@@ -25750,8 +25768,8 @@ self: {
      }:
      mkDerivation {
        pname = "biostockholm";
-       version = "0.3.2";
-       sha256 = "13rzlb2s3y8vp969s8z1gxmiccvpgrv4yxpim4bjbyc2yblbbnk7";
+       version = "0.3.4";
+       sha256 = "04k7cl8fjsi2mv60p2qg2nmy86z2adw9gzjnkxffqsc1q85y4lz7";
        buildDepends = [
          attoparsec attoparsec-conduit base biocore blaze-builder
          blaze-builder-conduit bytestring conduit containers deepseq
@@ -26383,7 +26401,9 @@ self: {
      mkDerivation {
        pname = "blank-canvas";
        version = "0.5";
+       revision = "1";
        sha256 = "05kfyjp9vncyzsvq018ilb8vh7fyzbc06nlx35jk3dzj6i6x5bgs";
+       editedCabalFile = "a9d9c32056144a2e5b84e96dfb3a5334aa89dc616c759e523c538a6b950d5084";
        buildDepends = [
          aeson base base64-bytestring bytestring colour containers
          data-default-class http-types kansas-comet scotty stm text
@@ -30868,8 +30888,8 @@ self: {
      }:
      mkDerivation {
        pname = "cgrep";
-       version = "6.4.16";
-       sha256 = "0mvd80gn6z8iyy8y43drjzmq479zh2zsz3swmlmgvmbvsb1kchlb";
+       version = "6.4.20";
+       sha256 = "1p0nm6gb7hvxvfkgrync1a66zl58s041pgnkly2vx91cpm6yavcm";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -31086,8 +31106,8 @@ self: {
      }:
      mkDerivation {
        pname = "chatter";
-       version = "0.5.1.0";
-       sha256 = "014palhzpphwq3q1c211xajl30afr4ac6mjcpvyzqwxdr9ia74c8";
+       version = "0.5.2.0";
+       sha256 = "01594wp13kigqvr27112fmsrgz4cny4vlprqvyygp90k8mavxw8s";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -34587,8 +34607,8 @@ self: {
      }:
      mkDerivation {
        pname = "conduit";
-       version = "1.2.4.2";
-       sha256 = "1shx58xg4lqf0dj50m2svh132xlzasgg6j175hxk8zf8k1v9b1zl";
+       version = "1.2.5";
+       sha256 = "0iia5hc3rx813aayp839ixr377ajnrhfvpbjach266bk52scs05i";
        buildDepends = [
          base exceptions lifted-base mmorph mtl resourcet transformers
          transformers-base
@@ -34685,8 +34705,8 @@ self: {
      }:
      mkDerivation {
        pname = "conduit-combinators";
-       version = "1.0.1";
-       sha256 = "014n3qhn9flwj43zjp62vagp5df9ll6nkjk1x9qpagni1vf9cbqq";
+       version = "1.0.1.1";
+       sha256 = "02x0n4yar1s3x73pbaxs6ghd5kihl3wz3svrvvm24xnmwv5j9aaz";
        buildDepends = [
          base base16-bytestring base64-bytestring bytestring chunked-data
          conduit conduit-extra filepath monad-control mono-traversable
@@ -34732,8 +34752,8 @@ self: {
      }:
      mkDerivation {
        pname = "conduit-extra";
-       version = "1.1.9";
-       sha256 = "1bs28gs0xfsqywhm8bchap9zr10wxfrlpdphflhzkm8am2bgz55i";
+       version = "1.1.9.1";
+       sha256 = "18x01yll1jfv1p9kb7529k8gdh0lav4pbqcqkam2qr9jxxdy26rz";
        buildDepends = [
          attoparsec base blaze-builder bytestring conduit directory filepath
          monad-control network primitive process resourcet stm
@@ -34821,12 +34841,17 @@ self: {
      }) {};
 
   "conf" = callPackage
-    ({ mkDerivation, base, haskell-src }:
+    ({ mkDerivation, base, haskell-src, HUnit, test-framework
+     , test-framework-hunit, test-framework-th
+     }:
      mkDerivation {
        pname = "conf";
-       version = "0.1.0.0";
-       sha256 = "15zd72l2izdiw79hldf34pymxc4d9r06db91x6p2mfv2i31wy2n2";
+       version = "0.1.1.0";
+       sha256 = "1mxrr14188ikizyxb06764qq1iwhnh19g150mz310q8yw6cypbfw";
        buildDepends = [ base haskell-src ];
+       testDepends = [
+         base HUnit test-framework test-framework-hunit test-framework-th
+       ];
        jailbreak = true;
        description = "Parser for Haskell-based configuration files";
        license = stdenv.lib.licenses.bsd3;
@@ -36689,8 +36714,8 @@ self: {
      }:
      mkDerivation {
        pname = "creatur";
-       version = "5.9.6";
-       sha256 = "0lxmsd59sa37j8bc7y6v29s8wlscqa4xz15p60jiy5ks7am61wa5";
+       version = "5.9.7";
+       sha256 = "1617whwg9f0l6ji3jmd7fcs3n650mz0jpvrw4hf97r7mqzlyfkjp";
        buildDepends = [
          array base bytestring cereal cond directory filepath gray-extended
          hdaemonize hsyslog MonadRandom mtl old-locale process random split
@@ -38611,8 +38636,8 @@ self: {
      }:
      mkDerivation {
        pname = "dash-haskell";
-       version = "1.1.0.1";
-       sha256 = "1m82zpr37jdqr06ynqz4bbnvy1s81756frcgfiyk4wvlmmcl2fyk";
+       version = "1.1.0.2";
+       sha256 = "1h22ay2cl5j2ngm2xi2hyvvprnmz48qcpzxiq9ldkzx8gg3gs36j";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -39212,12 +39237,11 @@ self: {
      }:
      mkDerivation {
        pname = "data-lens";
-       version = "2.10.6";
-       sha256 = "0pnn84m6xvqvxmqpddsi4db1w65788yrwdkpfm9z1vkkajqixaxj";
+       version = "2.10.7";
+       sha256 = "0l70jzys2qb31cyq3nci97i01ncadkhizxvc9c3psxcd2n28l69v";
        buildDepends = [
          base comonad containers semigroupoids transformers
        ];
-       jailbreak = true;
        homepage = "http://github.com/roconnor/data-lens/";
        description = "Used to be Haskell 98 Lenses";
        license = stdenv.lib.licenses.bsd3;
@@ -39266,10 +39290,9 @@ self: {
     ({ mkDerivation, base, data-lens, template-haskell }:
      mkDerivation {
        pname = "data-lens-template";
-       version = "2.1.8";
-       sha256 = "0w8x5zn3d98z0q74bqfgkb9s0ca9hd1xc53gjl759s77wm4iwa0q";
+       version = "2.1.9";
+       sha256 = "0dpj3a1dj5l5jll2f0flj3wss9h2jbsljihrwh68zbb92pcgb56g";
        buildDepends = [ base data-lens template-haskell ];
-       jailbreak = true;
        homepage = "http://github.com/roconnor/data-lens-template/";
        description = "Utilities for Data.Lens";
        license = stdenv.lib.licenses.bsd3;
@@ -39877,14 +39900,21 @@ self: {
      }) {};
 
   "datetime" = callPackage
-    ({ mkDerivation, base, old-locale, old-time, QuickCheck, time }:
+    ({ mkDerivation, base, HUnit, old-locale, old-time, QuickCheck
+     , test-framework, test-framework-hunit, test-framework-quickcheck2
+     , time
+     }:
      mkDerivation {
        pname = "datetime";
-       version = "0.2.1";
-       sha256 = "1yfg3wvi13r725dhfsmcdw4ns3cgl2ayrb5jck0q8b4crk2dlrzg";
-       buildDepends = [ base old-locale old-time QuickCheck time ];
-       homepage = "http://github.com/esessoms/datetime";
-       description = "Utilities to make Data.Time.* easier to use.";
+       version = "0.3.1";
+       sha256 = "0jmxxmv5s9rch84ivfjhqxdqnvqqzvabjs152wyv47h5qmvpag1k";
+       buildDepends = [ base old-locale old-time time ];
+       testDepends = [
+         base HUnit old-locale old-time QuickCheck test-framework
+         test-framework-hunit test-framework-quickcheck2 time
+       ];
+       homepage = "http://github.com/stackbuilders/datetime";
+       description = "Utilities to make Data.Time.* easier to use";
        license = "GPL";
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -40475,8 +40505,8 @@ self: {
      }:
      mkDerivation {
        pname = "debian-build";
-       version = "0.7.1.1";
-       sha256 = "0r2f14h0bpbq861jfa0rgp0y87nq142f80dyjzyzzrdwc8szj120";
+       version = "0.7.2.1";
+       sha256 = "1x3jvrz5y85m9mnp5b8b85f4magbxa4r0yhkw30vgcljph6v7mfm";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -40937,18 +40967,19 @@ self: {
      }) {};
 
   "delta" = callPackage
-    ({ mkDerivation, base, containers, directory, filepath, sodium
-     , time
+    ({ mkDerivation, base, containers, directory, filepath
+     , optparse-applicative, process, sodium, time
      }:
      mkDerivation {
        pname = "delta";
-       version = "0.1.2.0";
-       revision = "1";
-       sha256 = "1yk4cb21n4kq0wvsw6lw8s8sc69gnmzfdn9f5zgwsknza0vayi39";
-       editedCabalFile = "5f7c4ae62f0d0758b892ac7002bc31eebfc4e4dcbe1ff141f0135daf5788e6e9";
+       version = "0.2.1.1";
+       sha256 = "06msfi733jmqqgxyx5p4mifjgxrgh0x8ls4j0fkcan5377sydjcv";
        isLibrary = true;
        isExecutable = true;
-       buildDepends = [ base containers directory filepath sodium time ];
+       buildDepends = [
+         base containers directory filepath optparse-applicative process
+         sodium time
+       ];
        homepage = "https://github.com/kryoxide/delta";
        description = "A library for detecting file changes";
        license = stdenv.lib.licenses.gpl3;
@@ -41491,8 +41522,8 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-builder";
-       version = "0.7.1";
-       sha256 = "1cfmklds0l2jyn7p2hldq0riq4m01dxfg9cran6sx65a7d82x96d";
+       version = "0.7.1.1";
+       sha256 = "1klmmh144bdwrg3zs45l6yy1li64r60jygqspxzyzlm8pfgzvgah";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -41502,7 +41533,6 @@ self: {
          lucid-svg mtl split transformers
        ];
        configureFlags = [ "-fcairo" "-fps" "-frasterific" "-fsvg" ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams";
        description = "hint-based build service for the diagrams graphics EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41517,15 +41547,14 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-cairo";
-       version = "1.3.0.2";
-       sha256 = "1ja089hnq24fx5sd5r3r2z76pmwk5w6j93b7hha7m4jylcdjcnpp";
+       version = "1.3.0.3";
+       sha256 = "0962kz1b45hycjij90yxq88wa5qsdll82h16agzf0pm16j8r4v5s";
        buildDepends = [
          base bytestring cairo colour containers data-default-class
          diagrams-core diagrams-lib filepath hashable JuicyPixels lens mtl
          optparse-applicative pango split statestack transformers unix
          vector
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams";
        description = "Cairo backend for diagrams drawing EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41538,14 +41567,13 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-canvas";
-       version = "1.3.0.1";
-       sha256 = "0ik2kfgs5fi1a51hn9g5sii0n4j9lb0xd9paydz342b7zizy0w70";
+       version = "1.3.0.2";
+       sha256 = "1jklgvkmdhg5ari577jh5y7vr54wjdwyz2hql1n1icbfba5d6p0c";
        buildDepends = [
          base blank-canvas cmdargs containers data-default-class
          diagrams-core diagrams-lib lens mtl NumInstances
          optparse-applicative statestack text
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "HTML5 canvas backend for diagrams drawing EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41562,8 +41590,8 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-contrib";
-       version = "1.3.0.3";
-       sha256 = "0sl99ikghfmiwa51iyacgrma844dqn44iw7c9ahx70r4l8j8is2q";
+       version = "1.3.0.4";
+       sha256 = "0mr4m4kl028jxrjldn38kq7zsph6vqwzdjhxd0rznzbwpsnvsnkf";
        buildDepends = [
          base circle-packing colour containers data-default
          data-default-class diagrams-core diagrams-lib diagrams-solve
@@ -41574,7 +41602,6 @@ self: {
          base containers diagrams-lib HUnit QuickCheck test-framework
          test-framework-hunit test-framework-quickcheck2
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "Collection of user contributions to diagrams EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41587,13 +41614,12 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-core";
-       version = "1.3.0.1";
-       sha256 = "1whig632hx03ysiqidaxf29r67xl2skw0pkx454s036gdwl7sqj2";
+       version = "1.3.0.2";
+       sha256 = "0lrzphpia24dk1mxv33c9f5iy18r5d0lfsw92422nhbs36dslyzm";
        buildDepends = [
          adjunctions base containers distributive dual-tree lens linear
          monoid-extras mtl semigroups unordered-containers
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams";
        description = "Core libraries for diagrams EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41621,8 +41647,8 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-haddock";
-       version = "0.3.0.5";
-       sha256 = "00118bnxkgfg4s4h825bl9v1mdb8cfv27l6licmx8z0dch3all9k";
+       version = "0.3.0.6";
+       sha256 = "0pa83kd1b1fnj9plwmz8gsi2nm35ghdsxdxi4w4f7shsgc64nhrj";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -41635,7 +41661,6 @@ self: {
          base containers haskell-src-exts lens parsec QuickCheck tasty
          tasty-quickcheck
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "Preprocessor for embedding diagrams in Haddock documentation";
        license = stdenv.lib.licenses.bsd3;
@@ -41667,14 +41692,13 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-html5";
-       version = "1.3.0.1";
-       sha256 = "1b6qrhqangdd2j3hzgslkq2sgk9wgk9ll9znfcmxpzc9k04aanqc";
+       version = "1.3.0.2";
+       sha256 = "18ifqv5xkk9cd86d3mir1qka2jy35vj4hqycq44z96hhp50yl29j";
        buildDepends = [
          base cmdargs containers data-default-class diagrams-core
          diagrams-lib lens mtl NumInstances optparse-applicative split
          statestack static-canvas text
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "HTML5 canvas backend for diagrams drawing EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41691,8 +41715,8 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-lib";
-       version = "1.3.0.1";
-       sha256 = "04s21ms9w521fhm7hralq155lwisjv1pszz4cvpl3hc1jm1vwfa3";
+       version = "1.3.0.2";
+       sha256 = "1gvvyzpzzdwzvrh452l6r2709qpbdzx1fi1ysvzalywi3gib69ds";
        buildDepends = [
          active adjunctions array base colour containers data-default-class
          diagrams-core diagrams-solve directory distributive dual-tree
@@ -41701,7 +41725,6 @@ self: {
          process semigroups system-filepath tagged text transformers
          unordered-containers
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams";
        description = "Embedded domain-specific language for declarative graphics";
        license = stdenv.lib.licenses.bsd3;
@@ -41755,14 +41778,13 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-postscript";
-       version = "1.3.0.1";
-       sha256 = "0w6ck71hjjx0rl930v2wapznjvrg5jq538gnyidp2yshik8xh2rp";
+       version = "1.3.0.2";
+       sha256 = "0cdhs5ia6jm89h1bxgqm1w9gkjqnw6g0nw13vjasj0fh08nayk7s";
        buildDepends = [
          base containers data-default-class diagrams-core diagrams-lib dlist
          filepath hashable lens monoid-extras mtl semigroups split
          statestack
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "Postscript backend for diagrams drawing EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -41791,14 +41813,13 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-rasterific";
-       version = "1.3.1.2";
-       sha256 = "1shkwhi7yv8cmv8697z7qqax0z7brcmjqlc17hldfflzwniiyk81";
+       version = "1.3.1.3";
+       sha256 = "1gkapj3n2xyy13a819zbckslvv8k5jkdlz7x2dzhcganra9gkcki";
        buildDepends = [
          base bytestring containers data-default-class diagrams-core
          diagrams-lib filepath FontyFruity hashable JuicyPixels lens mtl
          optparse-applicative Rasterific split unix
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "Rasterific backend for diagrams";
        license = stdenv.lib.licenses.bsd3;
@@ -41837,15 +41858,14 @@ self: {
      }:
      mkDerivation {
        pname = "diagrams-svg";
-       version = "1.3.1.3";
-       sha256 = "0migb5vjlslbxlmbqxl0qdrpsi0ghbiq86rjna57g804r149n7ni";
+       version = "1.3.1.4";
+       sha256 = "009xn6q9qwgi3l4v0rm79309i91m1s0jbng34bbli29s6vzwgjmz";
        buildDepends = [
          base base64-bytestring bytestring colour containers diagrams-core
          diagrams-lib directory filepath hashable JuicyPixels lens lucid-svg
          monoid-extras mtl old-time optparse-applicative process semigroups
          split text time
        ];
-       jailbreak = true;
        homepage = "http://projects.haskell.org/diagrams/";
        description = "SVG backend for diagrams drawing EDSL";
        license = stdenv.lib.licenses.bsd3;
@@ -44109,6 +44129,23 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "draw-poker" = callPackage
+    ({ mkDerivation, base, random-shuffle, safe }:
+     mkDerivation {
+       pname = "draw-poker";
+       version = "0.1.0.1";
+       revision = "1";
+       sha256 = "16b17qfj3bah468hqsksk2rhyl33m2vyqw0rrs1wyaz75yq35257";
+       editedCabalFile = "62a11039e0b634f0b372c28d87f6fe84f40a33981211c9f2bc077135abcef629";
+       isLibrary = true;
+       isExecutable = true;
+       buildDepends = [ base random-shuffle safe ];
+       testDepends = [ base ];
+       homepage = "http://tune.hateblo.jp/entry/2015/05/12/023112";
+       description = "playing draw poker";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "drawille" = callPackage
     ({ mkDerivation, base, containers, hspec, QuickCheck }:
      mkDerivation {
@@ -44403,17 +44440,16 @@ self: {
      }) {};
 
   "dtw" = callPackage
-    ({ mkDerivation, base, containers, MemoTrie, QuickCheck
-     , test-framework, test-framework-quickcheck2, thyme, vector
-     , vector-space
+    ({ mkDerivation, base, containers, QuickCheck, test-framework
+     , test-framework-quickcheck2, thyme, vector, vector-space
      }:
      mkDerivation {
        pname = "dtw";
-       version = "1.0.0.0";
-       sha256 = "0kcb773sly86lkvnb3ihsswrz432phi3ccizwbf1phzf72kdflzr";
-       buildDepends = [ base containers MemoTrie vector vector-space ];
+       version = "1.0.1.0";
+       sha256 = "15qk8r958pssgwqhxffw45vm5bpvv9wfarv9spaplrnb3sm5bzhk";
+       buildDepends = [ base containers vector vector-space ];
        testDepends = [
-         base containers MemoTrie QuickCheck test-framework
+         base containers QuickCheck test-framework
          test-framework-quickcheck2 thyme vector vector-space
        ];
        jailbreak = true;
@@ -44433,6 +44469,27 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "dump" = callPackage
+    ({ mkDerivation, base, haskell-src-meta, hspec
+     , interpolatedstring-perl6, template-haskell, text
+     }:
+     mkDerivation {
+       pname = "dump";
+       version = "0.2.6";
+       sha256 = "0rhjx4g83pbm0zfqgz8ykfccaq8wa7wspjc6k1n4d1bgcwkc617y";
+       buildDepends = [
+         base haskell-src-meta interpolatedstring-perl6 template-haskell
+         text
+       ];
+       testDepends = [
+         base haskell-src-meta hspec interpolatedstring-perl6
+         template-haskell text
+       ];
+       homepage = "https://github.com/Wizek/dump";
+       description = "Dumps the names and values of expressions to ease debugging";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "duplo" = callPackage
     ({ mkDerivation, aeson, aeson-pretty, ansi-terminal, base
      , base64-bytestring, bytestring, containers, directory
@@ -44740,8 +44797,8 @@ self: {
      }:
      mkDerivation {
        pname = "dynamic-pp";
-       version = "0.1.0";
-       sha256 = "1i01k8c75yxdmxz3db4kajpqbgl8lcbfsp9rb9q2kzbk44fc2zpc";
+       version = "0.2.0";
+       sha256 = "03y9sl3xcnp1ixi4y0i1a7frd2bgfvnb0r4pqjs38bvjkz96bbdd";
        buildDepends = [
          ansi-terminal base blaze-builder bytestring Cabal hashable
          unordered-containers utf8-string
@@ -45475,16 +45532,21 @@ self: {
      }) { eibclient = null;};
 
   "eigen" = callPackage
-    ({ mkDerivation, base, bytestring, primitive, vector }:
+    ({ mkDerivation, base, binary, bytestring, mtl, primitive
+     , transformers, vector
+     }:
      mkDerivation {
        pname = "eigen";
-       version = "2.1.0";
-       sha256 = "14amg4g7gxsi529hz5ilhv8b8nzs8p2ypmxh21hq5x4sfnsl4n07";
-       buildDepends = [ base bytestring primitive vector ];
-       testDepends = [ base primitive vector ];
-       jailbreak = true;
+       version = "2.1.6";
+       sha256 = "0287j907pasjb7w7bwr6snb4qic7j14msxhps445yjfkqa2arzfz";
+       buildDepends = [
+         base binary bytestring primitive transformers vector
+       ];
+       testDepends = [
+         base binary bytestring mtl primitive transformers vector
+       ];
        homepage = "https://github.com/osidorkin/haskell-eigen";
-       description = "Eigen C++ library (linear algebra: matrices, vectors, numerical solvers)";
+       description = "Eigen C++ library (linear algebra: matrices, sparse matrices, vectors, numerical solvers)";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -45848,17 +45910,17 @@ self: {
 
   "elm-init" = callPackage
     ({ mkDerivation, aeson, aeson-pretty, base, bytestring, containers
-     , directory, file-embed, filepath, text
+     , directory, file-embed, filepath, text, time
      }:
      mkDerivation {
        pname = "elm-init";
-       version = "0.1.2.1";
-       sha256 = "0x5p5jwxz07m515421xpcw777lgc3bx40mnl0y9fdw2gz4f3svs2";
+       version = "1.0.1.0";
+       sha256 = "0jvdln18dhsxly33ysy1vv1740ri1576x44jn10gjva432rp8rwx";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
          aeson aeson-pretty base bytestring containers directory file-embed
-         filepath text
+         filepath text time
        ];
        description = "Set up basic structure for an elm project";
        license = stdenv.lib.licenses.mit;
@@ -46323,6 +46385,23 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "engine-io-wai" = callPackage
+    ({ mkDerivation, attoparsec, base, bytestring, engine-io
+     , http-types, mtl, text, transformers, unordered-containers, wai
+     , wai-websockets, websockets
+     }:
+     mkDerivation {
+       pname = "engine-io-wai";
+       version = "1.0.1";
+       sha256 = "0cr53x8bxfmrx97v7jsb7gw3hqb94zp9xvvnl16080zmqm0gi2rh";
+       buildDepends = [
+         attoparsec base bytestring engine-io http-types mtl text
+         transformers unordered-containers wai wai-websockets websockets
+       ];
+       homepage = "http://github.com/ocharles/engine.io";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "engine-io-yesod" = callPackage
     ({ mkDerivation, base, bytestring, conduit, conduit-extra
      , engine-io, http-types, text, unordered-containers, wai
@@ -46615,11 +46694,10 @@ self: {
     ({ mkDerivation, base, exceptions, mtl }:
      mkDerivation {
        pname = "eprocess";
-       version = "1.7.0";
-       sha256 = "1h4ajq1rraiz7qw7350128n26jnqhzk9iyjzqc3lnbyx87q8j73v";
+       version = "1.7.2";
+       sha256 = "190qgsqj41dbkphjrgljif7q0zjm9ddp8wawc9wx8qklb897jrvj";
        buildDepends = [ base exceptions mtl ];
-       jailbreak = true;
-       description = "*Very* basic Erlang-like process support for Haskell";
+       description = "Basic Erlang-like process support for Haskell";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -47587,15 +47665,13 @@ self: {
      }) {};
 
   "exceptional" = callPackage
-    ({ mkDerivation, base }:
+    ({ mkDerivation, base, exceptions }:
      mkDerivation {
        pname = "exceptional";
-       version = "0.1.5.1";
-       revision = "1";
-       sha256 = "1fkz90d776z8fj8p3123ssqwxy9nmz4bgh9gn4nvg0xnvwzc069c";
-       editedCabalFile = "a79514b512d8776f9ae66a80aeb3f604ac9ae1d4c5c98fdd9ea2acc8c312adda";
-       buildDepends = [ base ];
-       homepage = "https://github.com/pharpend/exceptional";
+       version = "0.3.0.0";
+       sha256 = "01lzx4ihdvyivjnkvn78hcdsk83dvm6iy9v5q1f28kd1iv96x1ns";
+       buildDepends = [ base exceptions ];
+       homepage = "https://github.com/";
        description = "Essentially the Maybe type with error messages";
        license = stdenv.lib.licenses.bsd2;
      }) {};
@@ -48094,8 +48170,8 @@ self: {
      }:
      mkDerivation {
        pname = "extra";
-       version = "1.3";
-       sha256 = "12n67ibj6zk7r8hzk0vn6ijfr926h0g6jkwn5krkp79xzdq82apr";
+       version = "1.4";
+       sha256 = "1cp9vsqgjc46v1i8w8lhakdk1qj6q2bd0y365qj0madpjj7q1qi8";
        buildDepends = [ base directory filepath process time unix ];
        testDepends = [ base directory filepath QuickCheck time unix ];
        homepage = "https://github.com/ndmitchell/extra#readme";
@@ -48329,6 +48405,21 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "fast-builder" = callPackage
+    ({ mkDerivation, base, bytestring, ghc-prim, process, QuickCheck
+     , stm
+     }:
+     mkDerivation {
+       pname = "fast-builder";
+       version = "0.0.0.0";
+       sha256 = "1ga28vxsv4hk8491jv51jd8xqvafss56kkm97x2ma4naqx4v6snw";
+       buildDepends = [ base bytestring ghc-prim ];
+       testDepends = [ base bytestring process QuickCheck stm ];
+       homepage = "http://github.com/takano-akio/fast-builder";
+       description = "Fast ByteString Builder";
+       license = stdenv.lib.licenses.publicDomain;
+     }) {};
+
   "fast-logger" = callPackage
     ({ mkDerivation, array, auto-update, base, bytestring
      , bytestring-builder, directory, filepath, hspec, text
@@ -48513,8 +48604,8 @@ self: {
      }:
      mkDerivation {
        pname = "fay";
-       version = "0.23.1.7";
-       sha256 = "1yjpbbxxjz8hrqb3arcn74i9s936kr44zg2v27kxmhrin4lnrw4b";
+       version = "0.23.1.8";
+       sha256 = "1772gdqka5hcgs2bq76bba9pca5xx32q3fg9vvkjqd5249rk5gv6";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -49181,12 +49272,15 @@ self: {
      }) { inherit (pkgs) fftw;};
 
   "fgl" = callPackage
-    ({ mkDerivation, array, base, containers, mtl }:
+    ({ mkDerivation, array, base, containers, deepseq, hspec
+     , QuickCheck, transformers
+     }:
      mkDerivation {
        pname = "fgl";
-       version = "5.5.1.0";
-       sha256 = "0rcmz0xlyr1wj490ffja29z1jgl51gz19ka609da6bx39bwx7nga";
-       buildDepends = [ array base containers mtl ];
+       version = "5.5.2.0";
+       sha256 = "1r9vkv5v32nyqghr4fq3ijrdl2sr9bncfpj3zix53h5m2zyn7kg3";
+       buildDepends = [ array base containers deepseq transformers ];
+       testDepends = [ base containers hspec QuickCheck ];
        description = "Martin Erwig's Functional Graph Library";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -49195,9 +49289,9 @@ self: {
     ({ mkDerivation, base, containers, fgl, hspec, QuickCheck }:
      mkDerivation {
        pname = "fgl-arbitrary";
-       version = "0.1.0.0";
-       sha256 = "0npgwg2lgi8rr3wm40q4a9srpnih3mzy1add2aazc4ahr32dfzm1";
-       buildDepends = [ base containers fgl QuickCheck ];
+       version = "0.2.0.0";
+       sha256 = "1116c4r1ick3xjhwwq9b6i1082njmxj2aymgkqppabj3d0hv43c4";
+       buildDepends = [ base fgl QuickCheck ];
        testDepends = [ base containers fgl hspec QuickCheck ];
        description = "QuickCheck support for fgl";
        license = stdenv.lib.licenses.bsd3;
@@ -50607,8 +50701,8 @@ self: {
      }:
      mkDerivation {
        pname = "foldl";
-       version = "1.1.0";
-       sha256 = "184arkpffi2z7dayplc47nvyabzr5sig4zs8hc4lilcklv4q9zn6";
+       version = "1.1.1";
+       sha256 = "01zqlb3hh5jsq49ax08nkwvysqq4fgkxpz4sdcman9y9fnxgwjgg";
        buildDepends = [
          base bytestring containers mwc-random primitive profunctors text
          transformers vector
@@ -50786,10 +50880,9 @@ self: {
      }:
      mkDerivation {
        pname = "force-layout";
-       version = "0.4.0.1";
-       sha256 = "1qchmhn6hp91gzds6yqjn4kssp7n3g7vqhl919wf8d3nn4ykz3av";
+       version = "0.4.0.2";
+       sha256 = "0lncciqizp55if5ivlcbv5lqj21hlp2vfi40iagjswf2apxi0w0g";
        buildDepends = [ base containers data-default-class lens linear ];
-       jailbreak = true;
        description = "Simple force-directed layout";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -52222,13 +52315,15 @@ self: {
      }:
      mkDerivation {
        pname = "fwgl";
-       version = "0.1.1.0";
-       sha256 = "07ml9f8x4rw7wg6wib63nayh8mpszrkx0zal9zz0cpjh2f85n10a";
+       version = "0.1.2.0";
+       revision = "1";
+       sha256 = "1b18xzxbbrnmmvjgmzhy5r4ww7rvbli76m7vh3li30fb95k1sznr";
+       editedCabalFile = "d97edefc7ee59578d181dfc36d85b1a82a6e0c9ed1bb602918655a3439a5eb51";
        buildDepends = [
          base hashable transformers unordered-containers vector Yampa
        ];
        jailbreak = true;
-       homepage = "https://github.com/ZioCrocifisso/FWGL";
+       homepage = "https://github.com/ziocroc/FWGL";
        description = "FRP 2D/3D game engine";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -52239,16 +52334,16 @@ self: {
      }:
      mkDerivation {
        pname = "fwgl-glfw";
-       version = "0.1.0.3";
+       version = "0.1.0.4";
        revision = "1";
-       sha256 = "1zmvw7945lkghavik72w096rqh8ivjyb9h6j98yjvlj6xf85bsq0";
-       editedCabalFile = "f2a35fcd71bbea225624cf3b6d1f78647e103a1ee1edcc0a7eb9e27b0c4642d8";
+       sha256 = "1pph1arlmi905rkcjcn3yf5ypdmk82363vgdmwg26dbrb2sb4cs8";
+       editedCabalFile = "26e4026f5ac7fe57292c5df79d35894b736728c31cad845f11641d833f789fb8";
        buildDepends = [
          base fwgl gl GLFW-b hashable JuicyPixels transformers
          unordered-containers vector Yampa
        ];
        jailbreak = true;
-       homepage = "https://github.com/ZioCrocifisso/FWGL";
+       homepage = "https://github.com/ziocroc/FWGL";
        description = "FWGL GLFW backend";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -52259,13 +52354,13 @@ self: {
      }:
      mkDerivation {
        pname = "fwgl-javascript";
-       version = "0.1.0.2";
-       sha256 = "1vgc3dqm0pqac8l17w0fi4xv2rx2bik6n405qzarjnjlyp7czqcm";
+       version = "0.1.0.4";
+       sha256 = "1bwg6dzp2kgny5s6zygdi120pcrdclql22rgp43vhwim5aqkp9d7";
        buildDepends = [
          base fwgl ghcjs-base hashable unordered-containers Yampa
        ];
        jailbreak = true;
-       homepage = "https://github.com/ZioCrocifisso/FWGL";
+       homepage = "https://github.com/ziocroc/FWGL";
        description = "FWGL GHCJS backend";
        license = stdenv.lib.licenses.bsd3;
        broken = true;
@@ -52698,8 +52793,8 @@ self: {
      }:
      mkDerivation {
        pname = "generic-accessors";
-       version = "0.4.0";
-       sha256 = "0wpv9i80lai771fws5yg5ri05iskbq2vgar66f72xqwvz3nm44i7";
+       version = "0.4.1";
+       sha256 = "1qhik496296v42pjmlxxlimnw4z9p451ndc2fjvrid4g0knfzvg0";
        buildDepends = [ base linear spatial-math ];
        testDepends = [
          base HUnit QuickCheck test-framework test-framework-hunit
@@ -53436,20 +53531,21 @@ self: {
      }) {};
 
   "ghc-exactprint" = callPackage
-    ({ mkDerivation, base, containers, directory, filepath, free, ghc
-     , ghc-paths, ghc-syb-utils, HUnit, mtl, random, stm, syb
+    ({ mkDerivation, base, containers, directory, filemanip, filepath
+     , free, ghc, ghc-paths, HUnit, mtl, random, silently, syb
      }:
      mkDerivation {
        pname = "ghc-exactprint";
-       version = "0.2";
-       sha256 = "1sqk6y6b1scn51kjbvdnazw34bkwmfii5dhb1fzwzx4cb4iqg3ik";
+       version = "0.3";
+       sha256 = "0wgqlll95fbxnni1dzlyiyb4d7lqp3hrfw9xh5hqsnqm45smi7j1";
+       isLibrary = true;
+       isExecutable = true;
        buildDepends = [
-         base containers directory filepath free ghc ghc-paths ghc-syb-utils
-         mtl syb
+         base containers directory filepath free ghc ghc-paths mtl syb
        ];
        testDepends = [
-         base containers directory filepath ghc ghc-paths ghc-syb-utils
-         HUnit mtl random stm syb
+         base containers directory filemanip filepath ghc ghc-paths HUnit
+         mtl random silently syb
        ];
        description = "ExactPrint for GHC";
        license = stdenv.lib.licenses.bsd3;
@@ -54131,6 +54227,7 @@ self: {
          gitlib gitlib-libgit2 scientific shake split tagged text
          unordered-containers vector yaml
        ];
+       jailbreak = true;
        homepage = "https://github.com/nomeata/gipeda";
        description = "Git Performance Dashboard";
        license = stdenv.lib.licenses.mit;
@@ -54216,7 +54313,7 @@ self: {
          yesod-static
        ];
        buildTools = [
-         bup curl git gnupg lsof openssh perl rsync wget which
+         curl git gnupg openssh perl rsync wget which
        ];
        configureFlags = [ "-fassistant" "-fproduction" ];
        preConfigure = "export HOME=$TEMPDIR";
@@ -56765,8 +56862,8 @@ self: {
     ({ mkDerivation, base, hierarchical-clustering }:
      mkDerivation {
        pname = "gsc-weighting";
-       version = "0.2";
-       sha256 = "1mdm0n96gy00wf7lv6c0qxk9bi1ahf58vzrgnh3jfiwhzjivcvlj";
+       version = "0.2.2";
+       sha256 = "0y80j5qk601c965assl8d91k9bpvzijn2z0w64n2ksij9lm6b8p5";
        buildDepends = [ base hierarchical-clustering ];
        description = "Generic implementation of Gerstein/Sonnhammer/Chothia weighting";
        license = stdenv.lib.licenses.bsd3;
@@ -56931,20 +57028,20 @@ self: {
 
   "gtk-mac-integration" = callPackage
     ({ mkDerivation, array, base, containers, glib, gtk
-     , gtk-mac-integration, gtk2hs-buildtools, mtl
+     , gtk-mac-integration-gtk2, gtk2hs-buildtools, mtl
      }:
      mkDerivation {
        pname = "gtk-mac-integration";
-       version = "0.3.0.2";
-       sha256 = "05pihi7fc413j8iwwrdb7p1ckxsjzd8cvayk76hhwnqcyykvjlr5";
+       version = "0.3.1.1";
+       sha256 = "02s5ksr8fkqlbwlq468v93w0is1xa73wswgxahyyvhh51wnqp3ax";
        buildDepends = [ array base containers glib gtk mtl ];
        buildTools = [ gtk2hs-buildtools ];
-       pkgconfigDepends = [ gtk-mac-integration ];
+       pkgconfigDepends = [ gtk-mac-integration-gtk2 ];
        homepage = "http://www.haskell.org/gtk2hs/";
        description = "Bindings for the Gtk/OS X integration library";
        license = stdenv.lib.licenses.lgpl21;
        hydraPlatforms = stdenv.lib.platforms.none;
-     }) { gtk-mac-integration = null;};
+     }) { gtk-mac-integration-gtk2 = null;};
 
   "gtk-serialized-event" = callPackage
     ({ mkDerivation, array, base, containers, glib, gtk, haskell98, mtl
@@ -57189,8 +57286,8 @@ self: {
      }:
      mkDerivation {
        pname = "gtk3-mac-integration";
-       version = "0.3.0.3";
-       sha256 = "1jzkx10mmmxxv1ys9ywr2sfpy0pxvy8276pbkh0xnypxsyd2sfdn";
+       version = "0.3.1.1";
+       sha256 = "0j6fpzk1gq1y15cjpkq3k1azkn7xvlqiidn3m0g9czz5iy303adv";
        buildDepends = [ array base containers glib gtk3 mtl ];
        buildTools = [ gtk2hs-buildtools ];
        pkgconfigDepends = [ gtk-mac-integration-gtk3 ];
@@ -58553,8 +58650,8 @@ self: {
      }:
      mkDerivation {
        pname = "haddock";
-       version = "2.16.0";
-       sha256 = "1afb96w1vv3gmvha2f1h3p8zywpdk8dfk6bgnsa307ydzsmsc3qa";
+       version = "2.16.1";
+       sha256 = "1mnnvc5jqp6n6rj7xw8wdm0z2xp9fndkz11c8p3vbljsrcqd3v26";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [ base haddock-api ];
@@ -58591,8 +58688,8 @@ self: {
      }:
      mkDerivation {
        pname = "haddock-api";
-       version = "2.16.0";
-       sha256 = "0hk42w6fbr6xp8xcpjv00bhi9r75iig5kp34vxbxdd7k5fqxr1hj";
+       version = "2.16.1";
+       sha256 = "1spd5axg1pdjv4dkdb5gcwjsc8gg37qi4mr2k2db6ayywdkis1p2";
        buildDepends = [
          array base bytestring Cabal containers deepseq directory filepath
          ghc ghc-paths haddock-library xhtml
@@ -58629,10 +58726,8 @@ self: {
      }:
      mkDerivation {
        pname = "haddock-library";
-       version = "1.2.0";
-       revision = "1";
-       sha256 = "0kf8qihkxv86phaznb3liq6qhjs53g3iq0zkvz5wkvliqas4ha56";
-       editedCabalFile = "39bebb4a575c547378a245ee6028135602cbb73e5adbb4f7743449e5717517da";
+       version = "1.2.1";
+       sha256 = "0mhh2ppfhrvvi9485ipwbkv2fbgj35jvz3la02y3jlvg5ffs1c8g";
        buildDepends = [ base bytestring deepseq transformers ];
        testDepends = [
          base base-compat bytestring deepseq hspec QuickCheck transformers
@@ -58798,8 +58893,8 @@ self: {
      }:
      mkDerivation {
        pname = "hailgun";
-       version = "0.4.0.1";
-       sha256 = "1jwk8rip8d96ivkv2k3dzmppid8dyvkrhgkjrxawgvwjzavfwwfn";
+       version = "0.4.0.3";
+       sha256 = "1c4fd116xhkw0hknzfyxyw7v62wjixcdbdidx804rs8g8f3c5p1c";
        buildDepends = [
          aeson base bytestring email-validate exceptions filepath
          http-client http-client-tls http-types tagsoup text time
@@ -59042,8 +59137,8 @@ self: {
      }:
      mkDerivation {
        pname = "hakyll-agda";
-       version = "0.1.9";
-       sha256 = "1fh0901r140p3lvw54q8d6x17zhbvpik5bsx2hifa8q2g5bnxnxd";
+       version = "0.1.10";
+       sha256 = "1621l7pw2rcyalp17dcjp1bk650rs8w1i3swnwrzr9wwi6nrx7qb";
        buildDepends = [
          Agda base containers directory filepath hakyll mtl pandoc
          transformers xhtml
@@ -59256,8 +59351,8 @@ self: {
      }:
      mkDerivation {
        pname = "halma";
-       version = "0.2.0.0";
-       sha256 = "053r1npyq7f07d29bryrr0vwx4kpm3m1bdjkwr77znimshcvy9b3";
+       version = "0.2.0.1";
+       sha256 = "04b0djijhmgwr79hkprikqxdzfxabavrvkwmb1pv9qybsa82j6sc";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -59268,7 +59363,6 @@ self: {
          base containers grid HUnit QuickCheck test-framework
          test-framework-hunit test-framework-quickcheck2
        ];
-       jailbreak = true;
        homepage = "https://github.com/timjb/halma";
        description = "Library implementing Halma rules";
        license = stdenv.lib.licenses.mit;
@@ -60373,10 +60467,10 @@ self: {
     ({ mkDerivation, base }:
      mkDerivation {
        pname = "harp";
-       version = "0.4";
-       sha256 = "0fk3prqai1ynm5wdfsn9f700i9r499jc2z9fbsgy81k1rci2mrxh";
+       version = "0.4.1";
+       sha256 = "0q9q3rw9yqkryjf5vvm41ckycqjfaxnsrmc1p0kmdrlb4f4dgclz";
        buildDepends = [ base ];
-       homepage = "http://www.cs.chalmers.se/~d00nibro/harp/";
+       homepage = "https://github.com/seereason/harp";
        description = "HaRP allows pattern-matching with regular expressions";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -61064,10 +61158,9 @@ self: {
     ({ mkDerivation, base, process }:
      mkDerivation {
        pname = "haskell-coffee";
-       version = "0.1.0.1";
-       sha256 = "0g95vhqga7hq6w6x993d29wpphcqidmm0vzni93blqka7yfc7ybb";
+       version = "0.1.0.2";
+       sha256 = "1iz94kyq1xn3v89aay282qglv2sh41b04p8vaygwm22v1g4b4kk7";
        buildDepends = [ base process ];
-       jailbreak = true;
        description = "Simple CoffeeScript API";
        license = stdenv.lib.licenses.gpl3;
      }) {};
@@ -61286,8 +61379,8 @@ self: {
      }:
      mkDerivation {
        pname = "haskell-neo4j-client";
-       version = "0.3.1.2";
-       sha256 = "1qb2m6bxpw24ll1r0hyicmddn9plm55ipdgbykd6yrw1cfrm9qz7";
+       version = "0.3.1.4";
+       sha256 = "171ar3vfhgijy79p0a4wqm0b8bisgqf8iqzm17yb5pwirlfm5hi6";
        buildDepends = [
          aeson base bytestring containers data-default hashable HTTP
          http-conduit http-types lifted-base mtl network-uri resourcet
@@ -61301,7 +61394,6 @@ self: {
          test-framework-quickcheck2 test-framework-th text transformers
          transformers-base transformers-compat unordered-containers vector
        ];
-       jailbreak = true;
        homepage = "https://github.com/asilvestre/haskell-neo4j-rest-client";
        description = "A Haskell neo4j client";
        license = stdenv.lib.licenses.mit;
@@ -63060,8 +63152,8 @@ self: {
      }:
      mkDerivation {
        pname = "haxr";
-       version = "3000.11.1";
-       sha256 = "07rz03n0v9nflzid0vx5qh5hc7fmlq9c9kkk35slljv7lwmxw0qh";
+       version = "3000.11.1.1";
+       sha256 = "0a4ad0h45a6jv1x19ss0p6krhq040164cvvaivf0zba5q4ifmffh";
        buildDepends = [
          array base base-compat base64-bytestring blaze-builder bytestring
          HaXml HsOpenSSL http-streams http-types io-streams mtl mtl-compat
@@ -63947,8 +64039,8 @@ self: {
      }:
      mkDerivation {
        pname = "hedis";
-       version = "0.6.8";
-       sha256 = "0n6x7dbdbfrxn3y6q9vp7x6vqgdc9nb3w85xjmim7agdf088zzh6";
+       version = "0.6.9";
+       sha256 = "0yciwxsnqc8d09356fisfb44nbzsnvi01aad86gbx4vhrdnw7n7a";
        buildDepends = [
          attoparsec base BoundedChan bytestring bytestring-lexing mtl
          network resource-pool time vector
@@ -64100,14 +64192,15 @@ self: {
      mkDerivation {
        pname = "heist";
        version = "0.14.1.1";
+       revision = "1";
        sha256 = "0hwf8d20lw4gn5mal8iqd62npr2859541h3md451hjlbwpjyqd19";
+       editedCabalFile = "51f2aa86d7582ba504e26ead511da54db5350cf4bed7f13252c678c0cf19d400";
        buildDepends = [
          aeson attoparsec base blaze-builder blaze-html bytestring
          containers directory directory-tree dlist either filepath hashable
          map-syntax MonadCatchIO-transformers mtl process random text time
          transformers unordered-containers vector xmlhtml
        ];
-       jailbreak = true;
        homepage = "http://snapframework.com/";
        description = "An Haskell template system supporting both HTML5 and XML";
        license = stdenv.lib.licenses.bsd3;
@@ -64920,29 +65013,29 @@ self: {
     ({ mkDerivation, base, bytestring, case-insensitive, configurator
      , containers, directory, errors, exceptions, filemanip, filepath
      , HandsomeSoup, hspec, HTTP, http-types, hxt, iso8601-time
-     , MissingH, mtl, multipart, old-locale, random, silently, stm, tar
-     , temporary, text, time, transformers, unix, unordered-containers
-     , utf8-string, wai, warp
+     , MissingH, mtl, multipart, old-locale, optparse-applicative
+     , random, silently, stm, tar, temporary, text, time, transformers
+     , unix, unordered-containers, utf8-string, wai, warp
      }:
      mkDerivation {
        pname = "heyefi";
-       version = "0.1.0.2";
-       sha256 = "0zjhdhigkfh3wrhwynpcqimasifs3qxkv8x2w7bl1ly8amlz7hf4";
+       version = "0.1.1.0";
+       sha256 = "13m66ix0kmvqwgvqh56mjdwgwpjjqi67hyr6giwhs63fr3wxw3f3";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
          base bytestring case-insensitive configurator directory errors
          exceptions filemanip filepath HandsomeSoup HTTP http-types hxt
-         iso8601-time MissingH mtl multipart old-locale random stm tar
-         temporary text time transformers unix unordered-containers
-         utf8-string wai warp
+         iso8601-time MissingH mtl multipart old-locale optparse-applicative
+         random stm tar temporary text time transformers unix
+         unordered-containers utf8-string wai warp
        ];
        testDepends = [
          base bytestring case-insensitive configurator containers directory
          errors exceptions filemanip filepath HandsomeSoup hspec HTTP
          http-types hxt iso8601-time MissingH mtl multipart old-locale
-         random silently stm tar temporary text time transformers unix
-         unordered-containers utf8-string wai warp
+         optparse-applicative random silently stm tar temporary text time
+         transformers unix unordered-containers utf8-string wai warp
        ];
        homepage = "https://github.com/ryantm/heyefi";
        description = "A server for Eye-Fi SD cards";
@@ -65411,8 +65504,8 @@ self: {
      }:
      mkDerivation {
        pname = "hierarchical-clustering";
-       version = "0.4.4";
-       sha256 = "1hm47fccji8dn70477ww7s6846mxrmgr5n056c11dh9azz5jl5x2";
+       version = "0.4.6";
+       sha256 = "1cfcrnxqczqzqgpyipsw9dwfw1j75zd11vpd12i533f3p44pzwbm";
        buildDepends = [ array base containers ];
        testDepends = [ base hspec HUnit QuickCheck ];
        description = "Fast algorithms for single, average/UPGMA and complete linkage clustering";
@@ -65426,8 +65519,8 @@ self: {
      }:
      mkDerivation {
        pname = "hierarchical-clustering-diagrams";
-       version = "0.3";
-       sha256 = "0yq3sh6xn3p1jzp3w33zv1sx7yhv9v2ddcqd27cl3rm6lhph81jc";
+       version = "0.3.2";
+       sha256 = "06ncyzhql74ni746a9hzma1v0grw99vas4xglmyvgd6yhdwl08sr";
        buildDepends = [ base diagrams-lib hierarchical-clustering ];
        testDepends = [
          base diagrams-cairo diagrams-lib hierarchical-clustering hspec
@@ -65518,6 +65611,24 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "highjson" = callPackage
+    ({ mkDerivation, attoparsec, base, bytestring, containers, hashable
+     , hspec, hvect, scientific, text, unordered-containers, vector
+     }:
+     mkDerivation {
+       pname = "highjson";
+       version = "0.1.0.0";
+       sha256 = "1j0gcbgawimzr8vvglikmdr8q58zvvak68k8221ljydppanc30k0";
+       buildDepends = [
+         attoparsec base bytestring containers hashable hvect scientific
+         text unordered-containers vector
+       ];
+       testDepends = [ base hspec text ];
+       homepage = "https://github.com/agrafix/highjson";
+       description = "Very fast JSON parsing";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "highlight-versions" = callPackage
     ({ mkDerivation, ansi-terminal, base, Cabal, containers, hackage-db
      }:
@@ -65850,10 +65961,9 @@ self: {
      }:
      mkDerivation {
        pname = "hint-server";
-       version = "1.4.0";
-       sha256 = "0iirk76n9j4iwll44gs4spnssv2kkxrw4ypp228gap5h4pyimvx5";
+       version = "1.4.2";
+       sha256 = "1rv6b0vlqs855m3bv047pvdkycmx2mv049cnp9iw8b97d0fsfyf5";
        buildDepends = [ base eprocess exceptions hint monad-loops mtl ];
-       jailbreak = true;
        description = "A server process that runs hint";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
@@ -67233,10 +67343,8 @@ self: {
      }:
      mkDerivation {
        pname = "hnix";
-       version = "0.2.0";
-       revision = "1";
-       sha256 = "02aygnc0hhg3gsj9z323pq6i6v9ijjj5r6i8g1zx1cnwd51dw1aj";
-       editedCabalFile = "8267f50b3b3fc9736bb1e942fbe425a1a4ef2b96a6b906dff18496ce1e0578d6";
+       version = "0.2.1";
+       sha256 = "1y10w6ylgrdgy271a372f14rqdkvzlmpkjl08d5zg3r84jxhy6ia";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -69062,8 +69170,8 @@ self: {
     ({ mkDerivation, base, deepseq, HUnit, mtl, parallel, random }:
      mkDerivation {
        pname = "hs-carbon";
-       version = "0.1.0.0";
-       sha256 = "0i6jzqqlayxi1aqkrsdlb9kbj6ysj2qxr0rbmdw66zr5hinm345v";
+       version = "0.1.1.0";
+       sha256 = "0frip4q5vxvdkc4f8bigpp066i53f4786cj2znyq21h65zndaq53";
        buildDepends = [ base deepseq mtl parallel random ];
        testDepends = [ base HUnit ];
        description = "A Haskell framework for parallel monte carlo simulations";
@@ -70219,26 +70327,31 @@ self: {
 
   "hsdev" = callPackage
     ({ mkDerivation, aeson, aeson-pretty, array, attoparsec, base
-     , bytestring, Cabal, containers, deepseq, directory, exceptions
-     , filepath, ghc, ghc-mod, ghc-paths, haddock-api, haskell-src-exts
-     , hdocs, HTTP, lens, monad-loops, mtl, network, process
-     , regex-pcre-builtin, scientific, template-haskell, text, time
-     , transformers, uniplate, unix, unordered-containers, vector
+     , bin-package-db, bytestring, Cabal, containers, deepseq, directory
+     , exceptions, filepath, fsnotify, ghc, ghc-mod, ghc-paths
+     , haddock-api, haskell-src-exts, hdocs, hlint, HTTP, lens
+     , monad-loops, MonadCatchIO-transformers, mtl, network, process
+     , regex-pcre-builtin, scientific, simple-log, system-filepath
+     , template-haskell, text, time, transformers, uniplate, unix
+     , unordered-containers, vector
      }:
      mkDerivation {
        pname = "hsdev";
-       version = "0.1.3.4";
-       sha256 = "1m21wwl93sba113qr733a9qpxc0ljrn6mpd17760gzxpa5vhfjqd";
+       version = "0.1.4.0";
+       sha256 = "1m7pfrzi23wq7b3bwp4fc885di96gkg453q8xmlwdip37mh2swgz";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
-         aeson aeson-pretty array attoparsec base bytestring Cabal
-         containers deepseq directory exceptions filepath ghc ghc-mod
-         ghc-paths haddock-api haskell-src-exts hdocs HTTP lens monad-loops
-         mtl network process regex-pcre-builtin scientific template-haskell
-         text time transformers uniplate unix unordered-containers vector
+         aeson aeson-pretty array attoparsec base bin-package-db bytestring
+         Cabal containers deepseq directory exceptions filepath fsnotify ghc
+         ghc-mod ghc-paths haddock-api haskell-src-exts hdocs hlint HTTP
+         lens monad-loops MonadCatchIO-transformers mtl network process
+         regex-pcre-builtin scientific simple-log system-filepath
+         template-haskell text time transformers uniplate unix
+         unordered-containers vector
        ];
        testDepends = [ base ];
+       jailbreak = true;
        homepage = "https://github.com/mvoidex/hsdev";
        description = "Haskell development library and tool with support of autocompletion, symbol info, go to declaration, find references etc";
        license = stdenv.lib.licenses.bsd3;
@@ -72250,8 +72363,8 @@ self: {
      }:
      mkDerivation {
        pname = "html-tokenizer";
-       version = "0.3.0.2";
-       sha256 = "1cd332xv2acx626hkiaakng1fwwkg9m2mg7p6jj1zzb981r6xh6y";
+       version = "0.3.0.3";
+       sha256 = "0xdjjmpp1wh17cb4lnziglwhv7frr0y5v216s5ycy9lkby9r9fyv";
        buildDepends = [
          attoparsec base-prelude case-insensitive conversion
          conversion-case-insensitive conversion-text text
@@ -72471,8 +72584,8 @@ self: {
      }:
      mkDerivation {
        pname = "http-client";
-       version = "0.4.16";
-       sha256 = "1ghz498h3c0n1wfkxgkh9zd8l6yik650505hihnayp4wcykc1p82";
+       version = "0.4.18";
+       sha256 = "0skla9kvlak482fsk21gz57jcwc568x3q62nkanxjn1pgxc1jili";
        buildDepends = [
          array base base64-bytestring blaze-builder bytestring
          case-insensitive containers cookie data-default-class deepseq
@@ -72646,8 +72759,8 @@ self: {
      }:
      mkDerivation {
        pname = "http-conduit";
-       version = "2.1.5.1";
-       sha256 = "1rpp830319hqqazf1gh28jh239a67qksmx2ki3p91h9nsa8lh6w2";
+       version = "2.1.7.1";
+       sha256 = "15caswd172i8hzwmxsd3rynnfz96v5iqg9avv1ybydikvvgbqx56";
        buildDepends = [
          base bytestring conduit http-client http-client-tls http-types
          lifted-base monad-control mtl resourcet transformers
@@ -73557,12 +73670,12 @@ self: {
     ({ mkDerivation, base, HTF }:
      mkDerivation {
        pname = "hvect";
-       version = "0.1.0.0";
-       sha256 = "12zwrzz0bk83i42q3iv5cs2dma2a80s8zkjyill0ysxyrjni25wy";
+       version = "0.2.0.0";
+       sha256 = "01iarjnwm5syhmf6552g3p9dc05nqc74r4nfmagajgv7fnlsf3ri";
        buildDepends = [ base ];
        testDepends = [ base HTF ];
        homepage = "https://github.com/agrafix/hvect";
-       description = "Simple heterogeneous lists";
+       description = "Simple strict heterogeneous lists";
        license = stdenv.lib.licenses.mit;
      }) {};
 
@@ -74613,7 +74726,9 @@ self: {
      mkDerivation {
        pname = "ib-api";
        version = "0.1.0.0";
+       revision = "1";
        sha256 = "1030bj90myx5x3y297qmlmnzppfnh5d3cmwglqj1s7i6nyrh86k5";
+       editedCabalFile = "7cb1fe96767e6253ef55d4997404eb3f4048f1b9bfccfb9e6cca627a734c3bcd";
        buildDepends = [ attoparsec base bytestring network ];
        jailbreak = true;
        homepage = "https://github.com/rbermani/ib-api";
@@ -75937,8 +76052,8 @@ self: {
      }:
      mkDerivation {
        pname = "inflections";
-       version = "0.1.0.10";
-       sha256 = "0v9iz9q4f5cx2hr0afvbzy5ax71kx1klbjrla14bqdfh55hzdhrp";
+       version = "0.2.0.0";
+       sha256 = "16s2sj2417qmhdlzn7j51yf7fh50f5msgb50fsavw80845602x43";
        buildDepends = [ base containers parsec ];
        testDepends = [
          base containers HUnit parsec QuickCheck test-framework
@@ -76026,6 +76141,24 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "inilist" = callPackage
+    ({ mkDerivation, base, bifunctors, containers, deepseq, HUnit, safe
+     , tasty, tasty-hunit, testpack, trifecta
+     }:
+     mkDerivation {
+       pname = "inilist";
+       version = "0.1.0.0";
+       sha256 = "18f93kvc5x0y1wqcicrh510r3skldf52jn0n6cxyn7fk2271cc1b";
+       buildDepends = [ base bifunctors containers safe trifecta ];
+       testDepends = [
+         base bifunctors containers deepseq HUnit safe tasty tasty-hunit
+         testpack trifecta
+       ];
+       homepage = "https://chiselapp.com/user/mwm/repository/inilist";
+       description = "Processing for .ini files with duplicate sections and options";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "inject" = callPackage
     ({ mkDerivation, attoparsec, base, hspec, hspec-expectations
      , process, text
@@ -76162,13 +76295,12 @@ self: {
      }:
      mkDerivation {
        pname = "instant-aeson";
-       version = "0.1";
-       sha256 = "1idxwd0wxy6xziwlwnjwgbv9canpvwbnigrcjn3kvl0j7nld6wvj";
+       version = "0.1.0.1";
+       sha256 = "18zxvd4sw13j4gn2f7r2xdy6p0xayjv3ks8j97j7vi6cdw9aqw2z";
        buildDepends = [ aeson base instant-generics ];
        testDepends = [
          aeson base instant-generics tasty tasty-quickcheck
        ];
-       jailbreak = true;
        description = "Generic Aeson instances through instant-generics";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -76179,13 +76311,12 @@ self: {
      }:
      mkDerivation {
        pname = "instant-bytes";
-       version = "0.1";
-       sha256 = "0gjj7ix1dxlbk1im2ww3qpfx4m40vg0hl7n9ribnlx2krw53mmm1";
+       version = "0.1.0.1";
+       sha256 = "1g99yakjychx12amls2b6cfma0fzh0n9w4m2k03wqibk1aagl940";
        buildDepends = [ base bytes instant-generics ];
        testDepends = [
          base bytes instant-generics tasty tasty-quickcheck
        ];
-       jailbreak = true;
        description = "Generic Serial instances through instant-generics";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -76194,10 +76325,9 @@ self: {
     ({ mkDerivation, base, deepseq, instant-generics }:
      mkDerivation {
        pname = "instant-deepseq";
-       version = "0.1";
-       sha256 = "13w4ilnjm6m9idqkxzp0l91f156n097zlhmpny1lamy5brvzpls0";
+       version = "0.1.0.1";
+       sha256 = "1yv5zqv2fqj8b7qzx2004sa287mrvrswmghl13vsbj2whmdh0kjz";
        buildDepends = [ base deepseq instant-generics ];
-       jailbreak = true;
        description = "Generic NFData instances through instant-generics";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -76219,10 +76349,9 @@ self: {
     ({ mkDerivation, base, hashable, instant-generics }:
      mkDerivation {
        pname = "instant-hashable";
-       version = "0.1";
-       sha256 = "0bqn9na0pxkkffmwwz6p4rgv11fq2mn724sk4l7nxv44k7vrirz2";
+       version = "0.1.0.1";
+       sha256 = "1yaf24r68zh5vsp73747hbv2fdk9y9vgswj6lv22s52s8h6f1agj";
        buildDepends = [ base hashable instant-generics ];
-       jailbreak = true;
        description = "Generic Hashable instances through instant-generics";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -76477,13 +76606,13 @@ self: {
      }:
      mkDerivation {
        pname = "interpolatedstring-perl6";
-       version = "0.9.0";
-       sha256 = "15hzmni3wfdgjl0vyk5mcld61ba99wdax87s7wkz2s8bsyxkbq9n";
+       version = "1.0.0";
+       sha256 = "1lx125wzadvbicsaml9wrhxxplc4gd0i4wk3f1apb0kl5nnv5q35";
        buildDepends = [
          base bytestring haskell-src-meta template-haskell text
        ];
        description = "QuasiQuoter for Perl6-style multi-line interpolated strings";
-       license = stdenv.lib.licenses.bsd3;
+       license = stdenv.lib.licenses.publicDomain;
      }) {};
 
   "interpolatedstring-qq" = callPackage
@@ -77115,6 +77244,19 @@ self: {
        license = "unknown";
      }) {};
 
+  "irc-fun-color" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "irc-fun-color";
+       version = "0.1.0.0";
+       sha256 = "1zb3d3m17049g7cfnpnl8c1ldyhhwvxh99dbfx1xzyadg841i08a";
+       buildDepends = [ base ];
+       testDepends = [ base ];
+       homepage = "http://rel4tion.org/projects/irc-fun-color/";
+       description = "Add color and style decorations to IRC messages";
+       license = stdenv.lib.licenses.publicDomain;
+     }) {};
+
   "ircbot" = callPackage
     ({ mkDerivation, base, bytestring, containers, directory, filepath
      , irc, mtl, network, parsec, random, SafeSemaphore, stm, time, unix
@@ -78432,18 +78574,21 @@ self: {
      }) {};
 
   "jsaddle" = callPackage
-    ({ mkDerivation, base, hslogger, lens, template-haskell, text
-     , transformers
+    ({ mkDerivation, base, glib, gtk3, hslogger, lens, template-haskell
+     , text, transformers, webkitgtk3, webkitgtk3-javascriptcore
      }:
      mkDerivation {
        pname = "jsaddle";
-       version = "0.2.0.5";
-       sha256 = "0avl5gvq3sv2fk524hazfk1xgb9rlyqqqrvnxb63psjds7s6rxp1";
-       buildDepends = [ base lens template-haskell text transformers ];
+       version = "0.2.0.6";
+       sha256 = "1ggnhv9lgsd330p1k6zvg20dbqb1ysh282nalxramqvn2yhmqsx4";
+       buildDepends = [
+         base lens template-haskell text transformers webkitgtk3
+         webkitgtk3-javascriptcore
+       ];
        testDepends = [
-         base hslogger lens template-haskell text transformers
+         base glib gtk3 hslogger lens template-haskell text transformers
+         webkitgtk3 webkitgtk3-javascriptcore
        ];
-       jailbreak = true;
        description = "High level interface for webkit-javascriptcore";
        license = stdenv.lib.licenses.mit;
      }) {};
@@ -78722,8 +78867,8 @@ self: {
      }:
      mkDerivation {
        pname = "json-rpc-client";
-       version = "0.2.0.0";
-       sha256 = "13mc23dpyn9zsv1gfb913g8w8csjgnk5xrbbyhxgmam9kslpbxjj";
+       version = "0.2.1.0";
+       sha256 = "1ma5vahbcfarbvc0m8n88i0hn9szbvanmfd81jmvwkamkqxxgmis";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -78747,8 +78892,8 @@ self: {
      }:
      mkDerivation {
        pname = "json-rpc-server";
-       version = "0.2.0.0";
-       sha256 = "08v2bvswn0a0jhd0gd83f2lxr0n0nirl9xav7zj3y3bjdkxwlkys";
+       version = "0.2.1.0";
+       sha256 = "1rbm8anj3lg3x7gky5nazxcsdwd5c48b1axphgcqzzy5hn8hsg2r";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -80812,25 +80957,27 @@ self: {
      }) {};
 
   "lambdacms-core" = callPackage
-    ({ mkDerivation, base, blaze-html, bytestring, containers
-     , data-default, esqueleto, file-embed, friendly-time, gravatar
-     , lists, mime-mail, old-locale, persistent, shakespeare
-     , template-haskell, text, time, uuid, wai, yesod, yesod-auth
-     , yesod-core, yesod-form
+    ({ mkDerivation, base, blaze-html, bytestring, classy-prelude
+     , classy-prelude-yesod, containers, data-default, esqueleto
+     , file-embed, friendly-time, gravatar, hspec, lists, mime-mail
+     , old-locale, persistent, shakespeare, template-haskell, text, time
+     , uuid, wai, yesod, yesod-auth, yesod-core, yesod-form
      }:
      mkDerivation {
        pname = "lambdacms-core";
-       version = "0.1.0.0";
-       sha256 = "0f34158j493ga5zrl1fxqyxvxfj3gzx77vs3p9rb7syn7c1zxa53";
+       version = "0.3.0.2";
+       sha256 = "0m8piymzcciy4dqhxqxslpm1rbzasm1diasr8ab05r9lcrs1dn76";
        buildDepends = [
          base blaze-html bytestring containers data-default esqueleto
          file-embed friendly-time gravatar lists mime-mail old-locale
          persistent shakespeare template-haskell text time uuid wai yesod
          yesod-auth yesod-core yesod-form
        ];
-       jailbreak = true;
+       testDepends = [
+         base classy-prelude classy-prelude-yesod hspec yesod yesod-core
+       ];
        homepage = "http://lambdacms.org";
-       description = "LambdaCms Core subsite for Yesod apps";
+       description = "LambdaCms 'core' subsite for Yesod apps";
        license = stdenv.lib.licenses.mit;
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
@@ -80841,8 +80988,8 @@ self: {
      }:
      mkDerivation {
        pname = "lambdacms-media";
-       version = "0.2.0";
-       sha256 = "08c2qdpqv8bw0qkpjk5fcyyqdgpxgp6xivfimai6bh3lxz2yk0gz";
+       version = "0.3.0.1";
+       sha256 = "074bghfbi3m4ffla34z0yq2qgbw3ps81fq2cm8ibqry3bps511xp";
        buildDepends = [
          base directory filepath lambdacms-core persistent shakespeare text
          time yesod yesod-form
@@ -82216,8 +82363,8 @@ self: {
      }:
      mkDerivation {
        pname = "leksah";
-       version = "0.15.1.0";
-       sha256 = "0skvn5n69ir63q91jaj5qdhk8cxvic61g9ar5wck0gwpzdjcfl6w";
+       version = "0.15.1.1";
+       sha256 = "0gjgaigkd34gzfvqhlxqqxcydh12064prnn0x653kb5ks8bq4qml";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -82251,8 +82398,8 @@ self: {
      }:
      mkDerivation {
        pname = "leksah-server";
-       version = "0.15.0.4";
-       sha256 = "0zjdzsv9vwhsabkkyf47gfsca4b1yqjgd2vlvb0qm7ca9gymd0ic";
+       version = "0.15.0.6";
+       sha256 = "1pcf42hipc5q3n61pbd2sdgvhshl2ri261i94myb3fc13kbi90hb";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -82535,8 +82682,8 @@ self: {
      }:
      mkDerivation {
        pname = "lentil";
-       version = "0.1.2.6";
-       sha256 = "0pn4x75l04qs95h9ca5chvxbivnb29h4d8415n4r2b1gmx4apn0w";
+       version = "0.1.2.7";
+       sha256 = "1g3if2y41li6wyg7ffvpybqvbywiq8bf5b5fb6pz499hinzahb9d";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -83290,14 +83437,13 @@ self: {
      }:
      mkDerivation {
        pname = "libsystemd-journal";
-       version = "1.3.1";
-       sha256 = "1i66w6dhycvi3d0vnws91mc0k9v46qr0zpc35yliv1paipm1s51a";
+       version = "1.3.3";
+       sha256 = "02d1zpmimmisjngkx9l23af51v18pdbc5mh7yljyw81lm39yzvfn";
        buildDepends = [
          base bytestring hashable hsyslog pipes pipes-safe text transformers
          uniplate unix-bytestring unordered-containers uuid vector
        ];
        pkgconfigDepends = [ systemd ];
-       jailbreak = true;
        homepage = "http://github.com/ocharles/libsystemd-journal";
        description = "Haskell bindings to libsystemd-journal";
        license = stdenv.lib.licenses.bsd3;
@@ -83570,8 +83716,8 @@ self: {
      }:
      mkDerivation {
        pname = "limp";
-       version = "0.3.2.0";
-       sha256 = "0shc69jlzmn8b2pxdfav9lk9cbhxpd1cmsr36rwgyvyn5shiijy1";
+       version = "0.3.2.1";
+       sha256 = "0fx8q7ll47qc06laagiap0z4b5mbp958r3b9mc6qm1h9rhksimjk";
        buildDepends = [ base containers ];
        testDepends = [
          base containers QuickCheck tasty tasty-quickcheck tasty-th
@@ -83587,8 +83733,8 @@ self: {
     ({ mkDerivation, base, c2hs, containers, limp, vector }:
      mkDerivation {
        pname = "limp-cbc";
-       version = "0.3.2.0";
-       sha256 = "10cm2vwbjyzqpq2ras8viza0vy0r0hgrm84landlcgkbhfj71l79";
+       version = "0.3.2.1";
+       sha256 = "0q4az96nbwvm7jhrwvbjp87vzkb5nlp739jhkya6z0iq340cjxjy";
        buildDepends = [ base containers limp vector ];
        testDepends = [ base limp ];
        buildTools = [ c2hs ];
@@ -83905,13 +84051,12 @@ self: {
      }:
      mkDerivation {
        pname = "linklater";
-       version = "3.1.0.0";
-       sha256 = "0mvmlq1nl428syc013hif07rssvya7wxkr44rs58rjn2zsxhhlqq";
+       version = "3.2.0.0";
+       sha256 = "15c6p63yd1g5if2nz9pig6kc0rvqpjixjs6zr2j9m16q0h6kgrfr";
        buildDepends = [
          aeson base base-prelude bytestring containers http-types text wai
          wreq
        ];
-       jailbreak = true;
        homepage = "https://github.com/hlian/linklater";
        description = "The fast and fun way to write Slack.com bots";
        license = stdenv.lib.licenses.bsd3;
@@ -85698,8 +85843,8 @@ self: {
      }:
      mkDerivation {
        pname = "ltk";
-       version = "0.15.0.1";
-       sha256 = "0qw689ip8kibczjvar6bicns6g8a0zwlb6vdcmpicxxmpr1p7g16";
+       version = "0.15.0.2";
+       sha256 = "19wnkl9acibs6kcnm0m02jhjxrn19sanf5z2w0kqwjbqlfcrcc4a";
        buildDepends = [
          base Cabal containers filepath ghc glib gtk3 mtl parsec pretty text
          transformers
@@ -86968,8 +87113,8 @@ self: {
      }:
      mkDerivation {
        pname = "mangopay";
-       version = "1.11.3";
-       sha256 = "1w9p0na0am2hl8f32qgkdym00kjjnavv1wxp6f4vh9msa6cfw6yl";
+       version = "1.11.4";
+       sha256 = "0yb6i97ihcywbgzqkrad72q33m7fgx903rqizlhb4nz4bkl8793d";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -90584,8 +90729,8 @@ self: {
      }:
      mkDerivation {
        pname = "monoid-subclasses";
-       version = "0.4.1.1";
-       sha256 = "0r2ypb85qz88jz70pr4rgygwsdslaw781s0d3svd6s7xfibi9hww";
+       version = "0.4.1.2";
+       sha256 = "0j9an1zq3dg02jz8skqkch01kg2ha59zja2729v8lpwxsd4sbi9x";
        buildDepends = [ base bytestring containers primes text vector ];
        testDepends = [
          base bytestring containers primes QuickCheck quickcheck-instances
@@ -91035,6 +91180,27 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "ms" = callPackage
+    ({ mkDerivation, base, contravariant, doctest, edit-distance, lens
+     , profunctors, semigroupoids, semigroups, tasty, tasty-quickcheck
+     , vector
+     }:
+     mkDerivation {
+       pname = "ms";
+       version = "0.2.1";
+       sha256 = "0h70dkgzybbjm48ay9xqbvydf13a6q1zy99ln8kx4qlfdi4gsrnp";
+       buildDepends = [
+         base contravariant edit-distance lens profunctors semigroupoids
+         semigroups vector
+       ];
+       testDepends = [
+         base doctest profunctors tasty tasty-quickcheck vector
+       ];
+       homepage = "https://github.com/relrod/ms";
+       description = "metric spaces";
+       license = stdenv.lib.licenses.bsd2;
+     }) {};
+
   "msgpack" = callPackage
     ({ mkDerivation, base, binary, blaze-builder, bytestring
      , containers, data-binary-ieee754, deepseq, hashable, mtl
@@ -93479,10 +93645,9 @@ self: {
     ({ mkDerivation, base, netwire }:
      mkDerivation {
        pname = "netwire-input";
-       version = "0.0.3";
-       sha256 = "0c6wi1gfr0pxm8hav6ziic444a83cns3yf07kdylxbymgzgq7n7z";
+       version = "0.0.4";
+       sha256 = "1f0dczgnc1fibq5ypdzi1hgsahmbfmv783bliwh5x4j4vm81k0h6";
        buildDepends = [ base netwire ];
-       jailbreak = true;
        homepage = "https://www.github.com/Mokosha/netwire-input";
        description = "Input handling abstractions for netwire";
        license = stdenv.lib.licenses.mit;
@@ -93493,12 +93658,11 @@ self: {
      }:
      mkDerivation {
        pname = "netwire-input-glfw";
-       version = "0.0.3";
-       sha256 = "04flihwgs4wibhppyjw7x23s2629rbywafbv9dmdcda6bv6d8qm3";
+       version = "0.0.4";
+       sha256 = "163jd8bb0msy9r51s8qb6ypk25lax46kkbzq9wh2s4kvzribmdlg";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [ base containers GLFW-b mtl netwire-input stm ];
-       jailbreak = true;
        homepage = "https://www.github.com/Mokosha/netwire-input-glfw";
        description = "GLFW instance of netwire-input";
        license = stdenv.lib.licenses.mit;
@@ -94182,6 +94346,7 @@ self: {
          amqp base network-transport network-transport-tests tasty
          tasty-hunit
        ];
+       jailbreak = true;
        description = "AMQP-based transport layer for distributed-process (aka Cloud Haskell)";
        license = stdenv.lib.licenses.mit;
        hydraPlatforms = stdenv.lib.platforms.none;
@@ -94880,24 +95045,25 @@ self: {
     ({ mkDerivation, base, primitive, vector }:
      mkDerivation {
        pname = "nonlinear-optimization";
-       version = "0.3.7";
-       sha256 = "147dbq19n18ixfz6bhx9yi9ppr9j3wnc5dfz8kx5gwihy64b8l1b";
+       version = "0.3.10";
+       sha256 = "11dq7fvysdb0szkg58f2wmx2vg6sa9qfj9kfv7wv6fl3386dnp7f";
        buildDepends = [ base primitive vector ];
-       jailbreak = true;
        description = "Various iterative algorithms for optimization of nonlinear functions";
        license = "GPL";
      }) {};
 
   "nonlinear-optimization-ad" = callPackage
-    ({ mkDerivation, ad, base, nonlinear-optimization, primitive
+    ({ mkDerivation, ad, base, csv, nonlinear-optimization, primitive
      , reflection, vector
      }:
      mkDerivation {
        pname = "nonlinear-optimization-ad";
-       version = "0.2.0";
-       sha256 = "1aglqfmvjb7wmxlnlkakkp27lbyq62pjy48k18sqppj6q0qp062m";
+       version = "0.2.1";
+       sha256 = "0k3iynppdvmm9asy1wddp8n3gmskh40dmcngqv8pgy5qx0bnx8jd";
+       isLibrary = true;
+       isExecutable = true;
        buildDepends = [
-         ad base nonlinear-optimization primitive reflection vector
+         ad base csv nonlinear-optimization primitive reflection vector
        ];
        homepage = "https://github.com/msakai/nonlinear-optimization-ad";
        description = "Wrapper of nonlinear-optimization package for using with AD package";
@@ -94938,8 +95104,8 @@ self: {
      }:
      mkDerivation {
        pname = "not-gloss";
-       version = "0.7.4.0";
-       sha256 = "11ikk8yia52qbaajcnwc7gq1jwwid12j8vzgn2v18j5d272lzwyc";
+       version = "0.7.5.0";
+       sha256 = "1r0mycb3ilz2k89vab08c1diz18mp03b5sds4ixmxfb0zqaz68lb";
        buildDepends = [
          base binary bmp bytestring cereal GLUT OpenGL OpenGLRaw
          spatial-math time vector vector-binary-instances
@@ -95426,6 +95592,42 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "nvim-hs" = callPackage
+    ({ mkDerivation, base, bytestring, cereal, cereal-conduit, conduit
+     , conduit-extra, containers, data-default, directory, dyre
+     , filepath, hslogger, hspec, hspec-discover, HUnit, lifted-base
+     , messagepack, monad-control, mtl, network, optparse-applicative
+     , parsec, process, QuickCheck, resourcet, stm, streaming-commons
+     , template-haskell, text, time, transformers, transformers-base
+     , utf8-string
+     }:
+     mkDerivation {
+       pname = "nvim-hs";
+       version = "0.0.1";
+       sha256 = "1zma19lb4kzzfiabkx55ffgvdqrycijpm2yz3jszm1m6m58khif5";
+       isLibrary = true;
+       isExecutable = true;
+       buildDepends = [
+         base bytestring cereal cereal-conduit conduit conduit-extra
+         containers data-default directory dyre filepath hslogger
+         lifted-base messagepack monad-control mtl network
+         optparse-applicative parsec process resourcet stm streaming-commons
+         template-haskell text time transformers transformers-base
+         utf8-string
+       ];
+       testDepends = [
+         base bytestring cereal cereal-conduit conduit conduit-extra
+         containers data-default directory dyre filepath hslogger hspec
+         hspec-discover HUnit lifted-base messagepack mtl network
+         optparse-applicative parsec process QuickCheck resourcet stm
+         streaming-commons template-haskell text time transformers
+         utf8-string
+       ];
+       homepage = "https://github.com/saep/nvim-hs";
+       description = "Haskell plugin backend for neovim";
+       license = stdenv.lib.licenses.asl20;
+     }) {};
+
   "nyan" = callPackage
     ({ mkDerivation, base, bytestring, mtl, ncurses, text }:
      mkDerivation {
@@ -95996,24 +96198,23 @@ self: {
 
   "opaleye" = callPackage
     ({ mkDerivation, attoparsec, base, base16-bytestring, bytestring
-     , case-insensitive, contravariant, postgresql-simple, pretty
-     , product-profunctors, profunctors, semigroups, text, time
-     , time-locale-compat, transformers, uuid
+     , case-insensitive, containers, contravariant, postgresql-simple
+     , pretty, product-profunctors, profunctors, QuickCheck, semigroups
+     , text, time, time-locale-compat, transformers, uuid, void
      }:
      mkDerivation {
        pname = "opaleye";
-       version = "0.3.1.2";
-       revision = "3";
-       sha256 = "01ldghza5l1qgcpvsphajfkq7g09fw0dm4vnya9wbs0hla307av9";
-       editedCabalFile = "9ee83219b8bc26fe01cca7484513bc3373d2868855ba8757fd210482f0605852";
+       version = "0.4.0.0";
+       sha256 = "1dzfxy5r2phqcnijvq74ardjg9p2mlkpidg95dd3v9qiz1ls71rk";
        buildDepends = [
          attoparsec base base16-bytestring bytestring case-insensitive
          contravariant postgresql-simple pretty product-profunctors
          profunctors semigroups text time time-locale-compat transformers
-         uuid
+         uuid void
        ];
        testDepends = [
-         base postgresql-simple product-profunctors profunctors time
+         base containers contravariant postgresql-simple product-profunctors
+         profunctors QuickCheck semigroups time
        ];
        homepage = "https://github.com/tomjaguarpaw/haskell-opaleye";
        description = "An SQL-generating DSL targeting PostgreSQL";
@@ -97524,8 +97725,8 @@ self: {
      }:
      mkDerivation {
        pname = "pandoc-crossref";
-       version = "0.1.2.2";
-       sha256 = "1ynxg9d3ssq9bby073j40913z11xap6gpf8hkjl0h0ll3mx89vb9";
+       version = "0.1.2.4";
+       sha256 = "1ay54zkxxa22nz5sr40d6k4bam81hxh19583kffwqdcp0af23d7l";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -99227,6 +99428,20 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "persist2er" = callPackage
+    ({ mkDerivation, base, optparse-applicative, persistent, text }:
+     mkDerivation {
+       pname = "persist2er";
+       version = "0.1.0.1";
+       sha256 = "096gjkmw06crywwwydyr67447xmp8x967dwh1gavlr0061skb72p";
+       isLibrary = false;
+       isExecutable = true;
+       buildDepends = [ base optparse-applicative persistent text ];
+       jailbreak = true;
+       description = "Transforms persist's quasi-quoted syntax into ER format";
+       license = stdenv.lib.licenses.gpl3;
+     }) {};
+
   "persistable-record" = callPackage
     ({ mkDerivation, array, base, containers, dlist, names-th
      , template-haskell, transformers
@@ -99318,6 +99533,17 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "persistent-instances-iproute" = callPackage
+    ({ mkDerivation, base, bytestring, iproute, persistent }:
+     mkDerivation {
+       pname = "persistent-instances-iproute";
+       version = "0.1.0.1";
+       sha256 = "0nmk138kv020aa0pw29l177rb6rji4rnmw4ndnkn1xvp8gh3w0yn";
+       buildDepends = [ base bytestring iproute persistent ];
+       description = "Persistent instances for types in iproute";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "persistent-map" = callPackage
     ({ mkDerivation, base, binary, containers, directory, EdisonAPI
      , EdisonCore, filepath, LRU, mtl, stm-io-hooks
@@ -100339,6 +100565,21 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "pipes-cereal" = callPackage
+    ({ mkDerivation, base, bytestring, cereal, mtl, pipes
+     , pipes-bytestring, pipes-parse
+     }:
+     mkDerivation {
+       pname = "pipes-cereal";
+       version = "0.1.0.0";
+       sha256 = "04f538gyzvwxhqscsj9sywi6hz5k1fabjaga0vf861hlmv9agaa8";
+       buildDepends = [
+         base bytestring cereal mtl pipes pipes-bytestring pipes-parse
+       ];
+       description = "Encode and decode binary streams using the pipes and cereal libraries";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "pipes-cereal-plus" = callPackage
     ({ mkDerivation, base, bytestring, cereal-plus, errors, mtl, pipes
      , pipes-bytestring, text
@@ -104715,6 +104956,24 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "pusher-haskell" = callPackage
+    ({ mkDerivation, aeson, base, bytestring, hspec, HTTP, MissingH
+     , mtl, SHA, time
+     }:
+     mkDerivation {
+       pname = "pusher-haskell";
+       version = "0.1.0.0";
+       sha256 = "0ymj27a3kmaddydd5zshj108fmzhlxasn9i4igzjaj308f1ygki6";
+       buildDepends = [
+         aeson base bytestring HTTP MissingH mtl SHA time
+       ];
+       testDepends = [ base hspec ];
+       jailbreak = true;
+       homepage = "http://www.github.com/sidraval/pusher-haskell";
+       description = "A Pusher.com client written in Haskell";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "pushme" = callPackage
     ({ mkDerivation, aeson, base, bytestring, containers, deepseq
      , hslogger, io-storage, lens, old-locale, optparse-applicative
@@ -106051,16 +106310,16 @@ self: {
      }) {};
 
   "range" = callPackage
-    ({ mkDerivation, base, Cabal, parsec, QuickCheck, random
+    ({ mkDerivation, base, Cabal, free, parsec, QuickCheck, random
      , test-framework, test-framework-quickcheck2
      }:
      mkDerivation {
        pname = "range";
-       version = "0.1.1.1";
-       sha256 = "05xcy4r97yyqr72cqpr5rq514zygbwa2hfnhilvgzrh3cmk61n0p";
-       buildDepends = [ base parsec ];
+       version = "0.1.2.0";
+       sha256 = "028bigaq4vk5ykzf04f5hi3g37gxzzp6q24bjcb3gjfzcgy7z6ab";
+       buildDepends = [ base free parsec ];
        testDepends = [
-         base Cabal QuickCheck random test-framework
+         base Cabal free QuickCheck random test-framework
          test-framework-quickcheck2
        ];
        homepage = "https://bitbucket.org/robertmassaioli/range";
@@ -106333,8 +106592,8 @@ self: {
      }:
      mkDerivation {
        pname = "rdf4h";
-       version = "1.3.1";
-       sha256 = "0mcswyjlvhnv4rvapanfmxf2brsp5b9r1ps22n3rlhpa3mfw72rc";
+       version = "1.3.2";
+       sha256 = "09ya3d1svg6fj7jdm408gisv0cnn0c2i2c3pn07xggnn882s93bw";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -106343,9 +106602,9 @@ self: {
          unordered-containers
        ];
        testDepends = [
-         base bytestring containers deepseq fgl hashable HTTP HUnit hxt knob
-         network network-uri parsec QuickCheck test-framework
-         test-framework-hunit test-framework-quickcheck2 text
+         base binary bytestring containers deepseq fgl hashable HTTP HUnit
+         hxt knob network network-uri parsec QuickCheck test-framework
+         test-framework-hunit test-framework-quickcheck2 text text-binary
          unordered-containers
        ];
        homepage = "https://github.com/robstewart57/rdf4h";
@@ -106411,15 +106670,16 @@ self: {
      }) {};
 
   "react-haskell" = callPackage
-    ({ mkDerivation, base, deepseq, haste-compiler, lens-family
-     , monads-tf, transformers, void
+    ({ mkDerivation, aeson, base, deepseq, lens-family, monads-tf, text
+     , transformers, unordered-containers, void
      }:
      mkDerivation {
        pname = "react-haskell";
-       version = "1.3.0.0";
-       sha256 = "1jq96fiq133ng6ayknzxwcz59f2gxa5f5hhj9n46pixwdp6bf2aa";
+       version = "2.0.0";
+       sha256 = "016bpbci89b6grkwnq1yqjm5y50di1hmjlf2mkxjc0wyi82c7say";
        buildDepends = [
-         base deepseq haste-compiler lens-family monads-tf transformers void
+         aeson base deepseq lens-family monads-tf text transformers
+         unordered-containers void
        ];
        homepage = "https://github.com/joelburget/react-haskell";
        description = "Haskell React bindings";
@@ -106955,6 +107215,31 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "reddit" = callPackage
+    ({ mkDerivation, aeson, api-builder, base, bytestring, Cabal
+     , data-default, hspec, http-conduit, http-types, network, stm, text
+     , time, transformers, unordered-containers, vector
+     }:
+     mkDerivation {
+       pname = "reddit";
+       version = "0.1.0.0";
+       revision = "1";
+       sha256 = "1g18lfl9hvz13f3i5h819pfh724i5lhgqfvyy2r06ni7hjfylzj4";
+       editedCabalFile = "84c6e65809dcd5c4fed83d64c71c6465a6ee1fe6e913c637dc2db608c6cc5870";
+       buildDepends = [
+         aeson api-builder base bytestring data-default http-conduit
+         http-types network stm text time transformers unordered-containers
+         vector
+       ];
+       testDepends = [
+         api-builder base bytestring Cabal hspec http-conduit text time
+         transformers
+       ];
+       homepage = "https://github.com/intolerable/reddit";
+       description = "Library for interfacing with Reddit's API";
+       license = stdenv.lib.licenses.bsd2;
+     }) {};
+
   "redis" = callPackage
     ({ mkDerivation, base, bytestring, concurrent-extra, containers
      , exceptions, mtl, network, old-time, utf8-string
@@ -107150,6 +107435,17 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "refact" = callPackage
+    ({ mkDerivation, base }:
+     mkDerivation {
+       pname = "refact";
+       version = "0.2.0.0";
+       sha256 = "1ixbji328bxdz4rblb0s7hp6vbckj4yj03a8a8sa756igj988v8f";
+       buildDepends = [ base ];
+       description = "Specify refactorings to perform with apply-refact";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "refcount" = callPackage
     ({ mkDerivation, base, Cabal, hashable, HUnit, QuickCheck
      , test-framework, test-framework-hunit, test-framework-quickcheck2
@@ -107334,6 +107630,19 @@ self: {
        broken = true;
      }) { ghcjs-base = null;};
 
+  "reflex-gloss" = callPackage
+    ({ mkDerivation, base, dependent-sum, gloss, reflex, transformers
+     }:
+     mkDerivation {
+       pname = "reflex-gloss";
+       version = "0.1.0.2";
+       sha256 = "18sbqryf6kxadgbvr6nh0f07897fq9fjj0h2w07xcdpp1ygg1nfg";
+       buildDepends = [ base dependent-sum gloss reflex transformers ];
+       homepage = "https://github.com/reflex-frp/reflex-gloss";
+       description = "An reflex interface for gloss";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "reform" = callPackage
     ({ mkDerivation, base, containers, mtl, text }:
      mkDerivation {
@@ -107986,6 +108295,25 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "rei" = callPackage
+    ({ mkDerivation, attoparsec, base, bytestring, containers
+     , directory, regex-posix, split
+     }:
+     mkDerivation {
+       pname = "rei";
+       version = "0.1.0.1";
+       sha256 = "15xq2aj77y7l4frxkariw1z0c3y324iz697im8ynlzm88z2iixs6";
+       isLibrary = false;
+       isExecutable = true;
+       buildDepends = [
+         attoparsec base bytestring containers directory regex-posix split
+       ];
+       jailbreak = true;
+       homepage = "https://github.com/kerkomen/rei";
+       description = "Process lists easily";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "reified-records" = callPackage
     ({ mkDerivation, base, containers, mtl }:
      mkDerivation {
@@ -111341,15 +111669,16 @@ self: {
 
   "satchmo" = callPackage
     ({ mkDerivation, array, async, base, bytestring, containers
-     , directory, minisat, mtl, process
+     , deepseq, directory, hashable, lens, memoize, minisat, mtl
+     , process, transformers
      }:
      mkDerivation {
        pname = "satchmo";
-       version = "2.9.7.3";
-       sha256 = "1gkb3whi0sv51jxb3x4dpam532fv3wbn1dyp9sc2c7mdjnv24kn8";
+       version = "2.9.9";
+       sha256 = "134i2xd7fvdhx43a51486mb3szi6c604pqc6w3cxsic1ngm30jbw";
        buildDepends = [
-         array async base bytestring containers directory minisat mtl
-         process
+         array async base bytestring containers deepseq directory hashable
+         lens memoize minisat mtl process transformers
        ];
        testDepends = [ array base ];
        homepage = "https://github.com/jwaldmann/satchmo";
@@ -112003,7 +112332,9 @@ self: {
      mkDerivation {
        pname = "scotty";
        version = "0.10.2";
+       revision = "1";
        sha256 = "0jlw82brnvc4cbpws0dq3qxn4rnb3z6rx6cfiarqwas14x4k3kl6";
+       editedCabalFile = "e0ab23342583c37af1a5422fad9a64926e54cad208dbcac75c70b3db40bf9e99";
        buildDepends = [
          aeson base blaze-builder bytestring case-insensitive
          data-default-class http-types monad-control mtl nats network
@@ -112134,8 +112465,8 @@ self: {
     ({ mkDerivation, base, scotty, transformers, wai, warp, warp-tls }:
      mkDerivation {
        pname = "scotty-tls";
-       version = "0.3.0.0";
-       sha256 = "11zpbqrfmjyl8kck1za0pvf1b1gn0ih3an8vq85si22414bs5j23";
+       version = "0.4.0";
+       sha256 = "1axr54s8zi9jw5y6yl2izjx4xvd25y18nh4fw7asq9fz0nwjb45a";
        buildDepends = [ base scotty transformers wai warp warp-tls ];
        homepage = "https://github.com/dmjio/scotty-tls.git";
        description = "TLS for Scotty";
@@ -112504,27 +112835,29 @@ self: {
 
   "second-transfer" = callPackage
     ({ mkDerivation, attoparsec, base, base16-bytestring, binary
-     , bytestring, conduit, containers, cpphs, exceptions, hashable
-     , hashtables, hslogger, http2, HUnit, lens, network, network-uri
-     , openssl, text, time, transformers
+     , bytestring, clock, conduit, containers, cpphs, deepseq
+     , exceptions, hashable, hashtables, hslogger, http2, HUnit, lens
+     , network, network-uri, openssl, pqueue, SafeSemaphore, stm, text
+     , time, transformers, unordered-containers
      }:
      mkDerivation {
        pname = "second-transfer";
-       version = "0.5.5.1";
-       sha256 = "06ldrfzp96w7q99nhhhjhay6g0gsvg16x64hwjih1nswcj9rpl6x";
+       version = "0.6.0.0";
+       sha256 = "1w726qfbz86sicpg5apx5n767av61l3kn8fra7ban8f67amg3z7w";
        buildDepends = [
-         attoparsec base base16-bytestring binary bytestring conduit
-         containers exceptions hashable hashtables hslogger http2 lens
-         network network-uri text time transformers
+         attoparsec base base16-bytestring binary bytestring clock conduit
+         containers deepseq exceptions hashable hashtables hslogger http2
+         lens network network-uri pqueue SafeSemaphore stm text time
+         transformers
        ];
        testDepends = [
-         attoparsec base base16-bytestring binary bytestring conduit
-         containers cpphs exceptions hashable hashtables hslogger http2
-         HUnit lens network network-uri text time transformers
+         attoparsec base base16-bytestring binary bytestring clock conduit
+         containers cpphs deepseq exceptions hashable hashtables hslogger
+         http2 HUnit lens network network-uri pqueue SafeSemaphore stm text
+         time transformers unordered-containers
        ];
        buildTools = [ cpphs ];
        extraLibraries = [ openssl ];
-       jailbreak = true;
        homepage = "https://www.httptwo.com/second-transfer/";
        description = "Second Transfer HTTP/2 web server";
        license = stdenv.lib.licenses.bsd3;
@@ -113503,6 +113836,7 @@ self: {
          network parsec QuickCheck servant string-conversions temporary text
          transformers wai wai-extra warp
        ];
+       jailbreak = true;
        homepage = "http://haskell-servant.github.io/";
        description = "A family of combinators for defining webservices APIs and serving them";
        license = stdenv.lib.licenses.bsd3;
@@ -114358,8 +114692,8 @@ self: {
      }:
      mkDerivation {
        pname = "shared-fields";
-       version = "0.1.0.0";
-       sha256 = "178jpksnxmyc07nc49wdalyh63bxwshddif9fb48p1fzcy2z5aph";
+       version = "0.2.0.0";
+       sha256 = "107n6w4dn0n4iv7qmfm1d9y04rgj3ab3qc8kyqqddnbnfa44y157";
        buildDepends = [ base template-haskell ];
        testDepends = [ base Cabal hspec lens text ];
        homepage = "http://github.com/intolerable/shared-fields";
@@ -114531,8 +114865,8 @@ self: {
      }:
      mkDerivation {
        pname = "shelly";
-       version = "1.6.2.5";
-       sha256 = "1dvaf1w1b5y717n24b9c3ri1qnpqppk5syh834h4iqcwfwlkjcvy";
+       version = "1.6.3.1";
+       sha256 = "1yd54i4ac1h23b4l4mz9ixpkhj0zxnb8gamk5jdhzgsd809cqy9q";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -114553,15 +114887,17 @@ self: {
      }) {};
 
   "shelly-extra" = callPackage
-    ({ mkDerivation, async, base, HUnit, mtl, SafeSemaphore, shelly
-     , text
+    ({ mkDerivation, async, base, hspec, HUnit, mtl, SafeSemaphore
+     , shelly, text
      }:
      mkDerivation {
        pname = "shelly-extra";
-       version = "0.3";
-       sha256 = "0rin1rqpzrjh4gs9235wy9w8rj4ac9yh83ap78a6nj0zi9w9vlwd";
+       version = "0.3.0.1";
+       sha256 = "1mc55m10s89mp2fz267sqhayaj0igj27kwyx7hnk5h23w0nhc0h5";
        buildDepends = [ async base mtl SafeSemaphore shelly ];
-       testDepends = [ base HUnit SafeSemaphore shelly text ];
+       testDepends = [
+         async base hspec HUnit mtl SafeSemaphore shelly text
+       ];
        homepage = "https://github.com/yesodweb/Shelly.hs";
        description = "shelly features that require extra dependencies";
        license = stdenv.lib.licenses.bsd3;
@@ -114857,14 +115193,14 @@ self: {
      }) {};
 
   "silently" = callPackage
-    ({ mkDerivation, base, deepseq, directory, nanospec }:
+    ({ mkDerivation, base, deepseq, directory, nanospec, temporary }:
      mkDerivation {
        pname = "silently";
-       version = "1.2.4.1";
-       sha256 = "035dw3zg680ykyz5rqkkrjn51wkznbc4jb45a8l2gh3vgqzgbf52";
+       version = "1.2.5";
+       sha256 = "0f9qm3f7y0hpxn6mddhhg51mm1r134qkvd2kr8r6192ka1ijbxnf";
        buildDepends = [ base deepseq directory ];
-       testDepends = [ base deepseq directory nanospec ];
-       homepage = "https://github.com/trystan/silently";
+       testDepends = [ base deepseq directory nanospec temporary ];
+       homepage = "https://github.com/hspec/silently";
        description = "Prevent or capture writing to stdout and other handles";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -116307,8 +116643,8 @@ self: {
     ({ mkDerivation, aeson, base, linear, text, vector }:
      mkDerivation {
        pname = "smoothie";
-       version = "0.4";
-       sha256 = "0j8nwc44q9l7wf4m3z7r32b7if7is21k3xgmi2206r4i1yxc869j";
+       version = "0.4.0.1";
+       sha256 = "1h501mcgfwak586gakqsjhmrdkq2mmfi8gwalb7wbsp57bchfg67";
        buildDepends = [ aeson base linear text vector ];
        homepage = "https://github.com/phaazon/smoothie";
        description = "Smooth curves via several interpolation modes";
@@ -116450,7 +116786,7 @@ self: {
   "snap" = callPackage
     ({ mkDerivation, aeson, attoparsec, base, bytestring, cereal
      , clientsession, comonad, configurator, containers, directory
-     , directory-tree, dlist, errors, filepath, hashable, heist, lens
+     , directory-tree, dlist, either, filepath, hashable, heist, lens
      , logict, MonadCatchIO-transformers, mtl, mwc-random, old-time
      , pwstore-fast, regex-posix, snap-core, snap-server, stm
      , template-haskell, text, time, transformers, unordered-containers
@@ -116458,19 +116794,18 @@ self: {
      }:
      mkDerivation {
        pname = "snap";
-       version = "0.14.0.5";
-       sha256 = "0wifww6mry2lxj572j9gwjxpjz4z7z9hd9jzhfyfwv2c67b39iyr";
+       version = "0.14.0.6";
+       sha256 = "05xnil6kfxwrnbvg7sigzh7hl8jsfr8cvbjd41z9ywn6ymxzr7zs";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
          aeson attoparsec base bytestring cereal clientsession comonad
-         configurator containers directory directory-tree dlist errors
+         configurator containers directory directory-tree dlist either
          filepath hashable heist lens logict MonadCatchIO-transformers mtl
          mwc-random old-time pwstore-fast regex-posix snap-core snap-server
          stm template-haskell text time transformers unordered-containers
          vector vector-algorithms xmlhtml
        ];
-       jailbreak = true;
        homepage = "http://snapframework.com/";
        description = "Top-level package for the Snap Web Framework";
        license = stdenv.lib.licenses.bsd3;
@@ -116572,7 +116907,9 @@ self: {
      mkDerivation {
        pname = "snap-core";
        version = "0.9.7.2";
+       revision = "1";
        sha256 = "0lgnflwcjyiinrm75dy1flr37bvjn3yljx53cvlsb3ccfnxqwsjj";
+       editedCabalFile = "d39520edcc970d9d1f683af9631ccbcad39536b9f88040b93efb66cbe7aefc55";
        buildDepends = [
          attoparsec attoparsec-enumerator base blaze-builder
          blaze-builder-enumerator bytestring bytestring-mmap
@@ -118275,6 +118612,25 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "spanout" = callPackage
+    ({ mkDerivation, base, containers, gloss, lens, linear, MonadRandom
+     , mtl, netwire
+     }:
+     mkDerivation {
+       pname = "spanout";
+       version = "0.1";
+       sha256 = "0qi1pm46fyrn4vv1b5kcwhd8im59nz5qil6z33r8wq16vv151qb4";
+       isLibrary = false;
+       isExecutable = true;
+       buildDepends = [
+         base containers gloss lens linear MonadRandom mtl netwire
+       ];
+       jailbreak = true;
+       homepage = "https://github.com/vtan/spanout";
+       description = "A breakout clone written in netwire and gloss";
+       license = stdenv.lib.licenses.bsd3;
+     }) {};
+
   "sparse" = callPackage
     ({ mkDerivation, base, bytestring, containers, contravariant
      , deepseq, directory, doctest, filepath, hlint, hybrid-vectors
@@ -118376,12 +118732,14 @@ self: {
      }) {};
 
   "spatial-math" = callPackage
-    ({ mkDerivation, base, binary, cereal, doctest, ghc-prim, linear }:
+    ({ mkDerivation, base, binary, cereal, doctest, ghc-prim, lens
+     , linear
+     }:
      mkDerivation {
        pname = "spatial-math";
-       version = "0.2.3.0";
-       sha256 = "0170v4wjdpwf5s1bil9jj6magaa3fv05zz8b6zd4s6ca8cgw4lc4";
-       buildDepends = [ base binary cereal ghc-prim linear ];
+       version = "0.2.4.0";
+       sha256 = "0aysc8r9ry7ii76d6522ja4pjwrfl3m212mbrimbdrh20ykirjvv";
+       buildDepends = [ base binary cereal ghc-prim lens linear ];
        testDepends = [ base doctest ];
        description = "3d math including quaternions/euler angles/dcms and utility functions";
        license = stdenv.lib.licenses.bsd3;
@@ -119606,8 +119964,8 @@ self: {
      }:
      mkDerivation {
        pname = "stackage-curator";
-       version = "0.9.0";
-       sha256 = "1mp05hv45nfysc43mdcjlhgpwkks4h533m5xf9h86xc1pmc563xf";
+       version = "0.10.0";
+       sha256 = "0dlsgm9bbib45591m7kj9vai48r4n0zvkwm4vd4c78rj54qhnq9n";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -119728,8 +120086,8 @@ self: {
      }:
      mkDerivation {
        pname = "stackage-types";
-       version = "1.0.1.1";
-       sha256 = "0zffk8rc611nm5zl53fynz8ly4mzrqx9cjyfwrw07j9mdwi21dsz";
+       version = "1.1.0";
+       sha256 = "0ynfnkpzvgd54x294w4ga8nyg8lrmcwg3bhlwdlxs2fcffaazi81";
        buildDepends = [
          aeson base Cabal containers exceptions hashable safe semigroups
          text time unordered-containers vector
@@ -120075,12 +120433,11 @@ self: {
      }:
      mkDerivation {
        pname = "statistics-dirichlet";
-       version = "0.6.1";
-       sha256 = "1kd9s7m2a8awqiqbsj0z3w585bq236fmj5s5sadsdd698irkkib1";
+       version = "0.6.3";
+       sha256 = "1sx7hxv5gvzr270h4lb76dihcqcqwgdm6mq2394s407iipb2clbw";
        buildDepends = [
          base deepseq hmatrix-special nonlinear-optimization vector
        ];
-       jailbreak = true;
        description = "Functions for working with Dirichlet densities and mixtures on vectors";
        license = stdenv.lib.licenses.bsd3;
        hydraPlatforms = stdenv.lib.platforms.none;
@@ -120337,8 +120694,8 @@ self: {
      }:
      mkDerivation {
        pname = "stitch";
-       version = "0.3.0.0";
-       sha256 = "0h0n6xyi4fi7jcy2j0yzspfla65zmv3c54d88xynv6sw305rd1kz";
+       version = "0.3.2.0";
+       sha256 = "1h8n7ry8wmzvz4bjfg6vsd7ssy17y54h2pzgjdlfam8yfcly2bb7";
        buildDepends = [ base containers text transformers ];
        testDepends = [ base Cabal hspec text ];
        description = "lightweight CSS DSL";
@@ -120646,8 +121003,8 @@ self: {
      }:
      mkDerivation {
        pname = "stomp-queue";
-       version = "0.2.0";
-       sha256 = "0xd9sdyjasp8ncb5qyzkx77a3wrybcajxdpvndx0viykma6bfmqr";
+       version = "0.2.2";
+       sha256 = "1kymwwj7yjdsyykqdqcnvgphbb1ypx7hi5a2wvx1wzv53lrspa9c";
        buildDepends = [
          attoparsec base bytestring conduit conduit-extra mime mtl
          network-conduit-tls split stompl time utf8-string
@@ -124105,6 +124462,21 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "telegram" = callPackage
+    ({ mkDerivation, aeson, base, bytestring, data-default
+     , http-conduit, url, utf8-string
+     }:
+     mkDerivation {
+       pname = "telegram";
+       version = "0.1.0.0";
+       sha256 = "1ci6606fx5cisb9yrjh0mkd549w2j3h1vzj3zm2zsl9gr7agvh4n";
+       buildDepends = [
+         aeson base bytestring data-default http-conduit url utf8-string
+       ];
+       description = "Telegram API client";
+       license = stdenv.lib.licenses.gpl2;
+     }) {};
+
   "tellbot" = callPackage
     ({ mkDerivation, base, bifunctors, bytestring, containers, errors
      , http-conduit, mtl, network, regex-posix, split, tagsoup, text
@@ -125485,8 +125857,8 @@ self: {
     ({ mkDerivation, base, text }:
      mkDerivation {
        pname = "text-zipper";
-       version = "0.1.1";
-       sha256 = "0g8w7kyvqmjx4psj0cicv4bxn1ngx0giqyz8fyfhdr6v8wd9r410";
+       version = "0.2.1";
+       sha256 = "1a4kzn2s0ah1sizbdj6fks8zb4wmsx8cqjml4id9xj94zp4akq2r";
        buildDepends = [ base text ];
        description = "A text editor zipper library";
        license = stdenv.lib.licenses.bsd3;
@@ -125955,8 +126327,8 @@ self: {
      }:
      mkDerivation {
        pname = "themoviedb";
-       version = "1.1.0.0";
-       sha256 = "0yvpijr2dk01g1ks65nalyz547l9aq97a9v1bx3lp47allihrp8k";
+       version = "1.1.1.0";
+       sha256 = "1859hbhznmp7x8kbqzrpyhndfy69jg01qrp1vh67557mznari6d8";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -125965,7 +126337,6 @@ self: {
          transformers
        ];
        testDepends = [ base bytestring tasty tasty-hunit text time ];
-       jailbreak = true;
        homepage = "http://github.com/pjones/themoviedb";
        description = "Haskell API bindings for http://themoviedb.org";
        license = stdenv.lib.licenses.mit;
@@ -126450,8 +126821,8 @@ self: {
      }:
      mkDerivation {
        pname = "tidal";
-       version = "0.4.33";
-       sha256 = "0xx02wbclq6hh50gz6vj3wmq7d5y7l4d6h48yxg3nwv4kwf44gf6";
+       version = "0.5.2";
+       sha256 = "0ll65q5fi8qfi50q9lqxdq9nsr7gizbh2xrsxgvj09nacdnwfwv0";
        buildDepends = [
          base binary bytestring colour containers hashable hmt hosc
          mersenne-random-pure64 mtl parsec process text time transformers
@@ -127647,13 +128018,12 @@ self: {
      }) {};
 
   "total" = callPackage
-    ({ mkDerivation, base, ghc-prim, void }:
+    ({ mkDerivation, base, void }:
      mkDerivation {
        pname = "total";
-       version = "1.0.3";
-       sha256 = "1aqpjpxg4incb03zryp6j66fn9wq1jd7nr5kjvrad8awk7349ggn";
-       buildDepends = [ base ghc-prim void ];
-       jailbreak = true;
+       version = "1.0.4";
+       sha256 = "0zl02pznpgg719d2639491cy4df2amj7rmwfdy9dz9cksm029pga";
+       buildDepends = [ base void ];
        description = "Exhaustive pattern matching using lenses, traversals, and prisms";
        license = stdenv.lib.licenses.bsd3;
      }) {};
@@ -128470,8 +128840,8 @@ self: {
      }:
      mkDerivation {
        pname = "tttool";
-       version = "1.4.0.2";
-       sha256 = "0avn7011868nqibmdz07s27d8g46v9hwps5h04dg57vk9305j70g";
+       version = "1.4.0.3";
+       sha256 = "0mypgqgqaf2c74vka1pmqzrvz1kwl8pjm1llh4bflizfzrxq3s9d";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -128651,6 +129021,21 @@ self: {
        license = stdenv.lib.licenses.bsd3;
      }) {};
 
+  "turkish-deasciifier" = callPackage
+    ({ mkDerivation, base, containers, HUnit, vector }:
+     mkDerivation {
+       pname = "turkish-deasciifier";
+       version = "0.1.0.0";
+       sha256 = "0dk63dknwxi7v67jn9b747mkyiz2af4b76a9q1ynn16xva2qsh93";
+       isLibrary = true;
+       isExecutable = true;
+       buildDepends = [ base containers vector ];
+       testDepends = [ base HUnit ];
+       homepage = "http://github.com/joom/turkish-deasciifier.hs";
+       description = "Haskell port of Deniz Yuret's Turkish deasciifier";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "turni" = callPackage
     ({ mkDerivation, base, containers, MonadRandom, random }:
      mkDerivation {
@@ -129017,10 +129402,8 @@ self: {
      }:
      mkDerivation {
        pname = "twitter-conduit";
-       version = "0.1.0";
-       revision = "2";
-       sha256 = "1cymgp3wlswxn5qfdr442cqq2ak48b5w1zcsr67n2g5p1izadwji";
-       editedCabalFile = "e70397da5f43d657c6c3bef7419810f61675e78aa0b0da688b1f5939d1e11bf8";
+       version = "0.1.1";
+       sha256 = "0rair336wjgg5pd0vh3g3nlc64f5sw2sg60jj2sjaxv296jvr3xx";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -129037,7 +129420,6 @@ self: {
          template-haskell text time transformers transformers-base
          twitter-types twitter-types-lens
        ];
-       jailbreak = true;
        homepage = "https://github.com/himura/twitter-conduit";
        description = "Twitter API package with conduit interface and Streaming API support";
        license = stdenv.lib.licenses.bsd3;
@@ -129072,8 +129454,8 @@ self: {
      }:
      mkDerivation {
        pname = "twitter-feed";
-       version = "0.1.1.5";
-       sha256 = "1205s5a7x8vnv09717x6a2dv7y8rvzcxmmh6hm4cyph6b5p485vz";
+       version = "0.2.0.1";
+       sha256 = "19j10mbvmmdni136b0sdyr0isdhslxcvgabvdqrd3if6cizpmndn";
        buildDepends = [
          aeson authenticate-oauth base bytestring http-conduit
        ];
@@ -133121,6 +133503,30 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "vimeta" = callPackage
+    ({ mkDerivation, aeson, base, byline, bytestring, containers
+     , directory, either, filepath, http-client, http-client-tls
+     , http-types, mtl, old-locale, optparse-applicative, parsec
+     , process, temporary, text, themoviedb, time, time-locale-compat
+     , transformers, xdg-basedir, yaml
+     }:
+     mkDerivation {
+       pname = "vimeta";
+       version = "0.2.0.0";
+       sha256 = "14xzqhykw963ja6wsnrbq8dh9wbk63aramzj4n210srwxy6yqc05";
+       isLibrary = true;
+       isExecutable = true;
+       buildDepends = [
+         aeson base byline bytestring containers directory either filepath
+         http-client http-client-tls http-types mtl old-locale
+         optparse-applicative parsec process temporary text themoviedb time
+         time-locale-compat transformers xdg-basedir yaml
+       ];
+       homepage = "http://github.com/pjones/vimeta";
+       description = "Frontend for video metadata tagging tools";
+       license = stdenv.lib.licenses.bsd2;
+     }) {};
+
   "vimus" = callPackage
     ({ mkDerivation, base, bytestring, c2hs, containers, data-default
      , deepseq, directory, filepath, hspec, hspec-expectations, libmpd
@@ -133646,8 +134052,8 @@ self: {
      }:
      mkDerivation {
        pname = "wai-app-static";
-       version = "3.1.0.1";
-       sha256 = "1z542ivy5x4qj9kizkbbvhz5pn54rcxrs6cc52199khxkfc07gdm";
+       version = "3.1.1";
+       sha256 = "0aiywk7a25fpk9fwm6fmibi4zvg5kynnjs6syfxyzfw4hl1dazjv";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -133759,8 +134165,8 @@ self: {
      }:
      mkDerivation {
        pname = "wai-extra";
-       version = "3.0.8.2";
-       sha256 = "0j6yvwzw1mpamx0phplgang4gcjv25dhqvngfmzmh5fk76npmxr9";
+       version = "3.0.9";
+       sha256 = "19rnkqg4x6n2w2313naxbkcp2hyj4bj6d6kx3rwakk8wmdy70r04";
        buildDepends = [
          ansi-terminal base base64-bytestring blaze-builder bytestring
          case-insensitive containers cookie data-default-class deepseq
@@ -133898,6 +134304,7 @@ self: {
        sha256 = "1fm985jq1sa8v3vj850cpcjl6kcyq2kgq6xwpb1rmzi8zmb80kpc";
        buildDepends = [ base wai warp ];
        pkgconfigDepends = [ QtWebKit ];
+       jailbreak = true;
        homepage = "https://github.com/yesodweb/wai/tree/master/wai-handler-webkit";
        description = "Turn WAI applications into standalone GUIs using QtWebkit";
        license = stdenv.lib.licenses.mit;
@@ -134692,26 +135099,29 @@ self: {
 
   "warp" = callPackage
     ({ mkDerivation, array, async, auto-update, base, blaze-builder
-     , bytestring, case-insensitive, doctest, ghc-prim, hashable, hspec
-     , HTTP, http-date, http-types, HUnit, iproute, lifted-base, network
-     , old-locale, QuickCheck, simple-sendfile, streaming-commons, text
-     , time, transformers, unix, unix-compat, vault, wai
+     , bytestring, case-insensitive, containers, directory, doctest
+     , ghc-prim, hashable, hspec, HTTP, http-date, http-types, http2
+     , HUnit, iproute, lifted-base, network, old-locale, process
+     , QuickCheck, simple-sendfile, stm, streaming-commons, text, time
+     , transformers, unix, unix-compat, vault, wai, word8
      }:
      mkDerivation {
        pname = "warp";
-       version = "3.0.13.1";
-       sha256 = "17vik5xf2amyi4pwq7wfia2a6f1pksa4ll155hbhkndhbwszvrkc";
+       version = "3.1.0";
+       sha256 = "1lx1fbcf8bkr5g6j0flk6mplnvs289lkyds5hv31naa450wbca62";
        buildDepends = [
          array auto-update base blaze-builder bytestring case-insensitive
-         ghc-prim hashable http-date http-types iproute network
-         simple-sendfile streaming-commons text unix unix-compat vault wai
+         containers ghc-prim hashable http-date http-types http2 iproute
+         network simple-sendfile stm streaming-commons text unix unix-compat
+         vault wai word8
        ];
        testDepends = [
          array async auto-update base blaze-builder bytestring
-         case-insensitive doctest ghc-prim hashable hspec HTTP http-date
-         http-types HUnit iproute lifted-base network old-locale QuickCheck
-         simple-sendfile streaming-commons text time transformers unix
-         unix-compat vault wai
+         case-insensitive containers directory doctest ghc-prim hashable
+         hspec HTTP http-date http-types http2 HUnit iproute lifted-base
+         network old-locale process QuickCheck simple-sendfile stm
+         streaming-commons text time transformers unix unix-compat vault wai
+         word8
        ];
        homepage = "http://github.com/yesodweb/wai";
        description = "A fast, light-weight web server for WAI applications";
@@ -134760,14 +135170,14 @@ self: {
      }:
      mkDerivation {
        pname = "warp-tls";
-       version = "3.0.4.2";
-       sha256 = "070bq28mg29yw5w7n92j73b74amqxn0yb5cx9z28p8ilmx3y03v1";
+       version = "3.1.0";
+       sha256 = "1790hl3a327fv01w2shdslylmhp5zv0bh7ljhymipr5vpjwjknrz";
        buildDepends = [
          base bytestring cprng-aes data-default-class network
          streaming-commons tls wai warp
        ];
        homepage = "http://github.com/yesodweb/wai";
-       description = "HTTP over SSL/TLS support for Warp via the TLS package";
+       description = "HTTP over TLS support for Warp via the TLS package";
        license = stdenv.lib.licenses.mit;
      }) {};
 
@@ -136213,8 +136623,8 @@ self: {
      }:
      mkDerivation {
        pname = "wordpass";
-       version = "1.0.0.3";
-       sha256 = "1nbgzrc3g3kcc8462sqskdywk0n1m54810r0jsw8ip2xllvkxx9b";
+       version = "1.0.0.4";
+       sha256 = "0plyggai2mq38bmmgc92gd0n3q4dlsywh44yflradg50aslqw0vv";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -136938,8 +137348,8 @@ self: {
      }:
      mkDerivation {
        pname = "xcffib";
-       version = "0.3.2";
-       sha256 = "0njsflaxz2l01vbwndsmqmq37i6nl4cfczy776jdpnv7043b1ynv";
+       version = "0.3.4";
+       sha256 = "03z31c5gnybpfvh3idqimnz90pzbijhrqa8hlikryab148gp1gzn";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -138532,15 +138942,15 @@ self: {
      }) {};
 
   "yaml" = callPackage
-    ({ mkDerivation, aeson, aeson-qq, attoparsec, base, bytestring
-     , conduit, containers, directory, enclosed-exceptions, filepath
-     , hspec, hspec-expectations, HUnit, resourcet, scientific, text
+    ({ mkDerivation, aeson, aeson-qq, attoparsec, base, base-compat
+     , bytestring, conduit, containers, directory, enclosed-exceptions
+     , filepath, hspec, HUnit, mockery, resourcet, scientific, text
      , transformers, unordered-containers, vector
      }:
      mkDerivation {
        pname = "yaml";
-       version = "0.8.11";
-       sha256 = "18ara96wca3gnk436i8rarb5smv80aa3ww4lnlrd5w01rp0p171v";
+       version = "0.8.12";
+       sha256 = "0nmpc1n80sv2bjqhzq5jdhd0zxzz9vka31y7k54fmdwr2jbg879i";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -138549,9 +138959,8 @@ self: {
          unordered-containers vector
        ];
        testDepends = [
-         aeson aeson-qq base bytestring conduit directory hspec
-         hspec-expectations HUnit resourcet text transformers
-         unordered-containers vector
+         aeson aeson-qq base base-compat bytestring conduit hspec HUnit
+         mockery resourcet text transformers unordered-containers vector
        ];
        homepage = "http://github.com/snoyberg/yaml/";
        description = "Support for parsing and rendering YAML documents";
@@ -138681,6 +139090,25 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "yamlkeysdiff" = callPackage
+    ({ mkDerivation, base, containers, parsec, text
+     , unordered-containers, yaml
+     }:
+     mkDerivation {
+       pname = "yamlkeysdiff";
+       version = "0.5.1";
+       sha256 = "13s5qiydxcwpp0j8xap556yrlmqs7bsi62ql2c9clr4hpbw8may7";
+       isLibrary = false;
+       isExecutable = true;
+       buildDepends = [
+         base containers parsec text unordered-containers yaml
+       ];
+       jailbreak = true;
+       homepage = "https://github.com/acatton/yamlkeysdiff";
+       description = "Compares the keys from two yaml files";
+       license = "unknown";
+     }) {};
+
   "yampa-canvas" = callPackage
     ({ mkDerivation, base, blank-canvas, stm, text, time, Yampa }:
      mkDerivation {
@@ -139099,8 +139527,8 @@ self: {
      }:
      mkDerivation {
        pname = "yesod-auth-fb";
-       version = "1.6.6";
-       sha256 = "00pk5vridic77laydkfhrixfv50ps7f15dxvcd44cn0z8s2d3y74";
+       version = "1.7";
+       sha256 = "1kp4vka9sjij8zyp15vj1jkaqwgy483q2gjb5wmhlqwcyp843h02";
        buildDepends = [
          aeson base bytestring conduit fb http-conduit lifted-base
          shakespeare text time transformers wai yesod-auth yesod-core
@@ -139169,6 +139597,22 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "yesod-auth-ldap-mediocre" = callPackage
+    ({ mkDerivation, aeson, base, LDAP, text, yesod-auth, yesod-core
+     , yesod-form
+     }:
+     mkDerivation {
+       pname = "yesod-auth-ldap-mediocre";
+       version = "0.1.0.0";
+       sha256 = "03pij218i9lk79n02c2pfrxsxyqi6lzjn5bzg7zgk5a87b6b57jh";
+       buildDepends = [
+         aeson base LDAP text yesod-auth yesod-core yesod-form
+       ];
+       jailbreak = true;
+       description = "Very simlple LDAP auth for yesod";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "yesod-auth-oauth" = callPackage
     ({ mkDerivation, authenticate-oauth, base, bytestring, lifted-base
      , text, transformers, yesod-auth, yesod-core, yesod-form
@@ -139274,8 +139718,8 @@ self: {
      }:
      mkDerivation {
        pname = "yesod-bin";
-       version = "1.4.11";
-       sha256 = "0n9ssbg7iggrgmxn3hb8niqic2rf453a4fqp0g9xx1rz6p323dv2";
+       version = "1.4.13";
+       sha256 = "0rqwmvl2pl05fp7xyfcpmpjkki8ww47rhifcclasaxvj109hvj1k";
        isLibrary = false;
        isExecutable = true;
        buildDepends = [
@@ -139678,8 +140122,8 @@ self: {
      }:
      mkDerivation {
        pname = "yesod-mangopay";
-       version = "1.11.2";
-       sha256 = "1jyn38q0q4s4lrnw93yzvnn49js4jf6zhq8wb7whyxks1jbkjxbv";
+       version = "1.11.4";
+       sha256 = "0syg5a0xihrdbclsrbgqgf6llhji7zdn1g50fbvlklfpw4dkb1f7";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [
@@ -139717,6 +140161,23 @@ self: {
        hydraPlatforms = stdenv.lib.platforms.none;
      }) {};
 
+  "yesod-media-simple" = callPackage
+    ({ mkDerivation, base, bytestring, diagrams-cairo, diagrams-core
+     , diagrams-lib, directory, JuicyPixels, vector, yesod
+     }:
+     mkDerivation {
+       pname = "yesod-media-simple";
+       version = "0.1.0.1";
+       sha256 = "1ajlrqsq7x83vc67xqb4r3328akwjp0a0vwf7nvqj3bsjqg5af76";
+       buildDepends = [
+         base bytestring diagrams-cairo diagrams-core diagrams-lib directory
+         JuicyPixels vector yesod
+       ];
+       homepage = "https://github.com/mgsloan/yesod-media-simple";
+       description = "Simple display of media types, served by yesod";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "yesod-newsfeed" = callPackage
     ({ mkDerivation, base, blaze-html, blaze-markup, bytestring
      , containers, shakespeare, text, time, xml-conduit, yesod-core
@@ -139998,6 +140459,22 @@ self: {
        license = stdenv.lib.licenses.mit;
      }) {};
 
+  "yesod-routes-flow" = callPackage
+    ({ mkDerivation, attoparsec, base, classy-prelude, system-fileio
+     , text, yesod-core
+     }:
+     mkDerivation {
+       pname = "yesod-routes-flow";
+       version = "1.0";
+       sha256 = "1bb0w1910mnzci4mi6r2zxhjy4wsridi5h2g97nqhd65qncq4km0";
+       buildDepends = [
+         attoparsec base classy-prelude system-fileio text yesod-core
+       ];
+       homepage = "https://github.com/frontrowed/yesod-routes-flow";
+       description = "Generate Flow routes for Yesod";
+       license = stdenv.lib.licenses.mit;
+     }) {};
+
   "yesod-routes-typescript" = callPackage
     ({ mkDerivation, attoparsec, base, classy-prelude, system-fileio
      , text, yesod-core, yesod-routes
@@ -140117,10 +140594,8 @@ self: {
      }:
      mkDerivation {
        pname = "yesod-static";
-       version = "1.5.0";
-       revision = "1";
-       sha256 = "1i95c43hlks1wclhwal9yr1pasmz78ddi7wzjhg9k5w21hrkcp92";
-       editedCabalFile = "d01c0a6fcb4ae005dea0c4898fd1ad452cde5e1989c90e62309c481cd0ff36c3";
+       version = "1.5.0.1";
+       sha256 = "1yda1m7dafcmq9s2gv0cdq3kphl5gg1279crqjgf3x57dyrypjpl";
        buildDepends = [
          async attoparsec base base64-bytestring blaze-builder byteable
          bytestring conduit conduit-extra containers cryptohash
@@ -140175,8 +140650,8 @@ self: {
      }:
      mkDerivation {
        pname = "yesod-table";
-       version = "1.0.1";
-       sha256 = "0ixypahxrm23pahjq972r8kc4h2a14fidf1cx3wiip8wxfhc9jsi";
+       version = "1.0.2";
+       sha256 = "0rrc9cfjl1g8if0ncs2xzpb1hnaa4hi3w62q16gwir0l79vfj7b9";
        buildDepends = [ base containers contravariant text yesod-core ];
        homepage = "https://github.com/andrewthad/yesod-table";
        description = "HTML tables for Yesod";
@@ -140276,21 +140751,23 @@ self: {
      }) {};
 
   "yesod-transloadit" = callPackage
-    ({ mkDerivation, aeson, base, byteable, bytestring, cryptohash
-     , hspec, lens, lens-aeson, old-locale, shakespeare, text, time
-     , transformers, yesod, yesod-core, yesod-form, yesod-test
+    ({ mkDerivation, aeson, base, byteable, bytestring, containers
+     , cryptohash, hspec, lens, lens-aeson, old-locale, shakespeare
+     , text, time, transformers, unordered-containers, yesod, yesod-core
+     , yesod-form, yesod-test
      }:
      mkDerivation {
        pname = "yesod-transloadit";
-       version = "0.2.1.0";
-       sha256 = "1x4sbjzlx5kxwcsywb90milk5s7shgggsqjsq7zrys28w079y00k";
+       version = "0.3.0.0";
+       sha256 = "0p2npza0clflh1vswyjr4gxx5fxggzv1x61x7c7d79jadq88bi4m";
        buildDepends = [
          aeson base byteable bytestring cryptohash lens lens-aeson
-         old-locale shakespeare text time transformers yesod yesod-core
-         yesod-form
+         old-locale shakespeare text time transformers unordered-containers
+         yesod yesod-core yesod-form
        ];
        testDepends = [
-         base hspec old-locale text time yesod yesod-form yesod-test
+         aeson base containers hspec lens old-locale text time yesod
+         yesod-form yesod-test
        ];
        description = "Transloadit support for Yesod";
        license = stdenv.lib.licenses.mit;
@@ -140318,16 +140795,17 @@ self: {
      }) {};
 
   "yesod-websockets" = callPackage
-    ({ mkDerivation, async, base, conduit, monad-control, transformers
-     , wai, wai-websockets, websockets, yesod-core
+    ({ mkDerivation, async, base, conduit, enclosed-exceptions
+     , monad-control, transformers, wai, wai-websockets, websockets
+     , yesod-core
      }:
      mkDerivation {
        pname = "yesod-websockets";
-       version = "0.2.1.1";
-       sha256 = "0ksmyag5h5i78jb7bdvsvq0wkyb82k8i4y5d2m6czvhf3i1zw6da";
+       version = "0.2.3";
+       sha256 = "15kklk4wkxclrmsvwzjcy8ggal14c6nrckfn0kqcrfp0hbxzj09m";
        buildDepends = [
-         async base conduit monad-control transformers wai wai-websockets
-         websockets yesod-core
+         async base conduit enclosed-exceptions monad-control transformers
+         wai wai-websockets websockets yesod-core
        ];
        homepage = "https://github.com/yesodweb/yesod";
        description = "WebSockets support for Yesod";
@@ -140902,8 +141380,8 @@ self: {
      }:
      mkDerivation {
        pname = "z3";
-       version = "4.0.0";
-       sha256 = "1axn3kzy6hsrnq5mcgf2n1sv63q3pqkhznvvhlj13k6jc3h2jzhl";
+       version = "4.1.0";
+       sha256 = "1vpmwizxcab1mlz7vp3hp72ddla7805jn0lq60fmkjgmj95ryvq9";
        isLibrary = true;
        isExecutable = true;
        buildDepends = [ base containers mtl ];
diff --git a/pkgs/development/interpreters/php/5.4.nix b/pkgs/development/interpreters/php/5.4.nix
index c1ba35a91343..c9391a4e24fc 100644
--- a/pkgs/development/interpreters/php/5.4.nix
+++ b/pkgs/development/interpreters/php/5.4.nix
@@ -1,6 +1,6 @@
 { callPackage, apacheHttpd }:
 callPackage ./generic.nix {
-  phpVersion = "5.4.42";
-  sha = "1yg03b6a88i7hg593m9zmmcm4kr59wdrhz9xk1frx9ps9gkb51b2";
+  phpVersion = "5.4.43";
+  sha = "0sydirpwg150wxsjrpp3m38564832wviglmsylhbbl8an17p5mr5";
   apacheHttpd = apacheHttpd;
 }
diff --git a/pkgs/development/interpreters/php/5.5.nix b/pkgs/development/interpreters/php/5.5.nix
index 0d66e64693a9..18dfde4ae67c 100644
--- a/pkgs/development/interpreters/php/5.5.nix
+++ b/pkgs/development/interpreters/php/5.5.nix
@@ -1,6 +1,6 @@
 { callPackage, apacheHttpd  }:
 callPackage ./generic.nix {
-  phpVersion = "5.5.25";
-  sha = "0qrc4qll07hfs5a3l4ajrj7969w10d0n146zq1smdl6x4pkkgpv8";
+  phpVersion = "5.5.27";
+  sha = "0w0zgqria3i3mrp03p9m0613xlaj3vsw9girmslngjn06jjwdd64";
   apacheHttpd = apacheHttpd;
 }
diff --git a/pkgs/development/interpreters/php/5.6.nix b/pkgs/development/interpreters/php/5.6.nix
index e05f1ae10bd8..51ba06b2922a 100644
--- a/pkgs/development/interpreters/php/5.6.nix
+++ b/pkgs/development/interpreters/php/5.6.nix
@@ -1,6 +1,6 @@
 { callPackage, apacheHttpd  }:
 callPackage ./generic.nix {
-  phpVersion = "5.6.10";
-  sha = "0iccgibmbc659z6dh6c58l1b7vnqly7al37fbs0l3si4qy0rqmqa";
+  phpVersion = "5.6.11";
+  sha = "0riq0c8s8anb1nxvn3ljs7wdn811903sv7kl8ir2ck3n2q42csxx";
   apacheHttpd = apacheHttpd;
 }
diff --git a/pkgs/development/libraries/bobcat/default.nix b/pkgs/development/libraries/bobcat/default.nix
index 38dfce7583a7..2a9ee1c9c5bd 100644
--- a/pkgs/development/libraries/bobcat/default.nix
+++ b/pkgs/development/libraries/bobcat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gcc49, icmake, libmilter, libX11, openssl, readline
+{ stdenv, fetchurl, icmake, libmilter, libX11, openssl, readline
 , utillinux, yodl }:
 
 let version = "3.25.02"; in
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     maintainers = with maintainers; [ nckx ];
   };
 
-  buildInputs = [ gcc49 libmilter libX11 openssl readline utillinux ];
+  buildInputs = [ libmilter libX11 openssl readline utillinux ];
   nativeBuildInputs = [ icmake yodl ];
 
   postPatch = ''
diff --git a/pkgs/development/libraries/boost/1.58.nix b/pkgs/development/libraries/boost/1.58.nix
new file mode 100644
index 000000000000..aa010494bf70
--- /dev/null
+++ b/pkgs/development/libraries/boost/1.58.nix
@@ -0,0 +1,40 @@
+{ stdenv, callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.58.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_58_0.tar.bz2";
+    sha256 = "1rfkqxns60171q62cppiyzj8pmsbwp1l8jd7p6crriryqd7j1z7x";
+  };
+
+  patches = if stdenv.isCygwin then [
+      ./cygwin-fedora-boost-1.50.0-fix-non-utf8-files.patch
+      ./cygwin-fedora-boost-1.50.0-pool.patch
+      ./cygwin-fedora-boost-1.57.0-mpl-print.patch
+      ./cygwin-fedora-boost-1.57.0-spirit-unused_typedef.patch
+      ./cygwin-fedora-boost-1.54.0-locale-unused_typedef.patch
+      ./cygwin-fedora-boost-1.54.0-python-unused_typedef.patch
+      ./cygwin-fedora-boost-1.57.0-pool-test_linking.patch
+      ./cygwin-fedora-boost-1.54.0-pool-max_chunks_shadow.patch
+      ./cygwin-fedora-boost-1.57.0-signals2-weak_ptr.patch
+      ./cygwin-fedora-boost-1.57.0-uuid-comparison.patch
+      ./cygwin-fedora-boost-1.57.0-move-is_class.patch
+      ./cygwin-1.40.0-cstdint-cygwin.patch
+      ./cygwin-1.57.0-asio-cygwin.patch
+      ./cygwin-1.55.0-asio-MSG_EOR.patch
+      ./cygwin-1.57.0-config-cygwin.patch
+      ./cygwin-1.57.0-context-cygwin.patch
+      ./cygwin-1.57.0-filesystem-cygwin.patch
+      ./cygwin-1.55.0-interlocked-cygwin.patch
+      ./cygwin-1.40.0-iostreams-cygwin.patch
+      ./cygwin-1.57.0-locale-cygwin.patch
+      ./cygwin-1.57.0-log-cygwin.patch
+      ./cygwin-1.40.0-python-cygwin.patch
+      ./cygwin-1.40.0-regex-cygwin.patch
+      ./cygwin-1.57.0-smart_ptr-cygwin.patch
+      ./cygwin-1.57.0-system-cygwin.patch
+      ./cygwin-1.45.0-jam-cygwin.patch
+      ./cygwin-1.50.0-jam-pep3149.patch
+    ] else null;
+})
diff --git a/pkgs/development/libraries/cppzmq/default.nix b/pkgs/development/libraries/cppzmq/default.nix
index 481c80994e85..282ad7bfcd77 100644
--- a/pkgs/development/libraries/cppzmq/default.nix
+++ b/pkgs/development/libraries/cppzmq/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchgit }:
 
 stdenv.mkDerivation rec {
-  name = "cppzmq-2015-03-05";
+  name = "cppzmq-2015-07-06";
 
   src = fetchgit {
-    url = "git://github.com/zeromq/cppzmq";
-    rev = "ac705f604701e2ca1643fa31bae240f9da8b9b9a";
-    sha256 = "1bcd5553601a6cdc926aa7a7c89fe54d3b14693cfce85dea97af25cf5a144398";
+    url = "https://github.com/zeromq/cppzmq";
+    rev = "a88bf3e0b0bc6ed5f5b25a58f8997a1dae374c8b";
+    sha256 = "75a6630b870c1f0d5b9d6a0ba03e83ceee47aaa2a253894e75a8a93a6d65d3aa";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index d114cf17c4ef..4a0f98d262a0 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -7,8 +7,8 @@ assert x11Support -> libX11 != null
                   && libSM != null;
 
 let
-  version = "1.8.18";
-  sha256 = "1wn4k142m68d8yqd4i6dmx1ac0798yhkdnkk4mb72g3sfyffpwin";
+  version = "1.8.20";
+  sha256 = "0fkh3d5r57a659hw9lqnw4v0bc5556vx54fsf7l9c732ci6byksw";
 
   inherit (stdenv) lib;
 
diff --git a/pkgs/development/libraries/double-conversion/default.nix b/pkgs/development/libraries/double-conversion/default.nix
index 7de7cb4d102d..049a799c44fa 100644
--- a/pkgs/development/libraries/double-conversion/default.nix
+++ b/pkgs/development/libraries/double-conversion/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
-  version = "1.1.5";
+  version = "2.0.1";
   name = "double-conversion-${version}";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "double-conversion";
     rev = "v${version}";
-    sha256 = "1a264wpnvxmnq5pdlnp417ld1ybrng83lnbg38bv4ahz7a29ap4z";
+    sha256 = "05x5rdwndgp1vdq2z1bpvng0dd8pn93kw4vhl6nsvv9vsara2q4b";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/exempi/default.nix b/pkgs/development/libraries/exempi/default.nix
index e941f0f65476..e7a3bd495132 100644
--- a/pkgs/development/libraries/exempi/default.nix
+++ b/pkgs/development/libraries/exempi/default.nix
@@ -8,7 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "01vcd1mfn2s0iiq2cjyzgvnxx6kcq9cwra1iipijhs0vwvjx0yhf";
   };
 
-  configureFlags = [ "--with-boost=${boost.dev}" ];
+  configureFlags = [
+    "--with-boost=${boost.dev}"
+  ];
 
   buildInputs = [ expat zlib boost ];
 
diff --git a/pkgs/development/libraries/expat/CVE-2015-1283.patch b/pkgs/development/libraries/expat/CVE-2015-1283.patch
new file mode 100644
index 000000000000..33b975912d40
--- /dev/null
+++ b/pkgs/development/libraries/expat/CVE-2015-1283.patch
@@ -0,0 +1,77 @@
+Found at https://hg.mozilla.org/releases/mozilla-esr31/rev/2f3e78643f5c on 2015-07-27.  Modified: replaced path parser/expat/lib/xmlparse.c with lib/xmlparse.c.
+diff --git a/lib/xmlparse.c b/lib/xmlparse.c
+--- a/lib/xmlparse.c
++++ b/lib/xmlparse.c
+@@ -1646,29 +1646,40 @@ XML_ParseBuffer(XML_Parser parser, int l
+   XmlUpdatePosition(encoding, positionPtr, bufferPtr, &position);
+   positionPtr = bufferPtr;
+   return result;
+ }
+ 
+ void * XMLCALL
+ XML_GetBuffer(XML_Parser parser, int len)
+ {
++/* BEGIN MOZILLA CHANGE (sanity check len) */
++  if (len < 0) {
++    errorCode = XML_ERROR_NO_MEMORY;
++    return NULL;
++  }
++/* END MOZILLA CHANGE */
+   switch (ps_parsing) {
+   case XML_SUSPENDED:
+     errorCode = XML_ERROR_SUSPENDED;
+     return NULL;
+   case XML_FINISHED:
+     errorCode = XML_ERROR_FINISHED;
+     return NULL;
+   default: ;
+   }
+ 
+   if (len > bufferLim - bufferEnd) {
+-    /* FIXME avoid integer overflow */
+     int neededSize = len + (int)(bufferEnd - bufferPtr);
++/* BEGIN MOZILLA CHANGE (sanity check neededSize) */
++    if (neededSize < 0) {
++      errorCode = XML_ERROR_NO_MEMORY;
++      return NULL;
++    }
++/* END MOZILLA CHANGE */
+ #ifdef XML_CONTEXT_BYTES
+     int keep = (int)(bufferPtr - buffer);
+ 
+     if (keep > XML_CONTEXT_BYTES)
+       keep = XML_CONTEXT_BYTES;
+     neededSize += keep;
+ #endif  /* defined XML_CONTEXT_BYTES */
+     if (neededSize  <= bufferLim - buffer) {
+@@ -1687,17 +1698,25 @@ XML_GetBuffer(XML_Parser parser, int len
+     }
+     else {
+       char *newBuf;
+       int bufferSize = (int)(bufferLim - bufferPtr);
+       if (bufferSize == 0)
+         bufferSize = INIT_BUFFER_SIZE;
+       do {
+         bufferSize *= 2;
+-      } while (bufferSize < neededSize);
++/* BEGIN MOZILLA CHANGE (prevent infinite loop on overflow) */
++      } while (bufferSize < neededSize && bufferSize > 0);
++/* END MOZILLA CHANGE */
++/* BEGIN MOZILLA CHANGE (sanity check bufferSize) */
++      if (bufferSize <= 0) {
++        errorCode = XML_ERROR_NO_MEMORY;
++        return NULL;
++      }
++/* END MOZILLA CHANGE */
+       newBuf = (char *)MALLOC(bufferSize);
+       if (newBuf == 0) {
+         errorCode = XML_ERROR_NO_MEMORY;
+         return NULL;
+       }
+       bufferLim = newBuf + bufferSize;
+ #ifdef XML_CONTEXT_BYTES
+       if (bufferPtr) {
+
+
+
+
diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix
index 9a49225d1723..05cfeaee4232 100644
--- a/pkgs/development/libraries/expat/default.nix
+++ b/pkgs/development/libraries/expat/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2";
   };
 
+  patches = [ ./CVE-2015-1283.patch ];
+
   meta = with stdenv.lib; {
     homepage = http://www.libexpat.org/;
     description = "A stream-oriented XML parser library written in C";
diff --git a/pkgs/development/libraries/folly/default.nix b/pkgs/development/libraries/folly/default.nix
index 79584a99f630..0cea9413baef 100644
--- a/pkgs/development/libraries/folly/default.nix
+++ b/pkgs/development/libraries/folly/default.nix
@@ -2,14 +2,14 @@
 , google-gflags, python, libiberty, openssl }:
 
 stdenv.mkDerivation rec {
-  version = "0.38.0";
+  version = "0.52.0";
   name = "folly-${version}";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
     rev = "v${version}";
-    sha256 = "0b273iwizy08r8lap367q79lai4l4aib2bvd827lkkdax5jpqf6b";
+    sha256 = "16g3hpy1gy56zqnhwzkvzzpm6dgm01qa9yaigmrqr9b59c3k6cqf";
   };
 
   buildInputs = [ libiberty boost.lib libevent double_conversion glog google-gflags openssl ];
diff --git a/pkgs/development/libraries/freetds/default.nix b/pkgs/development/libraries/freetds/default.nix
index 11d10e73cdd7..695abcfbba2b 100644
--- a/pkgs/development/libraries/freetds/default.nix
+++ b/pkgs/development/libraries/freetds/default.nix
@@ -4,11 +4,11 @@
 assert odbcSupport -> unixODBC != null;
 
 stdenv.mkDerivation rec {
-  name = "freetds-0.91.112";
+  name = "freetds-0.91";
 
   src = fetchurl {
-    url = "ftp://ftp.astron.com/pub/freetds/stable/${name}.tar.gz";
-    sha256 = "be4f04ee57328c32e7e7cd7e2e1483e535071cec6101e46b9dd15b857c5078ed";
+    url = "http://mirrors.ibiblio.org/freetds/stable/${name}.tar.gz";
+    sha256 = "0r946axzxs0czsmr7283w7vmk5jx3jnxxc32d2ncxsrsh2yli0ba";
   };
 
   buildInputs = stdenv.lib.optional odbcSupport [ unixODBC ];
@@ -30,4 +30,3 @@ stdenv.mkDerivation rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-
diff --git a/pkgs/development/libraries/gdk-pixbuf/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index fafff05a032c..1322bc4eeab3 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -3,14 +3,14 @@
 
 let
   ver_maj = "2.31";
-  ver_min = "4";
+  ver_min = "5";
 in
 stdenv.mkDerivation rec {
   name = "gdk-pixbuf-${ver_maj}.${ver_min}";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gdk-pixbuf/${ver_maj}/${name}.tar.xz";
-    sha256 = "05bslhk33qpssg66n2wys9khyzwkr4am0b23dym8n67qjds9gng5";
+    sha256 = "19ppbycbr87rai93vf2ff8k3ksjqq64s8qysq0mfy9fdjw2ffxha";
   };
 
   setupHook = ./setup-hook.sh;
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index f86a15cb0d61..4b6fd2008e86 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libiconv, xz }:
 
 stdenv.mkDerivation (rec {
-  name = "gettext-0.19.4";
+  name = "gettext-0.19.5.1";
 
   src = fetchurl {
     url = "mirror://gnu/gettext/${name}.tar.gz";
-    sha256 = "0gvz86m4cs8bdf3mwmwsyx6lrq4ydfxgadrgd9jlx32z3bnz3jca";
+    sha256 = "0cbp498ckjwj7qr8b9pmkry8hkhldgkvg5yix8hi9c8z1hxxb651";
   };
 
   LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
diff --git a/pkgs/development/libraries/gnutls/generic.nix b/pkgs/development/libraries/gnutls/generic.nix
index 07760933935a..436f6beb54eb 100644
--- a/pkgs/development/libraries/gnutls/generic.nix
+++ b/pkgs/development/libraries/gnutls/generic.nix
@@ -1,5 +1,6 @@
-{ fetchurl, stdenv, autoreconfHook, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
-, guileBindings, guile, perl, gmp, libidn, p11_kit, unbound, trousers
+{ lib, fetchurl, stdenv, autoreconfHook, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
+, guileBindings, guile, perl, gmp, libidn, p11_kit, unbound
+, tpmSupport ? false, trousers
 
 # Version dependent args
 , version, src, patches ? []
@@ -7,9 +8,6 @@
 
 assert guileBindings -> guile != null;
 
-let
-  inherit (stdenv.lib) optional optionals optionalString;
-in
 stdenv.mkDerivation rec {
   name = "gnutls-${version}";
 
@@ -17,11 +15,11 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     # FIXME: perhaps use $SSL_CERT_FILE instead
-    optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
+    lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
   ++ [
     "--disable-dependency-tracking"
     "--enable-fast-install"
-  ] ++ optionals guileBindings
+  ] ++ lib.optional guileBindings
     [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ];
 
   # Build of the Guile bindings is not parallel-safe.  See
@@ -30,9 +28,9 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = !guileBindings;
 
   buildInputs = [ lzo lzip nettle libtasn1 libidn p11_kit zlib gmp ]
-    ++ optional stdenv.isLinux trousers
+    ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
     ++ [ unbound ]
-    ++ optional guileBindings guile;
+    ++ lib.optional guileBindings guile;
 
   nativeBuildInputs = [ perl pkgconfig autoreconfHook ];
 
@@ -41,14 +39,14 @@ stdenv.mkDerivation rec {
   doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
 
   # Fixup broken libtool and pkgconfig files
-  preFixup = optionalString (!stdenv.isDarwin) ''
-    sed -e 's,-ltspi,-L${trousers}/lib -ltspi,' \
+  preFixup = lib.optionalString (!stdenv.isDarwin) ''
+    sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
         -e 's,-lz,-L${zlib}/lib -lz,' \
         -e 's,-lgmp,-L${gmp}/lib -lgmp,' \
         -i $out/lib/libgnutls.la $out/lib/pkgconfig/gnutls.pc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The GNU Transport Layer Security Library";
 
     longDescription = ''
diff --git a/pkgs/development/libraries/gtk+/3.x.nix b/pkgs/development/libraries/gtk+/3.x.nix
index f83986187270..5fb70ac05ea9 100644
--- a/pkgs/development/libraries/gtk+/3.x.nix
+++ b/pkgs/development/libraries/gtk+/3.x.nix
@@ -10,7 +10,7 @@ assert cupsSupport -> cups != null;
 
 let
   ver_maj = "3.16";
-  ver_min = "5";
+  ver_min = "6";
   version = "${ver_maj}.${ver_min}";
 in
 stdenv.mkDerivation rec {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/${ver_maj}/gtk+-${version}.tar.xz";
-    sha256 = "0cdwykh4086f7fl4dkybgpyxyb1jcmxbfin2az42z5pb4z8rjz5q";
+    sha256 = "1gpzlnfrifc17yfk0zki6b2vmsfpf5cmrbh232s6iaan11np44jd";
   };
 
   nativeBuildInputs = [ pkgconfig gettext gobjectIntrospection perl ];
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index 311bfe2c209d..216bad19790e 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -8,11 +8,11 @@
 # (icu is a ~30 MB dependency, the rest is very small in comparison)
 
 stdenv.mkDerivation rec {
-  name = "harfbuzz-0.9.40";
+  name = "harfbuzz-0.9.41";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/harfbuzz/release/${name}.tar.bz2";
-    sha256 = "07rjp05axas96fp23lpf8l2yyfdj9yib4m0qjv592vdyhcsxaw8p";
+    sha256 = "0z05vj3va43adzxn026fpdvdd533q5zrs5dcxaz3gd021hysa6nq";
   };
 
   configureFlags = [
diff --git a/pkgs/development/libraries/libaacs/default.nix b/pkgs/development/libraries/libaacs/default.nix
index 631c7c778ae2..119a46bfc31d 100644
--- a/pkgs/development/libraries/libaacs/default.nix
+++ b/pkgs/development/libraries/libaacs/default.nix
@@ -8,7 +8,7 @@
 # https://wiki.archlinux.org/index.php/BluRay
 
 let baseName = "libaacs";
-    version  = "0.8.0";
+    version  = "0.8.1";
 in
 
 stdenv.mkDerivation {
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/${baseName}/${version}/${baseName}-${version}.tar.bz2";
-    sha256 = "155sah8z4vbp6j3sq9b17mcn6rj1938ijszz97m8pd2cgif58i2y";
+    sha256 = "1s5v075hnbs57995r6lljm79wgrip3gnyf55a0y7bja75jh49hwm";
   };
 
   buildInputs = [ libgcrypt libgpgerror ];
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ yacc flex ];
 
   meta = with stdenv.lib; {
-    homepage = http://www.videolan.org/developers/libbluray.html;
+    homepage = https://www.videolan.org/developers/libaacs.html;
     description = "Library to access AACS protected Blu-Ray disks";
     license = licenses.lgpl21;
     maintainers = with maintainers; [ abbradar ];
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index 60777614881d..2a3e740b2e7a 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -24,6 +24,10 @@ stdenv.mkDerivation rec {
     echo "#include <windows.h>" >> config.h
   '' else null;
 
+  preFixup = ''
+    sed 's|-lcrypto|-L${openssl}/lib -lcrypto|' -i $out/lib/libarchive.la
+  '';
+
   meta = {
     description = "Multi-format archive and compression library";
     longDescription = ''
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index de0fa1a56d3c..d85712549672 100644
--- a/pkgs/development/libraries/libbluray/default.nix
+++ b/pkgs/development/libraries/libbluray/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, fontconfig, autoreconfHook
-, withJava ? true, jdk ? null, ant ? null
+, withJava ? false, jdk ? null, ant ? null
 , withAACS ? false, libaacs ? null
 , withBDplus ? false, libbdplus ? null
 , withMetadata ? true, libxml2 ? null
@@ -19,12 +19,12 @@ assert withFonts -> freetype != null;
 
 stdenv.mkDerivation rec {
   baseName = "libbluray";
-  version  = "0.8.0";
+  version  = "0.8.1";
   name = "${baseName}-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.videolan.org/pub/videolan/${baseName}/${version}/${name}.tar.bz2";
-    sha256 = "027xbdbsjyp1spfiva2331pzixrzw6vm97xlvgz16hzm5a5j103v";
+    sha256 = "13zvkrwy2fr877gkifgwnqfsb3krbz7hklfcwqfjbhmvqn0cdgnd";
   };
 
   nativeBuildInputs = [ pkgconfig autoreconfHook ]
diff --git a/pkgs/development/libraries/libchardet/default.nix b/pkgs/development/libraries/libchardet/default.nix
index f7834c56b63a..6fc17256a390 100644
--- a/pkgs/development/libraries/libchardet/default.nix
+++ b/pkgs/development/libraries/libchardet/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "libchardet-1.0.4";
   
   src = fetchurl {
-    url = "ftp://ftp.oops.org/pub/oops/libchardet/${name}.tar.bz2";
+    url = "http://yupmin.net/wp-content/uploads/2014/03/libchardet-1.0.4.tar.bz2";
     sha256 = "0cvwba4la25qw70ap8jd5r743a9jshqd26nnbh5ph68zj1imlgzl";
   };
 
diff --git a/pkgs/development/libraries/libdmtx/default.nix b/pkgs/development/libraries/libdmtx/default.nix
index 8d7049dc29ab..26cf2c023ebd 100644
--- a/pkgs/development/libraries/libdmtx/default.nix
+++ b/pkgs/development/libraries/libdmtx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, imagemagick }:
+{ stdenv, fetchurl, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "libdmtx-0.7.4";
@@ -10,8 +10,6 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  propagatedBuildInputs = [ imagemagick ];
-
   meta = {
     description = "An open source software for reading and writing Data Matrix barcodes";
     homepage = http://libdmtx.org;
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index b223bd962e7e..775a8f920472 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, udev }:
+{ stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, udev, valgrind }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.61";
+  name = "libdrm-2.4.62";
 
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "8b549092c8961a393a7e1d9a1bccddcea8e2af67c0d7d7c67babb9fc3b47699c";
+    sha256 = "906c294bdbe1c94c3ca084305d61a6e5a8367f3b4986e6cc13b1e9b3f75931dc";
   };
 
   nativeBuildInputs = [ pkgconfig ];
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   preConfigure = stdenv.lib.optionalString stdenv.isDarwin
     "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
 
-  configureFlags = [ "--enable-freedreno" ]
+  configureFlags = [ "--enable-freedreno" "--disable-valgrind" ]
     ++ stdenv.lib.optional stdenv.isLinux "--enable-udev"
     ++ stdenv.lib.optional stdenv.isDarwin "-C";
 
diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix
index eddc4eed55c0..6a68b5610da2 100644
--- a/pkgs/development/libraries/libiberty/default.nix
+++ b/pkgs/development/libraries/libiberty/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "4.8.4";
+  version = "4.9.3";
   name = "libiberty-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "15c6gwm6dzsaagamxkak5smdkf1rdfbqqjs9jdbrp3lbg4ism02a";
+    sha256 = "0zmnm00d2a1hsd41g34bhvxzvxisa2l584q3p447bd91lfjv4ci3";
   };
 
   postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index bf1a1e232bb6..3d9a288b5bb5 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "0mbrc021dk0ayyglk4qyf9328cayrlz2q94lh8sh9l9r6g79fvcs";
   };
 
+  outputs = [ "out" "doc" ];
+
   buildInputs = [ intltool pkgconfig ];
   propagatedBuildInputs = [ cln libxml2 glib ];
 
diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix
index 3e0d2348a50d..d272ad184925 100644
--- a/pkgs/development/libraries/libraw/default.nix
+++ b/pkgs/development/libraries/libraw/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   name = "libraw-${version}";
-  version = "0.16.1";
+  version = "0.16.0";
 
   src = fetchurl {
     url = "http://www.libraw.org/data/LibRaw-${version}.tar.gz";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  meta = { 
+  meta = {
     description = "Library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)";
     homepage = http://www.libraw.org/;
     license = stdenv.lib.licenses.gpl2Plus;
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 4c22c988c790..ea1910733e7d 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf
+{ lib, stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo, libxml2, libgsf
 , bzip2, libcroco, libintlOrEmpty
-, gtk3 ? null
+, withGTK ? false, gtk3 ? null
 , gobjectIntrospection ? null, enableIntrospection ? false }:
 
 # no introspection by default, it's too big
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libxml2 libgsf bzip2 libcroco pango libintlOrEmpty ]
     ++ stdenv.lib.optional enableIntrospection [ gobjectIntrospection ];
 
-  propagatedBuildInputs = [ glib gdk_pixbuf cairo gtk3 ];
+  propagatedBuildInputs = [ glib gdk_pixbuf cairo ] ++ lib.optional withGTK gtk3;
 
   nativeBuildInputs = [ pkgconfig ];
 
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 82629ca3c6fa..12bb589cd9f3 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, glib, libxml2, pkgconfig
-, gnomeSupport ? true, libgnome_keyring, sqlite, glib_networking, gobjectIntrospection
+, gnomeSupport ? false, libgnome_keyring, sqlite, glib_networking, gobjectIntrospection
 , libintlOrEmpty
 , intltool, python }:
 let
@@ -30,6 +30,8 @@ stdenv.mkDerivation {
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
 
+  postInstall = "rm -rf $out/share/gtk-doc";
+
   meta = {
     inherit (glib.meta) maintainers platforms;
   };
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index 440014969887..c9af48d1c592 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "libva-1.5.1";
+  name = "libva-1.6.0";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2";
-    sha256 = "01d01mm9fgpwzqycmjjcj3in3vvzcibi3f64icsw2sksmmgb4495";
+    sha256 = "0n1l2mlhsvmsbs3qcphl4p6w13jnbv6s3hil8b6fj43a3afdrn9s";
   };
 
   buildInputs = [ libX11 libXext pkgconfig libdrm libXfixes wayland libffi mesa ];
diff --git a/pkgs/development/libraries/lightning/default.nix b/pkgs/development/libraries/lightning/default.nix
index 036d9c61d07a..3805e8c1ce84 100644
--- a/pkgs/development/libraries/lightning/default.nix
+++ b/pkgs/development/libraries/lightning/default.nix
@@ -1,14 +1,17 @@
-{ fetchurl, stdenv, binutils }:
+{ stdenv, fetchurl, binutils }:
 
+with stdenv.lib;
 stdenv.mkDerivation rec {
-  name = "lightning-2.0.5";
+
+  name = "lightning-${version}";
+  version = "2.1.0";
 
   src = fetchurl {
     url = "mirror://gnu/lightning/${name}.tar.gz";
-    sha256 = "0jm9a8ddxc1v9hyzyv4ybg37fjac2yjqv1hkd262wxzqms36mdk5";
+    sha256 = "19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz";
   };
 
-  # Needs libopcodes.so  from binutils for 'make check'
+  # Needs libopcodes.so from binutils for 'make check'
   buildInputs = [ binutils ];
 
   doCheck = true;
@@ -16,7 +19,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.gnu.org/software/lightning/;
     description = "Run-time code generation library";
-
     longDescription = ''
       GNU lightning is a library that generates assembly language code
       at run-time; it is very fast, making it ideal for Just-In-Time
@@ -24,7 +26,7 @@ stdenv.mkDerivation rec {
       to the clients a standardized RISC instruction set inspired by
       the MIPS and SPARC chips.
     '';
-
-    license = stdenv.lib.licenses.lgpl3Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    license = licenses.lgpl3Plus;
   };
 }
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index be2544091e26..9d7fa4ae4060 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -23,7 +23,7 @@ else
 */
 
 let
-  version = "10.6.1";
+  version = "10.6.2";
   # this is the default search path for DRI drivers
   driverLink = "/run/opengl-driver" + stdenv.lib.optionalString stdenv.isi686 "-32";
 in
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
       "https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
       "ftp://ftp.freedesktop.org/pub/mesa/${version}/mesa-${version}.tar.xz"
     ];
-    sha256 = "6c80a2b647e57c85dc36e609d9aed17f878f0d8e0cf9ace86d14cf604101e1eb";
+    sha256 = "05753d3db4212900927b9894221a1669a10f56786e86a7e818b6e18a0817dca9";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff
index 2b239e760ba3..a4bb6a72b138 100644
--- a/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff
+++ b/pkgs/development/libraries/mesa/dlopen-absolute-paths.diff
@@ -1,13 +1,22 @@
-diff --git a/src/loader/loader.c b/src/loader/loader.c
-index 666d015..4d7a9be 100644
+diff --git a/loader.c b/loader.c
+index 4fdf3c2..69ea22d 100644
 --- a/src/loader/loader.c
 +++ b/src/loader/loader.c
-@@ -101,7 +101,7 @@ static void *
+@@ -112,7 +112,7 @@ static void *udev_handle = NULL;
+ static void *
  udev_dlopen_handle(void)
  {
-    if (!udev_handle) {
--      udev_handle = dlopen("libudev.so.1", RTLD_LOCAL | RTLD_LAZY);
-+      udev_handle = dlopen("@udev@/lib/libudev.so.1", RTLD_LOCAL | RTLD_LAZY);
+-   char name[80];
++   char name[256];
+    unsigned flags = RTLD_NOLOAD | RTLD_LOCAL | RTLD_LAZY;
+    int version;
  
-       if (!udev_handle) {
-          /* libudev.so.1 changed the return types of the two unref functions
+@@ -126,7 +126,7 @@ udev_dlopen_handle(void)
+    /* First try opening an already linked libudev, then try loading one */
+    do {
+       for (version = 1; version >= 0; version--) {
+-         snprintf(name, sizeof(name), "libudev.so.%d", version);
++         snprintf(name, sizeof(name), "@udev@/lib/libudev.so.%d", version);
+          udev_handle = dlopen(name, flags);
+          if (udev_handle)
+             return udev_handle;
diff --git a/pkgs/development/libraries/mpfr/default.nix b/pkgs/development/libraries/mpfr/default.nix
index 555351bddc35..e1809d544d1f 100644
--- a/pkgs/development/libraries/mpfr/default.nix
+++ b/pkgs/development/libraries/mpfr/default.nix
@@ -1,26 +1,19 @@
 { stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
-  name = "mpfr-3.1.2";
+  name = "mpfr-3.1.3";
 
   src = fetchurl {
     url = "mirror://gnu/mpfr/${name}.tar.bz2";
-    sha256 = "0sqvpfkzamxdr87anzakf9dhkfh15lfmm5bsqajk02h1mxh3zivr";
+    sha256 = "1z8akfw9wbmq91vrx04bw86mmnxw2sw5qm5cr8ix5b3w2mcv8fzn";
   };
 
+  patches = [ ./upstream.patch ];
+
   # mpfr.h requires gmp.h
   propagatedBuildInputs = [ gmp ];
 
-  CFLAGS = "-I${gmp}/include";
-  LDFLAGS = if stdenv.isDarwin then "-L${gmp}/lib" else null;
-
   configureFlags =
-    /* Work around a FreeBSD bug that otherwise leads to segfaults in the test suite:
-          http://hydra.bordeaux.inria.fr/build/34862
-          http://websympa.loria.fr/wwsympa/arc/mpfr/2011-10/msg00015.html
-          http://www.freebsd.org/cgi/query-pr.cgi?pr=161344
-      */
-    stdenv.lib.optional (stdenv.isSunOS or stdenv.isFreeBSD) "--disable-thread-safe" ++
     stdenv.lib.optional stdenv.is64bit "--with-pic";
 
   doCheck = true;
diff --git a/pkgs/development/libraries/mpfr/upstream.patch b/pkgs/development/libraries/mpfr/upstream.patch
new file mode 100644
index 000000000000..779331605245
--- /dev/null
+++ b/pkgs/development/libraries/mpfr/upstream.patch
@@ -0,0 +1,1699 @@
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES	2015-07-02 10:49:23.950112879 +0000
++++ mpfr-3.1.3-b/PATCHES	2015-07-02 10:49:24.042113845 +0000
+@@ -0,0 +1 @@
++lngamma-and-doc
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION	2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/VERSION	2015-07-02 10:49:24.042113845 +0000
+@@ -1 +1 @@
+-3.1.3
++3.1.3-p1
+diff -Naurd mpfr-3.1.3-a/doc/mpfr.texi mpfr-3.1.3-b/doc/mpfr.texi
+--- mpfr-3.1.3-a/doc/mpfr.texi	2015-06-19 19:55:11.000000000 +0000
++++ mpfr-3.1.3-b/doc/mpfr.texi	2015-07-02 10:49:24.018113593 +0000
+@@ -810,13 +810,17 @@
+ When the input point is in the closure of the domain of the mathematical
+ function and an input argument is +0 (resp.@: @minus{}0), one considers
+ the limit when the corresponding argument approaches 0 from above
+-(resp.@: below). If the limit is not defined (e.g., @code{mpfr_log} on
+-@minus{}0), the behavior is specified in the description of the MPFR function.
++(resp.@: below), if possible. If the limit is not defined (e.g.,
++@code{mpfr_sqrt} and @code{mpfr_log} on @minus{}0), the behavior is
++specified in the description of the MPFR function, but must be consistent
++with the rule from the above paragraph (e.g., @code{mpfr_log} on @pom{}0
++gives @minus{}Inf).
+ 
+ When the result is equal to 0, its sign is determined by considering the
+ limit as if the input point were not in the domain: If one approaches 0
+ from above (resp.@: below), the result is +0 (resp.@: @minus{}0);
+-for example, @code{mpfr_sin} on +0 gives +0.
++for example, @code{mpfr_sin} on @minus{}0 gives @minus{}0 and
++@code{mpfr_acos} on 1 gives +0 (in all rounding modes).
+ In the other cases, the sign is specified in the description of the MPFR
+ function; for example @code{mpfr_max} on @minus{}0 and +0 gives +0.
+ 
+@@ -832,8 +836,8 @@
+ @c that advantages in practice), like for any bug fix.
+ Example: @code{mpfr_hypot} on (NaN,0) gives NaN, but @code{mpfr_hypot}
+ on (NaN,+Inf) gives +Inf (as specified in @ref{Special Functions}),
+-since for any finite input @var{x}, @code{mpfr_hypot} on (@var{x},+Inf)
+-gives +Inf.
++since for any finite or infinite input @var{x}, @code{mpfr_hypot} on
++(@var{x},+Inf) gives +Inf.
+ 
+ @node Exceptions, Memory Handling, Floating-Point Values on Special Numbers, MPFR Basics
+ @comment  node-name,  next,  previous,  up
+@@ -1581,7 +1585,8 @@
+ @deftypefunx int mpfr_add_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_add_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1} + @var{op2}} rounded in the direction
+-@var{rnd}. For types having no signed zero, it is considered unsigned
++@var{rnd}.  The IEEE-754 rules are used, in particular for signed zeros.
++But for types having no signed zeros, 0 is considered unsigned
+ (i.e., (+0) + 0 = (+0) and (@minus{}0) + 0 = (@minus{}0)).
+ The @code{mpfr_add_d} function assumes that the radix of the @code{double} type
+ is a power of 2, with a precision at most that declared by the C implementation
+@@ -1599,7 +1604,8 @@
+ @deftypefunx int mpfr_sub_z (mpfr_t @var{rop}, mpfr_t @var{op1}, mpz_t @var{op2}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_sub_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1} - @var{op2}} rounded in the direction
+-@var{rnd}. For types having no signed zero, it is considered unsigned
++@var{rnd}.  The IEEE-754 rules are used, in particular for signed zeros.
++But for types having no signed zeros, 0 is considered unsigned
+ (i.e., (+0) @minus{} 0 = (+0), (@minus{}0) @minus{} 0 = (@minus{}0),
+ 0 @minus{} (+0) = (@minus{}0) and 0 @minus{} (@minus{}0) = (+0)).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_sub}
+@@ -1615,7 +1621,7 @@
+ Set @var{rop} to @math{@var{op1} @GMPtimes{} @var{op2}} rounded in the
+ direction @var{rnd}.
+ When a result is zero, its sign is the product of the signs of the operands
+-(for types having no signed zero, it is considered positive).
++(for types having no signed zeros, 0 is considered positive).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_mul_d}.
+ @end deftypefun
+ 
+@@ -1635,7 +1641,7 @@
+ @deftypefunx int mpfr_div_q (mpfr_t @var{rop}, mpfr_t @var{op1}, mpq_t @var{op2}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{@var{op1}/@var{op2}} rounded in the direction @var{rnd}.
+ When a result is zero, its sign is the product of the signs of the operands
+-(for types having no signed zero, it is considered positive).
++(for types having no signed zeros, 0 is considered positive).
+ The same restrictions than for @code{mpfr_add_d} apply to @code{mpfr_d_div}
+ and @code{mpfr_div_d}.
+ @end deftypefun
+@@ -1643,15 +1649,18 @@
+ @deftypefun int mpfr_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ @deftypefunx int mpfr_sqrt_ui (mpfr_t @var{rop}, unsigned long int @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @m{\sqrt{@var{op}}, the square root of @var{op}}
+-rounded in the direction @var{rnd} (set @var{rop} to @minus{}0 if @var{op} is
+-@minus{}0, to be consistent with the IEEE 754 standard).
++rounded in the direction @var{rnd}.  Set @var{rop} to @minus{}0 if
++@var{op} is @minus{}0, to be consistent with the IEEE 754 standard.
+ Set @var{rop} to NaN if @var{op} is negative.
+ @end deftypefun
+ 
+ @deftypefun int mpfr_rec_sqrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @m{1/\sqrt{@var{op}}, the reciprocal square root of @var{op}}
+-rounded in the direction @var{rnd}. Set @var{rop} to +Inf if @var{op} is
+-@pom{}0, +0 if @var{op} is +Inf, and NaN if @var{op} is negative.
++rounded in the direction @var{rnd}.  Set @var{rop} to +Inf if @var{op} is
++@pom{}0, +0 if @var{op} is +Inf, and NaN if @var{op} is negative.  Warning!
++Therefore the result on @minus{}0 is different from the one of the rSqrt
++function recommended by the IEEE 754-2008 standard (Section 9.2.1), which
++is @minus{}Inf instead of +Inf.
+ @end deftypefun
+ 
+ @deftypefun int mpfr_cbrt (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+@@ -1832,7 +1841,9 @@
+ @m{\log_2 @var{op}, log2(@var{op})} or
+ @m{\log_{10} @var{op}, log10(@var{op})}, respectively,
+ rounded in the direction @var{rnd}.
+-Set @var{rop} to @minus{}Inf if @var{op} is @minus{}0
++Set @var{rop} to +0 if @var{op} is 1 (in all rounding modes),
++for consistency with the ISO C99 and IEEE 754-2008 standards.
++Set @var{rop} to @minus{}Inf if @var{op} is @pom{}0
+ (i.e., the sign of the zero has no influence on the result).
+ @end deftypefun
+ 
+@@ -2003,8 +2014,11 @@
+ @deftypefun int mpfr_lngamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to the value of the logarithm of the Gamma function on @var{op},
+ rounded in the direction @var{rnd}.
+-When @math{@minus{}2@var{k}@minus{}1 @le{} @var{op} @le{} @minus{}2@var{k}},
+-@var{k} being a non-negative integer, @var{rop} is set to NaN.
++When @var{op} is 1 or 2, set @var{rop} to +0 (in all rounding modes).
++When @var{op} is an infinity or a nonpositive integer, set @var{rop} to +Inf,
++following the general rules on special values.
++When @math{@minus{}2@var{k}@minus{}1 < @var{op} < @minus{}2@var{k}},
++@var{k} being a nonnegative integer, set @var{rop} to NaN@.
+ See also @code{mpfr_lgamma}.
+ @end deftypefun
+ 
+@@ -2012,10 +2026,11 @@
+ Set @var{rop} to the value of the logarithm of the absolute value of the
+ Gamma function on @var{op}, rounded in the direction @var{rnd}. The sign
+ (1 or @minus{}1) of Gamma(@var{op}) is returned in the object pointed to
+-by @var{signp}. When @var{op} is an infinity or a non-positive integer, set
+-@var{rop} to +Inf. When @var{op} is NaN, @minus{}Inf or a negative integer,
+-*@var{signp} is undefined, and when @var{op} is @pom{}0, *@var{signp} is
+-the sign of the zero.
++by @var{signp}.
++When @var{op} is 1 or 2, set @var{rop} to +0 (in all rounding modes).
++When @var{op} is an infinity or a nonpositive integer, set @var{rop} to +Inf.
++When @var{op} is NaN, @minus{}Inf or a negative integer, *@var{signp} is
++undefined, and when @var{op} is @pom{}0, *@var{signp} is the sign of the zero.
+ @end deftypefun
+ 
+ @deftypefun int mpfr_digamma (mpfr_t @var{rop}, mpfr_t @var{op}, mpfr_rnd_t @var{rnd})
+@@ -2064,7 +2079,10 @@
+ @deftypefunx int mpfr_fms (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_t @var{op3}, mpfr_rnd_t @var{rnd})
+ Set @var{rop} to @math{(@var{op1} @GMPtimes{} @var{op2}) + @var{op3}}
+ (resp.@: @math{(@var{op1} @GMPtimes{} @var{op2}) - @var{op3}})
+-rounded in the direction @var{rnd}.
++rounded in the direction @var{rnd}.  Concerning special values (signed zeros,
++infinities, NaN), these functions behave like a multiplication followed by a
++separate addition or subtraction.  That is, the fused operation matters only
++for rounding.
+ @end deftypefun
+ 
+ @deftypefun int mpfr_agm (mpfr_t @var{rop}, mpfr_t @var{op1}, mpfr_t @var{op2}, mpfr_rnd_t @var{rnd})
+@@ -2089,8 +2107,8 @@
+ i.e., $\sqrt{x^2+y^2}$,
+ @end tex
+ rounded in the direction @var{rnd}.
+-Special values are handled as described in Section F.9.4.3 of
+-the ISO C99 and IEEE 754-2008 standards:
++Special values are handled as described in the ISO C99 (Section F.9.4.3)
++and IEEE 754-2008 (Section 9.2.1) standards:
+ If @var{x} or @var{y} is an infinity, then +Inf is returned in @var{rop},
+ even if the other number is NaN.
+ @end deftypefun
+diff -Naurd mpfr-3.1.3-a/doc/mpfr.info mpfr-3.1.3-b/doc/mpfr.info
+--- mpfr-3.1.3-a/doc/mpfr.info	2015-06-19 19:55:53.000000000 +0000
++++ mpfr-3.1.3-b/doc/mpfr.info	2015-07-02 10:49:38.718267817 +0000
+@@ -1,4 +1,4 @@
+-This is mpfr.info, produced by makeinfo version 5.2 from mpfr.texi.
++This is mpfr.info, produced by makeinfo version 6.0 from mpfr.texi.
+ 
+ This manual documents how to install and use the Multiple Precision
+ Floating-Point Reliable Library, version 3.1.3.
+@@ -55,7 +55,7 @@
+ MPFR Copying Conditions
+ ***********************
+ 
+-The GNU MPFR library (or MPFR for short) is "free"; this means that
++The GNU MPFR library (or MPFR for short) is “free”; this means that
+ everyone is free to use it and free to redistribute it on a free basis.
+ The library is not in the public domain; it is copyrighted and there are
+ restrictions on its distribution, but these restrictions are designed to
+@@ -418,7 +418,7 @@
+ 4.2 Nomenclature and Types
+ ==========================
+ 
+-A "floating-point number", or "float" for short, is an arbitrary
++A “floating-point number”, or “float” for short, is an arbitrary
+ precision significand (also called mantissa) with a limited precision
+ exponent.  The C data type for such objects is ‘mpfr_t’ (internally
+ defined as a one-element array of a structure, and ‘mpfr_ptr’ is the C
+@@ -432,7 +432,7 @@
+ to the other functions supported by MPFR. Unless documented otherwise,
+ the sign bit of a NaN is unspecified.
+ 
+-The "precision" is the number of bits used to represent the significand
++The “precision” is the number of bits used to represent the significand
+ of a floating-point number; the corresponding C data type is
+ ‘mpfr_prec_t’.  The precision can be any integer between ‘MPFR_PREC_MIN’
+ and ‘MPFR_PREC_MAX’.  In the current implementation, ‘MPFR_PREC_MIN’ is
+@@ -446,7 +446,7 @@
+ may abort, crash or have undefined behavior (depending on your C
+ implementation).
+ 
+-The "rounding mode" specifies the way to round the result of a
++The “rounding mode” specifies the way to round the result of a
+ floating-point operation, in case the exact result can not be
+ represented exactly in the destination significand; the corresponding C
+ data type is ‘mpfr_rnd_t’.
+@@ -499,14 +499,14 @@
+ representable numbers, it is rounded to the one with the least
+ significant bit set to zero.  For example, the number 2.5, which is
+ represented by (10.1) in binary, is rounded to (10.0)=2 with a precision
+-of two bits, and not to (11.0)=3.  This rule avoids the "drift"
++of two bits, and not to (11.0)=3.  This rule avoids the “drift”
+ phenomenon mentioned by Knuth in volume 2 of The Art of Computer
+ Programming (Section 4.2.2).
+ 
+    Most MPFR functions take as first argument the destination variable,
+ as second and following arguments the input variables, as last argument
+ a rounding mode, and have a return value of type ‘int’, called the
+-"ternary value".  The value stored in the destination variable is
++“ternary value”.  The value stored in the destination variable is
+ correctly rounded, i.e., MPFR behaves as if it computed the result with
+ an infinite precision, then rounded it to the precision of this
+ variable.  The input variables are regarded as exact (in particular,
+@@ -572,15 +572,18 @@
+    When the input point is in the closure of the domain of the
+ mathematical function and an input argument is +0 (resp. −0), one
+ considers the limit when the corresponding argument approaches 0 from
+-above (resp. below).  If the limit is not defined (e.g., ‘mpfr_log’ on
+-−0), the behavior is specified in the description of the MPFR function.
++above (resp. below), if possible.  If the limit is not defined (e.g.,
++‘mpfr_sqrt’ and ‘mpfr_log’ on −0), the behavior is specified in the
++description of the MPFR function, but must be consistent with the rule
++from the above paragraph (e.g., ‘mpfr_log’ on ±0 gives −Inf).
+ 
+    When the result is equal to 0, its sign is determined by considering
+ the limit as if the input point were not in the domain: If one
+ approaches 0 from above (resp. below), the result is +0 (resp. −0); for
+-example, ‘mpfr_sin’ on +0 gives +0.  In the other cases, the sign is
+-specified in the description of the MPFR function; for example
+-‘mpfr_max’ on −0 and +0 gives +0.
++example, ‘mpfr_sin’ on −0 gives −0 and ‘mpfr_acos’ on 1 gives +0 (in all
++rounding modes).  In the other cases, the sign is specified in the
++description of the MPFR function; for example ‘mpfr_max’ on −0 and +0
++gives +0.
+ 
+    When the input point is not in the closure of the domain of the
+ function, the result is NaN. Example: ‘mpfr_sqrt’ on −17 gives NaN.
+@@ -590,8 +593,8 @@
+ numbers; such a case is always explicitly specified in *note MPFR
+ Interface::.  Example: ‘mpfr_hypot’ on (NaN,0) gives NaN, but
+ ‘mpfr_hypot’ on (NaN,+Inf) gives +Inf (as specified in *note Special
+-Functions::), since for any finite input X, ‘mpfr_hypot’ on (X,+Inf)
+-gives +Inf.
++Functions::), since for any finite or infinite input X, ‘mpfr_hypot’ on
++(X,+Inf) gives +Inf.
+ 
+ 
+ File: mpfr.info,  Node: Exceptions,  Next: Memory Handling,  Prev: Floating-Point Values on Special Numbers,  Up: MPFR Basics
+@@ -1253,8 +1256,9 @@
+           mpfr_rnd_t RND)
+  -- Function: int mpfr_add_q (mpfr_t ROP, mpfr_t OP1, mpq_t OP2,
+           mpfr_rnd_t RND)
+-     Set ROP to OP1 + OP2 rounded in the direction RND.  For types
+-     having no signed zero, it is considered unsigned (i.e., (+0) + 0 =
++     Set ROP to OP1 + OP2 rounded in the direction RND.  The IEEE-754
++     rules are used, in particular for signed zeros.  But for types
++     having no signed zeros, 0 is considered unsigned (i.e., (+0) + 0 =
+      (+0) and (−0) + 0 = (−0)).  The ‘mpfr_add_d’ function assumes that
+      the radix of the ‘double’ type is a power of 2, with a precision at
+      most that declared by the C implementation (macro
+@@ -1280,8 +1284,9 @@
+           mpfr_rnd_t RND)
+  -- Function: int mpfr_sub_q (mpfr_t ROP, mpfr_t OP1, mpq_t OP2,
+           mpfr_rnd_t RND)
+-     Set ROP to OP1 - OP2 rounded in the direction RND.  For types
+-     having no signed zero, it is considered unsigned (i.e., (+0) − 0 =
++     Set ROP to OP1 - OP2 rounded in the direction RND.  The IEEE-754
++     rules are used, in particular for signed zeros.  But for types
++     having no signed zeros, 0 is considered unsigned (i.e., (+0) − 0 =
+      (+0), (−0) − 0 = (−0), 0 − (+0) = (−0) and 0 − (−0) = (+0)).  The
+      same restrictions than for ‘mpfr_add_d’ apply to ‘mpfr_d_sub’ and
+      ‘mpfr_sub_d’.
+@@ -1300,7 +1305,7 @@
+           mpfr_rnd_t RND)
+      Set ROP to OP1 times OP2 rounded in the direction RND.  When a
+      result is zero, its sign is the product of the signs of the
+-     operands (for types having no signed zero, it is considered
++     operands (for types having no signed zeros, 0 is considered
+      positive).  The same restrictions than for ‘mpfr_add_d’ apply to
+      ‘mpfr_mul_d’.
+ 
+@@ -1327,21 +1332,24 @@
+           mpfr_rnd_t RND)
+      Set ROP to OP1/OP2 rounded in the direction RND.  When a result is
+      zero, its sign is the product of the signs of the operands (for
+-     types having no signed zero, it is considered positive).  The same
++     types having no signed zeros, 0 is considered positive).  The same
+      restrictions than for ‘mpfr_add_d’ apply to ‘mpfr_d_div’ and
+      ‘mpfr_div_d’.
+ 
+  -- Function: int mpfr_sqrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+  -- Function: int mpfr_sqrt_ui (mpfr_t ROP, unsigned long int OP,
+           mpfr_rnd_t RND)
+-     Set ROP to the square root of OP rounded in the direction RND (set
+-     ROP to −0 if OP is −0, to be consistent with the IEEE 754
+-     standard).  Set ROP to NaN if OP is negative.
++     Set ROP to the square root of OP rounded in the direction RND.  Set
++     ROP to −0 if OP is −0, to be consistent with the IEEE 754 standard.
++     Set ROP to NaN if OP is negative.
+ 
+  -- Function: int mpfr_rec_sqrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+      Set ROP to the reciprocal square root of OP rounded in the
+      direction RND.  Set ROP to +Inf if OP is ±0, +0 if OP is +Inf, and
+-     NaN if OP is negative.
++     NaN if OP is negative.  Warning!  Therefore the result on −0 is
++     different from the one of the rSqrt function recommended by the
++     IEEE 754-2008 standard (Section 9.2.1), which is −Inf instead of
++     +Inf.
+ 
+  -- Function: int mpfr_cbrt (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+  -- Function: int mpfr_root (mpfr_t ROP, mpfr_t OP, unsigned long int K,
+@@ -1515,8 +1523,10 @@
+  -- Function: int mpfr_log2 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+  -- Function: int mpfr_log10 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+      Set ROP to the natural logarithm of OP, log2(OP) or log10(OP),
+-     respectively, rounded in the direction RND.  Set ROP to −Inf if OP
+-     is −0 (i.e., the sign of the zero has no influence on the result).
++     respectively, rounded in the direction RND.  Set ROP to +0 if OP is
++     1 (in all rounding modes), for consistency with the ISO C99 and
++     IEEE 754-2008 standards.  Set ROP to −Inf if OP is ±0 (i.e., the
++     sign of the zero has no influence on the result).
+ 
+  -- Function: int mpfr_exp (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+  -- Function: int mpfr_exp2 (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+@@ -1649,17 +1659,21 @@
+ 
+  -- Function: int mpfr_lngamma (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+      Set ROP to the value of the logarithm of the Gamma function on OP,
+-     rounded in the direction RND.  When −2K−1 <= OP <= −2K, K being a
+-     non-negative integer, ROP is set to NaN. See also ‘mpfr_lgamma’.
++     rounded in the direction RND.  When OP is 1 or 2, set ROP to +0 (in
++     all rounding modes).  When OP is an infinity or a nonpositive
++     integer, set ROP to +Inf, following the general rules on special
++     values.  When −2K−1 < OP < −2K, K being a nonnegative integer, set
++     ROP to NaN.  See also ‘mpfr_lgamma’.
+ 
+  -- Function: int mpfr_lgamma (mpfr_t ROP, int *SIGNP, mpfr_t OP,
+           mpfr_rnd_t RND)
+      Set ROP to the value of the logarithm of the absolute value of the
+      Gamma function on OP, rounded in the direction RND.  The sign (1 or
+      −1) of Gamma(OP) is returned in the object pointed to by SIGNP.
+-     When OP is an infinity or a non-positive integer, set ROP to +Inf.
+-     When OP is NaN, −Inf or a negative integer, *SIGNP is undefined,
+-     and when OP is ±0, *SIGNP is the sign of the zero.
++     When OP is 1 or 2, set ROP to +0 (in all rounding modes).  When OP
++     is an infinity or a nonpositive integer, set ROP to +Inf.  When OP
++     is NaN, −Inf or a negative integer, *SIGNP is undefined, and when
++     OP is ±0, *SIGNP is the sign of the zero.
+ 
+  -- Function: int mpfr_digamma (mpfr_t ROP, mpfr_t OP, mpfr_rnd_t RND)
+      Set ROP to the value of the Digamma (sometimes also called Psi)
+@@ -1703,7 +1717,10 @@
+  -- Function: int mpfr_fms (mpfr_t ROP, mpfr_t OP1, mpfr_t OP2, mpfr_t
+           OP3, mpfr_rnd_t RND)
+      Set ROP to (OP1 times OP2) + OP3 (resp. (OP1 times OP2) - OP3)
+-     rounded in the direction RND.
++     rounded in the direction RND.  Concerning special values (signed
++     zeros, infinities, NaN), these functions behave like a
++     multiplication followed by a separate addition or subtraction.
++     That is, the fused operation matters only for rounding.
+ 
+  -- Function: int mpfr_agm (mpfr_t ROP, mpfr_t OP1, mpfr_t OP2,
+           mpfr_rnd_t RND)
+@@ -1717,9 +1734,10 @@
+           RND)
+      Set ROP to the Euclidean norm of X and Y, i.e., the square root of
+      the sum of the squares of X and Y, rounded in the direction RND.
+-     Special values are handled as described in Section F.9.4.3 of the
+-     ISO C99 and IEEE 754-2008 standards: If X or Y is an infinity, then
+-     +Inf is returned in ROP, even if the other number is NaN.
++     Special values are handled as described in the ISO C99 (Section
++     F.9.4.3) and IEEE 754-2008 (Section 9.2.1) standards: If X or Y is
++     an infinity, then +Inf is returned in ROP, even if the other number
++     is NaN.
+ 
+  -- Function: int mpfr_ai (mpfr_t ROP, mpfr_t X, mpfr_rnd_t RND)
+      Set ROP to the value of the Airy function Ai on X, rounded in the
+@@ -2670,7 +2688,7 @@
+ 5.16 Internals
+ ==============
+ 
+-A "limb" means the part of a multi-precision number that fits in a
++A “limb” means the part of a multi-precision number that fits in a
+ single word.  Usually a limb contains 32 or 64 bits.  The C data type
+ for a limb is ‘mp_limb_t’.
+ 
+@@ -3140,7 +3158,7 @@
+   0. PREAMBLE
+ 
+      The purpose of this License is to make a manual, textbook, or other
+-     functional and useful document "free" in the sense of freedom: to
++     functional and useful document “free” in the sense of freedom: to
+      assure everyone the effective freedom to copy and redistribute it,
+      with or without modifying it, either commercially or
+      noncommercially.  Secondarily, this License preserves for the
+@@ -3655,9 +3673,9 @@
+ * Menu:
+ 
+ * mpfr_abs:                              Basic Arithmetic Functions.
+-                                                              (line 160)
+-* mpfr_acos:                             Special Functions.   (line  51)
+-* mpfr_acosh:                            Special Functions.   (line 115)
++                                                              (line 165)
++* mpfr_acos:                             Special Functions.   (line  53)
++* mpfr_acosh:                            Special Functions.   (line 117)
+ * mpfr_add:                              Basic Arithmetic Functions.
+                                                               (line   6)
+ * mpfr_add_d:                            Basic Arithmetic Functions.
+@@ -3670,15 +3688,15 @@
+                                                               (line   8)
+ * mpfr_add_z:                            Basic Arithmetic Functions.
+                                                               (line  14)
+-* mpfr_agm:                              Special Functions.   (line 210)
+-* mpfr_ai:                               Special Functions.   (line 226)
+-* mpfr_asin:                             Special Functions.   (line  52)
+-* mpfr_asinh:                            Special Functions.   (line 116)
++* mpfr_agm:                              Special Functions.   (line 219)
++* mpfr_ai:                               Special Functions.   (line 236)
++* mpfr_asin:                             Special Functions.   (line  54)
++* mpfr_asinh:                            Special Functions.   (line 118)
+ * mpfr_asprintf:                         Formatted Output Functions.
+                                                               (line 193)
+-* mpfr_atan:                             Special Functions.   (line  53)
+-* mpfr_atan2:                            Special Functions.   (line  63)
+-* mpfr_atanh:                            Special Functions.   (line 117)
++* mpfr_atan:                             Special Functions.   (line  55)
++* mpfr_atan2:                            Special Functions.   (line  65)
++* mpfr_atanh:                            Special Functions.   (line 119)
+ * mpfr_buildopt_decimal_p:               Miscellaneous Functions.
+                                                               (line 162)
+ * mpfr_buildopt_gmpinternals_p:          Miscellaneous Functions.
+@@ -3690,7 +3708,7 @@
+ * mpfr_can_round:                        Rounding Related Functions.
+                                                               (line  39)
+ * mpfr_cbrt:                             Basic Arithmetic Functions.
+-                                                              (line 108)
++                                                              (line 113)
+ * mpfr_ceil:                             Integer Related Functions.
+                                                               (line   7)
+ * mpfr_check_range:                      Exception Related Functions.
+@@ -3735,18 +3753,18 @@
+                                                               (line  27)
+ * mpfr_cmp_z:                            Comparison Functions.
+                                                               (line  11)
+-* mpfr_const_catalan:                    Special Functions.   (line 237)
+-* mpfr_const_euler:                      Special Functions.   (line 236)
+-* mpfr_const_log2:                       Special Functions.   (line 234)
+-* mpfr_const_pi:                         Special Functions.   (line 235)
++* mpfr_const_catalan:                    Special Functions.   (line 247)
++* mpfr_const_euler:                      Special Functions.   (line 246)
++* mpfr_const_log2:                       Special Functions.   (line 244)
++* mpfr_const_pi:                         Special Functions.   (line 245)
+ * mpfr_copysign:                         Miscellaneous Functions.
+                                                               (line 109)
+-* mpfr_cos:                              Special Functions.   (line  29)
+-* mpfr_cosh:                             Special Functions.   (line  95)
+-* mpfr_cot:                              Special Functions.   (line  47)
+-* mpfr_coth:                             Special Functions.   (line 111)
+-* mpfr_csc:                              Special Functions.   (line  46)
+-* mpfr_csch:                             Special Functions.   (line 110)
++* mpfr_cos:                              Special Functions.   (line  31)
++* mpfr_cosh:                             Special Functions.   (line  97)
++* mpfr_cot:                              Special Functions.   (line  49)
++* mpfr_coth:                             Special Functions.   (line 113)
++* mpfr_csc:                              Special Functions.   (line  48)
++* mpfr_csch:                             Special Functions.   (line 112)
+ * mpfr_custom_get_exp:                   Custom Interface.    (line  75)
+ * mpfr_custom_get_kind:                  Custom Interface.    (line  65)
+ * mpfr_custom_get_significand:           Custom Interface.    (line  70)
+@@ -3756,47 +3774,47 @@
+ * mpfr_custom_move:                      Custom Interface.    (line  82)
+ * MPFR_DECL_INIT:                        Initialization Functions.
+                                                               (line  74)
+-* mpfr_digamma:                          Special Functions.   (line 166)
++* mpfr_digamma:                          Special Functions.   (line 172)
+ * mpfr_dim:                              Basic Arithmetic Functions.
+-                                                              (line 166)
++                                                              (line 171)
+ * mpfr_div:                              Basic Arithmetic Functions.
+-                                                              (line  72)
++                                                              (line  74)
+ * mpfr_divby0_p:                         Exception Related Functions.
+                                                               (line 134)
+ * mpfr_div_2exp:                         Compatibility with MPF.
+                                                               (line  49)
+ * mpfr_div_2si:                          Basic Arithmetic Functions.
+-                                                              (line 181)
++                                                              (line 186)
+ * mpfr_div_2ui:                          Basic Arithmetic Functions.
+-                                                              (line 179)
++                                                              (line 184)
+ * mpfr_div_d:                            Basic Arithmetic Functions.
+-                                                              (line  84)
++                                                              (line  86)
+ * mpfr_div_q:                            Basic Arithmetic Functions.
+-                                                              (line  88)
++                                                              (line  90)
+ * mpfr_div_si:                           Basic Arithmetic Functions.
+-                                                              (line  80)
++                                                              (line  82)
+ * mpfr_div_ui:                           Basic Arithmetic Functions.
+-                                                              (line  76)
++                                                              (line  78)
+ * mpfr_div_z:                            Basic Arithmetic Functions.
+-                                                              (line  86)
++                                                              (line  88)
+ * mpfr_d_div:                            Basic Arithmetic Functions.
+-                                                              (line  82)
++                                                              (line  84)
+ * mpfr_d_sub:                            Basic Arithmetic Functions.
+-                                                              (line  35)
+-* mpfr_eint:                             Special Functions.   (line 133)
++                                                              (line  36)
++* mpfr_eint:                             Special Functions.   (line 135)
+ * mpfr_eq:                               Compatibility with MPF.
+                                                               (line  28)
+ * mpfr_equal_p:                          Comparison Functions.
+                                                               (line  59)
+ * mpfr_erangeflag_p:                     Exception Related Functions.
+                                                               (line 137)
+-* mpfr_erf:                              Special Functions.   (line 177)
+-* mpfr_erfc:                             Special Functions.   (line 178)
+-* mpfr_exp:                              Special Functions.   (line  23)
+-* mpfr_exp10:                            Special Functions.   (line  25)
+-* mpfr_exp2:                             Special Functions.   (line  24)
+-* mpfr_expm1:                            Special Functions.   (line 129)
+-* mpfr_fac_ui:                           Special Functions.   (line 121)
++* mpfr_erf:                              Special Functions.   (line 183)
++* mpfr_erfc:                             Special Functions.   (line 184)
++* mpfr_exp:                              Special Functions.   (line  25)
++* mpfr_exp10:                            Special Functions.   (line  27)
++* mpfr_exp2:                             Special Functions.   (line  26)
++* mpfr_expm1:                            Special Functions.   (line 131)
++* mpfr_fac_ui:                           Special Functions.   (line 123)
+ * mpfr_fits_intmax_p:                    Conversion Functions.
+                                                               (line 150)
+ * mpfr_fits_sint_p:                      Conversion Functions.
+@@ -3815,20 +3833,20 @@
+                                                               (line 147)
+ * mpfr_floor:                            Integer Related Functions.
+                                                               (line   8)
+-* mpfr_fma:                              Special Functions.   (line 203)
++* mpfr_fma:                              Special Functions.   (line 209)
+ * mpfr_fmod:                             Integer Related Functions.
+                                                               (line  92)
+-* mpfr_fms:                              Special Functions.   (line 205)
++* mpfr_fms:                              Special Functions.   (line 211)
+ * mpfr_fprintf:                          Formatted Output Functions.
+                                                               (line 157)
+ * mpfr_frac:                             Integer Related Functions.
+                                                               (line  76)
+-* mpfr_free_cache:                       Special Functions.   (line 244)
++* mpfr_free_cache:                       Special Functions.   (line 254)
+ * mpfr_free_str:                         Conversion Functions.
+                                                               (line 137)
+ * mpfr_frexp:                            Conversion Functions.
+                                                               (line  45)
+-* mpfr_gamma:                            Special Functions.   (line 148)
++* mpfr_gamma:                            Special Functions.   (line 150)
+ * mpfr_get_d:                            Conversion Functions.
+                                                               (line   7)
+ * mpfr_get_decimal64:                    Conversion Functions.
+@@ -3887,7 +3905,7 @@
+                                                               (line  56)
+ * mpfr_greater_p:                        Comparison Functions.
+                                                               (line  55)
+-* mpfr_hypot:                            Special Functions.   (line 218)
++* mpfr_hypot:                            Special Functions.   (line 227)
+ * mpfr_inexflag_p:                       Exception Related Functions.
+                                                               (line 136)
+ * mpfr_inf_p:                            Comparison Functions.
+@@ -3922,21 +3940,21 @@
+                                                               (line  31)
+ * mpfr_integer_p:                        Integer Related Functions.
+                                                               (line 119)
+-* mpfr_j0:                               Special Functions.   (line 182)
+-* mpfr_j1:                               Special Functions.   (line 183)
+-* mpfr_jn:                               Special Functions.   (line 184)
++* mpfr_j0:                               Special Functions.   (line 188)
++* mpfr_j1:                               Special Functions.   (line 189)
++* mpfr_jn:                               Special Functions.   (line 190)
+ * mpfr_lessequal_p:                      Comparison Functions.
+                                                               (line  58)
+ * mpfr_lessgreater_p:                    Comparison Functions.
+                                                               (line  64)
+ * mpfr_less_p:                           Comparison Functions.
+                                                               (line  57)
+-* mpfr_lgamma:                           Special Functions.   (line 157)
+-* mpfr_li2:                              Special Functions.   (line 143)
+-* mpfr_lngamma:                          Special Functions.   (line 152)
++* mpfr_lgamma:                           Special Functions.   (line 162)
++* mpfr_li2:                              Special Functions.   (line 145)
++* mpfr_lngamma:                          Special Functions.   (line 154)
+ * mpfr_log:                              Special Functions.   (line  16)
+ * mpfr_log10:                            Special Functions.   (line  18)
+-* mpfr_log1p:                            Special Functions.   (line 125)
++* mpfr_log1p:                            Special Functions.   (line 127)
+ * mpfr_log2:                             Special Functions.   (line  17)
+ * mpfr_max:                              Miscellaneous Functions.
+                                                               (line  22)
+@@ -3947,29 +3965,29 @@
+ * mpfr_modf:                             Integer Related Functions.
+                                                               (line  82)
+ * mpfr_mul:                              Basic Arithmetic Functions.
+-                                                              (line  51)
++                                                              (line  53)
+ * mpfr_mul_2exp:                         Compatibility with MPF.
+                                                               (line  47)
+ * mpfr_mul_2si:                          Basic Arithmetic Functions.
+-                                                              (line 174)
++                                                              (line 179)
+ * mpfr_mul_2ui:                          Basic Arithmetic Functions.
+-                                                              (line 172)
++                                                              (line 177)
+ * mpfr_mul_d:                            Basic Arithmetic Functions.
+-                                                              (line  57)
++                                                              (line  59)
+ * mpfr_mul_q:                            Basic Arithmetic Functions.
+-                                                              (line  61)
++                                                              (line  63)
+ * mpfr_mul_si:                           Basic Arithmetic Functions.
+-                                                              (line  55)
++                                                              (line  57)
+ * mpfr_mul_ui:                           Basic Arithmetic Functions.
+-                                                              (line  53)
++                                                              (line  55)
+ * mpfr_mul_z:                            Basic Arithmetic Functions.
+-                                                              (line  59)
++                                                              (line  61)
+ * mpfr_nanflag_p:                        Exception Related Functions.
+                                                               (line 135)
+ * mpfr_nan_p:                            Comparison Functions.
+                                                               (line  39)
+ * mpfr_neg:                              Basic Arithmetic Functions.
+-                                                              (line 159)
++                                                              (line 164)
+ * mpfr_nextabove:                        Miscellaneous Functions.
+                                                               (line  15)
+ * mpfr_nextbelow:                        Miscellaneous Functions.
+@@ -3983,13 +4001,13 @@
+ * mpfr_overflow_p:                       Exception Related Functions.
+                                                               (line 133)
+ * mpfr_pow:                              Basic Arithmetic Functions.
+-                                                              (line 116)
++                                                              (line 121)
+ * mpfr_pow_si:                           Basic Arithmetic Functions.
+-                                                              (line 120)
++                                                              (line 125)
+ * mpfr_pow_ui:                           Basic Arithmetic Functions.
+-                                                              (line 118)
++                                                              (line 123)
+ * mpfr_pow_z:                            Basic Arithmetic Functions.
+-                                                              (line 122)
++                                                              (line 127)
+ * mpfr_prec_round:                       Rounding Related Functions.
+                                                               (line  13)
+ * ‘mpfr_prec_t’:                         Nomenclature and Types.
+@@ -3999,7 +4017,7 @@
+ * mpfr_print_rnd_mode:                   Rounding Related Functions.
+                                                               (line  71)
+ * mpfr_rec_sqrt:                         Basic Arithmetic Functions.
+-                                                              (line 103)
++                                                              (line 105)
+ * mpfr_regular_p:                        Comparison Functions.
+                                                               (line  43)
+ * mpfr_reldiff:                          Compatibility with MPF.
+@@ -4021,11 +4039,11 @@
+ * ‘mpfr_rnd_t’:                          Nomenclature and Types.
+                                                               (line  34)
+ * mpfr_root:                             Basic Arithmetic Functions.
+-                                                              (line 109)
++                                                              (line 114)
+ * mpfr_round:                            Integer Related Functions.
+                                                               (line   9)
+-* mpfr_sec:                              Special Functions.   (line  45)
+-* mpfr_sech:                             Special Functions.   (line 109)
++* mpfr_sec:                              Special Functions.   (line  47)
++* mpfr_sech:                             Special Functions.   (line 111)
+ * mpfr_set:                              Assignment Functions.
+                                                               (line   9)
+ * mpfr_setsign:                          Miscellaneous Functions.
+@@ -4100,57 +4118,57 @@
+                                                               (line  49)
+ * mpfr_signbit:                          Miscellaneous Functions.
+                                                               (line  99)
+-* mpfr_sin:                              Special Functions.   (line  30)
+-* mpfr_sinh:                             Special Functions.   (line  96)
+-* mpfr_sinh_cosh:                        Special Functions.   (line 101)
+-* mpfr_sin_cos:                          Special Functions.   (line  35)
++* mpfr_sin:                              Special Functions.   (line  32)
++* mpfr_sinh:                             Special Functions.   (line  98)
++* mpfr_sinh_cosh:                        Special Functions.   (line 103)
++* mpfr_sin_cos:                          Special Functions.   (line  37)
+ * mpfr_si_div:                           Basic Arithmetic Functions.
+-                                                              (line  78)
++                                                              (line  80)
+ * mpfr_si_sub:                           Basic Arithmetic Functions.
+-                                                              (line  31)
++                                                              (line  32)
+ * mpfr_snprintf:                         Formatted Output Functions.
+                                                               (line 180)
+ * mpfr_sprintf:                          Formatted Output Functions.
+                                                               (line 170)
+ * mpfr_sqr:                              Basic Arithmetic Functions.
+-                                                              (line  69)
++                                                              (line  71)
+ * mpfr_sqrt:                             Basic Arithmetic Functions.
+-                                                              (line  96)
++                                                              (line  98)
+ * mpfr_sqrt_ui:                          Basic Arithmetic Functions.
+-                                                              (line  97)
++                                                              (line  99)
+ * mpfr_strtofr:                          Assignment Functions.
+                                                               (line  80)
+ * mpfr_sub:                              Basic Arithmetic Functions.
+-                                                              (line  25)
++                                                              (line  26)
+ * mpfr_subnormalize:                     Exception Related Functions.
+                                                               (line  60)
+ * mpfr_sub_d:                            Basic Arithmetic Functions.
+-                                                              (line  37)
++                                                              (line  38)
+ * mpfr_sub_q:                            Basic Arithmetic Functions.
+-                                                              (line  43)
++                                                              (line  44)
+ * mpfr_sub_si:                           Basic Arithmetic Functions.
+-                                                              (line  33)
++                                                              (line  34)
+ * mpfr_sub_ui:                           Basic Arithmetic Functions.
+-                                                              (line  29)
++                                                              (line  30)
+ * mpfr_sub_z:                            Basic Arithmetic Functions.
+-                                                              (line  41)
+-* mpfr_sum:                              Special Functions.   (line 252)
++                                                              (line  42)
++* mpfr_sum:                              Special Functions.   (line 262)
+ * mpfr_swap:                             Assignment Functions.
+                                                               (line 150)
+ * ‘mpfr_t’:                              Nomenclature and Types.
+                                                               (line   6)
+-* mpfr_tan:                              Special Functions.   (line  31)
+-* mpfr_tanh:                             Special Functions.   (line  97)
++* mpfr_tan:                              Special Functions.   (line  33)
++* mpfr_tanh:                             Special Functions.   (line  99)
+ * mpfr_trunc:                            Integer Related Functions.
+                                                               (line  10)
+ * mpfr_ui_div:                           Basic Arithmetic Functions.
+-                                                              (line  74)
++                                                              (line  76)
+ * mpfr_ui_pow:                           Basic Arithmetic Functions.
+-                                                              (line 126)
++                                                              (line 131)
+ * mpfr_ui_pow_ui:                        Basic Arithmetic Functions.
+-                                                              (line 124)
++                                                              (line 129)
+ * mpfr_ui_sub:                           Basic Arithmetic Functions.
+-                                                              (line  27)
++                                                              (line  28)
+ * mpfr_underflow_p:                      Exception Related Functions.
+                                                               (line 132)
+ * mpfr_unordered_p:                      Comparison Functions.
+@@ -4181,61 +4199,61 @@
+                                                               (line 182)
+ * mpfr_vsprintf:                         Formatted Output Functions.
+                                                               (line 171)
+-* mpfr_y0:                               Special Functions.   (line 193)
+-* mpfr_y1:                               Special Functions.   (line 194)
+-* mpfr_yn:                               Special Functions.   (line 195)
++* mpfr_y0:                               Special Functions.   (line 199)
++* mpfr_y1:                               Special Functions.   (line 200)
++* mpfr_yn:                               Special Functions.   (line 201)
+ * mpfr_zero_p:                           Comparison Functions.
+                                                               (line  42)
+-* mpfr_zeta:                             Special Functions.   (line 171)
+-* mpfr_zeta_ui:                          Special Functions.   (line 172)
++* mpfr_zeta:                             Special Functions.   (line 177)
++* mpfr_zeta_ui:                          Special Functions.   (line 178)
+ * mpfr_z_sub:                            Basic Arithmetic Functions.
+-                                                              (line  39)
++                                                              (line  40)
+ 
+ 
+ 
+ Tag Table:
+ Node: Top775
+ Node: Copying2007
+-Node: Introduction to MPFR3766
+-Node: Installing MPFR5880
+-Node: Reporting Bugs11323
+-Node: MPFR Basics13353
+-Node: Headers and Libraries13669
+-Node: Nomenclature and Types16828
+-Node: MPFR Variable Conventions18874
+-Node: Rounding Modes20418
+-Ref: ternary value21544
+-Node: Floating-Point Values on Special Numbers23526
+-Node: Exceptions26572
+-Node: Memory Handling29749
+-Node: MPFR Interface30894
+-Node: Initialization Functions33008
+-Node: Assignment Functions40318
+-Node: Combined Initialization and Assignment Functions49673
+-Node: Conversion Functions50974
+-Node: Basic Arithmetic Functions60035
+-Node: Comparison Functions69200
+-Node: Special Functions72687
+-Node: Input and Output Functions86672
+-Node: Formatted Output Functions88644
+-Node: Integer Related Functions98431
+-Node: Rounding Related Functions105051
+-Node: Miscellaneous Functions108888
+-Node: Exception Related Functions117568
+-Node: Compatibility with MPF124386
+-Node: Custom Interface127127
+-Node: Internals131526
+-Node: API Compatibility133066
+-Node: Type and Macro Changes134995
+-Node: Added Functions137844
+-Node: Changed Functions141132
+-Node: Removed Functions145545
+-Node: Other Changes145973
+-Node: Contributors147576
+-Node: References150219
+-Node: GNU Free Documentation License151973
+-Node: Concept Index174562
+-Node: Function and Type Index180659
++Node: Introduction to MPFR3770
++Node: Installing MPFR5884
++Node: Reporting Bugs11327
++Node: MPFR Basics13357
++Node: Headers and Libraries13673
++Node: Nomenclature and Types16832
++Node: MPFR Variable Conventions18894
++Node: Rounding Modes20438
++Ref: ternary value21568
++Node: Floating-Point Values on Special Numbers23554
++Node: Exceptions26813
++Node: Memory Handling29990
++Node: MPFR Interface31135
++Node: Initialization Functions33249
++Node: Assignment Functions40559
++Node: Combined Initialization and Assignment Functions49914
++Node: Conversion Functions51215
++Node: Basic Arithmetic Functions60276
++Node: Comparison Functions69777
++Node: Special Functions73264
++Node: Input and Output Functions87862
++Node: Formatted Output Functions89834
++Node: Integer Related Functions99621
++Node: Rounding Related Functions106241
++Node: Miscellaneous Functions110078
++Node: Exception Related Functions118758
++Node: Compatibility with MPF125576
++Node: Custom Interface128317
++Node: Internals132716
++Node: API Compatibility134260
++Node: Type and Macro Changes136189
++Node: Added Functions139038
++Node: Changed Functions142326
++Node: Removed Functions146739
++Node: Other Changes147167
++Node: Contributors148770
++Node: References151413
++Node: GNU Free Documentation License153167
++Node: Concept Index175760
++Node: Function and Type Index181857
+ 
+ End Tag Table
+ 
+diff -Naurd mpfr-3.1.3-a/src/lngamma.c mpfr-3.1.3-b/src/lngamma.c
+--- mpfr-3.1.3-a/src/lngamma.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/lngamma.c	2015-07-02 10:49:24.018113593 +0000
+@@ -603,16 +603,17 @@
+       mpfr_get_prec (y), mpfr_log_prec, y, inex));
+ 
+   /* special cases */
+-  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
++  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x) ||
++                     (MPFR_IS_NEG (x) && mpfr_integer_p (x))))
+     {
+-      if (MPFR_IS_NAN (x) || MPFR_IS_NEG (x))
++      if (MPFR_IS_NAN (x))
+         {
+           MPFR_SET_NAN (y);
+           MPFR_RET_NAN;
+         }
+-      else /* lngamma(+Inf) = lngamma(+0) = +Inf */
++      else /* lngamma(+/-Inf) = lngamma(nonpositive integer) = +Inf */
+         {
+-          if (MPFR_IS_ZERO (x))
++          if (!MPFR_IS_INF (x))
+             mpfr_set_divby0 ();
+           MPFR_SET_INF (y);
+           MPFR_SET_POS (y);
+@@ -620,8 +621,8 @@
+         }
+     }
+ 
+-  /* if x < 0 and -2k-1 <= x <= -2k, then lngamma(x) = NaN */
+-  if (MPFR_IS_NEG (x) && (unit_bit (x) == 0 || mpfr_integer_p (x)))
++  /* if -2k-1 < x < -2k <= 0, then lngamma(x) = NaN */
++  if (MPFR_IS_NEG (x) && unit_bit (x) == 0)
+     {
+       MPFR_SET_NAN (y);
+       MPFR_RET_NAN;
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mpfr.h	2015-07-02 10:49:24.038113803 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3"
++#define MPFR_VERSION_STRING "3.1.3-p1"
+ 
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/version.c	2015-07-02 10:49:24.042113845 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+-  return "3.1.3";
++  return "3.1.3-p1";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tlngamma.c mpfr-3.1.3-b/tests/tlngamma.c
+--- mpfr-3.1.3-a/tests/tlngamma.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tlngamma.c	2015-07-02 10:49:24.018113593 +0000
+@@ -33,7 +33,7 @@
+ special (void)
+ {
+   mpfr_t x, y;
+-  int inex;
++  int i, inex;
+ 
+   mpfr_init (x);
+   mpfr_init (y);
+@@ -46,25 +46,29 @@
+       exit (1);
+     }
+ 
+-  mpfr_set_inf (x, -1);
++  mpfr_set_inf (x, 1);
++  mpfr_clear_flags ();
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (!mpfr_nan_p (y))
++  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || __gmpfr_flags != 0)
+     {
+-      printf ("Error for lngamma(-Inf)\n");
++      printf ("Error for lngamma(+Inf)\n");
+       exit (1);
+     }
+ 
+-  mpfr_set_inf (x, 1);
++  mpfr_set_inf (x, -1);
++  mpfr_clear_flags ();
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
++  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 || __gmpfr_flags != 0)
+     {
+-      printf ("Error for lngamma(+Inf)\n");
++      printf ("Error for lngamma(-Inf)\n");
+       exit (1);
+     }
+ 
+   mpfr_set_ui (x, 0, MPFR_RNDN);
++  mpfr_clear_flags ();
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0)
++  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++      __gmpfr_flags != MPFR_FLAGS_DIVBY0)
+     {
+       printf ("Error for lngamma(+0)\n");
+       exit (1);
+@@ -72,32 +76,58 @@
+ 
+   mpfr_set_ui (x, 0, MPFR_RNDN);
+   mpfr_neg (x, x, MPFR_RNDN);
++  mpfr_clear_flags ();
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (!mpfr_nan_p (y))
++  if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++      __gmpfr_flags != MPFR_FLAGS_DIVBY0)
+     {
+       printf ("Error for lngamma(-0)\n");
+       exit (1);
+     }
+ 
+   mpfr_set_ui (x, 1, MPFR_RNDN);
++  mpfr_clear_flags ();
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y))
++  if (mpfr_cmp_ui0 (y, 0) || MPFR_IS_NEG (y))
+     {
+       printf ("Error for lngamma(1)\n");
+       exit (1);
+     }
+ 
+-  mpfr_set_si (x, -1, MPFR_RNDN);
+-  mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (!mpfr_nan_p (y))
++  for (i = 1; i <= 5; i++)
+     {
+-      printf ("Error for lngamma(-1)\n");
+-      exit (1);
++      int c;
++
++      mpfr_set_si (x, -i, MPFR_RNDN);
++      mpfr_clear_flags ();
++      mpfr_lngamma (y, x, MPFR_RNDN);
++      if (!mpfr_inf_p (y) || mpfr_sgn (y) < 0 ||
++          __gmpfr_flags != MPFR_FLAGS_DIVBY0)
++        {
++          printf ("Error for lngamma(-%d)\n", i);
++          exit (1);
++        }
++      if (i & 1)
++        {
++          mpfr_nextabove (x);
++          c = '+';
++        }
++      else
++        {
++          mpfr_nextbelow (x);
++          c = '-';
++        }
++      mpfr_lngamma (y, x, MPFR_RNDN);
++      if (!mpfr_nan_p (y))
++        {
++          printf ("Error for lngamma(-%d%cepsilon)\n", i, c);
++          exit (1);
++        }
+     }
+ 
+   mpfr_set_ui (x, 2, MPFR_RNDN);
+   mpfr_lngamma (y, x, MPFR_RNDN);
+-  if (MPFR_IS_NAN (y) || mpfr_cmp_ui (y, 0) || MPFR_IS_NEG (y))
++  if (mpfr_cmp_ui0 (y, 0) || MPFR_IS_NEG (y))
+     {
+       printf ("Error for lngamma(2)\n");
+       exit (1);
+@@ -127,7 +157,7 @@
+   mpfr_set_str (x, CHECK_X2, 10, MPFR_RNDN);
+   mpfr_lngamma (y, x, MPFR_RNDN);
+   mpfr_set_str (x, CHECK_Y2, 10, MPFR_RNDN);
+-  if (MPFR_IS_NAN (y) || mpfr_cmp (y, x))
++  if (mpfr_cmp0 (y, x))
+     {
+       printf ("mpfr_lngamma("CHECK_X2") is wrong:\n"
+               "expected ");
+@@ -143,7 +173,7 @@
+   mpfr_lngamma (y, x, MPFR_RNDU);
+   mpfr_set_prec (x, 175);
+   mpfr_set_str_binary (x, "0.1010001100011101101011001101110010100001000001000001110011000001101100001111001001000101011011100100010101011110100111110101010100010011010010000101010111001100011000101111E7");
+-  if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++  if (mpfr_cmp0 (x, y))
+     {
+       printf ("Error in mpfr_lngamma (1)\n");
+       exit (1);
+@@ -155,7 +185,7 @@
+   mpfr_lngamma (x, y, MPFR_RNDZ);
+   mpfr_set_prec (y, 21);
+   mpfr_set_str_binary (y, "0.111000101000001100101E9");
+-  if (MPFR_IS_NAN (x) || mpfr_cmp (x, y))
++  if (mpfr_cmp0 (x, y))
+     {
+       printf ("Error in mpfr_lngamma (120)\n");
+       printf ("Expected "); mpfr_print_binary (y); puts ("");
+@@ -169,7 +199,7 @@
+   inex = mpfr_lngamma (y, x, MPFR_RNDN);
+   mpfr_set_prec (x, 206);
+   mpfr_set_str_binary (x, "0.10000111011000000011100010101001100110001110000111100011000100100110110010001011011110101001111011110110000001010100111011010000000011100110110101100111000111010011110010000100010111101010001101000110101001E13");
+-  if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++  if (mpfr_cmp0 (x, y))
+     {
+       printf ("Error in mpfr_lngamma (768)\n");
+       exit (1);
+@@ -185,7 +215,7 @@
+   mpfr_set_str_binary (x, "0.1100E-66");
+   mpfr_lngamma (y, x, MPFR_RNDN);
+   mpfr_set_str_binary (x, "0.1100E6");
+-  if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++  if (mpfr_cmp0 (x, y))
+     {
+       printf ("Error for lngamma(0.1100E-66)\n");
+       exit (1);
+@@ -199,7 +229,7 @@
+   mpfr_lngamma (y, x, MPFR_RNDN);
+   mpfr_set_prec (x, 32);
+   mpfr_set_str_binary (x, "-0.10001000111011111011000010100010E207");
+-  if (MPFR_IS_NAN (y) || mpfr_cmp (x, y))
++  if (mpfr_cmp0 (x, y))
+     {
+       printf ("Error for lngamma(-2^199+0.5)\n");
+       printf ("Got        ");
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES	2015-07-02 10:50:08.046573308 +0000
++++ mpfr-3.1.3-b/PATCHES	2015-07-02 10:50:08.126574142 +0000
+@@ -0,0 +1 @@
++muldiv-2exp-overflow
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION	2015-07-02 10:49:24.042113845 +0000
++++ mpfr-3.1.3-b/VERSION	2015-07-02 10:50:08.126574142 +0000
+@@ -1 +1 @@
+-3.1.3-p1
++3.1.3-p2
+diff -Naurd mpfr-3.1.3-a/src/div_2si.c mpfr-3.1.3-b/src/div_2si.c
+--- mpfr-3.1.3-a/src/div_2si.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/div_2si.c	2015-07-02 10:50:08.106573933 +0000
+@@ -49,7 +49,7 @@
+             rnd_mode = MPFR_RNDZ;
+           return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+         }
+-      else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n ||
++      else if (MPFR_UNLIKELY(n <= 0 && (__gmpfr_emax < MPFR_EMIN_MIN - n ||
+                                        exp > __gmpfr_emax + n)) )
+         return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
+ 
+diff -Naurd mpfr-3.1.3-a/src/div_2ui.c mpfr-3.1.3-b/src/div_2ui.c
+--- mpfr-3.1.3-a/src/div_2ui.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/div_2ui.c	2015-07-02 10:50:08.106573933 +0000
+@@ -32,7 +32,7 @@
+      rnd_mode),
+     ("y[%Pu]=%.*Rg inexact=%d", mpfr_get_prec(y), mpfr_log_prec, y, inexact));
+ 
+-  if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
++  if (MPFR_UNLIKELY (n == 0 || MPFR_IS_SINGULAR (x)))
+     return mpfr_set (y, x, rnd_mode);
+   else
+     {
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h	2015-07-02 10:49:24.038113803 +0000
++++ mpfr-3.1.3-b/src/mpfr.h	2015-07-02 10:50:08.126574142 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p1"
++#define MPFR_VERSION_STRING "3.1.3-p2"
+ 
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mul_2si.c mpfr-3.1.3-b/src/mul_2si.c
+--- mpfr-3.1.3-a/src/mul_2si.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/src/mul_2si.c	2015-07-02 10:50:08.106573933 +0000
+@@ -39,7 +39,7 @@
+     {
+       mpfr_exp_t exp = MPFR_GET_EXP (x);
+       MPFR_SETRAW (inexact, y, x, exp, rnd_mode);
+-      if (MPFR_UNLIKELY( n > 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
++      if (MPFR_UNLIKELY(n >= 0 && (__gmpfr_emax < MPFR_EMIN_MIN + n ||
+                                    exp > __gmpfr_emax - n)))
+         return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
+       else if (MPFR_UNLIKELY(n < 0 && (__gmpfr_emin > MPFR_EMAX_MAX + n ||
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c	2015-07-02 10:49:24.042113845 +0000
++++ mpfr-3.1.3-b/src/version.c	2015-07-02 10:50:08.126574142 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+-  return "3.1.3-p1";
++  return "3.1.3-p2";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tmul_2exp.c mpfr-3.1.3-b/tests/tmul_2exp.c
+--- mpfr-3.1.3-a/tests/tmul_2exp.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tmul_2exp.c	2015-07-02 10:50:08.106573933 +0000
+@@ -242,6 +242,76 @@
+   large (MPFR_EMAX_MAX);
+ }
+ 
++/* Cases where the function overflows on n = 0 when rounding is like
++   away from zero. */
++static void
++overflow0 (mpfr_exp_t emax)
++{
++  mpfr_exp_t old_emax;
++  mpfr_t x, y1, y2;
++  int neg, r, op;
++  static char *sop[4] = { "mul_2ui", "mul_2si", "div_2ui", "div_2si" };
++
++  old_emax = mpfr_get_emax ();
++  set_emax (emax);
++
++  mpfr_init2 (x, 8);
++  mpfr_inits2 (6, y1, y2, (mpfr_ptr) 0);
++
++  mpfr_set_inf (x, 1);
++  mpfr_nextbelow (x);
++
++  for (neg = 0; neg <= 1; neg++)
++    {
++      RND_LOOP (r)
++        {
++          int inex1, inex2;
++          unsigned int flags1, flags2;
++
++          /* Even if there isn't an overflow (rounding ~ toward zero),
++             the result is the same as the one of an overflow. */
++          inex1 = mpfr_overflow (y1, (mpfr_rnd_t) r, neg ? -1 : 1);
++          flags1 = MPFR_FLAGS_INEXACT;
++          if (mpfr_inf_p (y1))
++            flags1 |= MPFR_FLAGS_OVERFLOW;
++          for (op = 0; op < 4; op++)
++            {
++              mpfr_clear_flags ();
++              inex2 =
++                op == 0 ? mpfr_mul_2ui (y2, x, 0, (mpfr_rnd_t) r) :
++                op == 1 ? mpfr_mul_2si (y2, x, 0, (mpfr_rnd_t) r) :
++                op == 2 ? mpfr_div_2ui (y2, x, 0, (mpfr_rnd_t) r) :
++                op == 3 ? mpfr_div_2si (y2, x, 0, (mpfr_rnd_t) r) :
++                (MPFR_ASSERTN (0), 0);
++              flags2 = __gmpfr_flags;
++              if (!(mpfr_equal_p (y1, y2) &&
++                    SAME_SIGN (inex1, inex2) &&
++                    flags1 == flags2))
++                {
++                  printf ("Error in overflow0 for %s, mpfr_%s, emax = %"
++                          MPFR_EXP_FSPEC "d,\nx = ",
++                          mpfr_print_rnd_mode ((mpfr_rnd_t) r), sop[op],
++                          (mpfr_eexp_t) emax);
++                  mpfr_dump (x);
++                  printf ("Expected ");
++                  mpfr_dump (y1);
++                  printf ("  with inex = %d, flags =", inex1);
++                  flags_out (flags1);
++                  printf ("Got      ");
++                  mpfr_dump (y2);
++                  printf ("  with inex = %d, flags =", inex2);
++                  flags_out (flags2);
++                  exit (1);
++                }
++            }
++        }
++      mpfr_neg (x, x, MPFR_RNDN);
++    }
++
++  mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
++  set_emax (old_emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+@@ -334,6 +404,11 @@
+   underflow0 ();
+   large0 ();
+ 
++  if (mpfr_get_emax () != MPFR_EMAX_MAX)
++    overflow0 (mpfr_get_emax ());
++  overflow0 (MPFR_EMAX_MAX);
++  overflow0 (-1);
++
+   tests_end_mpfr ();
+   return 0;
+ }
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES	2015-07-17 08:54:48.592799981 +0000
++++ mpfr-3.1.3-b/PATCHES	2015-07-17 08:54:48.616811495 +0000
+@@ -0,0 +1 @@
++muldiv-2exp-underflow
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION	2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/VERSION	2015-07-17 08:54:48.616811495 +0000
+@@ -1 +1 @@
+-3.1.3-p2
++3.1.3-p3
+diff -Naurd mpfr-3.1.3-a/src/div_2si.c mpfr-3.1.3-b/src/div_2si.c
+--- mpfr-3.1.3-a/src/div_2si.c	2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/div_2si.c	2015-07-17 08:54:48.608807656 +0000
+@@ -45,7 +45,8 @@
+           if (rnd_mode == MPFR_RNDN &&
+               (__gmpfr_emin > MPFR_EMAX_MAX - (n - 1) ||
+                exp < __gmpfr_emin + (n - 1) ||
+-               (inexact >= 0 && mpfr_powerof2_raw (y))))
++               ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++                mpfr_powerof2_raw (y))))
+             rnd_mode = MPFR_RNDZ;
+           return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+         }
+diff -Naurd mpfr-3.1.3-a/src/div_2ui.c mpfr-3.1.3-b/src/div_2ui.c
+--- mpfr-3.1.3-a/src/div_2ui.c	2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/div_2ui.c	2015-07-17 08:54:48.608807656 +0000
+@@ -44,7 +44,9 @@
+       if (MPFR_UNLIKELY (n >= diffexp))  /* exp - n <= emin - 1 */
+         {
+           if (rnd_mode == MPFR_RNDN &&
+-              (n > diffexp || (inexact >= 0 && mpfr_powerof2_raw (y))))
++              (n > diffexp ||
++               ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++                mpfr_powerof2_raw (y))))
+             rnd_mode = MPFR_RNDZ;
+           return mpfr_underflow (y, rnd_mode, MPFR_SIGN (y));
+         }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h	2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/src/mpfr.h	2015-07-17 08:54:48.616811495 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p2"
++#define MPFR_VERSION_STRING "3.1.3-p3"
+ 
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/mul_2si.c mpfr-3.1.3-b/src/mul_2si.c
+--- mpfr-3.1.3-a/src/mul_2si.c	2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/src/mul_2si.c	2015-07-17 08:54:48.608807656 +0000
+@@ -48,7 +48,8 @@
+           if (rnd_mode == MPFR_RNDN &&
+               (__gmpfr_emin > MPFR_EMAX_MAX + (n + 1) ||
+                exp < __gmpfr_emin - (n + 1) ||
+-               (inexact >= 0 && mpfr_powerof2_raw (y))))
++               ((MPFR_IS_NEG (y) ? inexact <= 0 : inexact >= 0) &&
++                mpfr_powerof2_raw (y))))
+             rnd_mode = MPFR_RNDZ;
+           return mpfr_underflow (y, rnd_mode, MPFR_SIGN(y));
+         }
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c	2015-07-02 10:50:08.126574142 +0000
++++ mpfr-3.1.3-b/src/version.c	2015-07-17 08:54:48.616811495 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+-  return "3.1.3-p2";
++  return "3.1.3-p3";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tmul_2exp.c mpfr-3.1.3-b/tests/tmul_2exp.c
+--- mpfr-3.1.3-a/tests/tmul_2exp.c	2015-07-02 10:50:08.106573933 +0000
++++ mpfr-3.1.3-b/tests/tmul_2exp.c	2015-07-17 08:54:48.608807656 +0000
+@@ -50,77 +50,82 @@
+ {
+   mpfr_t x, y, z1, z2;
+   mpfr_exp_t emin;
+-  int i, k;
++  int i, k, s;
+   int prec;
+   int rnd;
+   int div;
+   int inex1, inex2;
+   unsigned int flags1, flags2;
+ 
+-  /* Test mul_2si(x, e - k), div_2si(x, k - e) and div_2ui(x, k - e)
+-   * with emin = e, x = 1 + i/16, i in { -1, 0, 1 }, and k = 1 to 4,
+-   * by comparing the result with the one of a simple division.
++  /* Test mul_2si(x, e - k), div_2si(x, k - e) and div_2ui(x, k - e) with
++   * emin = e, x = s * (1 + i/16), i in { -1, 0, 1 }, s in { -1, 1 }, and
++   * k = 1 to 4, by comparing the result with the one of a simple division.
+    */
+   emin = mpfr_get_emin ();
+   set_emin (e);
+   mpfr_inits2 (8, x, y, (mpfr_ptr) 0);
+   for (i = 15; i <= 17; i++)
+-    {
+-      inex1 = mpfr_set_ui_2exp (x, i, -4, MPFR_RNDN);
+-      MPFR_ASSERTN (inex1 == 0);
+-      for (prec = 6; prec >= 3; prec -= 3)
+-        {
+-          mpfr_inits2 (prec, z1, z2, (mpfr_ptr) 0);
+-          RND_LOOP (rnd)
+-            for (k = 1; k <= 4; k++)
+-              {
+-                /* The following one is assumed to be correct. */
+-                inex1 = mpfr_mul_2si (y, x, e, MPFR_RNDN);
+-                MPFR_ASSERTN (inex1 == 0);
+-                inex1 = mpfr_set_ui (z1, 1 << k, MPFR_RNDN);
+-                MPFR_ASSERTN (inex1 == 0);
+-                mpfr_clear_flags ();
+-                /* Do not use mpfr_div_ui to avoid the optimization
+-                   by mpfr_div_2si. */
+-                inex1 = mpfr_div (z1, y, z1, (mpfr_rnd_t) rnd);
+-                flags1 = __gmpfr_flags;
+-
+-              for (div = 0; div <= 2; div++)
++    for (s = 1; s >= -1; s -= 2)
++      {
++        inex1 = mpfr_set_si_2exp (x, s * i, -4, MPFR_RNDN);
++        MPFR_ASSERTN (inex1 == 0);
++        for (prec = 6; prec >= 3; prec -= 3)
++          {
++            mpfr_inits2 (prec, z1, z2, (mpfr_ptr) 0);
++            RND_LOOP (rnd)
++              for (k = 1; k <= 4; k++)
+                 {
++                  /* The following one is assumed to be correct. */
++                  inex1 = mpfr_mul_2si (y, x, e, MPFR_RNDN);
++                  MPFR_ASSERTN (inex1 == 0);
++                  inex1 = mpfr_set_ui (z1, 1 << k, MPFR_RNDN);
++                  MPFR_ASSERTN (inex1 == 0);
+                   mpfr_clear_flags ();
+-                  inex2 = div == 0 ?
+-                    mpfr_mul_2si (z2, x, e - k, (mpfr_rnd_t) rnd) : div == 1 ?
+-                    mpfr_div_2si (z2, x, k - e, (mpfr_rnd_t) rnd) :
+-                    mpfr_div_2ui (z2, x, k - e, (mpfr_rnd_t) rnd);
+-                  flags2 = __gmpfr_flags;
+-                  if (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
+-                      mpfr_equal_p (z1, z2))
+-                    continue;
+-                  printf ("Error in underflow(");
+-                  if (e == MPFR_EMIN_MIN)
+-                    printf ("MPFR_EMIN_MIN");
+-                  else if (e == emin)
+-                    printf ("default emin");
+-                  else if (e >= LONG_MIN)
+-                    printf ("%ld", (long) e);
+-                  else
+-                    printf ("<LONG_MIN");
+-                  printf (") with mpfr_%s,\nx = %d/16, prec = %d, k = %d, "
+-                          "%s\n", div == 0 ? "mul_2si" : div == 1 ?
+-                          "div_2si" : "div_2ui", i, prec, k,
+-                          mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
+-                  printf ("Expected ");
+-                  mpfr_out_str (stdout, 16, 0, z1, MPFR_RNDN);
+-                  printf (", inex = %d, flags = %u\n", SIGN (inex1), flags1);
+-                  printf ("Got      ");
+-                  mpfr_out_str (stdout, 16, 0, z2, MPFR_RNDN);
+-                  printf (", inex = %d, flags = %u\n", SIGN (inex2), flags2);
+-                  exit (1);
+-                }  /* div */
+-              }  /* k */
+-          mpfr_clears (z1, z2, (mpfr_ptr) 0);
+-        }  /* prec */
+-    }  /* i */
++                  /* Do not use mpfr_div_ui to avoid the optimization
++                     by mpfr_div_2si. */
++                  inex1 = mpfr_div (z1, y, z1, (mpfr_rnd_t) rnd);
++                  flags1 = __gmpfr_flags;
++
++                  for (div = 0; div <= 2; div++)
++                    {
++                      mpfr_clear_flags ();
++                      inex2 =
++                        div == 0 ?
++                        mpfr_mul_2si (z2, x, e - k, (mpfr_rnd_t) rnd) :
++                        div == 1 ?
++                        mpfr_div_2si (z2, x, k - e, (mpfr_rnd_t) rnd) :
++                        mpfr_div_2ui (z2, x, k - e, (mpfr_rnd_t) rnd);
++                      flags2 = __gmpfr_flags;
++                      if (flags1 == flags2 && SAME_SIGN (inex1, inex2) &&
++                          mpfr_equal_p (z1, z2))
++                        continue;
++                      printf ("Error in underflow(");
++                      if (e == MPFR_EMIN_MIN)
++                        printf ("MPFR_EMIN_MIN");
++                      else if (e == emin)
++                        printf ("default emin");
++                      else if (e >= LONG_MIN)
++                        printf ("%ld", (long) e);
++                      else
++                        printf ("<LONG_MIN");
++                      printf (") with mpfr_%s,\nx = %d/16, prec = %d, k = %d,"
++                              " %s\n", div == 0 ? "mul_2si" : div == 1 ?
++                              "div_2si" : "div_2ui", s * i, prec, k,
++                              mpfr_print_rnd_mode ((mpfr_rnd_t) rnd));
++                      printf ("Expected ");
++                      mpfr_out_str (stdout, 16, 0, z1, MPFR_RNDN);
++                      printf (", inex = %d, flags = %u\n",
++                              SIGN (inex1), flags1);
++                      printf ("Got      ");
++                      mpfr_out_str (stdout, 16, 0, z2, MPFR_RNDN);
++                      printf (", inex = %d, flags = %u\n",
++                              SIGN (inex2), flags2);
++                      exit (1);
++                    }  /* div */
++                }  /* k */
++            mpfr_clears (z1, z2, (mpfr_ptr) 0);
++          }  /* prec */
++      }  /* i */
+   mpfr_clears (x, y, (mpfr_ptr) 0);
+   set_emin (emin);
+ }
+diff -Naurd mpfr-3.1.3-a/PATCHES mpfr-3.1.3-b/PATCHES
+--- mpfr-3.1.3-a/PATCHES	2015-07-17 08:58:21.094987384 +0000
++++ mpfr-3.1.3-b/PATCHES	2015-07-17 08:58:21.118986898 +0000
+@@ -0,0 +1 @@
++frexp
+diff -Naurd mpfr-3.1.3-a/VERSION mpfr-3.1.3-b/VERSION
+--- mpfr-3.1.3-a/VERSION	2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/VERSION	2015-07-17 08:58:21.118986898 +0000
+@@ -1 +1 @@
+-3.1.3-p3
++3.1.3-p4
+diff -Naurd mpfr-3.1.3-a/src/frexp.c mpfr-3.1.3-b/src/frexp.c
+--- mpfr-3.1.3-a/src/frexp.c	2015-06-19 19:55:09.000000000 +0000
++++ mpfr-3.1.3-b/src/frexp.c	2015-07-17 08:58:21.106987142 +0000
+@@ -26,6 +26,13 @@
+ mpfr_frexp (mpfr_exp_t *exp, mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
+ {
+   int inex;
++  unsigned int saved_flags = __gmpfr_flags;
++  MPFR_BLOCK_DECL (flags);
++
++  MPFR_LOG_FUNC
++    (("x[%Pu]=%.*Rg rnd=%d", mpfr_get_prec (x), mpfr_log_prec, x, rnd),
++     ("y[%Pu]=%.*Rg exp=%" MPFR_EXP_FSPEC "d inex=%d", mpfr_get_prec (y),
++      mpfr_log_prec, y, (mpfr_eexp_t) *exp, inex));
+ 
+   if (MPFR_UNLIKELY(MPFR_IS_SINGULAR(x)))
+     {
+@@ -49,8 +56,32 @@
+         }
+     }
+ 
+-  inex = mpfr_set (y, x, rnd);
++  MPFR_BLOCK (flags, inex = mpfr_set (y, x, rnd));
++  __gmpfr_flags = saved_flags;
++
++  /* Possible overflow due to the rounding, no possible underflow. */
++
++  if (MPFR_UNLIKELY (MPFR_OVERFLOW (flags)))
++    {
++      int inex2;
++
++      /* An overflow here means that the exponent of y would be larger than
++         the one of x, thus x would be rounded to the next power of 2, and
++         the returned y should be 1/2 in absolute value, rounded (i.e. with
++         possible underflow or overflow). This also implies that x and y are
++         different objects, so that the exponent of x has not been lost. */
++      MPFR_LOG_MSG (("Internal overflow\n", 0));
++      MPFR_ASSERTD (x != y);
++      *exp = MPFR_GET_EXP (x) + 1;
++      inex2 = mpfr_set_si_2exp (y, MPFR_INT_SIGN (x), -1, rnd);
++      MPFR_LOG_MSG (("inex=%d inex2=%d\n", inex, inex2));
++      if (inex2 != 0)
++        inex = inex2;
++      MPFR_RET (inex);
++    }
++
+   *exp = MPFR_GET_EXP (y);
+-  MPFR_SET_EXP (y, 0);
++  /* Do not use MPFR_SET_EXP because the range has not been checked yet. */
++  MPFR_EXP (y) = 0;
+   return mpfr_check_range (y, inex, rnd);
+ }
+diff -Naurd mpfr-3.1.3-a/src/mpfr.h mpfr-3.1.3-b/src/mpfr.h
+--- mpfr-3.1.3-a/src/mpfr.h	2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/src/mpfr.h	2015-07-17 08:58:21.114986979 +0000
+@@ -27,7 +27,7 @@
+ #define MPFR_VERSION_MAJOR 3
+ #define MPFR_VERSION_MINOR 1
+ #define MPFR_VERSION_PATCHLEVEL 3
+-#define MPFR_VERSION_STRING "3.1.3-p3"
++#define MPFR_VERSION_STRING "3.1.3-p4"
+ 
+ /* Macros dealing with MPFR VERSION */
+ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
+diff -Naurd mpfr-3.1.3-a/src/version.c mpfr-3.1.3-b/src/version.c
+--- mpfr-3.1.3-a/src/version.c	2015-07-17 08:54:48.616811495 +0000
++++ mpfr-3.1.3-b/src/version.c	2015-07-17 08:58:21.118986898 +0000
+@@ -25,5 +25,5 @@
+ const char *
+ mpfr_get_version (void)
+ {
+-  return "3.1.3-p3";
++  return "3.1.3-p4";
+ }
+diff -Naurd mpfr-3.1.3-a/tests/tfrexp.c mpfr-3.1.3-b/tests/tfrexp.c
+--- mpfr-3.1.3-a/tests/tfrexp.c	2015-06-19 19:55:10.000000000 +0000
++++ mpfr-3.1.3-b/tests/tfrexp.c	2015-07-17 08:58:21.106987142 +0000
+@@ -129,12 +129,115 @@
+   mpfr_clear (x);
+ }
+ 
++static void check1 (void)
++{
++  mpfr_exp_t emin, emax, e;
++  mpfr_t x, y1, y2;
++  int r, neg, red;
++
++  emin = mpfr_get_emin ();
++  emax = mpfr_get_emax ();
++  set_emin (MPFR_EMIN_MIN);
++  set_emax (MPFR_EMAX_MAX);
++
++  mpfr_init2 (x, 7);
++  mpfr_inits2 (4, y1, y2, (mpfr_ptr) 0);
++
++  mpfr_set_ui_2exp (x, 1, -2, MPFR_RNDN);
++  while (mpfr_regular_p (x))
++    {
++      /* Test the exponents up to 3 and with the maximum exponent
++         (to check potential intermediate overflow). */
++      if (MPFR_GET_EXP (x) == 4)
++        mpfr_set_exp (x, MPFR_EMAX_MAX);
++      e = MPFR_GET_EXP (x);
++      for (neg = 0; neg < 2; neg++)
++        {
++          RND_LOOP (r)
++            {
++              int inex1, inex2;
++              mpfr_exp_t e1, e2;
++              unsigned int flags1, flags2;
++
++              for (red = 0; red < 2; red++)
++                {
++                  if (red)
++                    {
++                      /* e1: exponent of the rounded value of x. */
++                      MPFR_ASSERTN (e1 == e || e1 == e + 1);
++                      set_emin (e);
++                      set_emax (e);
++                      mpfr_clear_flags ();
++                      inex1 = e1 < 0 ?
++                        mpfr_mul_2ui (y1, x, -e1, (mpfr_rnd_t) r) :
++                        mpfr_div_2ui (y1, x, e1, (mpfr_rnd_t) r);
++                      flags1 = __gmpfr_flags;
++                    }
++                  else
++                    {
++                      inex1 = mpfr_set (y1, x, (mpfr_rnd_t) r);
++                      e1 = MPFR_IS_INF (y1) ? e + 1 : MPFR_GET_EXP (y1);
++                      flags1 = inex1 != 0 ? MPFR_FLAGS_INEXACT : 0;
++                    }
++                  mpfr_clear_flags ();
++                  inex2 = mpfr_frexp (&e2, y2, x, (mpfr_rnd_t) r);
++                  flags2 = __gmpfr_flags;
++                  set_emin (MPFR_EMIN_MIN);
++                  set_emax (MPFR_EMAX_MAX);
++                  if ((!red || e == 0) &&
++                      (! mpfr_regular_p (y2) || MPFR_GET_EXP (y2) != 0))
++                    {
++                      printf ("Error in check1 for %s, red = %d, x = ",
++                              mpfr_print_rnd_mode ((mpfr_rnd_t) r), red);
++                      mpfr_dump (x);
++                      printf ("Expected 1/2 <= |y| < 1, got y = ");
++                      mpfr_dump (y2);
++                      exit (1);
++                    }
++                  if (!red)
++                    {
++                      if (e2 > 0)
++                        mpfr_mul_2ui (y2, y2, e2, MPFR_RNDN);
++                      else if (e2 < 0)
++                        mpfr_div_2ui (y2, y2, -e2, MPFR_RNDN);
++                    }
++                  if (! (SAME_SIGN (inex1, inex2) &&
++                         mpfr_equal_p (y1, y2) &&
++                         flags1 == flags2))
++                    {
++                      printf ("Error in check1 for %s, red = %d, x = ",
++                              mpfr_print_rnd_mode ((mpfr_rnd_t) r), red);
++                      mpfr_dump (x);
++                      printf ("Expected y1 = ");
++                      mpfr_dump (y1);
++                      printf ("Got      y2 = ");
++                      mpfr_dump (y2);
++                      printf ("Expected inex ~= %d, got %d\n", inex1, inex2);
++                      printf ("Expected flags:");
++                      flags_out (flags1);
++                      printf ("Got flags:     ");
++                      flags_out (flags2);
++                      exit (1);
++                    }
++                }
++            }
++          mpfr_neg (x, x, MPFR_RNDN);
++        }
++      mpfr_nextabove (x);
++    }
++
++  mpfr_clears (x, y1, y2, (mpfr_ptr) 0);
++  set_emin (emin);
++  set_emax (emax);
++}
++
+ int
+ main (int argc, char *argv[])
+ {
+   tests_start_mpfr ();
+ 
+   check_special ();
++  check1 ();
+ 
+   tests_end_mpfr ();
+   return 0;
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index e5e4f1cfff33..129a65d3203b 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -34,12 +34,12 @@ let
 in
 stdenv.mkDerivation rec {
   name = "${prefix}nghttp2-${version}";
-  version = "1.0.2";
+  version = "1.1.1";
 
   # Don't use fetchFromGitHub since this needs a bootstrap curl
   src = fetchurl {
     url = "http://pub.wak.io/nixos/tarballs/nghttp2-${version}.tar.bz2";
-    sha256 = "633dd6d5d1f29a4d802d6c9e5b9eeb0b9104f35652396f26999a27515b6c1c14";
+    sha256 = "9659e8598c8481f1bf8e63ba4f828f5283053df62a51fa8324cb55ea7a51b80c";
   };
 
   # Configure script searches for a symbol which does not exist in jemalloc on Darwin
diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix
index 71420ba425c9..738e7d87af66 100644
--- a/pkgs/development/libraries/openexr/default.nix
+++ b/pkgs/development/libraries/openexr/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "0ca2j526n4wlamrxb85y2jrgcv0gf21b3a19rr0gh4rjqkv1581n";
   };
 
+  outputs = [ "out" "doc" ];
+
   preConfigure = ''
     ./bootstrap
   '';
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index 373fe630d11c..f54f12031b44 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -5,8 +5,8 @@
 }:
 
 let # beware: updates often break cups_filters build
-  version = "0.32.0"; # even major numbers are stable
-  sha256 = "162vfbvbz0frvqyk00ldsbl49h4bj8i8wn0ngfl30xg1lldy6qs9";
+  version = "0.34.0"; # even major numbers are stable
+  sha256 = "1c2wa4pfzqmvzq1jpp3ps5nmzz745gcg8dnpwqpfdccy5ydbm90v";
 in
 stdenv.mkDerivation rec {
   name = "poppler-${suffix}-${version}";
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 9edef767481f..96388c3a35a1 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -1,13 +1,13 @@
 { fetchurl, stdenv, gmpxx, perl, gnum4 }:
 
-let version = "1.0"; in
+let version = "1.1"; in
 
 stdenv.mkDerivation rec {
   name = "ppl-${version}";
 
   src = fetchurl {
     url = "http://bugseng.com/products/ppl/download/ftp/releases/${version}/ppl-${version}.tar.bz2";
-    sha256 = "0m0b6dzablci8mlavpsmn5w1v3r46li0wpjwvsybgxx0p1ifjsf1";
+    sha256 = "1vrqhbpyca6sf984cfcwlp8wdnfzj1g7ph9958qdky9978i1nlny";
   };
 
   nativeBuildInputs = [ perl gnum4 ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       "--disable-ppl_lcdd" "--disable-ppl_lpsol" "--disable-ppl_pips"
     ];
 
-  patches = [ ./upstream-based.patch ];
+  patches = [ ./ppl-cstddef.patch /* from Fedora */ ];
 
   # Beware!  It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
   # x86_64 box.  Nevertheless, being a dependency of GCC, it probably ought
diff --git a/pkgs/development/libraries/ppl/ppl-cstddef.patch b/pkgs/development/libraries/ppl/ppl-cstddef.patch
new file mode 100644
index 000000000000..8c43b26bef74
--- /dev/null
+++ b/pkgs/development/libraries/ppl/ppl-cstddef.patch
@@ -0,0 +1,238 @@
+diff -up ppl-1.1/src/Dense_Row_defs.hh.orig ppl-1.1/src/Dense_Row_defs.hh
+--- ppl-1.1/src/Dense_Row_defs.hh.orig	2014-04-29 13:08:10.516682937 -0300
++++ ppl-1.1/src/Dense_Row_defs.hh	2014-04-29 13:08:50.447684466 -0300
+@@ -33,6 +33,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include <memory>
+ #include <vector>
+ #include <limits>
++#include <cstddef>
+ 
+ #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
+ //! A finite sequence of coefficients.
+@@ -433,7 +434,7 @@ public:
+ 
+   typedef std::bidirectional_iterator_tag iterator_category;
+   typedef Coefficient value_type;
+-  typedef ptrdiff_t difference_type;
++  typedef std::ptrdiff_t difference_type;
+   typedef value_type* pointer;
+   typedef value_type& reference;
+ 
+@@ -474,7 +475,7 @@ class Parma_Polyhedra_Library::Dense_Row
+ public:
+ 
+   typedef const Coefficient value_type;
+-  typedef ptrdiff_t difference_type;
++  typedef std::ptrdiff_t difference_type;
+   typedef value_type* pointer;
+   typedef Coefficient_traits::const_reference reference;
+ 
+diff -up ppl-1.1/src/Linear_Expression_Interface_defs.hh.orig ppl-1.1/src/Linear_Expression_Interface_defs.hh
+--- ppl-1.1/src/Linear_Expression_Interface_defs.hh.orig	2014-04-29 13:08:17.337683198 -0300
++++ ppl-1.1/src/Linear_Expression_Interface_defs.hh	2014-04-29 13:08:40.999684104 -0300
+@@ -32,6 +32,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include "Sparse_Row_types.hh"
+ #include <vector>
+ #include <set>
++#include <cstddef>
+ 
+ #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
+ //! A linear expression.
+@@ -65,7 +66,7 @@ public:
+   public:
+     typedef std::bidirectional_iterator_tag iterator_category;
+     typedef const Coefficient value_type;
+-    typedef ptrdiff_t difference_type;
++    typedef std::ptrdiff_t difference_type;
+     typedef value_type* pointer;
+     typedef Coefficient_traits::const_reference reference;
+ 
+diff -up ppl-1.1/src/CO_Tree_defs.hh.orig ppl-1.1/src/CO_Tree_defs.hh
+--- ppl-1.1/src/CO_Tree_defs.hh.orig	2014-04-29 13:11:33.725690719 -0300
++++ ppl-1.1/src/CO_Tree_defs.hh	2014-04-29 13:11:55.943691569 -0300
+@@ -28,6 +28,7 @@ site: http://bugseng.com/products/ppl/ .
+ 
+ #include "Coefficient_defs.hh"
+ #include <memory>
++#include <cstddef>
+ 
+ #ifndef PPL_CO_TREE_EXTRA_DEBUG
+ #ifdef PPL_ABI_BREAKING_EXTRA_DEBUG
+@@ -159,7 +160,7 @@ public:
+ 
+     typedef std::bidirectional_iterator_tag iterator_category;
+     typedef const data_type value_type;
+-    typedef ptrdiff_t difference_type;
++    typedef std::ptrdiff_t difference_type;
+     typedef value_type* pointer;
+     typedef data_type_const_reference reference;
+ 
+@@ -314,7 +315,7 @@ public:
+ 
+     typedef std::bidirectional_iterator_tag iterator_category;
+     typedef data_type value_type;
+-    typedef ptrdiff_t difference_type;
++    typedef std::ptrdiff_t difference_type;
+     typedef value_type* pointer;
+     typedef value_type& reference;
+ 
+diff -up ppl-1.1/src/CO_Tree_inlines.hh.orig ppl-1.1/src/CO_Tree_inlines.hh
+--- ppl-1.1/src/CO_Tree_inlines.hh.orig	2014-04-29 13:14:12.738696808 -0300
++++ ppl-1.1/src/CO_Tree_inlines.hh	2014-04-29 13:14:48.887698192 -0300
+@@ -24,6 +24,8 @@ site: http://bugseng.com/products/ppl/ .
+ #ifndef PPL_CO_Tree_inlines_hh
+ #define PPL_CO_Tree_inlines_hh 1
+ 
++#include <cstddef>
++
+ namespace Parma_Polyhedra_Library {
+ 
+ inline dimension_type
+@@ -31,7 +33,7 @@ CO_Tree::dfs_index(const_iterator itr) c
+   PPL_ASSERT(itr.current_index != 0);
+   PPL_ASSERT(itr.current_index >= indexes + 1);
+   PPL_ASSERT(itr.current_index <= indexes + reserved_size);
+-  const ptrdiff_t index = itr.current_index - indexes;
++  const std::ptrdiff_t index = itr.current_index - indexes;
+   return static_cast<dimension_type>(index);
+ }
+ 
+@@ -40,7 +42,7 @@ CO_Tree::dfs_index(iterator itr) const {
+   PPL_ASSERT(itr.current_index != 0);
+   PPL_ASSERT(itr.current_index >= indexes + 1);
+   PPL_ASSERT(itr.current_index <= indexes + reserved_size);
+-  const ptrdiff_t index = itr.current_index - indexes;
++  const std::ptrdiff_t index = itr.current_index - indexes;
+   return static_cast<dimension_type>(index);
+ }
+ 
+@@ -772,7 +774,7 @@ CO_Tree::tree_iterator::follow_left_chil
+   p -= (offset - 1);
+   while (*p == unused_index)
+     ++p;
+-  const ptrdiff_t distance = p - tree.indexes;
++  const std::ptrdiff_t distance = p - tree.indexes;
+   PPL_ASSERT(distance >= 0);
+   i = static_cast<dimension_type>(distance);
+   offset = least_significant_one_mask(i);
+@@ -787,7 +789,7 @@ CO_Tree::tree_iterator::follow_right_chi
+   p += (offset - 1);
+   while (*p == unused_index)
+     --p;
+-  const ptrdiff_t distance = p - tree.indexes;
++  const std::ptrdiff_t distance = p - tree.indexes;
+   PPL_ASSERT(distance >= 0);
+   i = static_cast<dimension_type>(distance);
+   offset = least_significant_one_mask(i);
+diff -up ppl-1.1/src/Linear_Expression_defs.hh.orig ppl-1.1/src/Linear_Expression_defs.hh
+--- ppl-1.1/src/Linear_Expression_defs.hh.orig	2014-04-29 13:15:39.793700141 -0300
++++ ppl-1.1/src/Linear_Expression_defs.hh	2014-04-29 13:16:07.464701201 -0300
+@@ -51,6 +51,7 @@ site: http://bugseng.com/products/ppl/ .
+ 
+ #include "Linear_Expression_Interface_defs.hh"
+ #include "Variable_defs.hh"
++#include <cstddef>
+ 
+ namespace Parma_Polyhedra_Library {
+ 
+@@ -381,7 +382,7 @@ public:
+   public:
+     typedef std::bidirectional_iterator_tag iterator_category;
+     typedef const Coefficient value_type;
+-    typedef ptrdiff_t difference_type;
++    typedef std::ptrdiff_t difference_type;
+     typedef value_type* pointer;
+     typedef Coefficient_traits::const_reference reference;
+ 
+diff -up ppl-1.1/src/CO_Tree.cc.orig ppl-1.1/src/CO_Tree.cc
+--- ppl-1.1/src/CO_Tree.cc.orig	2014-04-29 13:19:37.192709232 -0300
++++ ppl-1.1/src/CO_Tree.cc	2014-04-29 13:19:58.000710029 -0300
+@@ -954,7 +954,7 @@ PPL::CO_Tree
+     --subtree_size;
+   }
+ 
+-  const ptrdiff_t distance = first_unused_index - indexes;
++  const std::ptrdiff_t distance = first_unused_index - indexes;
+   PPL_ASSERT(distance >= 0);
+   return static_cast<dimension_type>(distance);
+ }
+diff -up ppl-1.1/src/Constraint_System_defs.hh.orig ppl-1.1/src/Constraint_System_defs.hh
+--- ppl-1.1/src/Constraint_System_defs.hh.orig	2014-04-29 13:30:05.530733294 -0300
++++ ppl-1.1/src/Constraint_System_defs.hh	2014-04-29 13:30:27.167734122 -0300
+@@ -37,6 +37,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include "termination_types.hh"
+ #include <iterator>
+ #include <iosfwd>
++#include <cstddef>
+ 
+ namespace Parma_Polyhedra_Library {
+ 
+@@ -609,7 +610,7 @@ for (Constraint_System::const_iterator i
+ class Parma_Polyhedra_Library::Constraint_System_const_iterator
+   : public std::iterator<std::forward_iterator_tag,
+                          Constraint,
+-                         ptrdiff_t,
++                         std::ptrdiff_t,
+                          const Constraint*,
+                          const Constraint&> {
+ public:
+diff -up ppl-1.1/src/Congruence_System_defs.hh.orig ppl-1.1/src/Congruence_System_defs.hh
+--- ppl-1.1/src/Congruence_System_defs.hh.orig	2014-04-29 13:33:56.927742155 -0300
++++ ppl-1.1/src/Congruence_System_defs.hh	2014-04-29 13:34:15.535742867 -0300
+@@ -33,6 +33,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include "Congruence_defs.hh"
+ #include "Constraint_System_types.hh"
+ #include <iosfwd>
++#include <cstddef>
+ 
+ namespace Parma_Polyhedra_Library {
+ 
+@@ -249,7 +250,7 @@ public:
+   class const_iterator
+     : public std::iterator<std::forward_iterator_tag,
+                            Congruence,
+-                           ptrdiff_t,
++                           std::ptrdiff_t,
+                            const Congruence*,
+                            const Congruence&> {
+   public:
+diff -up ppl-1.1/src/Generator_System_defs.hh.orig ppl-1.1/src/Generator_System_defs.hh
+--- ppl-1.1/src/Generator_System_defs.hh.orig	2014-04-29 13:44:30.122766402 -0300
++++ ppl-1.1/src/Generator_System_defs.hh	2014-04-29 13:44:48.167767093 -0300
+@@ -33,6 +33,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include "Poly_Con_Relation_defs.hh"
+ #include "Polyhedron_types.hh"
+ #include <iosfwd>
++#include <cstddef>
+ 
+ namespace Parma_Polyhedra_Library {
+ 
+@@ -679,7 +680,7 @@ copy(gs.begin(), gs.end(), ostream_itera
+ class Parma_Polyhedra_Library::Generator_System_const_iterator
+   : public std::iterator<std::forward_iterator_tag,
+         Generator,
+-        ptrdiff_t,
++        std::ptrdiff_t,
+         const Generator*,
+         const Generator&> {
+ public:
+diff -up ppl-1.1/src/Grid_Generator_System_defs.hh.orig ppl-1.1/src/Grid_Generator_System_defs.hh
+--- ppl-1.1/src/Grid_Generator_System_defs.hh.orig	2014-04-29 13:45:26.073768544 -0300
++++ ppl-1.1/src/Grid_Generator_System_defs.hh	2014-04-29 13:45:42.535769175 -0300
+@@ -31,6 +31,7 @@ site: http://bugseng.com/products/ppl/ .
+ #include "Variables_Set_types.hh"
+ #include "Polyhedron_types.hh"
+ #include <iosfwd>
++#include <cstddef>
+ 
+ namespace Parma_Polyhedra_Library {
+ 
+@@ -277,7 +278,7 @@ public:
+   class const_iterator
+     : public std::iterator<std::forward_iterator_tag,
+                            Grid_Generator,
+-                           ptrdiff_t,
++                           std::ptrdiff_t,
+                            const Grid_Generator*,
+                            const Grid_Generator&> {
+   public:
diff --git a/pkgs/development/libraries/ppl/upstream-based.patch b/pkgs/development/libraries/ppl/upstream-based.patch
deleted file mode 100644
index 551050f67bf9..000000000000
--- a/pkgs/development/libraries/ppl/upstream-based.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=447928
---- ppl-1.0/src/p_std_bits.cc.org	2012-12-30 00:37:03.033948083 +0100
-+++ ppl-1.0/src/mp_std_bits.cc	2012-12-30 00:44:12.893019313 +0100
-@@ -25,6 +25,9 @@
- #include "ppl-config.h"
- #include "mp_std_bits.defs.hh"
- 
-+#if __GNU_MP_VERSION < 5 \
-+  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- const bool std::numeric_limits<mpz_class>::is_specialized;
- const int std::numeric_limits<mpz_class>::digits;
- const int std::numeric_limits<mpz_class>::digits10;
-@@ -70,3 +73,6 @@
- const bool std::numeric_limits<mpq_class>::traps;
- const bool std::numeric_limits<mpq_class>::tininess_before;
- const std::float_round_style std::numeric_limits<mpq_class>::round_style;
-+
-+#endif // __GNU_MP_VERSION < 5
-+       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
---- ppl-1.0/src/mp_std_bits.defs.hh.org	2012-12-30 00:37:03.037948187 +0100
-+++ ppl-1.0/src/mp_std_bits.defs.hh	2012-12-30 00:42:32.002424189 +0100
-@@ -38,6 +38,9 @@
- #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
- void swap(mpq_class& x, mpq_class& y);
- 
-+#if __GNU_MP_VERSION < 5 \
-+  || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- namespace std {
- 
- #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
-@@ -164,6 +167,9 @@
- 
- } // namespace std
- 
-+#endif // __GNU_MP_VERSION < 5
-+       // || (__GNU_MP_VERSION == 5 && __GNU_MP_VERSION_MINOR < 1)
-+
- #include "mp_std_bits.inlines.hh"
- 
- #endif // !defined(PPL_mp_std_bits_defs_hh)
diff --git a/pkgs/development/libraries/protobuf/3.0.nix b/pkgs/development/libraries/protobuf/3.0.nix
new file mode 100644
index 000000000000..900c9dc5a512
--- /dev/null
+++ b/pkgs/development/libraries/protobuf/3.0.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchFromGitHub, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "3.0.0-alpha-3.1";
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "protobuf";
+    rev = "v${version}";
+    sha256 = "0vzw20ymjmjrrmg84f822qslclsb2q0wf0qdj2da198gmkkbrw45";
+  };
+})
diff --git a/pkgs/development/libraries/qpdf/default.nix b/pkgs/development/libraries/qpdf/default.nix
index 939351750920..340f4558f819 100644
--- a/pkgs/development/libraries/qpdf/default.nix
+++ b/pkgs/development/libraries/qpdf/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, pcre, zlib, perl }:
 
-let version = "5.1.2";
+let version = "5.1.3";
 in
 stdenv.mkDerivation rec {
   name = "qpdf-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/qpdf/qpdf/${version}/${name}.tar.gz";
-    sha256 = "1zbvhrp0zjzbi6q2bnbxbg6399r47pq5gw3kspzph81j19fqvpg9";
+    sha256 = "1lq1v7xghvl6p4hgrwbps3a13ad6lh4ib3myimb83hxgsgd4n5nm";
   };
 
   nativeBuildInputs = [ perl ];
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index eb795d6b28eb..a4d210547fd2 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -1,19 +1,20 @@
-{ fetchurl, stdenv, libkrb5 }:
+{ fetchurl, stdenv, autoreconfHook, libkrb5 }:
 
 stdenv.mkDerivation rec {
-  name = "libtirpc-0.3.0";
+  name = "libtirpc-0.3.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/libtirpc/${name}.tar.bz2";
-    sha256 = "07d1wlfzf3ia09mjn3f3ay8isk7yx4a6ckfkzx5khnqlc7amkzna";
+    sha256 = "1z1z8xnlqgqznxzmyc6sypjc6b220xkv0s55hxd5sb3zydws6210";
   };
 
+  nativeBuildInputs = [ autoreconfHook ];
   propagatedBuildInputs = [ libkrb5 ];
 
-  # http://www.sourcemage.org/projects/grimoire/repository/revisions/d6344b6a3a94b88ed67925a474de5930803acfbf
-  preConfigure = ''
-    echo "" > src/des_crypt.c
+  # http://sourceforge.net/p/libtirpc/mailman/libtirpc-devel/thread/5581CB06.5020604%40email.com/#msg34216933
+  patches = [ ./fix_missing_rpc_get_default_domain.patch ];
 
+  preConfigure = ''
     sed -es"|/etc/netconfig|$out/etc/netconfig|g" -i doc/Makefile.in tirpc/netconfig.h
   '';
 
diff --git a/pkgs/development/libraries/ti-rpc/fix_missing_rpc_get_default_domain.patch b/pkgs/development/libraries/ti-rpc/fix_missing_rpc_get_default_domain.patch
new file mode 100644
index 000000000000..c905d3c0de87
--- /dev/null
+++ b/pkgs/development/libraries/ti-rpc/fix_missing_rpc_get_default_domain.patch
@@ -0,0 +1,88 @@
+diff -rNu3 libtirpc-0.3.2-old/src/Makefile.am libtirpc-0.3.2/src/Makefile.am
+--- libtirpc-0.3.2-old/src/Makefile.am	2015-07-28 15:17:49.248168000 +0300
++++ libtirpc-0.3.2/src/Makefile.am	2015-07-28 15:18:04.870144456 +0300
+@@ -69,7 +69,7 @@
+ endif
+ 
+ libtirpc_la_SOURCES += key_call.c key_prot_xdr.c getpublickey.c
+-libtirpc_la_SOURCES += netname.c netnamer.c rtime.c
++libtirpc_la_SOURCES += netname.c netnamer.c rpcdname.c rtime.c
+ 
+ CLEANFILES	       = cscope.* *~
+ DISTCLEANFILES	       = Makefile.in
+diff -rNu3 libtirpc-0.3.2-old/src/rpcdname.c libtirpc-0.3.2/src/rpcdname.c
+--- libtirpc-0.3.2-old/src/rpcdname.c	1970-01-01 03:00:00.000000000 +0300
++++ libtirpc-0.3.2/src/rpcdname.c	2015-07-28 15:18:04.870144456 +0300
+@@ -0,0 +1,72 @@
++/*
++ * Copyright (c) 2009, Sun Microsystems, Inc.
++ * All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions are met:
++ * - Redistributions of source code must retain the above copyright notice,
++ *   this list of conditions and the following disclaimer.
++ * - Redistributions in binary form must reproduce the above copyright notice,
++ *   this list of conditions and the following disclaimer in the documentation
++ *   and/or other materials provided with the distribution.
++ * - Neither the name of Sun Microsystems, Inc. nor the names of its
++ *   contributors may be used to endorse or promote products derived
++ *   from this software without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
++ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
++ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
++ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
++ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
++ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
++ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
++ * POSSIBILITY OF SUCH DAMAGE.
++ */
++
++/*
++ * rpcdname.c
++ * Gets the default domain name
++ */
++
++#include <stdlib.h>
++#include <unistd.h>
++#include <string.h>
++
++static char *default_domain = 0;
++
++static char *
++get_default_domain()
++{
++	char temp[256];
++
++	if (default_domain)
++		return (default_domain);
++	if (getdomainname(temp, sizeof(temp)) < 0)
++		return (0);
++	if ((int) strlen(temp) > 0) {
++		default_domain = (char *)malloc((strlen(temp)+(unsigned)1));
++		if (default_domain == 0)
++			return (0);
++		(void) strcpy(default_domain, temp);
++		return (default_domain);
++	}
++	return (0);
++}
++
++/*
++ * This is a wrapper for the system call getdomainname which returns a
++ * ypclnt.h error code in the failure case.  It also checks to see that
++ * the domain name is non-null, knowing that the null string is going to
++ * get rejected elsewhere in the NIS client package.
++ */
++int
++__rpc_get_default_domain(domain)
++	char **domain;
++{
++	if ((*domain = get_default_domain()) != 0)
++		return (0);
++	return (-1);
++}
diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix
index d873d801bac7..61f88cea7e1c 100644
--- a/pkgs/development/libraries/vaapi-intel/default.nix
+++ b/pkgs/development/libraries/vaapi-intel/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "libva-intel-driver-1.5.1";
+  name = "libva-intel-driver-1.6.0";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/vaapi/releases/libva-intel-driver/${name}.tar.bz2";
-    sha256 = "1p7aw0wmb6z3rbbm3bqlp6rxw41kii23csbjmcvbbk037lq6rnqb";
+    sha256 = "1m08z9md113rv455i78k6784vkjza5k84d59bgpah08cc7jayxlq";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/libraries/xapian/default.nix b/pkgs/development/libraries/xapian/default.nix
index a9334f31ecdc..89f97292d39d 100644
--- a/pkgs/development/libraries/xapian/default.nix
+++ b/pkgs/development/libraries/xapian/default.nix
@@ -9,9 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "0grd2s6gf8yzqwdaa50g57j9d81mxkrrpkyldm2shgyizdc8gx33";
   };
 
+  outputs = [ "out" "doc" ];
+
   buildInputs = [ libuuid zlib ];
 
-  meta = { 
+  meta = {
     description = "Search engine library";
     homepage = http://xapian.org/;
     license = stdenv.lib.licenses.gpl2Plus;
diff --git a/pkgs/development/libraries/xlslib/default.nix b/pkgs/development/libraries/xlslib/default.nix
index 2492063be270..e68415951c76 100644
--- a/pkgs/development/libraries/xlslib/default.nix
+++ b/pkgs/development/libraries/xlslib/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "C++/C library to construct Excel .xls files in code";
-    homepage = http://sourceforge.net/projects/xlslib/files/;
+    homepage = http://sourceforge.net/projects/xlslib/;
     license = licenses.bsd2;
     platforms = platforms.unix;
     maintainers = with maintainers; [ abbradar ];
diff --git a/pkgs/development/ocaml-modules/csv/default.nix b/pkgs/development/ocaml-modules/csv/default.nix
index 16f755f17b39..30f96a801d89 100644
--- a/pkgs/development/ocaml-modules/csv/default.nix
+++ b/pkgs/development/ocaml-modules/csv/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation {
 
-  name = "ocaml-csv-1.4";
+  name = "ocaml-csv-1.4.1";
 
   src = fetchzip {
-    url = https://github.com/Chris00/ocaml-csv/releases/download/1.4/csv-1.4.tar.gz;
-    sha256 = "0si0v79rxzyzmgyhd6lidpzxdlcpprlhg0pgrsf688g83xsclkwa";
+    url = https://github.com/Chris00/ocaml-csv/releases/download/1.4.1/csv-1.4.1.tar.gz;
+    sha256 = "1z38qy92lq8qh91bs70vsv868szainif53a2y6rf47ijdila25j4";
   };
 
   buildInputs = [ ocaml findlib ];
diff --git a/pkgs/development/ocaml-modules/fileutils/default.nix b/pkgs/development/ocaml-modules/fileutils/default.nix
index 2fbbabfd36b3..7a8a80a446c3 100644
--- a/pkgs/development/ocaml-modules/fileutils/default.nix
+++ b/pkgs/development/ocaml-modules/fileutils/default.nix
@@ -1,14 +1,18 @@
-{ stdenv, fetchurl, ocaml, findlib }:
+{ stdenv, fetchurl, ocaml, findlib, ounit }:
 
 stdenv.mkDerivation {
-  name = "ocaml-fileutils-0.4.5";
+  name = "ocaml-fileutils-0.5.0";
 
   src = fetchurl {
-    url = https://forge.ocamlcore.org/frs/download.php/1194/ocaml-fileutils-0.4.5.tar.gz;
-    sha256 = "0rlqmcgjrfjihjgw5cfmack169cag8054gh5yrqph15av3lx5cra";
+    url = https://forge.ocamlcore.org/frs/download.php/1531/ocaml-fileutils-0.5.0.tar.gz;
+    sha256 = "0xs96nlrrm335mcsgsxnqzspiqyfn26b0jjxm72br7c7ax534n47";
   };
 
-  buildInputs = [ ocaml findlib ];
+  buildInputs = [ ocaml findlib ounit ];
+
+  configureFlags = "--enable-tests";
+  doCheck = true;
+  checkTarget = "test";
 
   createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/macaque/default.nix b/pkgs/development/ocaml-modules/macaque/default.nix
index f2d13ad1f137..99c2a292fe8d 100644
--- a/pkgs/development/ocaml-modules/macaque/default.nix
+++ b/pkgs/development/ocaml-modules/macaque/default.nix
@@ -1,10 +1,10 @@
-{stdenv, fetchurl, ocaml, findlib, pgocaml, camlp4}:
+{ stdenv, fetchzip, ocaml, findlib, pgocaml, camlp4 }:
 
 stdenv.mkDerivation {
-  name = "ocaml-macaque-0.7.1";
-  src = fetchurl {
-    url = https://github.com/ocsigen/macaque/archive/0.7.1.tar.gz;
-    sha256 = "0wnq3pgpcrfpivr8j7p827rhag6hdx0yr0bdvma0hw1g30vwf9qa";
+  name = "ocaml-macaque-0.7.2";
+  src = fetchzip {
+    url = https://github.com/ocsigen/macaque/archive/0.7.2.tar.gz;
+    sha256 = "14i0a8cndzndjmlkyhf31r451q99cnkndgxcj0id4qjqhdl4bmjv";
   };
 
   buildInputs = [ ocaml findlib camlp4 ];
diff --git a/pkgs/development/ocaml-modules/mysql/default.nix b/pkgs/development/ocaml-modules/mysql/default.nix
index fc26d8b989c0..3131d8212e42 100644
--- a/pkgs/development/ocaml-modules/mysql/default.nix
+++ b/pkgs/development/ocaml-modules/mysql/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
 
   createFindlibDestdir = true;
 
-  propagatedbuildInputs = [ mysql.lib ];
+  propagatedBuildInputs = [ mysql.lib ];
 
   preConfigure = ''
     export LDFLAGS="-L${mysql.lib}/lib/mysql"
diff --git a/pkgs/development/perl-modules/DBD-Pg/default.nix b/pkgs/development/perl-modules/DBD-Pg/default.nix
index f6c8bcc2e2fc..6dbefa7111fd 100644
--- a/pkgs/development/perl-modules/DBD-Pg/default.nix
+++ b/pkgs/development/perl-modules/DBD-Pg/default.nix
@@ -17,6 +17,6 @@ buildPerlPackage rec {
     homepage = http://search.cpan.org/dist/DBD-Pg/;
     description = "DBI PostgreSQL interface";
     license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/python-modules/buildout-nix/default.nix b/pkgs/development/python-modules/buildout-nix/default.nix
index 43e8a45c0cf8..e96429e4033d 100644
--- a/pkgs/development/python-modules/buildout-nix/default.nix
+++ b/pkgs/development/python-modules/buildout-nix/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, buildPythonPackage }:
 
 buildPythonPackage {
-  name = "zc.buildout-nix-2.2.1";
+  name = "zc.buildout-nix-2.4.0";
 
   src = fetchurl {
-    url = "https://pypi.python.org/packages/source/z/zc.buildout/zc.buildout-2.2.1.tar.gz";
-    md5 = "476a06eed08506925c700109119b6e41";
+    url = "https://pypi.python.org/packages/source/z/zc.buildout/zc.buildout-2.4.0.tar.gz";
+    md5 = "b8323b1ad285544de0c3dc14ee76ddd3";
   };
 
   patches = [ ./nix.patch ];
diff --git a/pkgs/development/python-modules/buildout-nix/nix.patch b/pkgs/development/python-modules/buildout-nix/nix.patch
index dd3b8e12aa89..f358544d36a7 100644
--- a/pkgs/development/python-modules/buildout-nix/nix.patch
+++ b/pkgs/development/python-modules/buildout-nix/nix.patch
@@ -1,38 +1,15 @@
 --- a/src/zc/buildout/easy_install.py	2013-08-27 22:28:40.233718116 +0200
 +++ b/src/zc/buildout/easy_install.py   2013-10-07 00:29:31.077413935 +0200
-@@ -508,16 +508,31 @@
-                         self._dest, os.path.basename(dist.location))
- 
-                     if os.path.isdir(dist.location):
--                        # we got a directory. It must have been
--                        # obtained locally.  Just copy it.
--                        shutil.copytree(dist.location, newloc)
-+                        # Replace links to garbage collected eggs in
-+                        # /nix/store
-+                        if os.path.islink(newloc):
-+                            # It seems necessary to jump through these
-+                            # hoops, otherwise we end up in an
-+                            # infinite loop because
-+                            # self._env.best_match fails to find the dist
-+                            os.remove(newloc)
-+                            dist = self._fetch(avail, tmp, self._download_cache)
-+                            os.symlink(dist.location, newloc)
-+                            newdist = pkg_resources.Distribution.from_filename(
-+                                newloc)
-+                            self._env.add(newdist)
-+                            logger.info("Updated link to %s" %dist.location)
-+                        # Symlink to the egg in /nix/store
-+                        elif not os.path.exists(newloc):
-+                            os.symlink(dist.location, newloc)
-+                            logger.info("Created link to %s" %dist.location)
-                     else:
- 
- 
-                         setuptools.archive_util.unpack_archive(
-                             dist.location, newloc)
- 
--                    redo_pyc(newloc)
-+                        redo_pyc(newloc)
- 
-                     # Getting the dist from the environment causes the
-                     # distribution meta data to be read.  Cloning isn't
+@@ -227,6 +227,12 @@
+ 
+     def _satisfied(self, req, source=None):
+         dists = [dist for dist in self._env[req.project_name] if dist in req]
++        try:
++            dists = ([dist for dist in dists
++                     if dist.precedence == pkg_resources.DEVELOP_DIST]
++                     + [pkg_resources.get_distribution(req.project_name)])
++        except pkg_resources.DistributionNotFound:
++            pass
+         if not dists:
+             logger.debug('We have no distributions for %s that satisfies %r.',
+                          req.project_name, str(req))
diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix
index ab50d9d0c3c5..d04ce8664fc3 100644
--- a/pkgs/development/r-modules/default.nix
+++ b/pkgs/development/r-modules/default.nix
@@ -1502,6 +1502,20 @@ let
   ];
 
   otherOverrides = old: new: {
+    stringi = old.stringi.overrideDerivation (attrs: {
+      postInstall = let
+        icuName = "icudt52l";
+        icuSrc = pkgs.fetchzip {
+          url = "http://static.rexamine.com/packages/${icuName}.zip";
+          sha256 = "0hvazpizziq5ibc9017i1bb45yryfl26wzfsv05vk9mc1575r6xj";
+          stripRoot = false;
+        };
+        in ''
+          ${attrs.postInstall or ""}
+          cp ${icuSrc}/${icuName}.dat $out/library/stringi/libs
+        '';
+    });
+
     xml2 = old.xml2.overrideDerivation (attrs: {
       preConfigure = "export LIBXML_INCDIR=${pkgs.libxml2}/include/libxml2";
     });
diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix
index 0777b5a5f9a6..893ac521307b 100644
--- a/pkgs/development/tools/analysis/flow/default.nix
+++ b/pkgs/development/tools/analysis/flow/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchFromGitHub, ocaml, libelf }:
 
 stdenv.mkDerivation rec {
-  version = "0.1.0";
+  version = "0.13.1";
   name = "flow-${version}";
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "flow";
     rev = "v${version}";
-    sha256 = "1f33zmajd6agb36gp8bwj0yqihjhxnkpig9x3a4ggn369x6ixhn3";
+    sha256 = "1p7rzhvmz9y7ii2z05mfdb49i45f82kx8c9ywciwqma06zycvd80";
   };
 
   installPhase = ''
diff --git a/pkgs/development/tools/apktool/default.nix b/pkgs/development/tools/apktool/default.nix
index 239416535755..71e8dcc49537 100644
--- a/pkgs/development/tools/apktool/default.nix
+++ b/pkgs/development/tools/apktool/default.nix
@@ -18,6 +18,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ makeWrapper ];
 
+  sourceRoot = ".";
+
   installPhase = ''
     install -D apktool.jar "$out/libexec/apktool/apktool.jar"
     mkdir -p "$out/bin"
diff --git a/pkgs/development/tools/guile/g-wrap/default.nix b/pkgs/development/tools/guile/g-wrap/default.nix
index e62ce13ebf7f..ed492a0b82df 100644
--- a/pkgs/development/tools/guile/g-wrap/default.nix
+++ b/pkgs/development/tools/guile/g-wrap/default.nix
@@ -1,11 +1,10 @@
-{ fetchurl, stdenv, guile, libffi, pkgconfig, glib
-, guile_lib }:
+{ fetchurl, stdenv, guile, libffi, pkgconfig, glib, guile_lib }:
 
 stdenv.mkDerivation rec {
-  name = "g-wrap-1.9.13";
+  name = "g-wrap-1.9.15";
   src = fetchurl {
     url = "mirror://savannah/g-wrap/${name}.tar.gz";
-    sha256 = "0fc874zlwzjahyliqnva1zfsv0chlx4cvfhwchij9n2d3kmsss9v";
+    sha256 = "140fcvp24pqmfmiibhjxl3s75hj26ln7pkl2wxas84lnchbj9m4d";
   };
 
   # Note: Glib support is optional, but it's quite useful (e.g., it's
@@ -26,6 +25,6 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://www.nongnu.org/g-wrap/;
     license = stdenv.lib.licenses.lgpl2Plus;
-    maintainers = [ ];
+    maintainers = [ stdenv.lib.maintainers.taktoa ];
   };
 }
diff --git a/pkgs/development/tools/misc/dfu-util/default.nix b/pkgs/development/tools/misc/dfu-util/default.nix
new file mode 100644
index 000000000000..f3a986e64323
--- /dev/null
+++ b/pkgs/development/tools/misc/dfu-util/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, libusb1 }:
+
+stdenv.mkDerivation rec {
+  name="dfu-util-${version}";
+  version = "0.8";
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libusb1 ];
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/d/dfu-util/dfu-util_0.8.orig.tar.gz";
+    sha256 = "0n7h08avlzin04j93m6hkq9id6hxjiiix7ff9gc2n89aw6dxxjsm";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Device firmware update (DFU) USB programmer";
+    longDescription = ''
+      dfu-util is a program that implements the host (PC) side of the USB
+      DFU 1.0 and 1.1 (Universal Serial Bus Device Firmware Upgrade) protocol.
+
+      DFU is intended to download and upload firmware to devices connected over
+      USB. It ranges from small devices like micro-controller boards up to mobile
+      phones. With dfu-util you are able to download firmware to your device or
+      upload firmware from it.
+    '';
+    homepage = http://dfu-util.gnumonks.org/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.fpletz ];
+  };
+}
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 16ab1f8e5dc4..d50822d49491 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -8,7 +8,7 @@
 
 let
 
-  basename = "gdb-7.9";
+  basename = "gdb-7.9.1";
 
   # Whether (cross-)building for GNU/Hurd.  This is an approximation since
   # having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
@@ -27,11 +27,9 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/gdb/${basename}.tar.xz";
-    sha256 = "14l3hhsy7fmpn2dk7ivc67gnbjdhkxlq90kxijpzfa35l58mcccv";
+    sha256 = "0h5sfg4ndhb8q4fxbq0hdxfjp35n6ih96f6x8yvb418s84x5976d";
   };
 
-  # patches = [ ./edit-signals.patch ];
-
   # I think python is not a native input, but I leave it
   # here while I will not need it cross building
   nativeBuildInputs = [ texinfo python perl ]
diff --git a/pkgs/development/tools/misc/swig/2.x.nix b/pkgs/development/tools/misc/swig/2.x.nix
index b51ce0f2d5af..5cfc39a5254a 100644
--- a/pkgs/development/tools/misc/swig/2.x.nix
+++ b/pkgs/development/tools/misc/swig/2.x.nix
@@ -1,15 +1,28 @@
-{ stdenv, fetchurl, pcre }:
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
 
 stdenv.mkDerivation rec {
-  name = "swig-2.0.11";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/swig/${name}.tar.gz";
-    sha256 = "0kj21b6syp62vx68r1j6azv9033kng68pxm1k79pm4skkzr0ny33";
+  name = "swig-${version}";
+  version = "2.0.12";
+
+  src = fetchFromGitHub {
+    owner = "swig";
+    repo = "swig";
+    rev = "rel-${version}";
+    sha256 = "0khm9gh5pczfcihr0pbicaicc4v9kjm5ip2alvkhmbb3ga6njkcm";
   };
 
+  nativeBuildInputs = [ autoconf automake libtool bison ];
   buildInputs = [ pcre ];
 
+  postPatch = ''
+    # Disable ccache documentation as it need yodl
+    sed -i '/man1/d' CCache/Makefile.in
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
   meta = {
     description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
 
diff --git a/pkgs/development/tools/misc/swig/3.x.nix b/pkgs/development/tools/misc/swig/3.x.nix
index 1a02c88bb71e..88e73276a77f 100644
--- a/pkgs/development/tools/misc/swig/3.x.nix
+++ b/pkgs/development/tools/misc/swig/3.x.nix
@@ -1,15 +1,28 @@
-{ stdenv, fetchurl, pcre }:
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
 
 stdenv.mkDerivation rec {
-  name = "swig-3.0.2";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/swig/${name}.tar.gz";
-    sha256 = "04vqrij3k6pcq41y7rzl5rmhnghqg905f11wyrqw7vdwr9brcrm2";
+  name = "swig-${version}";
+  version = "3.0.6";
+
+  src = fetchFromGitHub {
+    owner = "swig";
+    repo = "swig";
+    rev = "rel-${version}";
+    sha256 = "1y8rlrkqs9h5cyp75s1i9rvrj35kkcwjjw65dyv3xy1skgfxb6w8";
   };
 
+  nativeBuildInputs = [ autoconf automake libtool bison ];
   buildInputs = [ pcre ];
 
+  postPatch = ''
+    # Disable ccache documentation as it need yodl
+    sed -i '/man1/d' CCache/Makefile.in
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
   meta = {
     description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
 
diff --git a/pkgs/development/tools/omniorb/default.nix b/pkgs/development/tools/omniorb/default.nix
new file mode 100644
index 000000000000..180e714b81e0
--- /dev/null
+++ b/pkgs/development/tools/omniorb/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, python }:
+stdenv.mkDerivation rec {
+
+  name = "omniorb-${version}";
+
+  version = "4.2.0";
+
+  src = fetchurl rec {
+    url = "http://sourceforge.net/projects/omniorb/files/omniORB/omniORB-${version}/omniORB-${version}.tar.bz2";
+    sha256 = "1g58xcw4641wyisp9wscrkzaqrz0vf123dgy52qq2a3wk7y77hkl";
+  };
+
+  buildInputs = [ python ];
+
+  meta = with stdenv.lib; {
+    description = "omniORB is a robust high performance CORBA ORB for C++ and Python. It is freely available under the terms of the GNU Lesser General Public License (for the libraries), and GNU General Public License (for the tools). omniORB is largely CORBA 2.6 compliant.";
+    homepage    = "http://omniorb.sourceforge.net/";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ smironov ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/pkgs/development/tools/parsing/flexc++/default.nix b/pkgs/development/tools/parsing/flexc++/default.nix
index 515fb9d251f2..d723cc0382b3 100644
--- a/pkgs/development/tools/parsing/flexc++/default.nix
+++ b/pkgs/development/tools/parsing/flexc++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bobcat, gcc49, icmake, yodl }:
+{ stdenv, fetchurl, bobcat, icmake, yodl }:
 
 let version = "2.02.00"; in
 stdenv.mkDerivation rec {
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ nckx ];
   };
 
-  buildInputs = [ bobcat gcc49 ];
+  buildInputs = [ bobcat ];
   nativeBuildInputs = [ icmake yodl ];
 
   postPatch = ''
diff --git a/pkgs/development/web/iojs/default.nix b/pkgs/development/web/iojs/default.nix
index 1f7db61090ec..d5f9baa05282 100644
--- a/pkgs/development/web/iojs/default.nix
+++ b/pkgs/development/web/iojs/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, python, utillinux, openssl_1_0_2, http-parser, zlib, libuv }:
 
 let
-  version = "2.3.4";
+  version = "2.4.0";
   inherit (stdenv.lib) optional maintainers licenses platforms;
 in stdenv.mkDerivation {
   name = "iojs-${version}";
 
   src = fetchurl {
     url = "https://iojs.org/dist/v${version}/iojs-v${version}.tar.gz";
-    sha256 = "1h9cjrs93c8rdycc0ahhc27wv826211aljvfmxfg8jdmg6nvibhq";
+    sha256 = "0g81bn8q4zgm8skkbxbzwa22dnpbing4b5wjqacvpxq3ygz4c98y";
   };
 
   prePatch = ''
diff --git a/pkgs/games/adom/default.nix b/pkgs/games/adom/default.nix
index d44da3d41b7c..74fe5232fa11 100644
--- a/pkgs/games/adom/default.nix
+++ b/pkgs/games/adom/default.nix
@@ -1,8 +1,7 @@
-{ stdenv, patchelf, zlib, libmad, libpng12, libcaca, mesa, alsaLib, libpulseaudio
-, xlibs, plowshare }:
-
-assert stdenv.isLinux;
+{ stdenv, fetchurl, patchelf, zlib, libmad, libpng12, libcaca, mesa, alsaLib, libpulseaudio
+, xlibs }:
 
+assert stdenv.system == "x86_64-linux";
 let
 
   inherit (xlibs) libXext libX11;
@@ -11,21 +10,13 @@ let
       zlib libmad libpng12 libcaca libXext libX11 mesa alsaLib libpulseaudio];
 
 in
-assert stdenv.is64bit;
 stdenv.mkDerivation rec {
+  name = "adom-${version}-noteye";
+  version = "1.2.0_pre23";
 
-  name = "adom-1.2.0-noteye";
-
-  # couldn't make fetchurl appear non-robot, even with --user-agent
-  src = stdenv.mkDerivation {
-    name = "adom-1.2.0-noteye.tar.gz";
-    buildCommand = ''
-      ${plowshare}/bin/plowdown "http://www30.zippyshare.com/v/39200582/file.html"
-      F=`ls *tar.gz`
-      mv $F $out
-    '';
-    outputHashAlgo = "sha256";
-    outputHash = "1f825845d5007e676a4d1a3ccd887904b959bdddbcb9f241c42c2dac34037669";
+  src = fetchurl {
+    url = "http://ancardia.uk.to/download/adom_noteye_linux_ubuntu_64_${version}.tar.gz";
+    sha256 = "0sbn0csaqb9cqi0z5fdwvnymkf84g64csg0s9mm6fzh0sm2mi0hz";
   };
 
   buildCommand = ''
@@ -52,7 +43,7 @@ stdenv.mkDerivation rec {
     mkdir $out/bin
     cat >$out/bin/adom <<EOF
     #! ${stdenv.shell}
-    (cd $out; $out/adom ; )
+    (cd $out; exec $out/adom ; )
     EOF
     chmod +x $out/bin/adom
   '';
diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix
index e99df5e6c747..43dc34095918 100644
--- a/pkgs/games/crawl/default.nix
+++ b/pkgs/games/crawl/default.nix
@@ -44,6 +44,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "Open-source, single-player, role-playing roguelike game";
+    homepage = http://crawl.develz.org/;
     longDescription = ''
       Open-source, single-player, role-playing roguelike game of exploration and
       treasure-hunting in dungeons filled with dangerous and unfriendly monsters
diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index 9a19366a074c..218a84d591d3 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,10 +1,11 @@
 { stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
-, mesa, openal, alsaOss, pulseaudioSupport ? false, libpulseaudio }:
+, mesa, openal
+, useAlsa ? false, alsaOss ? null }:
 
-assert jre ? architecture;
+assert useAlsa -> alsaOss != null;
 
 stdenv.mkDerivation {
-  name = "minecraft-2013.07.01";
+  name = "minecraft-2015.07.24";
 
   src = fetchurl {
     url = "https://s3.amazonaws.com/Minecraft.Download/launcher/Minecraft.jar";
@@ -22,8 +23,8 @@ stdenv.mkDerivation {
     #!${stdenv.shell}
 
     # wrapper for minecraft
-    export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${jre}/lib/${jre.architecture}/:${libX11}/lib/:${libXext}/lib/:${libXcursor}/lib/:${libXrandr}/lib/:${libXxf86vm}/lib/:${mesa}/lib/:${openal}/lib/
-    ${if pulseaudioSupport then "${libpulseaudio}/bin/padsp" else "${alsaOss}/bin/aoss" } \
+    export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${libX11}/lib/:${libXext}/lib/:${libXcursor}/lib/:${libXrandr}/lib/:${libXxf86vm}/lib/:${mesa}/lib/:${openal}/lib/
+    ${if useAlsa then "${alsaOss}/bin/aoss" else "" } \
       ${jre}/bin/java -jar $out/minecraft.jar
     EOF
 
diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix
index d817cf643238..e5057c27e997 100644
--- a/pkgs/games/nethack/default.nix
+++ b/pkgs/games/nethack/default.nix
@@ -1,57 +1,75 @@
-a :  
-let 
-  fetchurl = a.fetchurl;
-
-  version = a.lib.attrByPath ["version"] "3.4.3" a; 
-  buildInputs = with a; [
-    ncurses flex bison
-  ];
-in
-rec {
+{ stdenv, fetchurl, writeScript, ncurses, gzip, flex, bison }:
+
+stdenv.mkDerivation rec {
+  name = "nethack-3.4.3";
+
   src = fetchurl {
     url = "mirror://sourceforge/nethack/nethack-343-src.tgz";
     sha256 = "1r3ghqj82j0bar62z3b0lx9hhx33pj7p1ppxr2hg8bgfm79c6fdv";
   };
 
-  inherit buildInputs;
-  configureFlags = [];
+  buildInputs = [ ncurses ];
+
+  nativeBuildInputs = [ flex bison ];
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["preBuild" "doMakeInstall" "postInstall"];
-     
-  preBuild = a.fullDepEntry (''
+  preBuild = ''
     ( cd sys/unix ; sh setup.sh )
-    sed -e 's@.*define HACKDIR.*@\#define HACKDIR "/tmp/nethack"@' -i include/config.h
+
     sed -e '/define COMPRESS/d' -i include/config.h
-    sed -e '1i\#define COMPRESS "/usr/local/bin/gzip"' -i include/config.h
+    sed -e '1i\#define COMPRESS "${gzip}/bin/gzip"' -i include/config.h
     sed -e '1i\#define COMPRESS_EXTENSION ".gz"' -i include/config.h
+    sed -e '/define CHDIR/d' -i include/config.h
 
     sed -e '/extern char [*]tparm/d' -i win/tty/*.c
+
     sed -e 's/-ltermlib/-lncurses/' -i src/Makefile
     sed -e 's/^YACC *=.*/YACC = bison -y/' -i util/Makefile
     sed -e 's/^LEX *=.*/LEX = flex/' -i util/Makefile
 
-    sed -e 's@GAMEDIR = @GAMEDIR = /tmp/nethack@' -i Makefile
     sed -re 's@^(CH...).*@\1 = true@' -i Makefile
-  '') ["minInit" "doUnpack"];
 
-  postInstall = a.fullDepEntry (''
+    sed -e '/^ *cd /d' -i sys/unix/nethack.sh
+  '';
+
+  postInstall = ''
+    for i in logfile perm record save; do
+      rm -rf $out/games/lib/nethackdir/$i
+    done
+
     mkdir -p $out/bin
-    ln -s $out/games/nethack $out/bin/nethack
-    sed -i $out/bin/nethack -e '5aNEWHACKDIR="$HOME/.nethack"'
-    sed -i $out/bin/nethack -e '6amkdir -p "$NEWHACKDIR/save"'
-    sed -i $out/bin/nethack -e '7afor i in $(find "$NEWHACKDIR" -type l); do if ! test -e $(readlink "$i"); then rm "$i"; fi; done;'
-    sed -i $out/bin/nethack -e '8aln -s "$HACKDIR"/* "$NEWHACKDIR" &>/dev/null'
-    sed -i $out/bin/nethack -e '9atest -L "$NEWHACKDIR/record" && rm "$NEWHACKDIR"/record'
-    sed -i $out/bin/nethack -e '10aexport HACKDIR="$NEWHACKDIR"'
-  '') ["minInit" "defEnsureDir"];
-
-  makeFlags = [
-      "PREFIX=$out"
-    ];
-
-  name = "nethack-" + version;
-  meta = {
-    description = "rogue-like game";
+    cat <<EOF >$out/bin/nethack
+      #! ${stdenv.shell} -e
+      if [ ! -d ~/.nethack ]; then
+        mkdir -p ~/.nethack/save
+        for i in logfile perm record; do
+          [ ! -e ~/.nethack/\$i ] && touch ~/.nethack/\$i
+        done
+      fi
+
+      cd ~/.nethack
+
+      cleanup() {
+        for i in $out/games/lib/nethackdir/*; do
+          rm -rf \$(basename \$i)
+        done
+      }
+      trap cleanup EXIT
+
+      for i in $out/games/lib/nethackdir/*; do
+        ln -s \$i \$(basename \$i)
+      done
+      $out/games/nethack
+    EOF
+    chmod +x $out/bin/nethack
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with stdenv.lib; {
+    description = "Rogue-like game";
+    homepage = "http://nethack.org/";
+    license = "nethack";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
   };
 }
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index ff4b104059d7..9eca9c127df3 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -60,8 +60,6 @@ buildFHSUserEnv {
       pkgs.openal
       pkgs.libpulseaudio
 
-      pkgs.flashplayer
-
       pkgs.gst_all_1.gst-plugins-ugly # "Audiosurf 2" needs this
     ];
 
@@ -72,7 +70,9 @@ buildFHSUserEnv {
 
   profile = ''
     # Ugly workaround for https://github.com/ValveSoftware/steam-for-linux/issues/3504
-    export LD_PRELOAD=/lib32/libpulse.so:/lib64/libpulse.so:/lib32/libasound.so:/lib64/libasound.so
+    export LD_PRELOAD=/lib32/libpulse.so:/lib64/libpulse.so:/lib32/libasound.so:/lib64/libasound.so:$LD_PRELOAD
+    # Another one for https://github.com/ValveSoftware/steam-for-linux/issues/3801
+    export LD_PRELOAD=/lib32/libstdc++.so:/lib64/libstdc++.so:$LD_PRELOAD
   '';
 
   runScript = "steam";
diff --git a/pkgs/games/the-powder-toy/default.nix b/pkgs/games/the-powder-toy/default.nix
index 43d453f71d73..f79d31c7c5c9 100644
--- a/pkgs/games/the-powder-toy/default.nix
+++ b/pkgs/games/the-powder-toy/default.nix
@@ -27,6 +27,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     description = "A free 2D physics sandbox game";
+    homepage = http://powdertoy.co.uk/;
     platforms = platforms.unix;
     license = licenses.gpl3;
     maintainers = with maintainers; [ abbradar ];
diff --git a/pkgs/games/unnethack/default.nix b/pkgs/games/unnethack/default.nix
new file mode 100644
index 000000000000..0ba542fe63c2
--- /dev/null
+++ b/pkgs/games/unnethack/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchgit, utillinux, ncurses, flex, bison }:
+
+stdenv.mkDerivation rec {
+  name = "unnethack-5.3.1";
+
+  src = fetchgit {
+    url = "https://github.com/UnNetHack/UnNetHack";
+    rev = "63677eb256b5a75430f190cfb0f76bdd9bd0b9dd";
+    sha256 = "48a80ef83308b91d4aa86598e30e5b5ce9a5b2da2a763fe921698990c3243969";
+  };
+
+  buildInputs = [ ncurses ];
+
+  nativeBuildInputs = [ utillinux flex bison ];
+
+  configureFlags = [ "--enable-curses-graphics"
+                     "--disable-tty-graphics"
+                     "--with-owner=no"
+                     "--with-group=no"
+                     "--with-gamesdir=/tmp/unnethack"
+                   ];
+
+  postInstall = ''
+    cp -r /tmp/unnethack $out/share/unnethack/profile
+    mv $out/bin/unnethack $out/bin/.wrapped_unnethack
+    cat <<EOF >$out/bin/unnethack
+      #! ${stdenv.shell} -e
+      if [ ! -d ~/.unnethack ]; then
+        mkdir -p ~/.unnethack
+        cp -r $out/share/unnethack/profile/* ~/.unnethack
+        chmod -R +w ~/.unnethack
+      fi
+
+      ln -s ~/.unnethack /tmp/unnethack
+
+      cleanup() {
+        rm -rf /tmp/unnethack
+      }
+      trap cleanup EXIT
+
+      $out/bin/.wrapped_unnethack
+    EOF
+    chmod +x $out/bin/unnethack
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Fork of NetHack";
+    homepage = "http://unnethack.wordpress.com/";
+    license = "nethack";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  }; 
+}
diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix
index 0018a2762e78..bcd27d68ce02 100644
--- a/pkgs/misc/cups/default.nix
+++ b/pkgs/misc/cups/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, zlib, libjpeg, libpng, libtiff, pam, openssl
+{ stdenv, fetchurl, pkgconfig, zlib, libjpeg, libpng, libtiff, pam
 , dbus, acl, gmp, xdg_utils
 , libusb ? null, gnutls ? null, avahi ? null, libpaper ? null
 }:
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   buildInputs = [ pkgconfig zlib libjpeg libpng libtiff libusb gnutls avahi libpaper ]
     ++ optionals stdenv.isLinux [ pam dbus.libs acl xdg_utils ] ;
 
-  propagatedBuildInputs = [ openssl gmp ];
+  propagatedBuildInputs = [ gmp ];
 
   configureFlags = [
     "--localstatedir=/var"
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index ba64b729393f..d173b0ac406e 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -1,24 +1,30 @@
 { stdenv, fetchurl, automake, pkgconfig
-, cups, zlib, libjpeg, libusb1, pythonPackages, saneBackends, dbus
+, cups, zlib, libjpeg, libusb1, pythonPackages, saneBackends, dbus, usbutils
 , polkit, qtSupport ? true, qt4, pyqt4, net_snmp
 , withPlugin ? false, substituteAll, makeWrapper
 }:
 
 let
 
-  name = "hplip-3.15.6";
+  version = "3.15.7";
+
+  name = "hplip-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/hplip/${name}.tar.gz";
-    sha256 = "1jbnjw7vrn1qawrjfdv8j58w69q8ki1qkzvlh0nk8nxacpp17i9h";
+    sha256 = "17flpl89lgwlbsy9mka910g530nnvlwqqnif8a9hyq7k90q9046k";
+  };
+
+  plugin = fetchurl {
+    url = "http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
+    sha256 = "0fblh5m43jnws4vkwks0b4m9k3jg9kspaj1l8bic0r5swy97s41m";
   };
 
   hplip_state =
     substituteAll
       {
+        inherit version;
         src = ./hplip.state;
-        # evaluated this way, version is always up-to-date
-        version = (builtins.parseDrvName name).version;
       };
 
   hplip_arch =
@@ -29,16 +35,34 @@ let
       "arm7l-linux" = "arm32";
     }."${stdenv.system}" or (abort "Unsupported platform ${stdenv.system}");
 
-  plugin = fetchurl {
-    url = "http://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${name}-plugin.run";
-    sha256 = "1rymxahz12s1s37rri5qyvka6q0yi0yai08kgspg24176ry3a3fx";
-  };
-
 in
 
 stdenv.mkDerivation {
   inherit name src;
 
+  buildInputs = [
+    libjpeg
+    cups
+    libusb1
+    pythonPackages.python
+    pythonPackages.wrapPython
+    saneBackends
+    dbus
+    net_snmp
+  ] ++ stdenv.lib.optional qtSupport qt4;
+  nativeBuildInputs = [
+    pkgconfig
+  ];
+
+  pythonPath = with pythonPackages; [
+    dbus
+    pillow
+    pygobject
+    recursivePthLoader
+    reportlab
+    usbutils
+  ] ++ stdenv.lib.optional qtSupport pyqt4;
+
   prePatch = ''
     # HPLIP hardcodes absolute paths everywhere. Nuke from orbit.
     find . -type f -exec sed -i \
@@ -51,50 +75,33 @@ stdenv.mkDerivation {
       {} +
   '';
 
-  preConfigure = ''
-    export configureFlags="$configureFlags
-      --with-cupsfilterdir=$out/lib/cups/filter
-      --with-cupsbackenddir=$out/lib/cups/backend
-      --with-icondir=$out/share/applications
-      --with-systraydir=$out/xdg/autostart
-      --with-mimedir=$out/etc/cups
-      --enable-policykit
-    "
-
-    export makeFlags="
-      halpredir=$out/share/hal/fdi/preprobe/10osvendor
-      rulesdir=$out/etc/udev/rules.d
-      policykit_dir=$out/share/polkit-1/actions
-      policykit_dbus_etcdir=$out/etc/dbus-1/system.d
-      policykit_dbus_sharedir=$out/share/dbus-1/system-services
-      hplip_confdir=$out/etc/hp
-      hplip_statedir=$out/var/lib/hp
-    ";
+  configureFlags = ''
+    --with-cupsfilterdir=$(out)/lib/cups/filter
+    --with-cupsbackenddir=$(out)/lib/cups/backend
+    --with-icondir=$(out)/share/applications
+    --with-systraydir=$(out)/xdg/autostart
+    --with-mimedir=$(out)/etc/cups
+    --enable-policykit
   '';
 
+  makeFlags = ''
+    halpredir=$(out)/share/hal/fdi/preprobe/10osvendor
+    rulesdir=$(out)/etc/udev/rules.d
+    policykit_dir=$(out)/share/polkit-1/actions
+    policykit_dbus_etcdir=$(out)/etc/dbus-1/system.d
+    policykit_dbus_sharedir=$(out)/share/dbus-1/system-services
+    hplip_confdir=$(out)/etc/hp
+    hplip_statedir=$(out)/var/lib/hp
+  '';
+
+  enableParallelBuilding = true;
+
   postInstall =
-    ''
-      # Wrap the user-facing Python scripts in /bin without turning the ones
-      # in /share into shell scripts (they need to be importable).
-      # Complicated by the fact that /bin contains just symlinks to /share.
-      for bin in $out/bin/*; do
-        py=`readlink -m $bin`
-        rm $bin
-        cp $py $bin
-        wrapPythonProgramsIn $bin "$out $pythonPath"
-        sed -i "s@$(dirname $bin)/[^ ]*@$py@g" $bin
-      done
-
-      # Remove originals. Knows a little too much about wrapPythonProgramsIn.
-      rm -f $out/bin/.*-wrapped
-
-      wrapPythonPrograms $out/lib "$out $pythonPath"
-    ''
-    + (stdenv.lib.optionalString withPlugin
+    (stdenv.lib.optionalString withPlugin
     (let hplip_arch =
           if stdenv.system == "i686-linux" then "x86_32"
           else if stdenv.system == "x86_64-linux" then "x86_64"
-          else abort "Platform must be i686-linux or x86_64-linux!";
+          else abort "Plugin platform must be i686-linux or x86_64-linux!";
     in
     ''
     sh ${plugin} --noexec --keep
@@ -129,31 +136,39 @@ stdenv.mkDerivation {
     mv $out/etc/sane.d/dll.conf $out/etc/sane.d/dll.d/hpaio.conf
 
     rm $out/etc/udev/rules.d/56-hpmud.rules
-    ''));
+  ''));
+
+  fixupPhase = ''
+    # Wrap the user-facing Python scripts in $out/bin without turning the
+    # ones in $out /share into shell scripts (they need to be importable).
+    # Note that $out/bin contains only symlinks to $out/share.
+    for bin in $out/bin/*; do
+      py=`readlink -m $bin`
+      rm $bin
+      cp $py $bin
+      wrapPythonProgramsIn $bin "$out $pythonPath"
+      sed -i "s@$(dirname $bin)/[^ ]*@$py@g" $bin
+    done
 
-  buildInputs = [
-      libjpeg
-      cups
-      libusb1
-      pythonPackages.python
-      pythonPackages.wrapPython
-      saneBackends
-      dbus
-      net_snmp
-    ] ++ stdenv.lib.optional qtSupport qt4;
-  nativeBuildInputs = [
-    pkgconfig
-  ];
+    # Remove originals. Knows a little too much about wrapPythonProgramsIn.
+    rm -f $out/bin/.*-wrapped
 
-  pythonPath = with pythonPackages; [
-      dbus
-      pillow
-      pygobject
-      recursivePthLoader
-      reportlab
-    ] ++ stdenv.lib.optional qtSupport pyqt4;
+    # Merely patching shebangs in $out/share does not cause trouble.
+    for i in $out/share/hplip{,/*}/*.py; do
+      substituteInPlace $i \
+        --replace /usr/bin/python \
+        ${pythonPackages.python}/bin/${pythonPackages.python.executable} \
+        --replace "/usr/bin/env python" \
+        ${pythonPackages.python}/bin/${pythonPackages.python.executable}
+    done
+
+    wrapPythonProgramsIn $out/lib "$out $pythonPath"
+
+    substituteInPlace $out/etc/hp/hplip.conf --replace /usr $out
+  '';
 
   meta = with stdenv.lib; {
+    inherit version;
     description = "Print, scan and fax HP drivers for Linux";
     homepage = http://hplipopensource.com/;
     license = if withPlugin
diff --git a/pkgs/misc/emulators/stella/default.nix b/pkgs/misc/emulators/stella/default.nix
index a2338f376a74..04976a2bb839 100644
--- a/pkgs/misc/emulators/stella/default.nix
+++ b/pkgs/misc/emulators/stella/default.nix
@@ -4,15 +4,14 @@ with stdenv.lib;
 stdenv.mkDerivation rec {
 
   name = "stella-${version}";
-  version = "4.6";
+  version = "4.6.1";
 
   src = fetchurl {
     url = "http://downloads.sourceforge.net/project/stella/stella/${version}/${name}-src.tar.gz";
-    sha256 = "03vg8cxr0hn99vrr2dcwhv610xi9vhlw08ypazpm0nny522a9j4d";
+    sha256 = "126jph21b70jlxapzmll8pq36i53lb304hbsiap25160vdqid4n1";
   };
 
-  buildInputs = with stdenv.lib;
-  [ pkgconfig SDL2 ];
+  buildInputs = [ pkgconfig SDL2 ];
 
   meta = {
     description = "An open-source Atari 2600 VCS emulator";
diff --git a/pkgs/misc/ghostscript/default.nix b/pkgs/misc/ghostscript/default.nix
index c521e156f8e2..11f816dbb972 100644
--- a/pkgs/misc/ghostscript/default.nix
+++ b/pkgs/misc/ghostscript/default.nix
@@ -72,6 +72,8 @@ stdenv.mkDerivation rec {
     done
 
     rm -rf $out/lib/cups/filter/{gstopxl,gstoraster}
+
+    rm -rf $out/share/ghostscript/*/{doc,examples}
   '';
 
   meta = {
diff --git a/pkgs/misc/themes/vertex/default.nix b/pkgs/misc/themes/vertex/default.nix
new file mode 100644
index 000000000000..d1c81e0af483
--- /dev/null
+++ b/pkgs/misc/themes/vertex/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, gtk3, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "theme-vertex-${version}";
+  version = "20150718";
+
+  src = fetchFromGitHub {
+    owner = "horst3180";
+    repo = "Vertex-theme";
+    rev = version;
+    sha256 = "19mmybfkx3mrbm9vr78c7xiyazmyzji1n6669466svjr3jy87546";
+  };
+
+  buildInputs = [ autoreconfHook gtk3 pkgconfig ];
+
+  configureFlags = "--disable-unity";
+
+  postInstall = ''
+    mkdir -p $out/share/doc/theme-vertex
+    cp AUTHORS COPYING README.md $out/share/doc/theme-vertex/
+
+    mkdir -p $out/share/doc/theme-vertex/extra
+    cp -r extra/{Chrome,Firefox} $out/share/doc/theme-vertex/extra
+  '';
+
+  meta = with stdenv.lib; {
+    inherit (src.meta) homepage;
+    description = "Theme for GTK 3, GTK 2, Gnome-Shell, and Cinnamon";
+    license = licenses.gpl3;
+    maintainer = [ maintainers.rycee ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/os-specific/linux/android-udev-rules/default.nix b/pkgs/os-specific/linux/android-udev-rules/default.nix
index 7f0e345a2b0d..61e4291ecc50 100644
--- a/pkgs/os-specific/linux/android-udev-rules/default.nix
+++ b/pkgs/os-specific/linux/android-udev-rules/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchgit }:
 
 stdenv.mkDerivation {
-  name = "android-udev-rules-2015-02-28";
+  name = "android-udev-rules-20150301";
 
   src = fetchgit {
-    url = "git://github.com/M0Rf30/android-udev-rules";
+    url = "https://github.com/M0Rf30/android-udev-rules";
     rev = "2cc51a456ccfbca338c4e6b76211645aaac631e9";
     sha256 = "dbf1614cebb466d1adbcc5f17cefc0c37f148f9e3b46443b3e82f6cd19a1514f";
   };
diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
index bbe35fe96996..259c5acdf873 100644
--- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
+++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
@@ -1,13 +1,21 @@
-{ stdenv, fetchgit }:
+{ stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "firmware-linux-nonfree-${version}";
-  version = "2015-07-12";
+  version = "2015-07-23";
 
-  src = fetchgit {
-    url = "http://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git";
-    rev = "5e6d7a9d70b562c60471e234f78137020d65ccbf";
-    sha256 = "06gvjdqpbayfv696hxn9xjkbzddj1hy6z9aahi156lvj96qb9z49";
+  # This repo is built by merging the latest versions of
+  # http://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/
+  # and
+  # http://git.kernel.org/cgit/linux/kernel/git/iwlwifi/linux-firmware.git/
+  # for any given date. This gives us up to date iwlwifi firmware as well as
+  # the usual set of firmware. firmware/linux-firmware usually lags kernel releases
+  # so iwlwifi cards will fail to load on newly released kernels.
+  src = fetchFromGitHub {
+    owner = "wkennington";
+    repo = "linux-firmware";
+    rev = "854b7f33e839ceea41034b45d6f755ea70c85486";
+    sha256 = "1hhqvb96adk64ljf6hp5qss8fhpic28y985gbggh5p2w9bsgs5zq";
   };
 
   preInstall = ''
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index 53812a712862..f7ca0481a31b 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, flex, bison, db, iptables, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "iproute2-4.0.0";
+  name = "iproute2-4.1.1";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/net/iproute2/${name}.tar.xz";
-    sha256 = "0616cg6liyysfddf6d8i4vyndd9b0hjmfw35icq8p18b0nqnxl2w";
+    sha256 = "0vz6m2k6hdrjlg4x0r3cd75lg9ysmndbsp35pm8494zvksc7l1vk";
   };
 
   patch = [ ./vpnc.patch ];
@@ -19,9 +19,16 @@ stdenv.mkDerivation rec {
     "DESTDIR="
     "LIBDIR=$(out)/lib"
     "SBINDIR=$(out)/sbin"
-    "CONFDIR=$(out)/etc"
-    "DOCDIR=$(out)/share/doc/${name}"
     "MANDIR=$(out)/share/man"
+    "DOCDIR=$(TMPDIR)/share/doc/${name}" # Don't install docs
+  ];
+
+  buildFlags = [
+    "CONFDIR=/etc/iproute2"
+  ];
+
+  installFlags = [
+    "CONFDIR=$(out)/etc/iproute2"
   ];
 
   buildInputs = [ db iptables ];
@@ -29,9 +36,6 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  # Get rid of useless TeX/SGML docs.
-  postInstall = "rm -rf $out/share/doc";
-
   meta = with stdenv.lib; {
     homepage = http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2;
     description = "A collection of utilities for controlling TCP/IP networking and traffic control in Linux";
diff --git a/pkgs/os-specific/linux/jfbview/default.nix b/pkgs/os-specific/linux/jfbview/default.nix
index 4b371097ee6e..34bf136ece78 100644
--- a/pkgs/os-specific/linux/jfbview/default.nix
+++ b/pkgs/os-specific/linux/jfbview/default.nix
@@ -1,5 +1,4 @@
-# FIXME: remove gcc49 when the default gcc supports C++1y
-{ stdenv, fetchFromGitHub, freetype, gcc49, imlib2, jbig2dec, libjpeg, libX11
+{ stdenv, fetchFromGitHub, freetype, imlib2, jbig2dec, libjpeg, libX11
 , mujs, mupdf, ncurses, openjpeg, openssl }:
 
 let
@@ -16,7 +15,7 @@ stdenv.mkDerivation rec {
     owner = "jichu4n";
   };
 
-  buildInputs = [ freetype gcc49 imlib2 jbig2dec libjpeg libX11 mujs mupdf
+  buildInputs = [ freetype imlib2 jbig2dec libjpeg libX11 mujs mupdf
     ncurses openjpeg openssl ];
 
   buildFlags = binaries;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.18.nix b/pkgs/os-specific/linux/kernel/linux-3.18.nix
index b0b4c6ed5bd7..527ded2db94c 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.18.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.18.18";
+  version = "3.18.19";
   extraMeta.branch = "3.18";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1fcd4xfnywwb3grdvcnf39njwzb40v10rnzagxqmancsaqy253jv";
+    sha256 = "1jdp4mixggzjy1v806v5q7qqimkm6pbjav3gwbcl2cccv6wd701x";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-4.1.nix b/pkgs/os-specific/linux/kernel/linux-4.1.nix
index 5405ae9956d6..031b0d549d97 100644
--- a/pkgs/os-specific/linux/kernel/linux-4.1.nix
+++ b/pkgs/os-specific/linux/kernel/linux-4.1.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.1.2";
+  version = "4.1.3";
   extraMeta.branch = "4.1";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha256 = "1mdyjhnzhh254cblahqmpsk226z006z6sm9dmwvg6jlhpsw4cjhy";
+    sha256 = "02z3palvki31qimmycz4y4wl4lb46n662qql46iah224k0q2rpcn";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/mcelog/default.nix b/pkgs/os-specific/linux/mcelog/default.nix
index 31c360051bb3..f2b03e1be92d 100644
--- a/pkgs/os-specific/linux/mcelog/default.nix
+++ b/pkgs/os-specific/linux/mcelog/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchFromGitHub }:
 
-let version = "121"; in
+let version = "122"; in
 stdenv.mkDerivation {
   name = "mcelog-${version}";
 
   src = fetchFromGitHub {
-    sha256 = "1psdcbr3ssavl35svjzgsy5xl0f2s57s740anvyqy8ziy4k5fjyv";
+    sha256 = "0g3bp6wfgpjh345n988r2bxzdkbac8mls9v7fsylmfxf78y7n92d";
     rev = "v${version}";
     repo = "mcelog";
     owner = "andikleen";
diff --git a/pkgs/os-specific/linux/nvidia-x11/beta.nix b/pkgs/os-specific/linux/nvidia-x11/beta.nix
index fb57e194c80c..dc6af818837a 100644
--- a/pkgs/os-specific/linux/nvidia-x11/beta.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/beta.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
-, gtk, atk, pango, glib, gdk_pixbuf, cairo
+, gtk, atk, pango, glib, gdk_pixbuf, cairo, nukeReferences
 , # Whether to build the libraries only (i.e. not the kernel module or
   # nvidia-settings).  Used to support 32-bit binaries on 64-bit
   # Linux.
@@ -52,7 +52,9 @@ stdenv.mkDerivation {
     [ gtk atk pango glib gdk_pixbuf cairo ] );
   programPath = makeLibraryPath [ xlibs.libXv ];
 
-  buildInputs = [ perl ];
+  buildInputs = [ perl nukeReferences ];
+
+  disallowedReferences = if libsOnly then [] else [ kernel.dev ];
 
   meta = with stdenv.lib.meta; {
     homepage = http://www.nvidia.com/object/unix.html;
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder-legacy340.sh b/pkgs/os-specific/linux/nvidia-x11/builder-legacy340.sh
index 5d6647d1ee08..07cc1a85de0b 100755
--- a/pkgs/os-specific/linux/nvidia-x11/builder-legacy340.sh
+++ b/pkgs/os-specific/linux/nvidia-x11/builder-legacy340.sh
@@ -93,6 +93,12 @@ installPhase() {
       patchelf --set-rpath "$out/lib:$allLibPath" "$libname"
 
       libname_short=`echo -n "$libname" | sed 's/so\..*/so/'`
+
+      # nvidia's EGL stack seems to expect libGLESv2.so.2 to be available
+      if [ $(basename "$libname_short") == "libGLESv2.so" ]; then
+          ln -srnf "$libname" "$libname_short.2"
+      fi
+
       ln -srnf "$libname" "$libname_short"
       ln -srnf "$libname" "$libname_short.1"
     done
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh
index 5edadeda81ba..d34c4f355a34 100755
--- a/pkgs/os-specific/linux/nvidia-x11/builder.sh
+++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh
@@ -47,8 +47,10 @@ installPhase() {
 
         # Install the kernel module.
         mkdir -p $out/lib/modules/$kernelVersion/misc
-        cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc
-        cp kernel/uvm/nvidia-uvm.ko $out/lib/modules/$kernelVersion/misc
+        for i in kernel/nvidia.ko kernel/uvm/nvidia-uvm.ko; do
+            nuke-refs $i
+            cp $i $out/lib/modules/$kernelVersion/misc/
+        done
     fi
 
     # All libs except GUI-only are in $out now, so fixup them.
@@ -59,6 +61,12 @@ installPhase() {
       patchelf --set-rpath "$out/lib:$allLibPath" "$libname"
 
       libname_short=`echo -n "$libname" | sed 's/so\..*/so/'`
+
+      # nvidia's EGL stack seems to expect libGLESv2.so.2 to be available
+      if [ $(basename "$libname_short") == "libGLESv2.so" ]; then
+          ln -srnf "$libname" "$libname_short.2"
+      fi
+
       ln -srnf "$libname" "$libname_short"
       ln -srnf "$libname" "$libname_short.1"
     done
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index a1278af80843..66b1a81d2e4b 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
-, gtk, atk, pango, glib, gdk_pixbuf, cairo
+, gtk, atk, pango, glib, gdk_pixbuf, cairo, nukeReferences
 , # Whether to build the libraries only (i.e. not the kernel module or
   # nvidia-settings).  Used to support 32-bit binaries on 64-bit
   # Linux.
@@ -52,7 +52,9 @@ stdenv.mkDerivation {
     [ gtk atk pango glib gdk_pixbuf cairo ] );
   programPath = makeLibraryPath [ xlibs.libXv ];
 
-  buildInputs = [ perl ];
+  buildInputs = [ perl nukeReferences ];
+
+  disallowedReferences = if libsOnly then [] else [ kernel.dev ];
 
   meta = with stdenv.lib.meta; {
     homepage = http://www.nvidia.com/object/unix.html;
diff --git a/pkgs/os-specific/linux/perf-tools/default.nix b/pkgs/os-specific/linux/perf-tools/default.nix
index 7c9b319d2554..d0776ce546ac 100644
--- a/pkgs/os-specific/linux/perf-tools/default.nix
+++ b/pkgs/os-specific/linux/perf-tools/default.nix
@@ -1,13 +1,13 @@
 { lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation {
-  name = "perf-tools-20150704";
+  name = "perf-tools-20150723";
 
   src = fetchFromGitHub {
     owner = "brendangregg";
     repo = "perf-tools";
-    rev = "30ff4758915a98fd43020c1b45a63341208fd8b9";
-    sha256 = "0x59xm96jmpfgik6f9d6q6v85dip3kvi4ncijpghhg59ayyd5i6a";
+    rev = "80e25785e16acfbc0f048cae86a69006fa45148d";
+    sha256 = "13g98vqwy50yf2h0w6iav80kzwfz29mvnjw8akbjv4v36r9hcb69";
   };
 
   buildInputs = [ perl ];
diff --git a/pkgs/os-specific/linux/spl/git.nix b/pkgs/os-specific/linux/spl/git.nix
index b2a2f9ffebcd..9faba199a5da 100644
--- a/pkgs/os-specific/linux/spl/git.nix
+++ b/pkgs/os-specific/linux/spl/git.nix
@@ -1,12 +1,13 @@
-{ callPackage, fetchgit, ... } @ args:
+{ callPackage, fetchFromGitHub, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2015-06-29";
+  version = "2015-07-21";
 
-  src = fetchgit {
-    url = git://github.com/zfsonlinux/spl.git;
-    rev = "77ab5dd33a99bdf7fb062f0ea327582236a225b3";
-    sha256 = "1hbn8hi305cn15nlcm9x99nczjqjkhdc38hzww11xn78py8d90w9";
+  src = fetchFromGitHub {
+    owner = "zfsonlinux";
+    repo = "spl";
+    rev = "9eb361aaa537724c9a90ab6a9f33521bfd80bad9";
+    sha256 = "18sv4mw85fbm8i1s8k4y5dc43l6ll2f6hgfrawvzgvwni5i4h7n8";
   };
 
   patches = [ ./const.patch ./install_prefix.patch ];
diff --git a/pkgs/os-specific/linux/v4l2loopback/default.nix b/pkgs/os-specific/linux/v4l2loopback/default.nix
index 127341412abe..13617360d2d4 100644
--- a/pkgs/os-specific/linux/v4l2loopback/default.nix
+++ b/pkgs/os-specific/linux/v4l2loopback/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "v4l2loopback-${version}-${kernel.version}";
-  version = "0.8.0";
+  version = "0.9.1";
 
   src = fetchurl {
     url = "https://github.com/umlaeute/v4l2loopback/archive/v${version}.tar.gz";
-    sha256 = "1rhsgc4prrj8s6njixic7fs5m3gs94v9hhf3am6lnfh5yv6yab9h";
+    sha256 = "1crkhxlnskqrfj3f7jmiiyi5m75zmj7n0s26xz07wcwdzdf2p568";
   };
   
   preBuild = ''
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
     export PATH=${kmod}/sbin:$PATH
   '';
 
-  patches = [ ./kernel-3.18-fix.patch ];
-  
   buildInputs = [ kmod ];
   
   makeFlags = [
diff --git a/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch b/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch
deleted file mode 100644
index 9f6dc57f322a..000000000000
--- a/pkgs/os-specific/linux/v4l2loopback/kernel-3.18-fix.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 21195cd6d1ff767a271359dfa7d201078f766611 Mon Sep 17 00:00:00 2001
-From: tatokis <tasos@tasossah.com>
-Date: Mon, 24 Nov 2014 16:28:33 +0200
-Subject: [PATCH] Updated v4l2loopback.c to compile on >= 3.18 kernel
-
----
- v4l2loopback.c | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/v4l2loopback.c b/v4l2loopback.c
-index bb228bb..67f6ed4 100644
---- a/v4l2loopback.c
-+++ b/v4l2loopback.c
-@@ -498,10 +498,15 @@ static ssize_t attr_store_maxopeners(struct device *cd,
- {
- 	struct v4l2_loopback_device *dev = NULL;
- 	unsigned long curr = 0;
--
-+	
-+	#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,18,0)
-+	if (kstrtoul(buf, 0, &curr))
-+		return -EINVAL;
-+	#else
- 	if (strict_strtoul(buf, 0, &curr))
- 		return -EINVAL;
--
-+	#endif
-+	
- 	dev = v4l2loopback_cd2dev(cd);
- 
- 	if (dev->max_openers == curr)
diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix
index 1613dcb311a2..e2e574ee5913 100644
--- a/pkgs/os-specific/linux/zfs/generic.nix
+++ b/pkgs/os-specific/linux/zfs/generic.nix
@@ -58,6 +58,7 @@ stdenv.mkDerivation rec {
     "--with-udevdir=$(out)/lib/udev"
     "--with-systemdunitdir=$(out)/etc/systemd/system"
     "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
+    "--with-mounthelperdir=$(out)/bin"
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--enable-systemd"
@@ -69,6 +70,11 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "DEFAULT_INITCONF_DIR=\${out}/default"
+  ];
+
   postInstall = ''
     # Prevent kernel modules from depending on the Linux -dev output.
     nuke-refs $(find $out -name "*.ko")
diff --git a/pkgs/os-specific/linux/zfs/git.nix b/pkgs/os-specific/linux/zfs/git.nix
index 130a02c86e8e..26c48076c4ea 100644
--- a/pkgs/os-specific/linux/zfs/git.nix
+++ b/pkgs/os-specific/linux/zfs/git.nix
@@ -1,12 +1,13 @@
-{ callPackage, stdenv, fetchgit, spl_git, ... } @ args:
+{ callPackage, stdenv, fetchFromGitHub, spl_git, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2015-05-13";
+  version = "2015-07-21";
 
-  src = fetchgit {
-    url = git://github.com/zfsonlinux/zfs.git;
-    rev = "7fec46b9d8967109ad289d208e8cf36a0c16e40c";
-    sha256 = "0gvzw6vn7wyq2g9psv0fdars7ssidqc5l85x4yym5niccy1xl437";
+  src = fetchFromGitHub {
+    owner = "zfsonlinux";
+    repo = "zfs";
+    rev = "3b79cef21294f3ec46c4f71cc5a68a75a4d0ebc7";
+    sha256 = "01l4cg62wgn3wzasskx2nh3a4c74vq8qcwz090x8x1r4c2r4v943";
   };
 
   patches = [ ./nix-build.patch ];
diff --git a/pkgs/servers/ftp/vsftpd/default.nix b/pkgs/servers/ftp/vsftpd/default.nix
index f1ddf87e8c6a..17c41a9a4d46 100644
--- a/pkgs/servers/ftp/vsftpd/default.nix
+++ b/pkgs/servers/ftp/vsftpd/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, sslEnable ? false, libcap, pam }:
 
 stdenv.mkDerivation rec {
-  name = "vsftpd-3.0.2";
+  name = "vsftpd-3.0.3";
 
   src = fetchurl {
     url = "https://security.appspot.com/downloads/${name}.tar.gz";
-    sha256 = "0mjy345wszskz1vnk83360c1y37arwgap3gwz8hy13sjqpig0imy";
+    sha256 = "1xsyjn68k3fgm2incpb3lz2nikffl9by2safp994i272wvv2nkcx";
   };
 
   patches = [ ./CVE-2015-1419.patch ];
diff --git a/pkgs/servers/http/apache-httpd/2.2.nix b/pkgs/servers/http/apache-httpd/2.2.nix
index 2af7b761c24a..99d6fe12aa1c 100644
--- a/pkgs/servers/http/apache-httpd/2.2.nix
+++ b/pkgs/servers/http/apache-httpd/2.2.nix
@@ -12,12 +12,12 @@ assert ldapSupport -> aprutil.ldapSupport && openldap != null;
 assert mpm == "prefork" || mpm == "worker" || mpm == "event";
 
 stdenv.mkDerivation rec {
-  version = "2.2.29";
+  version = "2.2.31";
   name = "apache-httpd-${version}";
 
   src = fetchurl {
     url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
-    sha1 = "1d6a8fbc1391d358cc6fe430edc16222b97258d5";
+    sha256 = "1b165zi7jrrlz5wmyy3b34lcs3dl4g0dymfb0qxwdnimylcrsbzk";
   };
 
   buildInputs = [perl apr aprutil pcre] ++
diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix
index cb550652b785..29f8a9621c9e 100644
--- a/pkgs/servers/http/apache-httpd/2.4.nix
+++ b/pkgs/servers/http/apache-httpd/2.4.nix
@@ -14,12 +14,12 @@ assert sslSupport -> aprutil.sslSupport && openssl != null;
 assert ldapSupport -> aprutil.ldapSupport && openldap != null;
 
 stdenv.mkDerivation rec {
-  version = "2.4.12";
+  version = "2.4.16";
   name = "apache-httpd-${version}";
 
   src = fetchurl {
     url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
-    sha256 = "1r7a63ka41vlswrqbb21vall6sc7svwgd497kb6dh8a6zvnkjvdd";
+    sha256 = "0hrpy6gjwma0kba7p7m61vwh82qcnkf08123lrwpg257m93hnrmc";
   };
 
   buildInputs = [perl] ++
diff --git a/pkgs/servers/nosql/rethinkdb/default.nix b/pkgs/servers/nosql/rethinkdb/default.nix
index 2f47d542d00e..5d0b68bba2b8 100644
--- a/pkgs/servers/nosql/rethinkdb/default.nix
+++ b/pkgs/servers/nosql/rethinkdb/default.nix
@@ -1,26 +1,41 @@
-{ stdenv, fetchurl, which, protobuf, gperftools
-, boost, zlib, curl, python, m4, icu, jemalloc }:
+{ stdenv, fetchurl, which, m4, python
+, protobuf, boost, zlib, curl, openssl, icu, jemalloc
+}:
 
 stdenv.mkDerivation rec {
   name = "rethinkdb-${version}";
-  version = "2.0.3";
+  version = "2.0.4";
 
   src = fetchurl {
     url = "http://download.rethinkdb.com/dist/${name}.tgz";
-    sha256 = "1580h5clkw8kprdb9waaf8al3wa2vj5d2l2m394r91fq45ss23sd";
+    sha256 = "19qhia4lfa8a0rzp2v6lnlxp2lf4z4vqhgfxnicfdnx07q4r847i";
   };
 
+  postPatch = ''
+    # Remove the dependence on bundled libraries
+    sed -i '/must_fetch_list/ s/ v8//' configure
+
+    # Don't use the default command line args
+    rm configure.default
+  '';
+
   preConfigure = ''
     export ALLOW_WARNINGS=1
     patchShebangs .
   '';
 
-  configureFlags = "--lib-path ${gperftools}/lib --lib-path ${jemalloc}/lib";
+  configureFlags = [
+    "--dynamic=all"
+    "--with-jemalloc"
+    "--lib-path=${jemalloc}/lib"
+  ];
 
-  buildInputs = [ protobuf boost zlib curl icu jemalloc ];
+  buildInputs = [ protobuf boost zlib curl openssl icu jemalloc ];
 
   nativeBuildInputs = [ which m4 python ];
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "An open-source distributed database built with love";
     longDescription = ''
diff --git a/pkgs/servers/nosql/riak/2.1.1.nix b/pkgs/servers/nosql/riak/2.1.1.nix
index ce160312dbbd..74cf03a1ca86 100644
--- a/pkgs/servers/nosql/riak/2.1.1.nix
+++ b/pkgs/servers/nosql/riak/2.1.1.nix
@@ -89,6 +89,6 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     maintainers = with maintainers; [ cstrahan ];
     description = "Dynamo inspired NoSQL DB by Basho";
-    platforms   = platforms.linux;
+    platforms   = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/servers/rpcbind/default.nix b/pkgs/servers/rpcbind/default.nix
index 6eb58d458382..6eb8a57cab4f 100644
--- a/pkgs/servers/rpcbind/default.nix
+++ b/pkgs/servers/rpcbind/default.nix
@@ -1,19 +1,16 @@
 { fetchurl, stdenv, pkgconfig, libtirpc
 , useSystemd ? true, systemd }:
 
-let version = "1.0.7";
+let version = "0.2.3";
 in stdenv.mkDerivation rec {
   name = "rpcbind-${version}";
   
   src = fetchurl {
     url = "mirror://sourceforge/rpcbind/${version}/${name}.tar.bz2";
-    sha256 = "14vl0kmavc1fay630f4w8l1hjfzhmcqm8d0akzahhgymh5fw1f7r";
+    sha256 = "0yyjzv4161rqxrgjcijkrawnk55rb96ha0pav48s03l2klx855wq";
   };
 
   patches = [ ./sunrpc.patch ];
-  postPatch = ''
-    sed -e 's|/usr/include/tirpc|${libtirpc}/include/tirpc|' -i src/Makefile.am -i src/Makefile.in
-  '';
 
   buildInputs = [ libtirpc ]
              ++ stdenv.lib.optional useSystemd systemd;
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index 27383721cebb..c8e9831f703f 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -104,6 +104,9 @@ stdenv.mkDerivation rec {
     # Make sure to propagate lib for compatability
     mkdir -p $out/nix-support
     echo "$lib" > $out/nix-support/propagated-native-build-inputs
+
+    # Don't install static libraries.
+    rm $lib/lib/libmysqlclient.a $lib/lib/libmysqld.a
   '';
 
   passthru.mysqlVersion = "5.6";
diff --git a/pkgs/servers/sql/postgresql/9.0.x.nix b/pkgs/servers/sql/postgresql/9.0.x.nix
deleted file mode 100644
index ef7e5d3797fe..000000000000
--- a/pkgs/servers/sql/postgresql/9.0.x.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ stdenv, fetchurl, zlib, readline, openssl }:
-
-let version = "9.0.22"; in
-
-stdenv.mkDerivation rec {
-  name = "postgresql-${version}";
-
-  src = fetchurl {
-    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "19gq6axjhvlr5zlrzwnll1fbrvai4xh0nb1jki6gmmschl6v5m4l";
-  };
-
-  buildInputs = [ zlib readline openssl ];
-
-  LC_ALL = "C";
-
-  configureFlags = [ "--with-openssl" ];
-
-  patches = [ ./less-is-more.patch ];
-
-  passthru = {
-    inherit readline;
-    psqlSchema = "9.0";
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://www.postgresql.org/;
-    description = "A powerful, open source object-relational database system";
-    license = licenses.postgresql;
-    maintainers = [ maintainers.ocharles ];
-    platforms = platforms.unix;
-    hydraPlatforms = platforms.linux;
-  };
-}
diff --git a/pkgs/servers/sql/postgresql/9.1.x.nix b/pkgs/servers/sql/postgresql/9.1.x.nix
deleted file mode 100644
index 7616f92ca624..000000000000
--- a/pkgs/servers/sql/postgresql/9.1.x.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ stdenv, fetchurl, zlib, readline, openssl }:
-
-let version = "9.1.18"; in
-
-stdenv.mkDerivation rec {
-  name = "postgresql-${version}";
-
-  src = fetchurl {
-    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "1a44hmcvfaa8j169ladsibmvjakw6maaxqkzz1ab8139cqkda9i7";
-  };
-
-  buildInputs = [ zlib readline openssl ];
-
-  enableParallelBuilding = true;
-
-  LC_ALL = "C";
-
-  configureFlags = [ "--with-openssl" ];
-
-  patches = [ ./less-is-more.patch ];
-
-  postInstall =
-    ''
-      mkdir -p $out/share/man
-      cp -rvd doc/src/sgml/man1 $out/share/man
-    '';
-
-  passthru = {
-    inherit readline;
-    psqlSchema = "9.1";
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://www.postgresql.org/;
-    description = "A powerful, open source object-relational database system";
-    license = licenses.postgresql;
-    maintainers = [ maintainers.ocharles ];
-    platforms = platforms.unix;
-    hydraPlatforms = platforms.linux;
-  };
-}
diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix
deleted file mode 100644
index 51a265da7854..000000000000
--- a/pkgs/servers/sql/postgresql/9.2.x.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, zlib, readline, openssl }:
-
-let version = "9.2.13"; in
-
-stdenv.mkDerivation rec {
-  name = "postgresql-${version}";
-
-  src = fetchurl {
-    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0i3avdr8mnvn6ldkx0hc4jmclhisb2338hzs0j2m03wck8hddjsx";
-  };
-
-  buildInputs = [ zlib readline openssl ];
-
-  enableParallelBuilding = true;
-
-  makeFlags = [ "world" ];
-
-  configureFlags = stdenv.lib.optionals (!stdenv.isCygwin) [ "--with-openssl" ];
-
-  patches = [ ./disable-resolve_symlinks.patch ./less-is-more.patch ];
-
-  installTargets = [ "install-world" ];
-
-  LC_ALL = "C";
-
-  passthru = {
-    inherit readline;
-    psqlSchema = "9.2";
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://www.postgresql.org/;
-    description = "A powerful, open source object-relational database system";
-    license = licenses.postgresql;
-    maintainers = [ maintainers.ocharles ];
-    platforms = platforms.unix;
-    hydraPlatforms = platforms.linux;
-  };
-}
diff --git a/pkgs/servers/sql/postgresql/9.3.x.nix b/pkgs/servers/sql/postgresql/9.3.x.nix
deleted file mode 100644
index 3e0b7d4a76ef..000000000000
--- a/pkgs/servers/sql/postgresql/9.3.x.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ stdenv, fetchurl, zlib, readline, libossp_uuid, openssl}:
-
-with stdenv.lib;
-
-let version = "9.3.9"; in
-
-stdenv.mkDerivation rec {
-  name = "postgresql-${version}";
-
-  src = fetchurl {
-    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0j85j69rf54cwz5yhrhk4ca22b82990j5sqb8cr1fl9843nd0fzp";
-  };
-
-  buildInputs = [ zlib readline openssl ]
-                ++ optionals (!stdenv.isDarwin) [ libossp_uuid ];
-
-  enableParallelBuilding = true;
-
-  makeFlags = [ "world" ];
-
-  configureFlags = [ "--with-openssl" ]
-                   ++ optional (!stdenv.isDarwin) "--with-ossp-uuid";
-
-  patches = [ ./disable-resolve_symlinks.patch ./less-is-more.patch ];
-
-  installTargets = [ "install-world" ];
-
-  LC_ALL = "C";
-
-  passthru = {
-    inherit readline;
-    psqlSchema = "9.3";
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://www.postgresql.org/;
-    description = "A powerful, open source object-relational database system";
-    license = licenses.postgresql;
-    maintainers = [ maintainers.ocharles ];
-    platforms = platforms.unix;
-    hydraPlatforms = platforms.linux;
-  };
-}
diff --git a/pkgs/servers/sql/postgresql/9.4.x.nix b/pkgs/servers/sql/postgresql/9.4.x.nix
deleted file mode 100644
index cdb689fc110b..000000000000
--- a/pkgs/servers/sql/postgresql/9.4.x.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }:
-
-with stdenv.lib;
-
-let version = "9.4.4"; in
-
-stdenv.mkDerivation rec {
-  name = "postgresql-${version}";
-
-  src = fetchurl {
-    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "04q07g209y99xzjh88y52qpvz225rxwifv8nzp3bxzfni2bdk3jk";
-  };
-
-  buildInputs = [ zlib readline openssl ]
-                ++ optionals (!stdenv.isDarwin) [ libossp_uuid ];
-
-  enableParallelBuilding = true;
-
-  makeFlags = [ "world" ];
-
-  configureFlags = [ "--with-openssl" ]
-                   ++ optional (stdenv.isDarwin)  "--with-uuid=e2fs"
-                   ++ optional (!stdenv.isDarwin) "--with-ossp-uuid";
-
-  patches = [ ./disable-resolve_symlinks-94.patch ./less-is-more.patch ];
-
-  installTargets = [ "install-world" ];
-
-  LC_ALL = "C";
-
-  passthru = {
-    inherit readline;
-    psqlSchema = "9.4";
-  };
-
-  meta = with stdenv.lib; {
-    homepage = http://www.postgresql.org/;
-    description = "A powerful, open source object-relational database system";
-    license = licenses.postgresql;
-    maintainers = [ maintainers.ocharles ];
-    platforms = platforms.unix;
-    hydraPlatforms = platforms.linux;
-  };
-}
diff --git a/pkgs/servers/sql/postgresql/default.nix b/pkgs/servers/sql/postgresql/default.nix
new file mode 100644
index 000000000000..cf4519a82327
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/default.nix
@@ -0,0 +1,91 @@
+{ lib, stdenv, fetchurl, zlib, readline, libossp_uuid, openssl }:
+
+let
+
+  common = { version, sha256, psqlSchema } @ args: stdenv.mkDerivation (rec {
+    name = "postgresql-${version}";
+
+    src = fetchurl {
+      url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
+      inherit sha256;
+    };
+
+    outputs = [ "out" "doc" ];
+
+    buildInputs =
+      [ zlib readline openssl ]
+      ++ lib.optionals (!stdenv.isDarwin) [ libossp_uuid ];
+
+    enableParallelBuilding = true;
+
+    makeFlags = [ "world" ];
+
+    configureFlags =
+      [ "--with-openssl" ]
+      ++ lib.optional (stdenv.isDarwin)  "--with-uuid=e2fs"
+      ++ lib.optional (!stdenv.isDarwin) "--with-ossp-uuid";
+
+    patches =
+      [ (if lib.versionAtLeast version "9.4" then ./disable-resolve_symlinks-94.patch else ./disable-resolve_symlinks.patch)
+        ./less-is-more.patch
+      ];
+
+    installTargets = [ "install-world" ];
+
+    LC_ALL = "C";
+
+    postInstall =
+      ''
+        # Prevent a retained dependency on gcc-wrapper.
+        substituteInPlace $out/lib/pgxs/src/Makefile.global --replace ${stdenv.cc}/bin/ld ld
+      '';
+
+    disallowedReferences = [ stdenv.cc ];
+
+    passthru = {
+      inherit readline psqlSchema;
+    };
+
+    meta = with lib; {
+      homepage = http://www.postgresql.org/;
+      description = "A powerful, open source object-relational database system";
+      license = licenses.postgresql;
+      maintainers = [ maintainers.ocharles ];
+      platforms = platforms.unix;
+      hydraPlatforms = platforms.linux;
+    };
+  });
+
+in {
+
+  postgresql90 = common {
+    version = "9.0.22";
+    psqlSchema = "9.0";
+    sha256 = "19gq6axjhvlr5zlrzwnll1fbrvai4xh0nb1jki6gmmschl6v5m4l";
+  };
+
+  postgresql91 = common {
+    version = "9.1.18";
+    psqlSchema = "9.1";
+    sha256 = "1a44hmcvfaa8j169ladsibmvjakw6maaxqkzz1ab8139cqkda9i7";
+  };
+
+  postgresql92 = common {
+    version = "9.2.13";
+    psqlSchema = "9.2";
+    sha256 = "0i3avdr8mnvn6ldkx0hc4jmclhisb2338hzs0j2m03wck8hddjsx";
+  };
+
+  postgresql93 = common {
+    version = "9.3.9";
+    psqlSchema = "9.3";
+    sha256 = "0j85j69rf54cwz5yhrhk4ca22b82990j5sqb8cr1fl9843nd0fzp";
+  };
+
+  postgresql94 = common {
+    version = "9.4.4";
+    psqlSchema = "9.4";
+    sha256 = "04q07g209y99xzjh88y52qpvz225rxwifv8nzp3bxzfni2bdk3jk";
+  };
+
+}
diff --git a/pkgs/servers/uwsgi/default.nix b/pkgs/servers/uwsgi/default.nix
index bf168611f386..e7e7502665fb 100644
--- a/pkgs/servers/uwsgi/default.nix
+++ b/pkgs/servers/uwsgi/default.nix
@@ -24,11 +24,11 @@ in
 assert builtins.filter (x: lib.all (y: y.name != x) available) plugins == [];
 
 stdenv.mkDerivation rec {
-  name = "uwsgi-2.0.10";
+  name = "uwsgi-2.0.11.1";
 
   src = fetchurl {
     url = "http://projects.unbit.it/downloads/${name}.tar.gz";
-    sha256 = "12q2sn35vf1ils5043svq8da0czy54k63ziybvl33a9dqbb83cy0";
+    sha256 = "11v2j9n204hlvi1p1wp4r3nn22fqyd1qlbqcfqddi77sih9x79vm";
   };
 
   nativeBuildInputs = [ python3 pkgconfig ];
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index f0fdb67f30e2..12aeb67d416f 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -1445,11 +1445,11 @@ let
   }) // {inherit inputproto xorgserver xproto ;};
 
   xf86inputlibinput = (mkDerivation "xf86inputlibinput" {
-    name = "xf86-input-libinput-0.10.0";
+    name = "xf86-input-libinput-0.12.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-input-libinput-0.10.0.tar.bz2;
-      sha256 = "1w1v83qlr7n4iqgd7grmhx0gbz1fhsnpk88j4a136dk4xmc069x4";
+      url = mirror://xorg/individual/driver/xf86-input-libinput-0.12.0.tar.bz2;
+      sha256 = "1mi6m1a32xc43na46amfqz0025952whiy3w4wz0wx0d34jf933yv";
     };
     buildInputs = [pkgconfig inputproto xorgserver xproto ];
   }) // {inherit inputproto xorgserver xproto ;};
@@ -1475,14 +1475,14 @@ let
   }) // {inherit inputproto randrproto recordproto libX11 libXi xorgserver xproto libXtst ;};
 
   xf86inputvmmouse = (mkDerivation "xf86inputvmmouse" {
-    name = "xf86-input-vmmouse-13.0.0";
+    name = "xf86-input-vmmouse-13.1.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-input-vmmouse-13.0.0.tar.bz2;
-      sha256 = "0b31ap9wp7nwpnihz8m7bz3p0hhaipxxhl652nw4v380cq1vdkq4";
+      url = mirror://xorg/individual/driver/xf86-input-vmmouse-13.1.0.tar.bz2;
+      sha256 = "06ckn4hlkpig5vnivl0zj8a7ykcgvrsj8b3iccl1pgn1gaamix8a";
     };
-    buildInputs = [pkgconfig inputproto randrproto xorgserver xproto ];
-  }) // {inherit inputproto randrproto xorgserver xproto ;};
+    buildInputs = [pkgconfig inputproto udev randrproto xorgserver xproto ];
+  }) // {inherit inputproto udev randrproto xorgserver xproto ;};
 
   xf86inputvoid = (mkDerivation "xf86inputvoid" {
     name = "xf86-input-void-1.4.1";
@@ -1615,11 +1615,11 @@ let
   }) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
 
   xf86videointel = (mkDerivation "xf86videointel" {
-    name = "xf86-video-intel-2.99.917";
+    name = "xf86-video-intel-2015-07-22";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-video-intel-2.99.917.tar.bz2;
-      sha256 = "1jb7jspmzidfixbc0gghyjmnmpqv85i7pi13l4h2hn2ml3p83dq0";
+      url = http://cgit.freedesktop.org/xorg/driver/xf86-video-intel/snapshot/a29e765ec0c1d73ee7ef2dad3aa148214ec04335.tar.gz;
+      sha256 = "094qa8x0f7vgyirjbj9qdyak71nwxnmmsxml4zk49z59blq4l874";
     };
     buildInputs = [pkgconfig dri2proto dri3proto fontsproto libdrm libpng udev libpciaccess presentproto randrproto renderproto libX11 xcbutil libxcb libXcursor libXdamage libXext xextproto xf86driproto libXfixes xorgserver xproto libXrandr libXrender libxshmfence libXtst libXvMC ];
   }) // {inherit dri2proto dri3proto fontsproto libdrm libpng udev libpciaccess presentproto randrproto renderproto libX11 xcbutil libxcb libXcursor libXdamage libXext xextproto xf86driproto libXfixes xorgserver xproto libXrandr libXrender libxshmfence libXtst libXvMC ;};
@@ -1815,11 +1815,11 @@ let
   }) // {inherit randrproto videoproto xorgserver xproto ;};
 
   xf86videovesa = (mkDerivation "xf86videovesa" {
-    name = "xf86-video-vesa-2.3.3";
+    name = "xf86-video-vesa-2.3.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-video-vesa-2.3.3.tar.bz2;
-      sha256 = "1y5fsg0c4bgmh1cfsbnaaf388fppyy02i7mcy9vax78flkjpb2yf";
+      url = mirror://xorg/individual/driver/xf86-video-vesa-2.3.4.tar.bz2;
+      sha256 = "1haiw8r1z8ihk68d0jqph2wsld13w4qkl86biq46fvyxg7cg9pbv";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ];
   }) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ;};
@@ -1975,11 +1975,11 @@ let
   }) // {inherit inputproto libX11 libXaw xproto libXt ;};
 
   xkeyboardconfig = (mkDerivation "xkeyboardconfig" {
-    name = "xkeyboard-config-2.11";
+    name = "xkeyboard-config-2.15";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.11.tar.bz2;
-      sha256 = "0xkdyyi759hzls42hp4j3q2lc35n4j6b2g44ilx5qarci5h584p7";
+      url = mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.15.tar.bz2;
+      sha256 = "1grqdy5a9f2dii3y24fn0p3kz4q5g9j2kh3jcj2402rgrbvkqi0f";
     };
     buildInputs = [pkgconfig libX11 xproto ];
   }) // {inherit libX11 xproto ;};
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 0fc70fb6e172..a43fb6d77069 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -79,9 +79,9 @@ in
     nativeBuildInputs = [ args.python ];
   };
 
-  libxkbfile = attrs: attrs // {
-    patches = lib.optional stdenv.cc.isClang ./libxkbfile-clang36.patch;
-  };
+  # libxkbfile = attrs: attrs // {
+  #   patches = lib.optional stdenv.cc.isClang ./libxkbfile-clang36.patch;
+  # };
 
   libpciaccess = attrs : attrs // {
     patches = [ ./libpciaccess-apple.patch ];
@@ -226,11 +226,6 @@ in
       "--with-xorg-conf-dir=$(out)/share/X11/xorg.conf.d"
       "--with-udev-rules-dir=$(out)/lib/udev/rules.d"
     ];
-    patches = [( args.fetchpatch {
-      url = "http://cgit.freedesktop.org/xorg/driver/xf86-input-vmmouse/patch/"
-        + "?id=1cbbc03c4b37d57760c57bd2e0b0f89d744a5795";
-      sha256 = "1qkhwj2yal0cz15lv9557d10ylvxlq05ibq43pm2rrvqdg3mb6h4";
-    })];
   };
 
   xf86videoati = attrs: attrs // {
@@ -261,15 +256,14 @@ in
   };
 
   xkbcomp = attrs: attrs // {
-    configureFlags = "--with-xkb-config-root=${xorg.xkeyboardconfig}/share/X11/xkb"; 
+    configureFlags = "--with-xkb-config-root=${xorg.xkeyboardconfig}/share/X11/xkb";
   };
 
   xkeyboardconfig = attrs: attrs // {
 
     buildInputs = attrs.buildInputs ++ [args.intltool];
 
-    #TODO: resurrect patches for US_intl?
-    patches = [ ./xkeyboard-config-eo.patch ];
+    #TODO: resurrect patches for US_intl or Esperanto?
 
     # 1: compatibility for X11/xkb location
     # 2: I think pkgconfig/ is supposed to be in /lib/
@@ -291,9 +285,9 @@ in
         dmxproto /*libdmx not used*/ xf86vidmodeproto
         recordproto libXext pixman libXfont
         damageproto xcmiscproto  bigreqsproto
-        libpciaccess inputproto xextproto randrproto renderproto presentproto
+        inputproto xextproto randrproto renderproto presentproto
         dri2proto dri3proto kbproto xineramaproto resourceproto scrnsaverproto videoproto
-      ];
+      ] ++ lib.optional (!isDarwin) libpciaccess;
       commonPatches = [ ./xorgserver-xkbcomp-path.patch ]
                    ++ lib.optional isDarwin ./fix-clang.patch;
       # XQuartz requires two compilations: the first to get X / XQuartz,
@@ -420,7 +414,7 @@ in
 
   xf86videointel = attrs: attrs // {
     buildInputs = attrs.buildInputs ++ [xorg.libXfixes];
-    patches = [ ./xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch ];
+    nativeBuildInputs = [args.autoreconfHook xorg.utilmacros];
   };
 
   xwd = attrs: attrs // {
diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list
index 932d4f1236f2..7522743310a2 100644
--- a/pkgs/servers/x11/xorg/tarballs-7.7.list
+++ b/pkgs/servers/x11/xorg/tarballs-7.7.list
@@ -121,10 +121,10 @@ mirror://xorg/X11R7.7/src/everything/xf86driproto-2.1.1.tar.bz2
 mirror://xorg/individual/driver/xf86-input-evdev-2.9.2.tar.bz2
 mirror://xorg/individual/driver/xf86-input-joystick-1.6.2.tar.bz2
 mirror://xorg/individual/driver/xf86-input-keyboard-1.8.1.tar.bz2
-mirror://xorg/individual/driver/xf86-input-libinput-0.10.0.tar.bz2
+mirror://xorg/individual/driver/xf86-input-libinput-0.12.0.tar.bz2
 mirror://xorg/individual/driver/xf86-input-mouse-1.9.1.tar.bz2
 mirror://xorg/individual/driver/xf86-input-synaptics-1.8.2.tar.bz2
-mirror://xorg/individual/driver/xf86-input-vmmouse-13.0.0.tar.bz2
+mirror://xorg/individual/driver/xf86-input-vmmouse-13.1.0.tar.bz2
 mirror://xorg/individual/driver/xf86-input-void-1.4.1.tar.bz2
 mirror://xorg/individual/driver/xf86-video-ark-0.7.5.tar.bz2
 mirror://xorg/individual/driver/xf86-video-ast-0.98.0.tar.bz2
@@ -158,7 +158,7 @@ mirror://xorg/individual/driver/xf86-video-tdfx-1.4.6.tar.bz2
 mirror://xorg/individual/driver/xf86-video-tga-1.2.2.tar.bz2
 mirror://xorg/individual/driver/xf86-video-trident-1.3.7.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xf86-video-v4l-0.2.0.tar.bz2
-mirror://xorg/individual/driver/xf86-video-vesa-2.3.3.tar.bz2
+mirror://xorg/individual/driver/xf86-video-vesa-2.3.4.tar.bz2
 mirror://xorg/individual/driver/xf86-video-vmware-13.1.0.tar.bz2
 mirror://xorg/individual/driver/xf86-video-voodoo-1.2.5.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xf86-video-wsfb-0.4.0.tar.bz2
@@ -171,7 +171,7 @@ mirror://xorg/individual/app/xinput-1.6.1.tar.bz2
 mirror://xorg/individual/app/xkbcomp-1.3.0.tar.bz2
 mirror://xorg/individual/app/xkbevd-1.1.4.tar.bz2
 mirror://xorg/individual/app/xkbutils-1.0.4.tar.bz2
-mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.11.tar.bz2
+mirror://xorg/individual/data/xkeyboard-config/xkeyboard-config-2.15.tar.bz2
 mirror://xorg/individual/app/xkill-1.0.4.tar.bz2
 mirror://xorg/individual/app/xlsatoms-1.1.2.tar.bz2
 mirror://xorg/individual/app/xlsclients-1.1.3.tar.bz2
@@ -179,7 +179,7 @@ mirror://xorg/individual/app/xlsfonts-1.0.5.tar.bz2
 mirror://xorg/individual/app/xmag-1.0.6.tar.bz2
 mirror://xorg/individual/app/xmodmap-1.0.9.tar.bz2
 mirror://xorg/individual/doc/xorg-docs-1.7.1.tar.bz2
-mirror://xorg/individual/xserver/xorg-server-1.16.4.tar.bz2
+mirror://xorg/individual/xserver/xorg-server-1.17.2.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xorg-sgml-doctools-1.11.tar.bz2
 mirror://xorg/X11R7.7/src/everything/xpr-1.0.4.tar.bz2
 mirror://xorg/individual/app/xprop-1.2.2.tar.bz2
diff --git a/pkgs/servers/x11/xorg/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch b/pkgs/servers/x11/xorg/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch
deleted file mode 100644
index ea3aa30ed13c..000000000000
--- a/pkgs/servers/x11/xorg/xf86-video-intel-2.99.917-libdrm-kernel-4_0-crash.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-From 7fe2b2948652443ff43d907855bd7a051d54d309 Mon Sep 17 00:00:00 2001
-From: Chris Wilson <chris@chris-wilson.co.uk>
-Date: Thu, 19 Mar 2015 23:14:17 +0000
-Subject: sna: Protect against ABI breakage in recent versions of libdrm
-
-Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-
-diff --git a/src/sna/kgem.c b/src/sna/kgem.c
-index 11f0828..6f16cba 100644
---- a/src/sna/kgem.c
-+++ b/src/sna/kgem.c
-@@ -182,6 +182,15 @@ struct local_i915_gem_caching {
- #define LOCAL_IOCTL_I915_GEM_SET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_SET_CACHING, struct local_i915_gem_caching)
- #define LOCAL_IOCTL_I915_GEM_GET_CACHING DRM_IOW(DRM_COMMAND_BASE + LOCAL_I915_GEM_GET_CACHING, struct local_i915_gem_caching)
- 
-+struct local_i915_gem_mmap {
-+	uint32_t handle;
-+	uint32_t pad;
-+	uint64_t offset;
-+	uint64_t size;
-+	uint64_t addr_ptr;
-+};
-+#define LOCAL_IOCTL_I915_GEM_MMAP DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MMAP, struct local_i915_gem_mmap)
-+
- struct local_i915_gem_mmap2 {
- 	uint32_t handle;
- 	uint32_t pad;
-@@ -514,15 +523,15 @@ retry_wc:
- 
- static void *__kgem_bo_map__cpu(struct kgem *kgem, struct kgem_bo *bo)
- {
--	struct drm_i915_gem_mmap mmap_arg;
-+	struct local_i915_gem_mmap arg;
- 	int err;
- 
- retry:
--	VG_CLEAR(mmap_arg);
--	mmap_arg.handle = bo->handle;
--	mmap_arg.offset = 0;
--	mmap_arg.size = bytes(bo);
--	if ((err = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_MMAP, &mmap_arg))) {
-+	VG_CLEAR(arg);
-+	arg.handle = bo->handle;
-+	arg.offset = 0;
-+	arg.size = bytes(bo);
-+	if ((err = do_ioctl(kgem->fd, LOCAL_IOCTL_I915_GEM_MMAP, &arg))) {
- 		assert(err != EINVAL);
- 
- 		if (__kgem_throttle_retire(kgem, 0))
-@@ -536,10 +545,10 @@ retry:
- 		return NULL;
- 	}
- 
--	VG(VALGRIND_MAKE_MEM_DEFINED(mmap_arg.addr_ptr, bytes(bo)));
-+	VG(VALGRIND_MAKE_MEM_DEFINED(arg.addr_ptr, bytes(bo)));
- 
- 	DBG(("%s: caching CPU vma for %d\n", __FUNCTION__, bo->handle));
--	return bo->map__cpu = (void *)(uintptr_t)mmap_arg.addr_ptr;
-+	return bo->map__cpu = (void *)(uintptr_t)arg.addr_ptr;
- }
- 
- static int gem_write(int fd, uint32_t handle,
--- 
-cgit v0.10.2
-
diff --git a/pkgs/servers/x11/xorg/xkeyboard-config-eo.patch b/pkgs/servers/x11/xorg/xkeyboard-config-eo.patch
deleted file mode 100644
index f288a5c0f6dd..000000000000
--- a/pkgs/servers/x11/xorg/xkeyboard-config-eo.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-diff --git a/rules/base.xml.in b/rules/base.xml.in
-index ec321f8..e9c3546 100644
---- a/rules/base.xml.in
-+++ b/rules/base.xml.in
-@@ -1786,6 +1786,13 @@
-     </layout>
-     <layout>
-       <configItem>
-+        <name>eo</name>
-+        <_shortDescription>Esp</_shortDescription>
-+        <_description>Esperanto</_description>
-+      </configItem>
-+    </layout>
-+    <layout>
-+      <configItem>
-         <name>ir</name>
-         <_shortDescription>Irn</_shortDescription>
-         <_description>Iran</_description>
-diff --git a/symbols/Makefile.am b/symbols/Makefile.am
-index 97c816d..d7e3a4e 100644
---- a/symbols/Makefile.am
-+++ b/symbols/Makefile.am
-@@ -10,7 +10,7 @@ bt by braille \
- ca cd \
- ch cn cz \
- de dk \
--ee es et epo \
-+ee eo es et epo \
- fi fo fr \
- gb ge gh gn \
- gr hr hu \
-diff --git a/symbols/Makefile.in b/symbols/Makefile.in
-index b5be077..5cddcc7 100644
---- a/symbols/Makefile.in
-+++ b/symbols/Makefile.in
-@@ -222,7 +222,7 @@ bt by braille \
- ca cd \
- ch cn cz \
- de dk \
--ee es et epo \
-+ee eo es et epo \
- fi fo fr \
- gb ge gh gn \
- gr hr hu \
-diff --git a/symbols/eo b/symbols/eo
-new file mode 100644
-index 0000000..d6358c9
---- /dev/null
-+++ b/symbols/eo
-@@ -0,0 +1,21 @@
-+// $XFree86$
-+
-+partial alphanumeric_keys
-+xkb_symbols "basic" {
-+
-+     // Describes the differences between a very simple en_US
-+     // keyboard and a simple Esperanto keyboard
-+     // Press AltGr or Windows Menu key together with C, H, J, S, U
-+     // to get accented letters.
-+     // 2001 by Radovan Garabik <garabik@melkor.dnp.fmph.uniba.sk>
-+
-+    key.type = "FOUR_LEVEL";
-+
-+    key <AD02>  { [w,W, ubreve,Ubreve ] };
-+    key <AD07>  { [u,U, ubreve, Ubreve ] };
-+    key <AC02>  { [s,S, scircumflex,    Scircumflex ] };
-+    key <AC05>  { [g,G, gcircumflex,Gcircumflex ] };
-+    key <AC06>  { [h,H, hcircumflex,Hcircumflex ] };
-+    key <AC07>  { [j,J, jcircumflex,Jcircumflex ] };
-+    key <AB03>  { [c,C, ccircumflex,Ccircumflex ] };
-+};
diff --git a/pkgs/tools/X11/xdg-utils/default.nix b/pkgs/tools/X11/xdg-utils/default.nix
index 6f306a868911..c010884abdd6 100644
--- a/pkgs/tools/X11/xdg-utils/default.nix
+++ b/pkgs/tools/X11/xdg-utils/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       substituteInPlace $item --replace "sed " "${gnused}/bin/sed "
       substituteInPlace $item --replace "egrep " "${gnugrep}/bin/egrep "
       sed -i $item -re "s#([^e])grep #\1${gnugrep}/bin/grep #g" # Don't replace 'egrep'
-      substituteInPlace $item --replace "which " "${which}/bin/which "
+      substituteInPlace $item --replace "which " "type -P "
       substituteInPlace $item --replace "/usr/bin/file" "${file}/bin/file"
     done
   '';
diff --git a/pkgs/tools/admin/awscli/default.nix b/pkgs/tools/admin/awscli/default.nix
index c846de708525..f544b81e78d5 100644
--- a/pkgs/tools/admin/awscli/default.nix
+++ b/pkgs/tools/admin/awscli/default.nix
@@ -2,12 +2,12 @@
 
 pythonPackages.buildPythonPackage rec {
   name = "awscli-${version}";
-  version = "1.7.29";
+  version = "1.7.41";
   namePrefix = "";
 
   src = fetchzip {
     url = "https://github.com/aws/aws-cli/archive/${version}.tar.gz";
-    sha256 = "0r0w5qldimdp2d2ykw7pmppn8chbhh6cm48famhldqnyrh3vrf02";
+    sha256 = "1xfvpqyxi5qaqcvm56q616k9zjidbc9l2vk1v3ld6lnlzri3a1ra";
   };
 
   propagatedBuildInputs = [
@@ -21,6 +21,14 @@ pythonPackages.buildPythonPackage rec {
     groff
   ];
 
+  postInstall = ''
+    mkdir -p $out/etc/bash_completion.d
+    echo "complete -C $out/bin/aws_completer aws" > $out/etc/bash_completion.d/awscli
+    mkdir -p $out/share/zsh/site-functions
+    mv $out/bin/aws_zsh_completer.sh $out/share/zsh/site-functions
+    rm $out/bin/aws.cmd
+  '';
+
   meta = {
     homepage = https://aws.amazon.com/cli/;
     description = "Unified tool to manage your AWS services";
diff --git a/pkgs/tools/backup/borg/default.nix b/pkgs/tools/backup/borg/default.nix
new file mode 100644
index 000000000000..f9a949f4d3fc
--- /dev/null
+++ b/pkgs/tools/backup/borg/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchzip, python3Packages, openssl, acl }:
+
+python3Packages.buildPythonPackage rec {
+  name = "borg-${version}";
+  version = "0.23.0";
+  namePrefix = "";
+
+  src = fetchzip {
+    name = "${name}-src";
+    url = "https://github.com/borgbackup/borg/archive/${version}.tar.gz";
+    sha256 = "1ns00bhrh4zm1s70mm32gnahj7yh4jdpkb8ziarhvcnknz7aga67";
+  };
+
+  propagatedBuildInputs = with python3Packages;
+    [ cython msgpack openssl acl llfuse tox detox ];
+
+  preConfigure = ''
+    export BORG_OPENSSL_PREFIX="${openssl}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A deduplicating backup program (attic fork)";
+    homepage = https://borgbackup.github.io/;
+    license = licenses.bsd3;
+    platforms = platforms.unix; # Darwin and FreeBSD mentioned on homepage
+  };
+}
diff --git a/pkgs/tools/compression/xdelta/default.nix b/pkgs/tools/compression/xdelta/default.nix
index 68c4ea809bed..bf02d8c3a0aa 100644
--- a/pkgs/tools/compression/xdelta/default.nix
+++ b/pkgs/tools/compression/xdelta/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchFromGitHub, autoreconfHook }:
 
-let version = "3.0.9"; in
+let version = "3.0.10"; in
 stdenv.mkDerivation rec {
   name = "xdelta-${version}";
   
   src = fetchFromGitHub {
-    sha256 = "1pd7dyq44dbggmwkrr8251anqsf2an67zbvrk4vfnc92jkmjp17i";
+    sha256 = "0wwxdr01var3f90iwi1lgjpsa4y549g850hyyix5cm0qk67ck4rg";
     rev = "v${version}";
     repo = "xdelta-devel";
     owner = "jmacd";
diff --git a/pkgs/tools/filesystems/ceph/0.80.nix b/pkgs/tools/filesystems/ceph/0.80.nix
index 302a65f626b9..3e859626ee8d 100644
--- a/pkgs/tools/filesystems/ceph/0.80.nix
+++ b/pkgs/tools/filesystems/ceph/0.80.nix
@@ -6,11 +6,13 @@ callPackage ./generic.nix (args // rec {
   src = fetchgit {
     url = "git://github.com/ceph/ceph.git";
     rev = "refs/tags/v${version}";
-    sha256 = "1arajccczjdqp7igs17569xlq5cj4azcm5wwixg6ryypjr2grcbl";
+    leaveDotGit = true;
+    sha256 = "0s81j6yj8y27hlx1hid9maz0l7bhjjskjxzxlhsikzmdc1j27m4r";
   };
 
   patches = [
     ./0001-Cleanup-boost-optionals.patch
     ./fix-pgrefdebugging.patch
+    ./boost-158.patch
   ];
 })
diff --git a/pkgs/tools/filesystems/ceph/0.94.nix b/pkgs/tools/filesystems/ceph/0.94.nix
index 9b9455b90612..3947cd70f56b 100644
--- a/pkgs/tools/filesystems/ceph/0.94.nix
+++ b/pkgs/tools/filesystems/ceph/0.94.nix
@@ -6,8 +6,12 @@ callPackage ./generic.nix (args // rec {
   src = fetchgit {
     url = "https://github.com/ceph/ceph.git";
     rev = "refs/tags/v${version}";
-    sha256 = "1nhqzmxv7bz93b8rbd88wgmw9icm2lhmc94dfscgh23kfpipyd6l";
+    leaveDotGit = true;
+    sha256 = "094f9knxgx8vb9fb1yzld9ib4m0wpqwqgqjl3xqf0dzm48nxqd73";
   };
 
-  patches = [ ./fix-pgrefdebugging.patch ];
+  patches = [
+    ./fix-pgrefdebugging.patch
+    ./boost-158.patch
+  ];
 })
diff --git a/pkgs/tools/filesystems/ceph/boost-158.patch b/pkgs/tools/filesystems/ceph/boost-158.patch
new file mode 100644
index 000000000000..11a1d55c4948
--- /dev/null
+++ b/pkgs/tools/filesystems/ceph/boost-158.patch
@@ -0,0 +1,27 @@
+From e7b196a4a091c0ea258866559ba06e7ed0cc4247 Mon Sep 17 00:00:00 2001
+From: Kefu Chai <kchai@redhat.com>
+Date: Fri, 8 May 2015 15:21:20 +0800
+Subject: [PATCH] mon: remove unused variable
+
+* as a side effect, this change silences
+  http://tracker.ceph.com/issues/11576
+
+Fixes: #11576
+Signed-off-by: Kefu Chai <kchai@redhat.com>
+---
+ src/mon/OSDMonitor.cc | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc
+index 73dcd5f..7caaa45 100644
+--- a/src/mon/OSDMonitor.cc
++++ b/src/mon/OSDMonitor.cc
+@@ -3174,8 +3174,6 @@ bool OSDMonitor::preprocess_command(MMonCommand *m)
+   } else if (prefix == "osd crush get-tunable") {
+     string tunable;
+     cmd_getval(g_ceph_context, cmdmap, "tunable", tunable);
+-    int value;
+-    cmd_getval(g_ceph_context, cmdmap, "value", value);
+     ostringstream rss;
+     if (f)
+       f->open_object_section("tunable");
diff --git a/pkgs/tools/filesystems/ceph/dev.nix b/pkgs/tools/filesystems/ceph/dev.nix
index 5cc183d1053c..c57bc200f24c 100644
--- a/pkgs/tools/filesystems/ceph/dev.nix
+++ b/pkgs/tools/filesystems/ceph/dev.nix
@@ -6,7 +6,8 @@ callPackage ./generic.nix (args // rec {
   src = fetchgit {
     url = "https://github.com/ceph/ceph.git";
     rev = "refs/tags/v${version}";
-    sha256 = "0kydjyvb1566mh33p6dlljfx1r4cfdj8ic4i19h5r9vavkc46nf0";
+    leaveDotGit = true;
+    sha256 = "13iyv53kq2ka5py759cdiw0wmzpsycskvhmyr74qkpxmw9g6177y";
   };
 
   patches = [ ./fix-pythonpath.patch ];
diff --git a/pkgs/tools/filesystems/ceph/generic.nix b/pkgs/tools/filesystems/ceph/generic.nix
index bece841d5f51..61659ef26fd4 100644
--- a/pkgs/tools/filesystems/ceph/generic.nix
+++ b/pkgs/tools/filesystems/ceph/generic.nix
@@ -1,5 +1,5 @@
-{ stdenv, autoconf, automake, makeWrapper, pkgconfig, libtool, which
-, boost, python, pythonPackages, libxml2, git, zlib
+{ stdenv, autoconf, automake, makeWrapper, pkgconfig, libtool, which, git
+, boost, python, pythonPackages, libxml2, zlib
 
 # Optional Dependencies
 , snappy ? null, leveldb ? null, yasm ? null, fcgi ? null, expat ? null
@@ -112,14 +112,13 @@ stdenv.mkDerivation {
     ./0001-Makefile-env-Don-t-force-sbin.patch
   ];
 
-  nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which ]
+  nativeBuildInputs = [ autoconf automake makeWrapper pkgconfig libtool which git ]
     ++ optionals (versionAtLeast version "9.0.2") [
       pythonPackages.setuptools pythonPackages.argparse
     ];
   buildInputs = buildInputs ++ cryptoLibsMap.${cryptoStr} ++ [
     boost python libxml2 optYasm optLibatomic_ops optLibs3 malloc pythonPackages.flask zlib
   ] ++ optional (versionAtLeast version "9.0.0") [
-    git                   # Used for the gitversion string
     pythonPackages.sphinx # Used for docs
   ] ++ optional stdenv.isLinux [
     linuxHeaders libuuid udev keyutils optLibaio optLibxfs optZfs
diff --git a/pkgs/tools/filesystems/ceph/git.nix b/pkgs/tools/filesystems/ceph/git.nix
index f65b7ea78465..916e8ad9d5ea 100644
--- a/pkgs/tools/filesystems/ceph/git.nix
+++ b/pkgs/tools/filesystems/ceph/git.nix
@@ -1,12 +1,13 @@
-{ callPackage, fetchgit, git, ... } @ args:
+{ callPackage, fetchgit, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2015-07-20";
+  version = "2015-07-23";
 
   src = fetchgit {
     url = "git://github.com/ceph/ceph.git";
-    rev = "ce534e1e0addfe93194a553cec98799ea97affe4";
-    sha256 = "19i9fp06fdyhx5x6ryw5q81id0354601yxnywvir3i9hy51p9xaz";
+    rev = "f7bda9567d2a1acf015ab891eb5bb9ca0cdc8396";
+    leaveDotGit = true;
+    sha256 = "0z3i4aadyyklafm3lia8dg8l0wr3cvy53v3h7b533nm61lq07maf";
   };
 
   patches = [ ./fix-pythonpath.patch ];
diff --git a/pkgs/tools/graphics/dmtx-utils/default.nix b/pkgs/tools/graphics/dmtx-utils/default.nix
index 0fe473f5d634..3e4e3e9312ed 100644
--- a/pkgs/tools/graphics/dmtx-utils/default.nix
+++ b/pkgs/tools/graphics/dmtx-utils/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libdmtx, pkgconfig}:
+{stdenv, fetchurl, libdmtx, pkgconfig, imagemagick}:
 let
   s = # Generated upstream information
   rec {
@@ -10,7 +10,7 @@ let
     sha256="1di8ymlziy9856abd6rb72z0zqzmrff4r3vql0q9r5sk5ax4s417";
   };
   buildInputs = [
-    libdmtx pkgconfig
+    libdmtx pkgconfig imagemagick
   ];
 in
 stdenv.mkDerivation {
diff --git a/pkgs/tools/graphics/imgurbash/default.nix b/pkgs/tools/graphics/imgurbash/default.nix
new file mode 100644
index 000000000000..66f85af87935
--- /dev/null
+++ b/pkgs/tools/graphics/imgurbash/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, bash, curl, xsel }:
+
+stdenv.mkDerivation {
+  name = "imgurbash-4";
+
+  src = fetchurl {
+    url = "https://imgur.com/tools/imgurbash.sh";
+    sha256 = "16m7dn5vqzx1q4pzssnwiwajfzrbhrz0niyhf5abxi1lwr3h0ca1";
+  };
+
+  buildCommand = ''
+    mkdir -p $out/bin
+    cat <<EOF >$out/bin/imgurbash
+    #!${bash}/bin/bash
+    PATH=${stdenv.lib.makeSearchPath "bin" [curl xsel]}:\$PATH
+    EOF
+    cat $src >>$out/bin/imgurbash
+    chmod +x $out/bin/imgurbash
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A simple bash script to upload an image to imgur from the commandline";
+    license = licenses.publicDomain;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index e3dc7bcb5337..7d991a415568 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "file-5.23";
+  name = "file-5.24";
 
   buildInputs = [ zlib ];
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
       "ftp://ftp.astron.com/pub/file/${name}.tar.gz"
       "http://distfiles.macports.org/file/${name}.tar.gz"
     ];
-    sha256 = "0z0mwqayrrf3w734rjp9rysf0y8az191ff7fxjsxyb1y2kzv72ic";
+    sha256 = "1kjhqwmi1sjw8jcf6li725c59wm00zajrdfwgkwqxs295vgb6b40";
   };
 
   meta = {
diff --git a/pkgs/tools/misc/fzf/default.nix b/pkgs/tools/misc/fzf/default.nix
new file mode 100644
index 000000000000..5692fc25a326
--- /dev/null
+++ b/pkgs/tools/misc/fzf/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, goPackages, syncthing, ncurses }:
+
+with goPackages;
+
+buildGoPackage rec {
+  name = "fzf-${version}";
+  version = "0.10.0";
+  goPackagePath = "github.com/junegunn/fzf";
+  src = fetchFromGitHub {
+    owner = "junegunn";
+    repo = "fzf";
+    rev = "${version}";
+    sha256 = "0dx9qwmcrnh31m2n75qmpj1dxm6rr6xsbazy4nwa3bzrb8y6svh2";
+  };
+
+  buildInputs = with goPackages; [
+    crypto
+    ginkgo
+    gomega
+    junegunn.go-runewidth
+    go-shellwords
+    ncurses
+    syncthing
+    text
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/junegunn/fzf;
+    description = "A command-line fuzzy finder written in Go";
+    license = licenses.mit;
+    maintainers = [ maintainers.magnetophon ];
+  };
+}
diff --git a/pkgs/tools/misc/profile-cleaner/default.nix b/pkgs/tools/misc/profile-cleaner/default.nix
index 903c8617128a..55c44770c3e1 100644
--- a/pkgs/tools/misc/profile-cleaner/default.nix
+++ b/pkgs/tools/misc/profile-cleaner/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, makeWrapper, parallel, sqlite }:
 
 stdenv.mkDerivation rec {
-  version = "2.34";
+  version = "2.35";
   name = "profile-cleaner-${version}";
 
   src = fetchFromGitHub {
     owner = "graysky2";
     repo = "profile-cleaner";
     rev = "v${version}";
-    sha256 = "17z73xyn31668f7vmbj7xs659fcrm0m0mnzja7hz6lipfaviqxrs";
+    sha256 = "0gashrzhpgcy98zsyc6b3awfp15j1x0nq82h60kvfjbs6xxzvszh";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/tools/misc/sdl-jstest/default.nix b/pkgs/tools/misc/sdl-jstest/default.nix
index 3da62874c13c..cf62039fc036 100644
--- a/pkgs/tools/misc/sdl-jstest/default.nix
+++ b/pkgs/tools/misc/sdl-jstest/default.nix
@@ -1,11 +1,11 @@
 { fetchgit, stdenv, cmake, pkgconfig, SDL, SDL2, ncurses, docbook_xsl }:
 
 stdenv.mkDerivation rec {
-  name = "sdl-jstest-20150611";
+  name = "sdl-jstest-20150625";
   src = fetchgit {
     url = "https://github.com/Grumbel/sdl-jstest";
-    rev = "684d168e5526da16760dcfc6d40da0103ab284cc";
-    sha256 = "fc110a858edc2defc5cd8b176a5ce74666d3957d0268b861d0f9669362a1bd03";
+    rev = "3f54b86ebe0d2f95e9c1d034bc4ed02d6d2b6409";
+    sha256 = "d33e0a2c66b551ecf333590f1a6e1730093af31cee1be8757748624d42e14df1";
   };
 
   buildInputs = [ SDL SDL2 ncurses ];
diff --git a/pkgs/tools/misc/wyrd/default.nix b/pkgs/tools/misc/wyrd/default.nix
index d76e393aaaa7..d02ce41b6aa1 100644
--- a/pkgs/tools/misc/wyrd/default.nix
+++ b/pkgs/tools/misc/wyrd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, ncurses, remind }:
+{ stdenv, fetchurl, ocaml, ncurses, remind, camlp4 }:
 
 stdenv.mkDerivation rec {
   version = "1.4.6";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0zlrg602q781q8dij62lwdprpfliyy9j1rqfqcz8p2wgndpivddj";
   };
 
-  buildInputs = [ ocaml ncurses remind ];
+  buildInputs = [ ocaml ncurses remind camlp4 ];
 
   preferLocalBuild = true;
 
diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix
index a89d1e3e888f..d4ec7f7f0ad1 100644
--- a/pkgs/tools/networking/dhcpcd/default.nix
+++ b/pkgs/tools/networking/dhcpcd/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, udev }:
 
 stdenv.mkDerivation rec {
-  name = "dhcpcd-6.9.0";
+  name = "dhcpcd-6.9.1";
 
   src = fetchurl {
-    url = "mirror://roy/dhcpcd/${name}.tar.bz2";
-    sha256 = "0s0a29ml9x108lxv5yz55f3l5kvlx4hcbxigfq3hr245yy7aarhm";
+    url = "mirror://roy/dhcpcd/${name}.tar.xz";
+    sha256 = "0vq6gjgn2sjq2rwvd23gvf55k2v9l6970z8fmii0p2g23w77afy0";
   };
 
   buildInputs = [ pkgconfig udev ];
diff --git a/pkgs/tools/networking/horst/default.nix b/pkgs/tools/networking/horst/default.nix
new file mode 100644
index 000000000000..0f18534d2004
--- /dev/null
+++ b/pkgs/tools/networking/horst/default.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchFromGitHub, pkgconfig, ncurses, libnl }:
+
+stdenv.mkDerivation rec {
+  name = "horst-${version}";
+  version = "git-2015-07-22";
+
+  src = fetchFromGitHub {
+    owner = "br101";
+    repo = "horst";
+    rev = "b62fc20b98690061522a431cb278d989e21141d8";
+    sha256 = "176yma8v2bsab2ypgmgzvjg0bsbnk9sga3xpwkx33mwm6q79kd6g";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ ncurses libnl ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv horst $out/bin
+
+    mkdir -p $out/man/man1
+    cp horst.1 $out/man/man1
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Small and lightweight IEEE802.11 wireless LAN analyzer with a text interface";
+    homepage = http://br1.einfach.org/tech/horst/;
+    maintainers = [ maintainers.fpletz ];
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/networking/i2p/default.nix b/pkgs/tools/networking/i2p/default.nix
index b5ef06c34eaa..1ef159131af2 100644
--- a/pkgs/tools/networking/i2p/default.nix
+++ b/pkgs/tools/networking/i2p/default.nix
@@ -1,12 +1,13 @@
 { stdenv, procps, coreutils, fetchurl, jdk, jre, ant, gettext, which }:
 
 stdenv.mkDerivation rec {
-  name = "i2p-0.9.19";
+  name = "i2p-0.9.20";
   src = fetchurl {
     url = "https://github.com/i2p/i2p.i2p/archive/${name}.tar.gz";
-    sha256 = "1q9sda1a708laxf452qnzbfv7bwfwyam5n1giw2n3z3ar602i936";
+    sha256 = "10rynkl9dbnfl67ck3d7wdwz52h7354r7nbwcypsjnng4f1dmj5s";
   };
   buildInputs = [ jdk ant gettext which ];
+  patches = [ ./i2p.patch ];
   buildPhase = ''
     export JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
     ant preppkg-linux-only
@@ -17,15 +18,15 @@ stdenv.mkDerivation rec {
     cp -r pkg-temp/* $out
     cp installer/lib/wrapper/linux64/* $out
     sed -i $out/i2prouter -i $out/runplain.sh \
-      -e "s#%INSTALL_PATH#$out#" \
+      -e "s#uname#${coreutils}/bin/uname#" \
+      -e "s#which#${which}/bin/which#" \
+      -e "s#%gettext%#${gettext}/bin/gettext#" \
       -e "s#/usr/ucb/ps#${procps}/bin/ps#" \
       -e "s#/usr/bin/tr#${coreutils}/bin/tr#" \
+      -e "s#%INSTALL_PATH#$out#" \
       -e 's#%USER_HOME#$HOME#' \
       -e "s#%SYSTEM_java_io_tmpdir#/tmp#" \
-      -e 's#JAVA=java#JAVA=${jre}/bin/java#'
-    sed -i $out/runplain.sh \
-      -e "s#nohup \(.*Launch\) .*#\1#" \
-      -e "s#echo \$\! .*##"
+      -e "s#%JAVA%#${jre}/bin/java#"
     mv $out/runplain.sh $out/bin/i2prouter-plain
     mv $out/man $out/share/
     chmod +x $out/bin/* $out/i2psvc
diff --git a/pkgs/tools/networking/i2p/i2p.patch b/pkgs/tools/networking/i2p/i2p.patch
new file mode 100644
index 000000000000..2ae6446ed286
--- /dev/null
+++ b/pkgs/tools/networking/i2p/i2p.patch
@@ -0,0 +1,39 @@
+--- a/installer/resources/runplain.sh
++++ b/installer/resources/runplain.sh
+@@ -21,7 +21,7 @@
+ 
+ # Try using the Java binary that I2P was installed with.
+ # If it's not found, try looking in the system PATH.
+-JAVA=$(which %JAVA_HOME/bin/java || which java)
++JAVA=%JAVA%
+ 
+ if [ -z $JAVA ] || [ ! -x $JAVA ]; then
+     echo "Error: Cannot find java." >&2
+@@ -40,15 +40,4 @@
+     export JAVA_TOOL_OPTIONS="-Djava.awt.headless=true"
+ fi
+ JAVAOPTS="-Djava.net.preferIPv4Stack=${PREFERv4} -Djava.library.path=${I2P}:${I2P}/lib -Di2p.dir.base=${I2P} -DloggerFilenameOverride=logs/log-router-@.txt"
+-(
+-    nohup ${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch > /dev/null 2>&1
+-) &
+-PID=$!
+-
+-if [ ! -z $PID ] && kill -0 $PID > /dev/null 2>&1 ; then
+-    echo "I2P started [$PID]" >&2
+-    echo $PID > "${I2PTEMP}/router.pid"
+-else
+-    echo "I2P failed to start." >&2
+-    exit 1
+-fi
++${JAVA} -cp \"${CP}\" ${JAVAOPTS} net.i2p.router.RouterLaunch
+--- a/installer/resources/i2prouter
++++ b/installer/resources/i2prouter
+@@ -49,7 +49,7 @@
+ 
+ # gettext - we look for it in the path
+ # fallback to echo is below, we can't set it to echo here.
+-GETTEXT=$(which gettext > /dev/null 2>&1)
++GETTEXT=%gettext%
+ 
+ # Where to install the systemd service
+ SYSTEMD_SERVICE="/etc/systemd/system/${APP_NAME}.service"
diff --git a/pkgs/tools/networking/ipv6calc/default.nix b/pkgs/tools/networking/ipv6calc/default.nix
index 102d06882349..a4725e8140f6 100644
--- a/pkgs/tools/networking/ipv6calc/default.nix
+++ b/pkgs/tools/networking/ipv6calc/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, geoip, geolite-legacy, getopt, openssl, perl }:
 
+let version = "0.99.0"; in
 stdenv.mkDerivation rec {
-  version = "0.98.0";
   name = "ipv6calc-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.deepspace6.net/pub/ds6/sources/ipv6calc/${name}.tar.gz";
-    sha256 = "02r0r4lgz10ivbmgdzivj7dvry1aad75ik9vyy6irjvngjkzg5r3";
+    sha256 = "1dgx6gji9dyz77jssk2ax5r0ycq4jcsks71bhvcpb79k02wkaxgw";
   };
 
   buildInputs = [ geoip geolite-legacy getopt openssl ];
@@ -21,18 +21,21 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  configureFlags = ''
-    --disable-bundled-getopt
-    --disable-bundled-md5
-    --disable-dynamic-load
-    --enable-shared
-    --enable-geoip
-    --with-geoip-db=${geolite-legacy}/share/GeoIP
-  '';
+  configureFlags = [
+    "--disable-bundled-getopt"
+    "--disable-bundled-md5"
+    "--disable-dynamic-load"
+    "--enable-shared"
+  ] ++ stdenv.lib.optional (geoip != null ) [
+    "--enable-geoip"
+  ] ++ stdenv.lib.optional (geolite-legacy != null) [
+    "--with-geoip-db=${geolite-legacy}/share/GeoIP"
+  ];
 
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
+    inherit version;
     description = "Calculate/manipulate (not only) IPv6 addresses";
     longDescription = ''
       ipv6calc is a small utility to manipulate (not only) IPv6 addresses and
@@ -44,7 +47,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://www.deepspace6.net/projects/ipv6calc.html;
     license = licenses.gpl2;
-    platforms = with platforms; linux;
+    platforms = platforms.linux;
     maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/tools/networking/netsniff-ng/default.nix b/pkgs/tools/networking/netsniff-ng/default.nix
index 51d25ac16a4a..9df8045a2e94 100644
--- a/pkgs/tools/networking/netsniff-ng/default.nix
+++ b/pkgs/tools/networking/netsniff-ng/default.nix
@@ -33,8 +33,8 @@ stdenv.mkDerivation {
   postInstall = ''
     ln -sv ${geolite-legacy}/share/GeoIP/GeoIP.dat		$out/etc/netsniff-ng/country4.dat
     ln -sv ${geolite-legacy}/share/GeoIP/GeoIPv6.dat		$out/etc/netsniff-ng/country6.dat
-    ln -sv ${geolite-legacy}/share/GeoIP/GeoLiteCity.dat	$out/etc/netsniff-ng/city4.dat
-    ln -sv ${geolite-legacy}/share/GeoIP/GeoLiteCityv6.dat	$out/etc/netsniff-ng/city6.dat
+    ln -sv ${geolite-legacy}/share/GeoIP/GeoIPCity.dat		$out/etc/netsniff-ng/city4.dat
+    ln -sv ${geolite-legacy}/share/GeoIP/GeoIPCityv6.dat	$out/etc/netsniff-ng/city6.dat
     ln -sv ${geolite-legacy}/share/GeoIP/GeoIPASNum.dat		$out/etc/netsniff-ng/asname4.dat
     ln -sv ${geolite-legacy}/share/GeoIP/GeoIPASNumv6.dat	$out/etc/netsniff-ng/asname6.dat
     rm -v $out/etc/netsniff-ng/geoip.conf # updating databases after installation is impossible
diff --git a/pkgs/tools/networking/zerotierone/default.nix b/pkgs/tools/networking/zerotierone/default.nix
index 78c729678803..b08edaa0fc67 100644
--- a/pkgs/tools/networking/zerotierone/default.nix
+++ b/pkgs/tools/networking/zerotierone/default.nix
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
     homepage = https://www.zerotier.com;
     license = stdenv.lib.licenses.gpl3;
     maintainers = [ stdenv.lib.maintainers.sjmackenzie ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = with stdenv.lib; platforms.allBut [ "i686-linux" ];
   };
 }
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index d64e194e93e2..588aaf8b612e 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
     sha256 = "8a47cd7c35dfa628a4acfaef387e7451013c61d250bbcf1f38067a7c73f9f3e1";
   };
 
+  outputs = [ "out" "doc" ];
+
   nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ curl openssl sqlite ] ++ lib.optional stdenv.isLinux libsodium;
diff --git a/pkgs/tools/package-management/nixops/default.nix b/pkgs/tools/package-management/nixops/default.nix
index b85591b0695a..374026b75977 100644
--- a/pkgs/tools/package-management/nixops/default.nix
+++ b/pkgs/tools/package-management/nixops/default.nix
@@ -29,7 +29,7 @@ pythonPackages.buildPythonPackage rec {
         docdir=$out/share/doc/nixops mandir=$out/share/man
 
       mkdir -p $out/share/nix/nixops
-      cp -av nix/* $out/share/nix/nixops
+      cp -av "nix/"* $out/share/nix/nixops
 
       # Add openssh to nixops' PATH. On some platforms, e.g. CentOS and RHEL
       # the version of openssh is causing errors when have big networks (40+)
diff --git a/pkgs/tools/package-management/nixops/unstable.nix b/pkgs/tools/package-management/nixops/unstable.nix
index 6f10989f3c7a..2ad826b928b0 100644
--- a/pkgs/tools/package-management/nixops/unstable.nix
+++ b/pkgs/tools/package-management/nixops/unstable.nix
@@ -26,7 +26,7 @@ pythonPackages.buildPythonPackage rec {
     sha256 = "01n2ykszrnqr3kqqdg1n2l8wm38yhri7r3d7b0abklsslz9dlvmy";
   };
 
-  buildInputs = [ pythonPackages.nose pythonPackages.coverage ];
+  buildInputs = [ /* libxslt */ pythonPackages.nose pythonPackages.coverage ];
 
   propagatedBuildInputs =
     [ pythonPackages.prettytable
@@ -43,16 +43,17 @@ pythonPackages.buildPythonPackage rec {
       # Backward compatibility symlink.
       ln -s nixops $out/bin/charon
 
-      make -C doc/manual install \
+      # Documentation build is currently broken. Re-try with newer version.
+      : make -C doc/manual install nixops.1 docbookxsl=${docbook5_xsl}/xml/xsl/docbook \
         docdir=$out/share/doc/nixops mandir=$out/share/man
 
       mkdir -p $out/share/nix/nixops
-      cp -av nix/* $out/share/nix/nixops
+      cp -av "nix/"* $out/share/nix/nixops
 
       # Add openssh to nixops' PATH. On some platforms, e.g. CentOS and RHEL
       # the version of openssh is causing errors when have big networks (40+)
       wrapProgram $out/bin/nixops --prefix PATH : "${openssh}/bin"
-    ''; # */
+    '';
 
   meta = {
     homepage = https://github.com/NixOS/nixops;
diff --git a/pkgs/tools/security/sudo/default.nix b/pkgs/tools/security/sudo/default.nix
index 69ef5328868a..8c9d35333466 100644
--- a/pkgs/tools/security/sudo/default.nix
+++ b/pkgs/tools/security/sudo/default.nix
@@ -3,14 +3,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "sudo-1.8.14p1";
+  name = "sudo-1.8.14p3";
 
   src = fetchurl {
     urls =
       [ "ftp://ftp.sudo.ws/pub/sudo/${name}.tar.gz"
         "ftp://ftp.sudo.ws/pub/sudo/OLD/${name}.tar.gz"
       ];
-    sha256 = "1806kxnkjibky8y04s4f9mpj0403v4b6sqdnmyaa98mnq3qwsb5i";
+    sha256 = "0dqj1bq2jr4jxqfrd5yg0i42a6268scd0l28jic9118kn75rg9m8";
   };
 
   configureFlags = [
diff --git a/pkgs/tools/system/facter/default.nix b/pkgs/tools/system/facter/default.nix
new file mode 100644
index 000000000000..5a37262f8187
--- /dev/null
+++ b/pkgs/tools/system/facter/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, boost, cmake, curl, libyamlcpp, openssl, utillinux }:
+
+stdenv.mkDerivation rec {
+  name = "facter-${version}";
+  version = "3.0.2";
+  src = fetchurl {
+    url = "https://downloads.puppetlabs.com/facter/${name}.tar.gz";
+    sha256 = "1myf1r827bh3n0snkzwj2jnc0sax9bq6z1vv9gr90rqr73lixvig";
+  };
+
+  libyamlcpp_ = libyamlcpp.override { makePIC = true; };
+
+  buildInputs = [ boost cmake curl libyamlcpp_ openssl utillinux ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/puppetlabs/facter;
+    description = "A system inventory tool";
+    license = licenses.asl20;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/pkgs/tools/system/stress-ng/default.nix b/pkgs/tools/system/stress-ng/default.nix
index 4093eb7879d4..a2cff62e2c8b 100644
--- a/pkgs/tools/system/stress-ng/default.nix
+++ b/pkgs/tools/system/stress-ng/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, attr }:
 
-let version = "0.04.10"; in
+let version = "0.04.12"; in
 stdenv.mkDerivation rec {
   name = "stress-ng-${version}";
 
   src = fetchurl {
-    sha256 = "1y0jmcgwn8np22r3ajg7giai8dvfg0r5ddpgbiqs48cx2gz7iyhf";
+    sha256 = "0gc5mai1dzhb7n8wsy2kzx0q85zbsa2ilvc2fpa30ilcwmg28kgm";
     url = "http://kernel.ubuntu.com/~cking/tarballs/stress-ng/${name}.tar.gz";
   };
 
diff --git a/pkgs/tools/system/thermald/default.nix b/pkgs/tools/system/thermald/default.nix
index 85bc40caa274..9fe9adaedadb 100644
--- a/pkgs/tools/system/thermald/default.nix
+++ b/pkgs/tools/system/thermald/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, dbus_libs, dbus_glib, libxml2 }:
 
 stdenv.mkDerivation rec {
-  version = "1.4.2";
+  version = "1.4.3";
   name = "thermald-${version}";
   src = fetchFromGitHub {
     owner = "01org";
     repo = "thermal_daemon";
     rev = "v${version}";
-    sha256 = "051119wb0n31rn15pnx56d1r58a2d1fmj030q991mcv7pcy6c8mg";
+    sha256 = "1wrbydmw1jc5dcjawhhsa52hilzajl9n849i09d2nfilv3qcqqi9";
   };
 
   buildInputs = [ autoconf automake libtool pkgconfig dbus_libs dbus_glib libxml2 ];
diff --git a/pkgs/tools/text/colordiff/default.nix b/pkgs/tools/text/colordiff/default.nix
index 34221d803661..18eae754f4f8 100644
--- a/pkgs/tools/text/colordiff/default.nix
+++ b/pkgs/tools/text/colordiff/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, perl /*, xmlto */}:
 
 stdenv.mkDerivation {
-  name = "colordiff-1.0.13";
+  name = "colordiff-1.0.15";
 
   src = fetchurl {
-    url = http://www.colordiff.org/colordiff-1.0.13.tar.gz;
-    sha256 = "0akcz1p3klsjnhwcqdfq4grs6paljc5c0jzr3mqla5f862hhaa6f";
+    url = http://www.colordiff.org/colordiff-1.0.15.tar.gz;
+    sha256 = "0icx4v2h1gy08vhh3qqi2qfyfjp37vgj27hq1fnjz83bg7ly8pjr";
   };
 
   buildInputs = [ perl /* xmlto */ ];
@@ -19,5 +19,6 @@ stdenv.mkDerivation {
     homepage = http://www.colordiff.org/;
     license = licenses.gpl3;
     platforms = platforms.linux;
+    maintainer = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix
index b0421a8ed0d4..039bff8c655a 100644
--- a/pkgs/tools/text/groff/default.nix
+++ b/pkgs/tools/text/groff/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1998v2kcs288d3y7kfxpvl369nqi06zbbvjzafyvyl3pr7bajj1s";
   };
 
+  outputs = [ "out" "doc" ];
+
   enableParallelBuilding = false;
 
   buildInputs = [ ghostscript ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9c14725cce15..4b2824df5dc5 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -141,6 +141,8 @@ let
   # below).
   callPackage = newScope {};
 
+  callPackages = lib.callPackagesWith defaultScope;
+
   newScope = extra: lib.callPackageWith (defaultScope // extra);
 
   # Easily override this package set.
@@ -512,6 +514,10 @@ let
 
   findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh;
 
+  wrapGAppsHook = makeSetupHook {
+    deps = [ makeWrapper ];
+  } ../build-support/setup-hooks/wrap-gapps-hook.sh;
+
 
   ### TOOLS
 
@@ -755,6 +761,8 @@ let
 
   bochs = callPackage ../applications/virtualization/bochs { };
 
+  borg = callPackage ../tools/backup/borg { };
+
   boomerang = callPackage ../development/tools/boomerang { };
 
   boost-build = callPackage ../development/tools/boost-build { };
@@ -880,6 +888,8 @@ let
 
   filter_audio = callPackage ../development/libraries/filter_audio { };
 
+  fzf = callPackage ../tools/misc/fzf { };
+
   gist = callPackage ../tools/text/gist { };
 
   gmic = callPackage ../tools/graphics/gmic { };
@@ -958,6 +968,12 @@ let
     enableStandardFeatures = true;
   });
 
+  asciidoc-full-with-plugins = appendToName "full-with-plugins" (asciidoc.override {
+    inherit (pythonPackages) pygments;
+    enableStandardFeatures = true;
+    enableExtraPlugins = true;
+  });
+
   autossh = callPackage ../tools/networking/autossh { };
 
   asynk = callPackage ../tools/networking/asynk { };
@@ -1411,7 +1427,7 @@ let
 
   evtest = callPackage ../applications/misc/evtest { };
 
-  exempi = callPackage ../development/libraries/exempi { boost = boost155; };
+  exempi = callPackage ../development/libraries/exempi { };
 
   execline = callPackage ../tools/misc/execline { };
 
@@ -1497,6 +1513,8 @@ let
 
   libbladeRF = callPackage ../development/libraries/libbladeRF { };
 
+  lp_solve = callPackage ../applications/science/math/lp_solve { };
+
   lprof = callPackage ../tools/graphics/lprof { };
 
   fdk_aac = callPackage ../development/libraries/fdk-aac { };
@@ -1836,6 +1854,8 @@ let
 
   honcho = callPackage ../tools/system/honcho { };
 
+  horst = callPackage ../tools/networking/horst { };
+
   host = callPackage ../tools/networking/host { };
 
   hping = callPackage ../tools/networking/hping { };
@@ -1884,6 +1904,8 @@ let
     inherit (perlPackages) MailIMAPClient;
   };
 
+  imgurbash = callPackage ../tools/graphics/imgurbash { };
+
   inadyn = callPackage ../tools/networking/inadyn { };
 
   inetutils = callPackage ../tools/networking/inetutils { };
@@ -2197,7 +2219,7 @@ let
   mfoc = callPackage ../tools/security/mfoc { };
 
   minecraft = callPackage ../games/minecraft {
-    pulseaudioSupport = config.pulseaudio or true;
+    useAlsa = config.minecraft.alsa or false;
   };
 
   minecraft-server = callPackage ../games/minecraft-server { };
@@ -2731,6 +2753,8 @@ let
 
   openmpi = callPackage ../development/libraries/openmpi { };
 
+  openmodelica = callPackage ../applications/science/misc/openmodelica { };
+
   qarte = callPackage ../applications/video/qarte {
     sip = pythonPackages.sip_4_16;
   };
@@ -2925,6 +2949,8 @@ let
 
   shellinabox = callPackage ../servers/shellinabox { };
 
+  sic = callPackage ../applications/networking/irc/sic { };
+
   siege = callPackage ../tools/networking/siege {};
 
   sigil = callPackage ../applications/editors/sigil { };
@@ -3095,7 +3121,6 @@ let
   texmacs = callPackage ../applications/editors/texmacs {
     tex = texLive; /* tetex is also an option */
     extraFonts = true;
-    guile = guile_1_8;
   };
 
   texmaker = callPackage ../applications/editors/texmaker { };
@@ -3132,9 +3157,7 @@ let
 
   torbutton = callPackage ../tools/security/torbutton { };
 
-  torbrowser = callPackage ../tools/security/tor/torbrowser.nix {
-    stdenv = overrideCC stdenv gcc49;
-  };
+  torbrowser = callPackage ../tools/security/tor/torbrowser.nix { };
 
   touchegg = callPackage ../tools/inputmethods/touchegg { };
 
@@ -3438,7 +3461,9 @@ let
 
   wv2 = callPackage ../tools/misc/wv2 { };
 
-  wyrd = callPackage ../tools/misc/wyrd { };
+  wyrd = callPackage ../tools/misc/wyrd {
+    inherit (ocamlPackages) camlp4;
+  };
 
   x86info = callPackage ../os-specific/linux/x86info { };
 
@@ -3839,7 +3864,7 @@ let
     isl = isl_0_14;
   }));
 
-  gfortran = if !stdenv.isDarwin then gfortran48
+  gfortran = if !stdenv.isDarwin then gfortran49
              else callPackage ../development/compilers/gcc/gfortran-darwin.nix {};
 
   gfortran48 = wrapCC (gcc48.cc.override {
@@ -3850,6 +3875,14 @@ let
     profiledCompiler = false;
   });
 
+  gfortran49 = wrapCC (gcc49.cc.override {
+    name = "gfortran";
+    langFortran = true;
+    langCC = false;
+    langC = false;
+    profiledCompiler = false;
+  });
+
   gcj = gcj48;
 
   gcj48 = wrapCC (gcc48.cc.override {
@@ -3960,7 +3993,9 @@ let
     overrides = config.haskellPackageOverrides or (self: super: {});
   };
 
-  haxe = callPackage ../development/compilers/haxe { };
+  haxe = callPackage ../development/compilers/haxe {
+    inherit (ocamlPackages) camlp4;
+  };
   hxcpp = callPackage ../development/compilers/haxe/hxcpp.nix { };
 
   hhvm = callPackage ../development/compilers/hhvm { };
@@ -4121,24 +4156,21 @@ let
   llvm_36 = llvmPackages_36.llvm;
   llvm_35 = llvmPackages_35.llvm;
   llvm_34 = llvmPackages_34.llvm;
-  llvm_33 = llvm_v ../development/compilers/llvm/3.3/llvm.nix;
+  llvm_33 = callPackage ../development/compilers/llvm/3.3/llvm.nix { };
 
-  llvm_v = path: callPackage path { };
+  llvmPackages = recurseIntoAttrs llvmPackages_36;
 
-  llvmPackages = llvmPackages_36;
+  llvmPackagesSelf = llvmPackages_34.override {
+    stdenv = libcxxStdenv;
+  };
 
-  llvmPackages_34 = recurseIntoAttrs (import ../development/compilers/llvm/3.4 {
-    inherit stdenv newScope fetchurl;
+  llvmPackages_34 = callPackage ../development/compilers/llvm/3.4 {
     isl = isl_0_12;
-  });
-  llvmPackagesSelf = import ../development/compilers/llvm/3.4 { inherit newScope fetchurl; isl = isl_0_12; stdenv = libcxxStdenv; };
-
-  llvmPackages_35 = import ../development/compilers/llvm/3.5 {
-    inherit pkgs stdenv newScope fetchurl isl;
   };
 
-  llvmPackages_36 = import ../development/compilers/llvm/3.6 {
-    inherit pkgs stdenv newScope fetchurl isl wrapCC;
+  llvmPackages_35 = callPackage ../development/compilers/llvm/3.5 { };
+
+  llvmPackages_36 = callPackage ../development/compilers/llvm/3.6 {
     inherit (stdenvAdapters) overrideCC;
   };
 
@@ -4695,7 +4727,9 @@ let
   sdcc = callPackage ../development/compilers/sdcc { };
 
   smlnjBootstrap = callPackage ../development/compilers/smlnj/bootstrap.nix { };
-  smlnj = callPackage_i686 ../development/compilers/smlnj { };
+  smlnj = if stdenv.isDarwin
+            then callPackage ../development/compilers/smlnj { }
+            else callPackage_i686 ../development/compilers/smlnj { };
 
   sqldeveloper = callPackage ../development/tools/database/sqldeveloper { };
 
@@ -5413,6 +5447,8 @@ let
 
   dfu-programmer = callPackage ../development/tools/misc/dfu-programmer { };
 
+  dfu-util = callPackage ../development/tools/misc/dfu-util { };
+
   ddd = callPackage ../development/tools/misc/ddd { };
 
   distcc = callPackage ../development/tools/misc/distcc { };
@@ -5614,6 +5650,8 @@ let
   omake = callPackage ../development/tools/ocaml/omake { };
   omake_rc1 = callPackage ../development/tools/ocaml/omake/0.9.8.6-rc1.nix { };
 
+  omniorb = callPackage ../development/tools/omniorb { };
+
   opengrok = callPackage ../development/tools/misc/opengrok { };
 
   openocd = callPackage ../development/tools/misc/openocd { };
@@ -5732,12 +5770,10 @@ let
 
   strace = callPackage ../development/tools/misc/strace { };
 
-  swig = callPackage ../development/tools/misc/swig { };
-
+  swig1 = callPackage ../development/tools/misc/swig { };
   swig2 = callPackage ../development/tools/misc/swig/2.x.nix { };
-
   swig3 = callPackage ../development/tools/misc/swig/3.x.nix { };
-
+  swig = swig3;
   swigWithJava = swig;
 
   swfmill = callPackage ../tools/video/swfmill { };
@@ -5758,7 +5794,9 @@ let
 
   texi2html = callPackage ../development/tools/misc/texi2html { };
 
-  uhd = callPackage ../development/tools/misc/uhd { };
+  uhd = callPackage ../development/tools/misc/uhd {
+    boost = boost157;
+  };
 
   uisp = callPackage ../development/tools/misc/uisp { };
 
@@ -5891,7 +5929,8 @@ let
   boost155 = callPackage ../development/libraries/boost/1.55.nix { };
   boost156 = callPackage ../development/libraries/boost/1.56.nix { };
   boost157 = callPackage ../development/libraries/boost/1.57.nix { };
-  boost = boost157;
+  boost158 = callPackage ../development/libraries/boost/1.58.nix { };
+  boost = boost158;
 
   boost_process = callPackage ../development/libraries/boost-process { };
 
@@ -6384,18 +6423,16 @@ let
 
   gnutls = gnutls34;
 
-  gnutls33 = callPackage ../development/libraries/gnutls/3.3.nix {
+  gnutls33 = import ../development/libraries/gnutls/3.3.nix {
+    inherit callPackage fetchurl;
     guileBindings = config.gnutls.guile or false;
   };
 
-  gnutls34 = callPackage ../development/libraries/gnutls/3.4.nix {
+  gnutls34 = import ../development/libraries/gnutls/3.4.nix {
+    inherit callPackage fetchurl;
     guileBindings = config.gnutls.guile or false;
   };
 
-  gnutls33_with_guile = lowPrio (gnutls33.override { guileBindings = true; });
-
-  gnutls34_with_guile = lowPrio (gnutls34.override { guileBindings = true; });
-
   gpac = callPackage ../applications/video/gpac { };
 
   gpgme = callPackage ../development/libraries/gpgme {
@@ -6507,6 +6544,8 @@ let
 
   herqq = callPackage ../development/libraries/herqq { };
 
+  heyefi = haskellPackages.heyefi;
+
   hidapi = callPackage ../development/libraries/hidapi {
     libusb = libusb1;
   };
@@ -7600,9 +7639,7 @@ let
     sslSupport = true;
   };
 
-  nethack = builderDefsPackage (import ../games/nethack) {
-    inherit ncurses flex bison;
-  };
+  nethack = callPackage ../games/nethack { };
 
   nettle27 = callPackage ../development/libraries/nettle/27.nix { };
   nettle = callPackage ../development/libraries/nettle { };
@@ -7821,6 +7858,7 @@ let
   postgis = callPackage ../development/libraries/postgis { };
 
   protobuf = protobuf2_6;
+  protobuf3_0 = lowPrio (callPackage ../development/libraries/protobuf/3.0.nix { });
   protobuf2_6 = callPackage ../development/libraries/protobuf/2.6.nix { };
   protobuf2_5 = callPackage ../development/libraries/protobuf/2.5.nix { };
 
@@ -8245,6 +8283,8 @@ let
     gnutls = gnutls;
   });
 
+  unnethack = callPackage ../games/unnethack { };
+
   v8_3_16_14 = callPackage ../development/libraries/v8/3.16.14.nix {
     inherit (pythonPackages) gyp;
     stdenv = overrideCC stdenv gcc48;
@@ -8516,7 +8556,9 @@ let
 
   lucene = callPackage ../development/libraries/java/lucene { };
 
-  lucenepp = callPackage ../development/libraries/lucene++ { };
+  lucenepp = callPackage ../development/libraries/lucene++ {
+    boost = boost157;
+  };
 
   mockobjects = callPackage ../development/libraries/java/mockobjects { };
 
@@ -9076,17 +9118,14 @@ let
     libmemcached = null; # Detection is broken upstream
   };
 
-  postgresql = postgresql92;
-
-  postgresql90 = callPackage ../servers/sql/postgresql/9.0.x.nix { };
-
-  postgresql91 = callPackage ../servers/sql/postgresql/9.1.x.nix { };
+  postgresql = postgresql94;
 
-  postgresql92 = callPackage ../servers/sql/postgresql/9.2.x.nix { };
-
-  postgresql93 = callPackage ../servers/sql/postgresql/9.3.x.nix { };
-
-  postgresql94 = callPackage ../servers/sql/postgresql/9.4.x.nix { };
+  inherit (callPackages ../servers/sql/postgresql { })
+    postgresql90
+    postgresql91
+    postgresql92
+    postgresql93
+    postgresql94;
 
   postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };
 
@@ -9135,9 +9174,7 @@ let
 
   restund = callPackage ../servers/restund {};
 
-  rethinkdb = callPackage ../servers/nosql/rethinkdb {
-    boost = boost155;
-  };
+  rethinkdb = callPackage ../servers/nosql/rethinkdb { };
 
   rippled = callPackage ../servers/rippled {
     boost = boost157;
@@ -9258,7 +9295,7 @@ let
   xorg = recurseIntoAttrs (import ../servers/x11/xorg/default.nix {
     inherit clangStdenv fetchurl fetchgit fetchpatch stdenv pkgconfig intltool freetype fontconfig
       libxslt expat libpng zlib perl mesa_drivers spice_protocol
-      dbus libuuid openssl gperf m4 libevdev tradcpp libinput makeWrapper
+      dbus libuuid openssl gperf m4 libevdev tradcpp libinput makeWrapper autoreconfHook
       autoconf automake libtool xmlto asciidoc flex bison python mtdev pixman;
     bootstrap_cmds = if stdenv.isDarwin then darwin.bootstrap_cmds else null;
     mesa = mesa_noglu;
@@ -9323,7 +9360,7 @@ let
     perl = perl516; # ${perl}/.../CORE/handy.h:124:34: error: 'bool' undeclared
   };
 
-  apparmor_2_9 = callPackage ../os-specific/linux/apparmor/2.9 { swig = swig2; };
+  apparmor_2_9 = callPackage ../os-specific/linux/apparmor/2.9 { };
   libapparmor = apparmor_2_9.libapparmor;
   apparmor-pam = apparmor_2_9.apparmor-pam;
   apparmor-parser = apparmor_2_9.apparmor-parser;
@@ -10662,7 +10699,9 @@ let
 
   schismtracker = callPackage ../applications/audio/schismtracker { };
 
-  altcoins = recurseIntoAttrs ( callPackage ../applications/altcoins { } );
+  altcoins = recurseIntoAttrs ( callPackage ../applications/altcoins {
+    callPackage = newScope { boost = boost157; };
+  } );
   bitcoin = altcoins.bitcoin;
 
   aumix = callPackage ../applications/audio/aumix {
@@ -10802,6 +10841,10 @@ let
 
   chatzilla = callPackage ../applications/networking/irc/chatzilla { };
 
+  chirp = callPackage ../applications/misc/chirp {
+    inherit (pythonPackages) pyserial pygtk;
+  };
+
   chromium = callPackage ../applications/networking/browsers/chromium {
     channel = "stable";
     pulseSupport = config.pulseaudio or true;
@@ -10829,7 +10872,6 @@ let
   clipit = callPackage ../applications/misc/clipit { };
 
   bomi = callPackage ../applications/video/bomi {
-    stdenv = overrideCC stdenv gcc49;
     pulseSupport = config.pulseaudio or true;
   };
 
@@ -10918,6 +10960,8 @@ let
 
   diffuse = callPackage ../applications/version-management/diffuse { };
 
+  direwolf = callPackage ../applications/misc/direwolf { };
+
   dirt = callPackage ../applications/audio/dirt {};
 
   distrho = callPackage ../applications/audio/distrho {};
@@ -11400,7 +11444,9 @@ let
     cmake = cmake-2_8;
   };
 
-  freicoin = callPackage ../applications/misc/freicoin { };
+  freicoin = callPackage ../applications/misc/freicoin {
+    boost = boost157;
+  };
 
   fuze = callPackage ../applications/networking/instant-messengers/fuze {};
 
@@ -11584,8 +11630,15 @@ let
 
   guvcview = callPackage ../os-specific/linux/guvcview { };
 
+  gxmessage = callPackage ../applications/misc/gxmessage { };
+
   hackrf = callPackage ../applications/misc/hackrf { };
 
+  hamster-time-tracker = callPackage ../applications/misc/hamster-time-tracker {
+    inherit (pythonPackages) pyxdg pygtk dbus sqlite3;
+    inherit (gnome) gnome_python;
+  };
+
   hello = callPackage ../applications/misc/hello/ex-2 { };
 
   helmholtz = callPackage ../applications/audio/pd-plugins/helmholtz { };
@@ -11635,7 +11688,10 @@ let
 
   i810switch = callPackage ../os-specific/linux/i810switch { };
 
-  icewm = callPackage ../applications/window-managers/icewm { };
+  icewm = callPackage ../applications/window-managers/icewm {
+    inherit (xlibs) libX11 libXft libXext libXinerama
+      libXrandr libICE libSM;
+  };
 
   id3v2 = callPackage ../applications/audio/id3v2 { };
 
@@ -11653,40 +11709,25 @@ let
   };
 
   imagemagick_light = imagemagick.override {
-    libcl = null;
-    perl = null;
-    jemalloc = null;
     bzip2 = null;
     zlib = null;
     libX11 = null;
     libXext = null;
     libXt = null;
-    dejavu_fonts = null;
-    fftw = null;
-    libfpx = null;
-    djvulibre = null;
     fontconfig = null;
     freetype = null;
     ghostscript = null;
-    graphviz = null;
-    jbigkit = null;
     libjpeg = null;
     lcms2 = null;
-    openjpeg = null;
-    liblqr1 = null;
-    xz = null;
     openexr = null;
-    pango = null;
     libpng = null;
     librsvg = null;
     libtiff = null;
-    libwebp = null;
     libxml2 = null;
   };
 
   imagemagick = callPackage ../applications/graphics/ImageMagick {
-    ghostscript = if stdenv.isDarwin then null else ghostscript;
-    perl = null; # Currently Broken
+    ghostscript = null;
   };
 
   imagemagickBig = imagemagick;
@@ -11840,7 +11881,6 @@ let
     inherit (perlPackages) ArchiveZip CompressZlib;
     inherit (gnome) GConf ORBit2 gnome_vfs;
     zip = zip.override { enableNLS = false; };
-    #boost = boost155;
     #glm = glm_0954;
     bluez5 = bluez5_28;
     fontsConf = makeFontsConf {
@@ -11866,7 +11906,9 @@ let
   links = callPackage ../applications/networking/browsers/links { };
 
   ledger2 = callPackage ../applications/office/ledger/2.6.3.nix { };
-  ledger3 = callPackage ../applications/office/ledger { };
+  ledger3 = callPackage ../applications/office/ledger {
+    boost = boost157;
+  };
   ledger = ledger3;
 
   lighttable = callPackage ../applications/editors/lighttable {};
@@ -12070,6 +12112,8 @@ let
     inherit (lua51Packages) luafilesystem lrexlib luazip luasqlite3;
   };
 
+  multimon-ng = callPackage ../applications/misc/multimon-ng { };
+
   multisync = callPackage ../applications/misc/multisync {
     inherit (gnome) ORBit2 libbonobo libgnomeui GConf;
   };
@@ -12103,6 +12147,10 @@ let
 
   openshift = callPackage ../applications/networking/cluster/openshift { };
 
+  oroborus = callPackage ../applications/window-managers/oroborus {
+    inherit (xlibs) libSM libICE libXt libXaw libXmu libXext libXft libXpm libXrandr libXrender xextproto libXinerama;
+  };
+
   panamax_api = callPackage ../applications/networking/cluster/panamax/api {
     ruby = ruby_2_1;
   };
@@ -12124,6 +12172,10 @@ let
     ruby = ruby_1_9_3.override { cursesSupport = true; };
   };
 
+  synapse = callPackage ../applications/misc/synapse {
+    inherit (gnome3) libgee;
+  };
+
   synfigstudio = callPackage ../applications/graphics/synfigstudio {
     fontsConf = makeFontsConf { fontDirectories = [ freefont_ttf ]; };
   };
@@ -12301,6 +12353,8 @@ let
 
   pidginmsnpecan = callPackage ../applications/networking/instant-messengers/pidgin-plugins/msn-pecan { };
 
+  pidgin-mra = callPackage ../applications/networking/instant-messengers/pidgin-plugins/pidgin-mra { };
+
   pidginotr = callPackage ../applications/networking/instant-messengers/pidgin-plugins/otr { };
 
   pidginsipe = callPackage ../applications/networking/instant-messengers/pidgin-plugins/sipe { };
@@ -12309,6 +12363,8 @@ let
 
   purple-plugin-pack = callPackage ../applications/networking/instant-messengers/pidgin-plugins/purple-plugin-pack { };
 
+  purple-vk-plugin = callPackage ../applications/networking/instant-messengers/pidgin-plugins/purple-vk-plugin { };
+
   toxprpl = callPackage ../applications/networking/instant-messengers/pidgin-plugins/tox-prpl { };
 
   pithos = callPackage ../applications/audio/pithos {
@@ -12333,6 +12389,8 @@ let
 
   pond = callPackage ../applications/networking/pond { goPackages = go14Packages; };
 
+  ponymix = callPackage ../applications/audio/ponymix { };
+
   potrace = callPackage ../applications/graphics/potrace {};
 
   posterazor = callPackage ../applications/misc/posterazor { };
@@ -12621,6 +12679,8 @@ let
 
   cura = callPackage ../applications/misc/cura { };
 
+  peru = callPackage ../applications/version-management/peru {};
+
   printrun = callPackage ../applications/misc/printrun { };
 
   sddm = callPackage ../applications/display-managers/sddm { };
@@ -12931,6 +12991,8 @@ let
 
   qpdfview = callPackage ../applications/misc/qpdfview {};
 
+  qtile = callPackage ../applications/window-managers/qtile { };
+
   qvim = lowPrio (callPackage ../applications/editors/vim/qvim.nix {
     inherit (pkgs) fetchgit stdenv ncurses pkgconfig gettext
       composableDerivation lib config python perl tcl ruby qt4;
@@ -13390,8 +13452,7 @@ let
   zathuraCollection = recurseIntoAttrs
     (let callPackage = newScope pkgs.zathuraCollection; in
       import ../applications/misc/zathura {
-        inherit callPackage pkgs fetchurl lib;
-        stdenv = overrideCC stdenv gcc49;
+        inherit stdenv callPackage pkgs fetchurl lib;
         useMupdf = config.zathura.useMupdf or false;
       });
 
@@ -13405,7 +13466,6 @@ let
 
   girara = callPackage ../applications/misc/girara {
     gtk = gtk3;
-    stdenv = overrideCC stdenv gcc49;
   };
 
   girara-light = callPackage ../applications/misc/girara {
@@ -14091,6 +14151,8 @@ let
 
   kde5 = kf5_stable // plasma5_stable // kdeApps_stable;
 
+  theme-vertex = callPackage ../misc/themes/vertex { };
+
   xfce = xfce4-12;
   xfce4-12 = recurseIntoAttrs (import ../desktops/xfce { inherit config pkgs newScope; });
 
@@ -15102,4 +15164,6 @@ let
 
   udevil = callPackage ../applications/misc/udevil {};
 
+  facter = callPackage ../tools/system/facter {};
+
 }; in self; in pkgs
diff --git a/pkgs/top-level/go-packages.nix b/pkgs/top-level/go-packages.nix
index b20443674c05..448c94e0602a 100644
--- a/pkgs/top-level/go-packages.nix
+++ b/pkgs/top-level/go-packages.nix
@@ -6,38 +6,34 @@
 let
   isGo13 = go.meta.branch == "1.3";
   isGo14 = go.meta.branch == "1.4";
+
+  buildFromGitHub = { rev, owner, repo, sha256, name ? repo, goPackagePath ? "github.com/${owner}/${repo}", ... }@args: buildGoPackage (args // {
+    inherit rev goPackagePath;
+    name = "${name}-${stdenv.lib.strings.substring 0 7 rev}";
+    src  = fetchFromGitHub { inherit rev owner repo sha256; };
+  });
+
   self = _self // overrides; _self = with self; {
 
   inherit go buildGoPackage;
 
   ## OFFICIAL GO PACKAGES
 
-  crypto = buildGoPackage rec {
-    rev = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
-    name = "crypto-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "golang.org/x/crypto";
-    goPackageAliases = [ "code.google.com/p/go.crypto" ];
+  crypto = buildFromGitHub {
+    rev      = "4d48e5fa3d62b5e6e71260571bf76c767198ca02";
     disabled = isGo13;
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "golang";
-      repo   = "crypto";
-      sha256 = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
-    };
+    owner    = "golang";
+    repo     = "crypto";
+    sha256   = "0plvjv56afb02p7l3c2zfwffnhscmc3f0ckj1gls9ay6vj85y7l8";
+    goPackagePath    = "golang.org/x/crypto";
+    goPackageAliases = [ "code.google.com/p/go.crypto" ];
   };
 
-  glog = buildGoPackage rec {
-    rev = "44145f04b68cf362d9c4df2182967c2275eaefed";
-    name = "glog-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/golang/glog";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "golang";
-      repo = "glog";
-      sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
-    };
+  glog = buildFromGitHub {
+    rev    = "44145f04b68cf362d9c4df2182967c2275eaefed";
+    owner  = "golang";
+    repo   = "glog";
+    sha256 = "1k7sf6qmpgm0iw81gx2dwggf9di6lgw0n54mni7862hihwfrb5rq";
   };
 
   image = buildGoPackage rec {
@@ -162,30 +158,18 @@ let
 
   ## THIRD PARTY
 
-  airbrake-go = buildGoPackage rec {
-    rev = "5b5e269e1bc398d43f67e43dafff3414a59cd5a2";
-    name = "airbrake-go-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/tobi/airbrake-go";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "tobi";
-      repo   = "airbrake-go";
-      sha256 = "1bps4y3vpphpj63mshjg2aplh579cvqac0hz7qzvac0d1fqcgkdz";
-    };
+  airbrake-go = buildFromGitHub {
+    rev    = "5b5e269e1bc398d43f67e43dafff3414a59cd5a2";
+    owner  = "tobi";
+    repo   = "airbrake-go";
+    sha256 = "1bps4y3vpphpj63mshjg2aplh579cvqac0hz7qzvac0d1fqcgkdz";
   };
 
-  ansicolor = buildGoPackage rec {
-    rev = "8368d3b31cf6f2c2464c7a91675342c9a0ac6658";
-    name = "ansicolor-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/shiena/ansicolor";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "shiena";
-      repo   = "ansicolor";
-      sha256 = "1fyn06vxm44s0ph8pr7r9gkab1f4x851zlyy3p6jbbwsa6an8g9w";
-    };
+  ansicolor = buildFromGitHub {
+    rev    = "8368d3b31cf6f2c2464c7a91675342c9a0ac6658";
+    owner  = "shiena";
+    repo   = "ansicolor";
+    sha256 = "1fyn06vxm44s0ph8pr7r9gkab1f4x851zlyy3p6jbbwsa6an8g9w";
   };
 
   asn1-ber = buildGoPackage rec {
@@ -252,42 +236,25 @@ let
     buildInputs = [ go-ini net sandblast ];
   };
 
-  binarydist = buildGoPackage rec {
-    rev = "9955b0ab8708602d411341e55fffd7e0700f86bd";
-    name = "binarydist-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/kr/binarydist";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "kr";
-      repo = "binarydist";
-      sha256 = "11wncbbbrdcxl5ff3h6w8vqfg4bxsf8709mh6vda0cv236flkyn3";
-    };
+  binarydist = buildFromGitHub {
+    rev    = "9955b0ab8708602d411341e55fffd7e0700f86bd";
+    owner  = "kr";
+    repo   = "binarydist";
+    sha256 = "11wncbbbrdcxl5ff3h6w8vqfg4bxsf8709mh6vda0cv236flkyn3";
   };
 
-  bolt = buildGoPackage rec {
-    rev = "957d850b5158a4eebf915476058e720f43459584";
-    name = "bolt-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/boltdb/bolt";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "boltdb";
-      repo = "bolt";
-      sha256 = "193adhhsqdy0kyq1l1fi8pg2n6pwyrw4h607qm78qyi26f8i7vzf";
-    };
+  bolt = buildFromGitHub {
+    rev    = "957d850b5158a4eebf915476058e720f43459584";
+    owner  = "boltdb";
+    repo   = "bolt";
+    sha256 = "193adhhsqdy0kyq1l1fi8pg2n6pwyrw4h607qm78qyi26f8i7vzf";
   };
 
-  bufio = buildGoPackage rec {
-    rev = "24e7e48f60fc2d9e99e43c07485d9fff42051e66";
-    name = "bufio-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/vmihailenco/bufio";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "vmihailenco";
-      repo = "bufio";
-      sha256 = "0x46qnf2f15v7m0j2dcb16raxjamk5rdc7hqwgyxfr1sqmmw3983";
-    };
+  bufio = buildFromGitHub {
+    rev    = "24e7e48f60fc2d9e99e43c07485d9fff42051e66";
+    owner  = "vmihailenco";
+    repo   = "bufio";
+    sha256 = "0x46qnf2f15v7m0j2dcb16raxjamk5rdc7hqwgyxfr1sqmmw3983";
   };
 
   bugsnag-go = buildGoPackage rec {
@@ -333,17 +300,11 @@ let
     };
   };
 
-  circbuf = buildGoPackage rec {
-    rev = "f092b4f207b6e5cce0569056fba9e1a2735cb6cf";
-    name = "circbuf-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/armon/circbuf";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "armon";
-      repo = "circbuf";
-      sha256 = "06kwwdwa3hskdh6ws7clj1vim80dyc3ldim8k9y5qpd30x0avn5s";
-    };
+  circbuf = buildFromGitHub {
+    rev    = "f092b4f207b6e5cce0569056fba9e1a2735cb6cf";
+    owner  = "armon";
+    repo   = "circbuf";
+    sha256 = "06kwwdwa3hskdh6ws7clj1vim80dyc3ldim8k9y5qpd30x0avn5s";
   };
 
   cli = buildGoPackage rec {
@@ -361,16 +322,11 @@ let
     propagatedBuildInputs = [ crypto ];
   };
 
-  cli-spinner = buildGoPackage rec {
-    rev = "610063bb4aeef25f7645b3e6080456655ec0fb33";
-    name = "cli-spinner-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/cli-spinner";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "cli-spinner";
-      sha256 = "13wzs2qrxd72ah32ym0ppswhvyimjw5cqaq3q153y68vlvxd048c";
-    };
+  cli-spinner = buildFromGitHub {
+    rev    = "610063bb4aeef25f7645b3e6080456655ec0fb33";
+    owner  = "odeke-em";
+    repo   = "cli-spinner";
+    sha256 = "13wzs2qrxd72ah32ym0ppswhvyimjw5cqaq3q153y68vlvxd048c";
   };
 
   cobra = buildGoPackage rec {
@@ -386,29 +342,18 @@ let
     propagatedBuildInputs = [ pflag ];
   };
 
-  columnize = buildGoPackage rec {
-    rev = "44cb4788b2ec3c3d158dd3d1b50aba7d66f4b59a";
-    name = "columnize-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/ryanuber/columnize";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "ryanuber";
-      repo = "columnize";
-      sha256 = "1qrqr76cw58x2hkjic6h88na5ihgvkmp8mqapj8kmjcjzdxkzhr9";
-    };
+  columnize = buildFromGitHub {
+    rev    = "44cb4788b2ec3c3d158dd3d1b50aba7d66f4b59a";
+    owner  = "ryanuber";
+    repo   = "columnize";
+    sha256 = "1qrqr76cw58x2hkjic6h88na5ihgvkmp8mqapj8kmjcjzdxkzhr9";
   };
 
-  command = buildGoPackage rec {
-    rev = "076a2ad5f3a7ec92179f2d57208728432280ec4e";
-    name = "command-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/command";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "command";
-      sha256 = "093as4kxlabk3hrsd52kr9fhl6qafr4ghg89cjyglsva0mk0n7sb";
-    };
+  command = buildFromGitHub {
+    rev    = "076a2ad5f3a7ec92179f2d57208728432280ec4e";
+    owner  = "odeke-em";
+    repo   = "command";
+    sha256 = "093as4kxlabk3hrsd52kr9fhl6qafr4ghg89cjyglsva0mk0n7sb";
   };
 
   copystructure = buildGoPackage rec {
@@ -440,17 +385,11 @@ let
     subPackages = [ "./" ];
   };
 
-  config = buildGoPackage rec {
-    rev = "0f78529c8c7e3e9a25f15876532ecbc07c7d99e6";
-    name = "config-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/robfig/config";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "robfig";
-      repo = "config";
-      sha256 = "0xmxy8ay0wzd307x7xba3rmigvr6rjlpfk9fmn6ir2nc97ifv3i0";
-    };
+  config = buildFromGitHub {
+    rev    = "0f78529c8c7e3e9a25f15876532ecbc07c7d99e6";
+    owner  = "robfig";
+    repo   = "config";
+    sha256 = "0xmxy8ay0wzd307x7xba3rmigvr6rjlpfk9fmn6ir2nc97ifv3i0";
   };
 
   consul = buildGoPackage rec {
@@ -598,42 +537,25 @@ let
     };
   };
 
-  dns = buildGoPackage rec {
-    rev = "bb1103f648f811d2018d4bedcb2d4b2bce34a0f1";
-    name = "dns-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/miekg/dns";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "miekg";
-      repo = "dns";
-      sha256 = "1c1gasvzlcmgwyqhksm656p03nc76kxjxllbcw9bwfy5v7p9w7qq";
-    };
+  dns = buildFromGitHub {
+    rev    = "bb1103f648f811d2018d4bedcb2d4b2bce34a0f1";
+    owner  = "miekg";
+    repo   = "dns";
+    sha256 = "1c1gasvzlcmgwyqhksm656p03nc76kxjxllbcw9bwfy5v7p9w7qq";
   };
 
-  docopt-go = buildGoPackage rec {
-    rev = "854c423c810880e30b9fecdabb12d54f4a92f9bb";
-    name = "docopt-go-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/docopt/docopt-go";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "docopt";
-      repo = "docopt-go";
-      sha256 = "1sddkxgl1pwlipfvmv14h8vg9b9wq1km427j1gjarhb5yfqhh3l1";
-    };
+  docopt-go = buildFromGitHub {
+    rev    = "854c423c810880e30b9fecdabb12d54f4a92f9bb";
+    owner  = "docopt";
+    repo   = "docopt-go";
+    sha256 = "1sddkxgl1pwlipfvmv14h8vg9b9wq1km427j1gjarhb5yfqhh3l1";
   };
 
-  dts = buildGoPackage rec {
-    rev = "ec2daabf2f9078e887405f7bcddb3d79cb65502d";
-    name = "dts-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/dts";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "dts";
-      sha256 = "0vq3cz4ab9vdsz9s0jjlp7z27w218jjabjzsh607ps4i8m5d441s";
-    };
+  dts = buildFromGitHub {
+    rev    = "ec2daabf2f9078e887405f7bcddb3d79cb65502d";
+    owner  = "odeke-em";
+    repo   = "dts";
+    sha256 = "0vq3cz4ab9vdsz9s0jjlp7z27w218jjabjzsh607ps4i8m5d441s";
   };
 
   ed25519 = buildGoPackage rec {
@@ -647,17 +569,11 @@ let
     };
   };
 
-  errwrap = buildGoPackage rec {
-    rev = "7554cd9344cec97297fa6649b055a8c98c2a1e55";
-    name = "errwrap-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/errwrap";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "errwrap";
-      sha256 = "0kmv0p605di6jc8i1778qzass18m0mv9ks9vxxrfsiwcp4la82jf";
-    };
+  errwrap = buildFromGitHub {
+    rev    = "7554cd9344cec97297fa6649b055a8c98c2a1e55";
+    owner  = "hashicorp";
+    repo   = "errwrap";
+    sha256 = "0kmv0p605di6jc8i1778qzass18m0mv9ks9vxxrfsiwcp4la82jf";
   };
 
   fsnotify.v0 = buildGoPackage rec {
@@ -687,16 +603,11 @@ let
     };
   };
 
-  g2s = buildGoPackage rec {
-    rev = "ec76db4c1ac16400ac0e17ca9c4840e1d23da5dc";
-    name = "g2s-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/peterbourgon/g2s";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "peterbourgon";
-      repo   = "g2s";
-      sha256 = "1p4p8755v2nrn54rik7yifpg9szyg44y5rpp0kryx4ycl72307rj";
-    };
+  g2s = buildFromGitHub {
+    rev    = "ec76db4c1ac16400ac0e17ca9c4840e1d23da5dc";
+    owner  = "peterbourgon";
+    repo   = "g2s";
+    sha256 = "1p4p8755v2nrn54rik7yifpg9szyg44y5rpp0kryx4ycl72307rj";
   };
 
   gcloud-golang = buildGoPackage rec {
@@ -733,16 +644,11 @@ let
     subPackages = [ "./" ];  # don't try to build test fixtures
   };
 
-  gls = buildGoPackage rec {
-    rev = "9a4a02dbe491bef4bab3c24fd9f3087d6c4c6690";
-    name = "gls-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/jtolds/gls";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "jtolds";
-      repo = "gls";
-      sha256 = "1gvgkx7llklz6plapb95fcql7d34i6j7anlvksqhdirpja465jnm";
-    };
+  gls = buildFromGitHub {
+    rev    = "9a4a02dbe491bef4bab3c24fd9f3087d6c4c6690";
+    owner  = "jtolds";
+    repo   = "gls";
+    sha256 = "1gvgkx7llklz6plapb95fcql7d34i6j7anlvksqhdirpja465jnm";
   };
 
   ugorji.go = buildGoPackage rec {
@@ -787,18 +693,11 @@ let
     };
   };
 
-  dgnorton.goback = buildGoPackage rec {
-    rev = "a49ca3c0a18f50ae0b8a247e012db4385e516cf4";
-    name = "goback-${stdenv.lib.strings.substring 0 7 rev}";
-
-    goPackagePath = "github.com/dgnorton/goback";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "dgnorton";
-      repo = "goback";
-      sha256 = "1nyg6sckwd0iafs9vcmgbga2k3hid2q0avhwj29qbdhj3l78xi47";
-    };
+  dgnorton.goback = buildFromGitHub {
+    rev    = "a49ca3c0a18f50ae0b8a247e012db4385e516cf4";
+    owner  = "dgnorton";
+    repo   = "goback";
+    sha256 = "1nyg6sckwd0iafs9vcmgbga2k3hid2q0avhwj29qbdhj3l78xi47";
   };
 
   gocheck = buildGoPackage rec {
@@ -838,30 +737,18 @@ let
     doCheck = false; # please check again
   };
 
-  gomdb = buildGoPackage rec {
-    rev = "151f2e08ef45cb0e57d694b2562f351955dff572";
-    name = "gomdb-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/armon/gomdb";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "armon";
-      repo = "gomdb";
-      sha256 = "02wdhgfarmmwfbc75snd1dh6p9k9c1y2135apdm6mkr062qlxx61";
-    };
+  gomdb = buildFromGitHub {
+    rev    = "151f2e08ef45cb0e57d694b2562f351955dff572";
+    owner  = "armon";
+    repo   = "gomdb";
+    sha256 = "02wdhgfarmmwfbc75snd1dh6p9k9c1y2135apdm6mkr062qlxx61";
   };
 
-  influx.gomdb = buildGoPackage rec {
-    rev = "29fe330c5ab33c4e48470bd4b980bf522471190a";
-    name = "gomdb-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/influxdb/gomdb";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "influxdb";
-      repo = "gomdb";
-      sha256 = "0yg1jpr7lcaqh6i8n9wbs9r128kk541qjv06r9a6fp9vj56rqr3m";
-    };
+  influx.gomdb = buildFromGitHub {
+    rev    = "29fe330c5ab33c4e48470bd4b980bf522471190a";
+    owner  = "influxdb";
+    repo   = "gomdb";
+    sha256 = "0yg1jpr7lcaqh6i8n9wbs9r128kk541qjv06r9a6fp9vj56rqr3m";
   };
 
   govers = buildGoPackage rec {
@@ -877,17 +764,11 @@ let
     };
   };
 
-  golang-lru = buildGoPackage rec {
-    rev = "995efda3e073b6946b175ed93901d729ad47466a";
-    name = "golang-lru-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/golang-lru";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "golang-lru";
-      sha256 = "0ilnzg9qq2pfa8qb9yd25s5afi0fvsm78kqzqy39kgg8zsx70xyj";
-    };
+  golang-lru = buildFromGitHub {
+    rev    = "995efda3e073b6946b175ed93901d729ad47466a";
+    owner  = "hashicorp";
+    repo   = "golang-lru";
+    sha256 = "0ilnzg9qq2pfa8qb9yd25s5afi0fvsm78kqzqy39kgg8zsx70xyj";
   };
 
   golang_protobuf_extensions = buildGoPackage rec {
@@ -918,42 +799,25 @@ let
     propagatedBuildInputs = [ ginkgo gomega gosnappy ];
   };
 
-  gollectd = buildGoPackage rec {
-    rev = "cf6dec97343244b5d8a5485463675d42f574aa2d";
-    name = "gollectd-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/kimor79/gollectd";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "kimor79";
-      repo = "gollectd";
-      sha256 = "1f3ml406cprzjc192csyr2af4wcadkc74kg8n4c0zdzglxxfsqxa";
-    };
+  gollectd = buildFromGitHub {
+    rev    = "cf6dec97343244b5d8a5485463675d42f574aa2d";
+    owner  = "kimor79";
+    repo   = "gollectd";
+    sha256 = "1f3ml406cprzjc192csyr2af4wcadkc74kg8n4c0zdzglxxfsqxa";
   };
 
-  gomega = buildGoPackage rec {
-    rev = "8adf9e1730c55cdc590de7d49766cb2acc88d8f2";
-    name = "gomega-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/onsi/gomega";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "onsi";
-      repo = "gomega";
-      sha256 = "1rf6cxn50d1pji3pv4q372s395r5nxwcgp405z2r2mfdkri4v3w4";
-    };
+  gomega = buildFromGitHub {
+    rev    = "8adf9e1730c55cdc590de7d49766cb2acc88d8f2";
+    owner  = "onsi";
+    repo   = "gomega";
+    sha256 = "1rf6cxn50d1pji3pv4q372s395r5nxwcgp405z2r2mfdkri4v3w4";
   };
 
-  gomemcache = buildGoPackage rec {
-    rev = "72a68649ba712ee7c4b5b4a943a626bcd7d90eb8";
-    name = "gomemcache-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/bradfitz/gomemcache";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "bradfitz";
-      repo = "gomemcache";
-      sha256 = "1r8fpzwhakq8fsppc33n4iivq1pz47xhs0h6bv4x5qiip5mswwvg";
-    };
+  gomemcache = buildFromGitHub {
+    rev    = "72a68649ba712ee7c4b5b4a943a626bcd7d90eb8";
+    owner  = "bradfitz";
+    repo   = "gomemcache";
+    sha256 = "1r8fpzwhakq8fsppc33n4iivq1pz47xhs0h6bv4x5qiip5mswwvg";
   };
 
   google-api-go-client = buildGoPackage rec {
@@ -1005,29 +869,18 @@ let
     buildInputs = [ crypto ];
   };
 
-  gopherduty = buildGoPackage rec {
-    rev = "f4906ce7e59b33a50bfbcba93e2cf58778c11fb9";
-    name = "gopherduty-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/darkcrux/gopherduty";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "darkcrux";
-      repo = "gopherduty";
-      sha256 = "11w1yqc16fxj5q1y5ha5m99j18fg4p9lyqi542x2xbrmjqqialcf";
-    };
+  gopherduty = buildFromGitHub {
+    rev    = "f4906ce7e59b33a50bfbcba93e2cf58778c11fb9";
+    owner  = "darkcrux";
+    repo   = "gopherduty";
+    sha256 = "11w1yqc16fxj5q1y5ha5m99j18fg4p9lyqi542x2xbrmjqqialcf";
   };
 
-  gosnappy = buildGoPackage rec {
-    rev = "ce8acff4829e0c2458a67ead32390ac0a381c862";
-    name = "gosnappy-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/syndtr/gosnappy";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "syndtr";
-      repo = "gosnappy";
-      sha256 = "0ywa52kcii8g2a9lbqcx8ghdf6y56lqq96sl5nl9p6h74rdvmjr7";
-    };
+  gosnappy = buildFromGitHub {
+    rev    = "ce8acff4829e0c2458a67ead32390ac0a381c862";
+    owner  = "syndtr";
+    repo   = "gosnappy";
+    sha256 = "0ywa52kcii8g2a9lbqcx8ghdf6y56lqq96sl5nl9p6h74rdvmjr7";
   };
 
   gox = buildGoPackage rec {
@@ -1106,43 +959,25 @@ let
     };
   };
 
-  robfig.go-cache = buildGoPackage rec {
-    rev = "9fc39e0dbf62c034ec4e45e6120fc69433a3ec51";
-    name = "go-cache-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/robfig/go-cache";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "robfig";
-      repo = "go-cache";
-      sha256 = "032nh3y43bpzpcm7bdkxfh55aydvzc2jzhigvy5gd9f648m4j9ha";
-    };
+  robfig.go-cache = buildFromGitHub {
+    rev    = "9fc39e0dbf62c034ec4e45e6120fc69433a3ec51";
+    owner  = "robfig";
+    repo   = "go-cache";
+    sha256 = "032nh3y43bpzpcm7bdkxfh55aydvzc2jzhigvy5gd9f648m4j9ha";
   };
 
-  go-checkpoint = buildGoPackage rec {
-    rev = "88326f6851319068e7b34981032128c0b1a6524d";
-    name = "go-checkpoint-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/go-checkpoint";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "go-checkpoint";
-      sha256 = "1npasn9lmvx57nw3wkswwvl5k0wmn01jpalbwv832x5wq4r0nsz4";
-    };
+  go-checkpoint = buildFromGitHub {
+    rev    = "88326f6851319068e7b34981032128c0b1a6524d";
+    owner  = "hashicorp";
+    repo   = "go-checkpoint";
+    sha256 = "1npasn9lmvx57nw3wkswwvl5k0wmn01jpalbwv832x5wq4r0nsz4";
   };
 
-  go-colortext = buildGoPackage rec {
-    rev = "13eaeb896f5985a1ab74ddea58707a73d875ba57";
-    name = "go-colortext-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/daviddengcn/go-colortext";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "daviddengcn";
-      repo = "go-colortext";
-      sha256 = "0618xs9lc5xfp5zkkb5j47dr7i30ps3zj5fj0zpv8afqh2cc689x";
-    };
+  go-colortext = buildFromGitHub {
+    rev    = "13eaeb896f5985a1ab74ddea58707a73d875ba57";
+    owner  = "daviddengcn";
+    repo   = "go-colortext";
+    sha256 = "0618xs9lc5xfp5zkkb5j47dr7i30ps3zj5fj0zpv8afqh2cc689x";
   };
 
   go-etcd = buildGoPackage rec {
@@ -1160,16 +995,11 @@ let
     buildInputs = [ pkgs.etcd ];
   };
 
-  go-flags = buildGoPackage rec {
-    rev = "5e118789801496c93ba210d34ef1f2ce5a9173bd";
-    name = "go-flags-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/jessevdk/go-flags";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "jessevdk";
-      repo = "go-flags";
-      sha256 = "1davr5h936fhc8zy7digp5yqxr216d1mshksr7iiad5xb3r8r9ja";
-    };
+  go-flags = buildFromGitHub {
+    rev    = "5e118789801496c93ba210d34ef1f2ce5a9173bd";
+    owner  = "jessevdk";
+    repo   = "go-flags";
+    sha256 = "1davr5h936fhc8zy7digp5yqxr216d1mshksr7iiad5xb3r8r9ja";
   };
 
   go-fuse = buildGoPackage rec {
@@ -1200,52 +1030,32 @@ let
     buildInputs = [ go-querystring oauth2 ];
   };
 
-  go-homedir = buildGoPackage rec {
-    rev = "7d2d8c8a4e078ce3c58736ab521a40b37a504c52";
-    name = "go-homedir-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mitchellh/go-homedir";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "mitchellh";
-      repo   = "go-homedir";
-      sha256 = "1ixhwxnvq1qx53asq47yhg3l88ndwrnyw4fkkidcjg759dc86d0i";
-    };
+  go-homedir = buildFromGitHub {
+    rev    = "7d2d8c8a4e078ce3c58736ab521a40b37a504c52";
+    owner  = "mitchellh";
+    repo   = "go-homedir";
+    sha256 = "1ixhwxnvq1qx53asq47yhg3l88ndwrnyw4fkkidcjg759dc86d0i";
   };
 
-  go-hostpool = buildGoPackage rec {
-    rev = "fed86fae5cacdc77e7399937e2f8836563620a2e";
-    name = "go-hostpool-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/bitly/go-hostpool";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "bitly";
-      repo = "go-hostpool";
-      sha256 = "0nbssfp5ksj4hhc0d8lfq54afd9nqv6qzk3vi6rinxr3fgplrj44";
-    };
+  go-hostpool = buildFromGitHub {
+    rev    = "fed86fae5cacdc77e7399937e2f8836563620a2e";
+    owner  = "bitly";
+    repo   = "go-hostpool";
+    sha256 = "0nbssfp5ksj4hhc0d8lfq54afd9nqv6qzk3vi6rinxr3fgplrj44";
   };
 
-  go-ini = buildGoPackage rec {
-    rev = "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1";
-    name = "go-ini-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/vaughan0/go-ini";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "vaughan0";
-      repo   = "go-ini";
-      sha256 = "1l1isi3czis009d9k5awsj4xdxgbxn4n9yqjc1ac7f724x6jacfa";
-    };
+  go-ini = buildFromGitHub {
+    rev    = "a98ad7ee00ec53921f08832bc06ecf7fd600e6a1";
+    owner  = "vaughan0";
+    repo   = "go-ini";
+    sha256 = "1l1isi3czis009d9k5awsj4xdxgbxn4n9yqjc1ac7f724x6jacfa";
   };
 
-  go-isatty = buildGoPackage rec {
-    rev = "ae0b1f8f8004be68d791a576e3d8e7648ab41449";
-    name = "go-isatty-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mattn/go-isatty";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "mattn";
-      repo = "go-isatty";
-      sha256 = "0qrcsh7j9mxcaspw8lfxh9hhflz55vj4aq1xy00v78301czq6jlj";
-    };
+  go-isatty = buildFromGitHub {
+    rev    = "ae0b1f8f8004be68d791a576e3d8e7648ab41449";
+    owner  = "mattn";
+    repo   = "go-isatty";
+    sha256 = "0qrcsh7j9mxcaspw8lfxh9hhflz55vj4aq1xy00v78301czq6jlj";
   };
 
   go-log = buildGoPackage rec {
@@ -1305,17 +1115,11 @@ let
     propagatedBuildInputs = [ prometheus.client_golang ];
   };
 
-  go-multierror = buildGoPackage rec {
-    rev = "fcdddc395df1ddf4247c69bd436e84cfa0733f7e";
-    name = "go-multierror-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/go-multierror";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "go-multierror";
-      sha256 = "1gvrm2bqi425mfg55m01z9gppfd7v4ljz1z8bykmh2sc82fj25jz";
-    };
+  go-multierror = buildFromGitHub {
+    rev    = "fcdddc395df1ddf4247c69bd436e84cfa0733f7e";
+    owner  = "hashicorp";
+    repo   = "go-multierror";
+    sha256 = "1gvrm2bqi425mfg55m01z9gppfd7v4ljz1z8bykmh2sc82fj25jz";
   };
 
   go-nsq = buildGoPackage rec {
@@ -1331,66 +1135,63 @@ let
     propagatedBuildInputs = [ go-simplejson go-snappystream ];
   };
 
-  go-options = buildGoPackage rec {
-    rev = "896a539cd709f4f39d787562d1583c016ce7517e";
-    name = "go-options-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mreiferson/go-options";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "mreiferson";
-      repo = "go-options";
-      sha256 = "0hg0n5grcjcj5719rqchz0plp39wfk3znqxw8y354k4jwsqwmn17";
-    };
+  go-options = buildFromGitHub {
+    rev    = "896a539cd709f4f39d787562d1583c016ce7517e";
+    owner  = "mreiferson";
+    repo   = "go-options";
+    sha256 = "0hg0n5grcjcj5719rqchz0plp39wfk3znqxw8y354k4jwsqwmn17";
   };
 
-  go-querystring = buildGoPackage rec {
-    rev = "547ef5ac979778feb2f760cdb5f4eae1a2207b86";
-    name = "go-querystring-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/google/go-querystring";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "google";
-      repo = "go-querystring";
-      sha256 = "00ani7fhydcmlsm3n93nmj1hcqp2wmzvihnb1gdzynif1hw0530y";
-    };
+  go-querystring = buildFromGitHub {
+    rev    = "547ef5ac979778feb2f760cdb5f4eae1a2207b86";
+    owner  = "google";
+    repo   = "go-querystring";
+    sha256 = "00ani7fhydcmlsm3n93nmj1hcqp2wmzvihnb1gdzynif1hw0530y";
   };
 
-  go-radix = buildGoPackage rec {
-    rev = "0bab926c3433cfd6490c6d3c504a7b471362390c";
-    name = "go-radix-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/armon/go-radix";
+  go-radix = buildFromGitHub {
+    rev    = "0bab926c3433cfd6490c6d3c504a7b471362390c";
+    owner  = "armon";
+    repo   = "go-radix";
+    sha256 = "0llq96lxh7p9426hjii8k42kq0cp1hflawh1kjwhbmi5g0jrq04d";
+  };
 
+  junegunn.go-runewidth = buildGoPackage rec {
+    rev = "travisish";
+    name = "go-runewidth-${rev}";
+    goPackagePath = "github.com/junegunn/go-runewidth";
     src = fetchFromGitHub {
       inherit rev;
-      owner = "armon";
-      repo = "go-radix";
-      sha256 = "0llq96lxh7p9426hjii8k42kq0cp1hflawh1kjwhbmi5g0jrq04d";
+      owner = "junegunn";
+      repo = "go-runewidth";
+      sha256 = "07d612val59sibqly5d6znfkp4h4gjd77783jxvmiq6h2fwb964k";
     };
   };
 
-  go-runit = buildGoPackage rec {
-    rev = "a9148323a615e2e1c93b7a9893914a360b4945c8";
-    name = "go-runit-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/soundcloud/go-runit";
+  go-shellwords = buildGoPackage rec {
+    rev = "35d512af75e283aae4ca1fc3d44b159ed66189a4";
+    name = "go-shellwords-${rev}";
+    goPackagePath = "github.com/junegunn/go-shellwords";
     src = fetchFromGitHub {
       inherit rev;
-      owner = "soundcloud";
-      repo = "go-runit";
-      sha256 = "00f2rfhsaqj2wjanh5qp73phx7x12a5pwd7lc0rjfv68l6sgpg2v";
+      owner = "junegunn";
+      repo = "go-shellwords";
+      sha256 = "c792abe5fda48d0dfbdc32a84edb86d884a0ccbd9ed49ad48a30cda5ba028a22";
     };
   };
 
-  go-simplejson = buildGoPackage rec {
-    rev = "1cfceb0e12f47ec02665ef480212d7b531d6f4c5";
-    name = "go-simplejson-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/bitly/go-simplejson";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "bitly";
-      repo = "go-simplejson";
-      sha256 = "1d8x0himl58qn87lv418djy6mbs66p9ai3zpqq13nhkfl67fj3bi";
-    };
+  go-runit = buildFromGitHub {
+    rev    = "a9148323a615e2e1c93b7a9893914a360b4945c8";
+    owner  = "soundcloud";
+    repo   = "go-runit";
+    sha256 = "00f2rfhsaqj2wjanh5qp73phx7x12a5pwd7lc0rjfv68l6sgpg2v";
+  };
+
+  go-simplejson = buildFromGitHub {
+    rev    = "1cfceb0e12f47ec02665ef480212d7b531d6f4c5";
+    owner  = "bitly";
+    repo   = "go-simplejson";
+    sha256 = "1d8x0himl58qn87lv418djy6mbs66p9ai3zpqq13nhkfl67fj3bi";
   };
 
   go-snappystream = buildGoPackage rec {
@@ -1406,17 +1207,11 @@ let
     propagatedBuildInputs = [ snappy-go ];
   };
 
-  go-syslog = buildGoPackage rec {
-    rev = "42a2b573b664dbf281bd48c3cc12c086b17a39ba";
-    name = "go-syslog-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/go-syslog";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "go-syslog";
-      sha256 = "1j53m2wjyczm9m55znfycdvm4c8vfniqgk93dvzwy8vpj5gm6sb3";
-    };
+  go-syslog = buildFromGitHub {
+    rev    = "42a2b573b664dbf281bd48c3cc12c086b17a39ba";
+    owner  = "hashicorp";
+    repo   = "go-syslog";
+    sha256 = "1j53m2wjyczm9m55znfycdvm4c8vfniqgk93dvzwy8vpj5gm6sb3";
   };
 
   go-systemd = buildGoPackage rec {
@@ -1452,29 +1247,18 @@ let
     };
   };
 
-  go-vhost = buildGoPackage rec {
-    rev = "c4c28117502e4bf00960c8282b2d1c51c865fe2c";
-    name = "go-vhost-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/inconshreveable/go-vhost";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "inconshreveable";
-      repo = "go-vhost";
-      sha256 = "1rway6sls6fl2s2jk20ajj36rrlzh9944ncc9pdd19kifix54z32";
-    };
+  go-vhost = buildFromGitHub {
+    rev    = "c4c28117502e4bf00960c8282b2d1c51c865fe2c";
+    owner  = "inconshreveable";
+    repo   = "go-vhost";
+    sha256 = "1rway6sls6fl2s2jk20ajj36rrlzh9944ncc9pdd19kifix54z32";
   };
 
-  go-zookeeper = buildGoPackage rec {
-    rev = "d0e0d8e11f318e000a8cc434616d69e329edc374";
-    name = "go-zookeeper-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/samuel/go-zookeeper";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "samuel";
-      repo = "go-zookeeper";
-      sha256 = "0v6g14ygnjl1l2fykyfjyvnab82a70jy0zzmsn5swlyy45b9gq2d";
-    };
+  go-zookeeper = buildFromGitHub {
+    rev    = "d0e0d8e11f318e000a8cc434616d69e329edc374";
+    owner  = "samuel";
+    repo   = "go-zookeeper";
+    sha256 = "0v6g14ygnjl1l2fykyfjyvnab82a70jy0zzmsn5swlyy45b9gq2d";
   };
 
   goquery = buildGoPackage rec {
@@ -1597,16 +1381,11 @@ let
     buildInputs = [ crypto ];
   };
 
-  httprouter = buildGoPackage rec {
-    rev = "bde5c16eb82ff15a1734a3818d9b9547065f65b1";
-    name = "httprouter-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/julienschmidt/httprouter";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "julienschmidt";
-      repo = "httprouter";
-      sha256 = "1l74pvqqhhval4vfnhca9d6i1ij69qs3ljf41w3m1l2id42rq7r9";
-    };
+  httprouter = buildFromGitHub {
+    rev    = "bde5c16eb82ff15a1734a3818d9b9547065f65b1";
+    owner  = "julienschmidt";
+    repo   = "httprouter";
+    sha256 = "1l74pvqqhhval4vfnhca9d6i1ij69qs3ljf41w3m1l2id42rq7r9";
   };
 
   influxdb = buildGoPackage rec {
@@ -1656,28 +1435,18 @@ let
     };
   };
 
-  flagfile = buildGoPackage rec {
-    rev = "871ce569c29360f95d7596f90aa54d5ecef75738";
-    name = "flagfile-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/spacemonkeygo/flagfile";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "spacemonkeygo";
-      repo = "flagfile";
-      sha256 = "1y6wf1s51c90qc1aki8qikkw1wqapzjzr690xrmnrngsfpdyvkrc";
-    };
+  flagfile = buildFromGitHub {
+    rev    = "871ce569c29360f95d7596f90aa54d5ecef75738";
+    owner  = "spacemonkeygo";
+    repo   = "flagfile";
+    sha256 = "1y6wf1s51c90qc1aki8qikkw1wqapzjzr690xrmnrngsfpdyvkrc";
   };
 
-  iochan = buildGoPackage rec {
-    rev = "b584a329b193e206025682ae6c10cdbe03b0cd77";
-    name = "iochan-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mitchellh/iochan";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "mitchellh";
-      repo = "iochan";
-      sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b";
-    };
+  iochan = buildFromGitHub {
+    rev    = "b584a329b193e206025682ae6c10cdbe03b0cd77";
+    owner  = "mitchellh";
+    repo   = "iochan";
+    sha256 = "1fcwdhfci41ibpng2j4c1bqfng578cwzb3c00yw1lnbwwhaq9r6b";
   };
 
   ipfs = buildGoPackage rec {
@@ -1728,29 +1497,18 @@ let
     buildInputs = [ pkgs.leveldb ];
   };
 
-  liner = buildGoPackage rec {
-    rev = "1bb0d1c1a25ed393d8feb09bab039b2b1b1fbced";
-    name = "liner-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/peterh/liner";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "peterh";
-      repo   = "liner";
-      sha256 = "05ihxpmp6x3hw71xzvjdgxnyvyx2s4lf23xqnfjj16s4j4qidc48";
-    };
+  liner = buildFromGitHub {
+    rev    = "1bb0d1c1a25ed393d8feb09bab039b2b1b1fbced";
+    owner  = "peterh";
+    repo   = "liner";
+    sha256 = "05ihxpmp6x3hw71xzvjdgxnyvyx2s4lf23xqnfjj16s4j4qidc48";
   };
 
-  odeke-em.log = buildGoPackage rec {
-    rev = "cad53c4565a0b0304577bd13f3862350bdc5f907";
-    name = "log-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/log";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "log";
-      sha256 = "059c933qjikxlvaywzpzljqnab19svymbv6x32pc7khw156fh48w";
-    };
+  odeke-em.log = buildFromGitHub {
+    rev    = "cad53c4565a0b0304577bd13f3862350bdc5f907";
+    owner  = "odeke-em";
+    repo   = "log";
+    sha256 = "059c933qjikxlvaywzpzljqnab19svymbv6x32pc7khw156fh48w";
   };
 
   log4go = buildGoPackage rec {
@@ -1791,30 +1549,18 @@ let
     propagatedBuildInputs = [ airbrake-go bugsnag-go raven-go ];
   };
 
-  logutils = buildGoPackage rec {
-    rev = "367a65d59043b4f846d179341d138f01f988c186";
-    name = "logutils-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/logutils";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "logutils";
-      sha256 = "0rjag8c6fn3f51nysrq62r46ma6gzyvijxba47q7cdfjq35mydb8";
-    };
+  logutils = buildFromGitHub {
+    rev    = "367a65d59043b4f846d179341d138f01f988c186";
+    owner  = "hashicorp";
+    repo   = "logutils";
+    sha256 = "0rjag8c6fn3f51nysrq62r46ma6gzyvijxba47q7cdfjq35mydb8";
   };
 
-  mapstructure = buildGoPackage rec {
-    rev = "f7d28d5aeab42b9b95d2e6d6b956f73a290077fc";
-    name = "mapstructure-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mitchellh/mapstructure";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "mitchellh";
-      repo = "mapstructure";
-      sha256 = "1l9bxx0lrxdb75bxgy3jq2f6sgin2xd5ll70z5797vi96mlz8ydb";
-    };
+  mapstructure = buildFromGitHub {
+    rev    = "f7d28d5aeab42b9b95d2e6d6b956f73a290077fc";
+    owner  = "mitchellh";
+    repo   = "mapstructure";
+    sha256 = "1l9bxx0lrxdb75bxgy3jq2f6sgin2xd5ll70z5797vi96mlz8ydb";
   };
 
   mdns = buildGoPackage rec {
@@ -1873,16 +1619,11 @@ let
     buildInputs = [ pkgs.cyrus_sasl ];
   };
 
-  mousetrap = buildGoPackage rec {
-    rev = "9dbb96d2c3a964935b0870b5abaea13c98b483aa";
-    name = "mousetrap-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/inconshreveable/mousetrap";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "inconshreveable";
-      repo = "mousetrap";
-      sha256 = "1f9g8vm18qv1rcb745a4iahql9vfrz0jni9mnzriab2wy1pfdl5b";
-    };
+  mousetrap = buildFromGitHub {
+    rev    = "9dbb96d2c3a964935b0870b5abaea13c98b483aa";
+    owner  = "inconshreveable";
+    repo   = "mousetrap";
+    sha256 = "1f9g8vm18qv1rcb745a4iahql9vfrz0jni9mnzriab2wy1pfdl5b";
   };
 
   msgpack = buildGoPackage rec {
@@ -1913,30 +1654,18 @@ let
     buildInputs = [ context ];
   };
 
-  muxado = buildGoPackage rec {
-    rev = "f693c7e88ba316d1a0ae3e205e22a01aa3ec2848";
-    name = "muxado-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/inconshreveable/muxado";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "inconshreveable";
-      repo = "muxado";
-      sha256 = "1vgiwwxhgx9c899f6ikvrs0w6vfsnypzalcqyr0mqm2w816r9hhs";
-    };
+  muxado = buildFromGitHub {
+    rev    = "f693c7e88ba316d1a0ae3e205e22a01aa3ec2848";
+    owner  = "inconshreveable";
+    repo   = "muxado";
+    sha256 = "1vgiwwxhgx9c899f6ikvrs0w6vfsnypzalcqyr0mqm2w816r9hhs";
   };
 
-  mysql = buildGoPackage rec {
-    rev = "0cc29e9fe8e25c2c58cf47bcab566e029bbaa88b";
-    name = "mysql-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/go-sql-driver/mysql";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "go-sql-driver";
-      repo = "mysql";
-      sha256 = "0ydvd0mk53793sj3hgycsx926zvzxipxvppld1i175g3pn4d41xp";
-    };
+  mysql = buildFromGitHub {
+    rev    = "0cc29e9fe8e25c2c58cf47bcab566e029bbaa88b";
+    owner  = "go-sql-driver";
+    repo   = "mysql";
+    sha256 = "0ydvd0mk53793sj3hgycsx926zvzxipxvppld1i175g3pn4d41xp";
   };
 
   net-rpc-msgpackrpc = buildGoPackage rec {
@@ -1954,29 +1683,18 @@ let
     propagatedBuildInputs = [ ugorji.go ];
   };
 
-  ntp = buildGoPackage rec {
-    rev = "0a5264e2563429030eb922f258229ae3fee5b5dc";
-    name = "ntp-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/beevik/ntp";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "beevik";
-      repo = "ntp";
-      sha256 = "03fvgbjf2aprjj1s6wdc35wwa7k1w5phkixzvp5n1j21sf6w4h24";
-    };
+  ntp = buildFromGitHub {
+    rev    = "0a5264e2563429030eb922f258229ae3fee5b5dc";
+    owner  = "beevik";
+    repo   = "ntp";
+    sha256 = "03fvgbjf2aprjj1s6wdc35wwa7k1w5phkixzvp5n1j21sf6w4h24";
   };
 
-  objx = buildGoPackage rec {
-    rev = "cbeaeb16a013161a98496fad62933b1d21786672";
-    name = "objx-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/stretchr/objx";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "stretchr";
-      repo = "objx";
-      sha256 = "1xn7iibjik77h6h0jilfvcjkkzaqz45baf44p3rb2i03hbmkqkp1";
-    };
+  objx = buildFromGitHub {
+    rev    = "cbeaeb16a013161a98496fad62933b1d21786672";
+    owner  = "stretchr";
+    repo   = "objx";
+    sha256 = "1xn7iibjik77h6h0jilfvcjkkzaqz45baf44p3rb2i03hbmkqkp1";
   };
 
   oglematchers = buildGoPackage rec {
@@ -2049,30 +1767,18 @@ let
     };
   };
 
-  pat = buildGoPackage rec {
-    rev = "b8a35001b773c267eb260a691f4e5499a3531600";
-    name = "pat-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/bmizerany/pat";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "bmizerany";
-      repo = "pat";
-      sha256 = "11zxd45rvjm6cn3wzbi18wy9j4vr1r1hgg6gzlqnxffiizkycxmz";
-    };
+  pat = buildFromGitHub {
+    rev    = "b8a35001b773c267eb260a691f4e5499a3531600";
+    owner  = "bmizerany";
+    repo   = "pat";
+    sha256 = "11zxd45rvjm6cn3wzbi18wy9j4vr1r1hgg6gzlqnxffiizkycxmz";
   };
 
-  pathtree = buildGoPackage rec {
-    rev = "41257a1839e945fce74afd070e02bab2ea2c776a";
-    name = "pathtree-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/robfig/pathtree";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "robfig";
-      repo = "pathtree";
-      sha256 = "087hvskjx1zw815h1617i135vwsn5288v579mz6yral91wbn0kvi";
-    };
+  pathtree = buildFromGitHub {
+    rev    = "41257a1839e945fce74afd070e02bab2ea2c776a";
+    owner  = "robfig";
+    repo   = "pathtree";
+    sha256 = "087hvskjx1zw815h1617i135vwsn5288v579mz6yral91wbn0kvi";
   };
 
   panicwrap = buildGoPackage rec {
@@ -2090,28 +1796,18 @@ let
     propagatedBuildInputs = [ osext ];
   };
 
-  perks = buildGoPackage rec {
-    rev = "aac9e2eab5a334037057336897fd10b0289a5ae8";
-    name = "perks-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/bmizerany/perks";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "bmizerany";
-      repo = "perks";
-      sha256 = "1d027jgc327qz5xmal0hrpqvsj45i9yqmm9pxk3xp3hancvz3l3k";
-    };
+  perks = buildFromGitHub {
+    rev    = "aac9e2eab5a334037057336897fd10b0289a5ae8";
+    owner  = "bmizerany";
+    repo   = "perks";
+    sha256 = "1d027jgc327qz5xmal0hrpqvsj45i9yqmm9pxk3xp3hancvz3l3k";
   };
 
-  pb = buildGoPackage rec {
-    rev = "e648e12b78cedf14ebb2fc1855033f07b034cfbb";
-    name = "pb-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/cheggaaa/pb";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "cheggaaa";
-      repo = "pb";
-      sha256 = "03k4cars7hcqqgdsd0minfls2p7gjpm8q6y8vknh1s68kvxd4xam";
-    };
+  pb = buildFromGitHub {
+    rev    = "e648e12b78cedf14ebb2fc1855033f07b034cfbb";
+    owner  = "cheggaaa";
+    repo   = "pb";
+    sha256 = "03k4cars7hcqqgdsd0minfls2p7gjpm8q6y8vknh1s68kvxd4xam";
   };
 
   beorn7.perks = buildGoPackage rec {
@@ -2153,17 +1849,11 @@ let
     };
   };
 
-  pq = buildGoPackage rec {
-    rev = "93e9980741c9e593411b94e07d5bad8cfb4809db";
-    name = "pq-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/lib/pq";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "lib";
-      repo = "pq";
-      sha256 = "1q0zlizsk3xn7jn0skbvbhcxsfhq7z3dva96cm72n2r5vs5ld783";
-    };
+  pq = buildFromGitHub {
+    rev    = "93e9980741c9e593411b94e07d5bad8cfb4809db";
+    owner  = "lib";
+    repo   = "pq";
+    sha256 = "1q0zlizsk3xn7jn0skbvbhcxsfhq7z3dva96cm72n2r5vs5ld783";
   };
 
   pretty = buildGoPackage rec {
@@ -2240,28 +1930,18 @@ let
     };
   };
 
-  pty = buildGoPackage rec {
-    rev = "67e2db24c831afa6c64fc17b4a143390674365ef";
-    name = "pty-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/kr/pty";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "kr";
-      repo = "pty";
-      sha256 = "1l3z3wbb112ar9br44m8g838z0pq2gfxcp5s3ka0xvm1hjvanw2d";
-    };
+  pty = buildFromGitHub {
+    rev    = "67e2db24c831afa6c64fc17b4a143390674365ef";
+    owner  = "kr";
+    repo   = "pty";
+    sha256 = "1l3z3wbb112ar9br44m8g838z0pq2gfxcp5s3ka0xvm1hjvanw2d";
   };
 
-  pushover = buildGoPackage rec {
-    rev = "a8420a1935479cc266bda685cee558e86dad4b9f";
-    name = "pushover-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/thorduri/pushover";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "thorduri";
-      repo = "pushover";
-      sha256 = "0j4k43ppka20hmixlwhhz5mhv92p6wxbkvdabs4cf7k8jpk5argq";
-    };
+  pushover = buildFromGitHub {
+    rev    = "a8420a1935479cc266bda685cee558e86dad4b9f";
+    owner  = "thorduri";
+    repo   = "pushover";
+    sha256 = "0j4k43ppka20hmixlwhhz5mhv92p6wxbkvdabs4cf7k8jpk5argq";
   };
 
   raft = buildGoPackage rec {
@@ -2309,55 +1989,32 @@ let
     propagatedBuildInputs = [ gomdb ugorji.go raft ];
   };
 
-  raw = buildGoPackage rec {
-    rev = "724aedf6e1a5d8971aafec384b6bde3d5608fba4";
-    name = "raw-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/feyeleanor/raw";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "feyeleanor";
-      repo   = "raw";
-      sha256 = "0z4dcnadgk0fbxxd14dqa1wzzr0v3ksqlzd0swzs2mipim5wjgsz";
-    };
+  raw = buildFromGitHub {
+    rev    = "724aedf6e1a5d8971aafec384b6bde3d5608fba4";
+    owner  = "feyeleanor";
+    repo   = "raw";
+    sha256 = "0z4dcnadgk0fbxxd14dqa1wzzr0v3ksqlzd0swzs2mipim5wjgsz";
   };
 
-  raven-go = buildGoPackage rec {
-    rev = "c8f8fb7c415203f52ca882e2661d21bc6dcb54d7";
-    name = "raven-go-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/getsentry/raven-go";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "getsentry";
-      repo   = "raven-go";
-      sha256 = "052avpl8xsqlcmjmi3v00nm23lhs95af6vpaw2sh5xckln0lfbxh";
-    };
+  raven-go = buildFromGitHub {
+    rev    = "c8f8fb7c415203f52ca882e2661d21bc6dcb54d7";
+    owner  = "getsentry";
+    repo   = "raven-go";
+    sha256 = "052avpl8xsqlcmjmi3v00nm23lhs95af6vpaw2sh5xckln0lfbxh";
   };
 
-  redigo = buildGoPackage rec {
-    rev = "535138d7bcd717d6531c701ef5933d98b1866257";
-    name = "redigo-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/garyburd/redigo";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "garyburd";
-      repo   = "redigo";
-      sha256 = "1m7nc1gvv5yqnq8ii75f33485il6y6prf8gxl97dimsw94qccc5v";
-    };
+  redigo = buildFromGitHub {
+    rev    = "535138d7bcd717d6531c701ef5933d98b1866257";
+    owner  = "garyburd";
+    repo   = "redigo";
+    sha256 = "1m7nc1gvv5yqnq8ii75f33485il6y6prf8gxl97dimsw94qccc5v";
   };
 
-  reflectwalk = buildGoPackage rec {
-    rev = "242be0c275dedfba00a616563e6db75ab8f279ec";
-    name = "reflectwalk-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/mitchellh/reflectwalk";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "mitchellh";
-      repo   = "reflectwalk";
-      sha256 = "0xjyjs7ci7yaslk0rcgdw99ys2kq0p14cx6c90pmdzl0m9pcc9v4";
-    };
+  reflectwalk = buildFromGitHub {
+    rev    = "242be0c275dedfba00a616563e6db75ab8f279ec";
+    owner  = "mitchellh";
+    repo   = "reflectwalk";
+    sha256 = "0xjyjs7ci7yaslk0rcgdw99ys2kq0p14cx6c90pmdzl0m9pcc9v4";
   };
 
   revel = buildGoPackage rec {
@@ -2379,28 +2036,18 @@ let
     ];
   };
 
-  rgbterm = buildGoPackage rec {
-    rev = "c07e2f009ed2311e9c35bca12ec00b38ccd48283";
-    name = "rgbterm-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/aybabtme/rgbterm";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner  = "aybabtme";
-      repo   = "rgbterm";
-      sha256 = "1qph7drds44jzx1whqlrh1hs58k0wv0v58zyq2a81hmm72gsgzam";
-    };
+  rgbterm = buildFromGitHub {
+    rev    = "c07e2f009ed2311e9c35bca12ec00b38ccd48283";
+    owner  = "aybabtme";
+    repo   = "rgbterm";
+    sha256 = "1qph7drds44jzx1whqlrh1hs58k0wv0v58zyq2a81hmm72gsgzam";
   };
 
-  ripper = buildGoPackage rec {
-    rev = "bd1a682568fcb8a480b977bb5851452fc04f9ccb";
-    name = "ripper-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/ripper";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "ripper";
-      sha256 = "010jsclnmkaywdlyfqdmq372q7kh3qbz2zra0c4wn91qnkmkrnw1";
-    };
+  ripper = buildFromGitHub {
+    rev    = "bd1a682568fcb8a480b977bb5851452fc04f9ccb";
+    owner  = "odeke-em";
+    repo   = "ripper";
+    sha256 = "010jsclnmkaywdlyfqdmq372q7kh3qbz2zra0c4wn91qnkmkrnw1";
   };
 
   sandblast = buildGoPackage rec {
@@ -2513,16 +2160,11 @@ let
     };
   };
 
-  statos = buildGoPackage rec {
-    rev = "f27d6ab69b62abd9d9fe80d355e23a3e45d347d6";
-    name = "statos-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/statos";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "statos";
-      sha256 = "17cpks8bi9i7p8j38x0wy60jb9g39wbzszcmhx4hlq6yzxr04jvs";
-    };
+  statos = buildFromGitHub {
+    rev    = "f27d6ab69b62abd9d9fe80d355e23a3e45d347d6";
+    owner  = "odeke-em";
+    repo   = "statos";
+    sha256 = "17cpks8bi9i7p8j38x0wy60jb9g39wbzszcmhx4hlq6yzxr04jvs";
   };
 
   statik = buildGoPackage rec {
@@ -2594,17 +2236,11 @@ let
     };
   };
 
-  toml = buildGoPackage rec {
-    rev = "056c9bc7be7190eaa7715723883caffa5f8fa3e4";
-    name = "toml-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/BurntSushi/toml";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "BurntSushi";
-      repo = "toml";
-      sha256 = "0gkgkw04ndr5y7hrdy0r4v2drs5srwfcw2bs1gyas066hwl84xyw";
-    };
+  toml = buildFromGitHub {
+    rev    = "056c9bc7be7190eaa7715723883caffa5f8fa3e4";
+    owner  = "BurntSushi";
+    repo   = "toml";
+    sha256 = "0gkgkw04ndr5y7hrdy0r4v2drs5srwfcw2bs1gyas066hwl84xyw";
   };
 
   usb = buildGoPackage rec {
@@ -2659,17 +2295,11 @@ let
     subPackages = [ "./" ];
   };
 
-  websocket = buildGoPackage rec {
-    rev = "f4076986b69612ecb8bc7ce06d742eda6286200d";
-    name = "websocket-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/gorilla/websocket";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "gorilla";
-      repo = "websocket";
-      sha256 = "09arvwlxw15maf4z8pcgjc25hd00mckqpdi0byafqfgm3nvvacvq";
-    };
+  websocket = buildFromGitHub {
+    rev    = "f4076986b69612ecb8bc7ce06d742eda6286200d";
+    owner  = "gorilla";
+    repo   = "websocket";
+    sha256 = "09arvwlxw15maf4z8pcgjc25hd00mckqpdi0byafqfgm3nvvacvq";
   };
 
   yaml-v1 = buildGoPackage rec {
@@ -2696,29 +2326,18 @@ let
     };
   };
 
-  yamux = buildGoPackage rec {
-    rev = "b2e55852ddaf823a85c67f798080eb7d08acd71d";
-    name = "yamux-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/hashicorp/yamux";
-
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "hashicorp";
-      repo = "yamux";
-      sha256 = "0mr87my5m8lgc0byjcddlclxg34d07cpi9p78ps3rhzq7p37g533";
-    };
+  yamux = buildFromGitHub {
+    rev    = "b2e55852ddaf823a85c67f798080eb7d08acd71d";
+    owner  = "hashicorp";
+    repo   = "yamux";
+    sha256 = "0mr87my5m8lgc0byjcddlclxg34d07cpi9p78ps3rhzq7p37g533";
   };
 
-  xon = buildGoPackage rec {
-    rev = "d580be739d723da4f6378083128f93017b8ab295";
-    name = "xon-${stdenv.lib.strings.substring 0 7 rev}";
-    goPackagePath = "github.com/odeke-em/xon";
-    src = fetchFromGitHub {
-      inherit rev;
-      owner = "odeke-em";
-      repo = "xon";
-      sha256 = "07a7zj01d4a23xqp01m48jp2v5mw49islf4nbq2rj13sd5w4s6sc";
-    };
+  xon = buildFromGitHub {
+    rev    = "d580be739d723da4f6378083128f93017b8ab295";
+    owner  = "odeke-em";
+    repo   = "xon";
+    sha256 = "07a7zj01d4a23xqp01m48jp2v5mw49islf4nbq2rj13sd5w4s6sc";
   };
 
 }; in self
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 8aaf05d8bc0a..0217a0c33be4 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -4033,6 +4033,10 @@ let self = _self // overrides; _self = with self; {
       sha256 = "0l7vxag0v3hf7w1kjyjv02zqrjzhg6xczcv60z00l3z0fr78xi16";
     };
     propagatedBuildInputs = [ IOString ];
+    meta = {
+      description = "TTF font support for Perl";
+      license = stdenv.lib.licenses.artistic2;
+    };
   };
 
   ForksSuper = buildPerlPackage {
@@ -4124,10 +4128,10 @@ let self = _self // overrides; _self = with self; {
   };
 
   Glib = buildPerlPackage rec {
-    name = "Glib-1.310";
+    name = "Glib-1.312";
     src = fetchurl {
       url = "mirror://cpan/authors/id/X/XA/XAOC/${name}.tar.gz";
-      sha256 = "1iv8q7d0817m3byh2yn7bxxk5qp8bgapaflbglhkw467i31slign";
+      sha256 = "1aqww3ncaxiclfiqvl81hx7k3w4pri3k52rrar0hpzcasics5zr3";
     };
     buildInputs = [ ExtUtilsDepends ExtUtilsPkgConfig pkgs.glib ];
     meta = {
@@ -6055,7 +6059,7 @@ let self = _self // overrides; _self = with self; {
       description = "A postmodern object system for Perl 5";
       license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
       maintainers = [ maintainers.eelco ];
-      platforms   = stdenv.lib.platforms.linux;
+      platforms   = stdenv.lib.platforms.unix;
     };
   };
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index e87409d5f4a2..e62bbbdf7980 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1433,12 +1433,12 @@ let
   };
 
   botocore = buildPythonPackage rec {
-    version = "1.0.0a1";
+    version = "1.1.4";
     name = "botocore-${version}";
 
     src = pkgs.fetchurl {
       url = "https://pypi.python.org/packages/source/b/botocore/${name}.tar.gz";
-      sha256 = "0fybr48l0fvpc57n71khynpb4j0ibzn35bzybw6g1q9063xfwnxm";
+      sha256 = "1wbbaj0y6bfzsh61hgnnssn5j8m93r6r2m5r1jmlf6iz3l9gqkkp";
     };
 
     propagatedBuildInputs =
@@ -1447,6 +1447,8 @@ let
         self.jmespath
       ];
 
+    buildInputs = [ self.docutils ];
+
     meta = {
       homepage = https://github.com/boto/botocore;
 
@@ -1681,11 +1683,11 @@ let
 
 
   cairocffi = buildPythonPackage rec {
-    name = "cairocffi-0.5.4";
+    name = "cairocffi-0.7.1";
 
     src = pkgs.fetchurl {
       url = "https://pypi.python.org/packages/source/c/cairocffi/${name}.tar.gz";
-      md5 = "e3fa4002583bfaa88b156e1af9c75bde";
+      md5 = "e26d06a8d8b16c7210414ce15d453636";
     };
 
     propagatedBuildInputs = with self; [ cffi ];
@@ -2363,11 +2365,11 @@ let
   };
 
   cffi = buildPythonPackage rec {
-    name = "cffi-0.8.6";
+    name = "cffi-1.1.2";
 
     src = pkgs.fetchurl {
-      url = "http://pypi.python.org/packages/source/c/cffi/${name}.tar.gz";
-      sha256 = "0406j3sgndmx88idv5zxkkrwfqxmjl18pj8gf47nsg4ymzixjci5";
+      url = "https://pypi.python.org/packages/source/c/cffi/${name}.tar.gz";
+      md5 = "ca6e6c45b45caa87aee9adc7c796eaea";
     };
 
     propagatedBuildInputs = with self; [ pkgs.libffi pycparser ];
@@ -3120,11 +3122,11 @@ let
 
 
   elasticsearch = buildPythonPackage (rec {
-    name = "elasticsearch-1.4.0";
+    name = "elasticsearch-1.6.0";
 
     src = pkgs.fetchurl {
       url = "https://pypi.python.org/packages/source/e/elasticsearch/${name}.tar.gz";
-      md5 = "14a758debd2296d923cb6c958db98eba";
+      sha256 = "1b0b5d1qp77r83r130kb2ikhd6am0d1389rdcllr1xsajrp5kj4h";
     };
 
     # Check is disabled because running them destroy the content of the local cluster!
@@ -3133,9 +3135,7 @@ let
 
     meta = {
       description = "Official low-level client for Elasticsearch";
-
       homepage = https://github.com/elasticsearch/elasticsearch-py;
-
       license = licenses.asl20;
     };
   });
@@ -3964,6 +3964,41 @@ let
     };
   };
 
+  netcdf4 = buildPythonPackage rec {
+    name = "netCDF4-${version}";
+    version = "1.1.8";
+
+    disabled = isPyPy;
+
+    src = pkgs.fetchurl {
+      url = "https://pypi.python.org/packages/source/n/netCDF4/${name}.tar.gz";
+      sha256 = "0y6s8g82rbij0brh9hz3aapyyq6apj8fpmhhlyibz1354as7rjq1";
+    };
+
+    propagatedBuildInputs = with self ; [
+      numpy
+      pkgs.zlib
+      pkgs.netcdf
+      pkgs.hdf5
+      pkgs.curl
+      pkgs.libjpeg
+    ];
+
+    patchPhase = ''
+      export USE_NCCONFIG=0
+      export HDF5_DIR="${pkgs.hdf5}"
+      export NETCDF4_DIR="${pkgs.netcdf}"
+      export CURL_DIR="${pkgs.curl}"
+      export JPEG_DIR="${pkgs.libjpeg}"
+    '';
+
+    meta = {
+      description = "interface to netCDF library (versions 3 and 4)";
+      homepage = https://pypi.python.org/pypi/netCDF4;
+      license = licenses.free;  # Mix of license (all MIT* like)
+    };
+  };
+
   odfpy = buildPythonPackage rec {
     version = "0.9.6";
     name = "odfpy-${version}";
@@ -5720,21 +5755,32 @@ let
   });
 
   falcon = buildPythonPackage (rec {
-    name = "falcon-0.2";
+    name = "falcon-0.3.0";
 
     src = pkgs.fetchurl {
       url = "https://pypi.python.org/packages/source/f/falcon/${name}.tar.gz";
-      md5 = "bf9e8bdd20700f1ff7ce6397cd441fbd";
+      sha256 = "10ivzk88m8nn3bqbg6xgv6yfy2dgp6yzbcvr645y93pzlash4xpj";
     };
 
     propagatedBuildInputs = with self; [ coverage ddt nose pyyaml requests2 six testtools python_mimeparse ];
 
+    # The travis build fails since the migration from multiprocessing to threading for hosting the API under test.
+    # OSError: [Errno 98] Address already in use
+    doCheck = false;
+
+    # This patch is required if the tests are enabled
+    # See https://github.com/falconry/falcon/issues/572
+    #patches = singleton (pkgs.fetchurl {
+    #  name = "falcon-572.patch";
+    #  url = "https://github.com/desiderius/falcon/commit/088bd3f2204eb6368acb3a1bf6c6b54c415225c2.patch";
+    #  sha256 = "19102dlzc4890skmam2v20va2vk5xr56fi4nzibzfvl7vyq68060";
+    #});
+
     meta = {
       description = "An unladen web framework for building APIs and app backends";
-
       homepage = http://falconframework.org;
-
       license = licenses.asl20;
+      maintainers = with maintainers; [ desiderius ];
     };
   });
 
@@ -8690,11 +8736,11 @@ let
   };
 
   pandas = buildPythonPackage rec {
-    name = "pandas-0.16.1";
+    name = "pandas-0.16.2";
 
     src = pkgs.fetchurl {
       url = "https://pypi.python.org/packages/source/p/pandas/${name}.tar.gz";
-      sha256 = "1dpq5p4iym7y13wkrm0hma87rvvv5rfj5fb10iwbys5hihzj83ap";
+      sha256 = "10agmrkps8bi5948vwpipfxds5kj1d076m9i0nhaxwqiw7gm6670";
     };
 
     buildInputs = [ self.nose ];
@@ -9128,6 +9174,10 @@ let
       click configobj prompt_toolkit psycopg2 pygments sqlparse
     ];
 
+    postPatch = ''
+      substituteInPlace setup.py --replace "==" ">="
+    '';
+
     meta = {
       inherit version;
       description = "Command-line interface for PostgreSQL";
@@ -9427,10 +9477,10 @@ let
 
   prompt_toolkit = buildPythonPackage rec {
     name = "prompt_toolkit-${version}";
-    version = "0.42";
+    version = "0.43";
 
     src = pkgs.fetchurl {
-      sha256 = "04nywwyxzkl3qgah29i959irsbqi8viiadxfkxycqh7hq2yq8h86";
+      sha256 = "1z5fap8c7q27p0s82jn11i6fwg0g9zm2zy5na8is53kgbhl10fdr";
       url = "https://pypi.python.org/packages/source/p/prompt_toolkit/${name}.tar.gz";
     };
 
@@ -11987,12 +12037,12 @@ let
   };
 
 
-  scikitlearn = buildPythonPackage {
+  scikitlearn = buildPythonPackage rec {
     name = "scikit-learn-0.16.1";
 
     src = pkgs.fetchurl {
-      url = "https://pypi.python.org/packages/source/s/scikit-learn/scikit-learn-0.15.2.tar.gz";
-      sha256 = "19jzmbi3j4ix8418i80ayl595dwyi4gy474kb2nc1v8kdwgqi2hs";
+      url = "https://pypi.python.org/packages/source/s/scikit-learn/${name}.tar.gz";
+      sha256 = "1r761qmsq2mnl8sapplbx0ipj6i7ppr2cmz009q5rjana0liwwn0";
     };
 
     buildInputs = with self; [ nose pillow pkgs.gfortran pkgs.glibcLocales ];
@@ -16722,4 +16772,22 @@ let
     };
   };
 
+  xcffib = buildPythonPackage rec {
+    version = "0.3.2";
+    name = "xcffib-${version}";
+
+    src = pkgs.fetchurl {
+      url = "https://pypi.python.org/packages/source/x/xcffib/${name}.tar.gz";
+      md5 = "fa13f3fee67c83016a1242982a7c8bda";
+    };
+
+    propagatedBuildInputs = [ self.cffi self.six ];
+
+    meta = {
+      description = "A drop in replacement for xpyb, an XCB python binding";
+      homepage = "https://github.com/tych0/xcffib";
+      license = licenses.asl20;
+      maintainers = with maintainers; [ kamilchm ];
+    };
+  };
 }; in pythonPackages