summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/audacious/default.nix2
-rw-r--r--pkgs/applications/audio/id3v2/default.nix2
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix2
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix2
-rw-r--r--pkgs/applications/editors/ed/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/org/default.nix2
-rw-r--r--pkgs/applications/editors/kdevelop/default.nix2
-rw-r--r--pkgs/applications/editors/kile/default.nix2
-rw-r--r--pkgs/applications/editors/vim/configurable.nix18
-rw-r--r--pkgs/applications/editors/vim/default.nix2
-rw-r--r--pkgs/applications/editors/zile/default.nix4
-rw-r--r--pkgs/applications/graphics/cinepaint/default.nix2
-rw-r--r--pkgs/applications/graphics/dia/default.nix2
-rw-r--r--pkgs/applications/graphics/digikam/default.nix2
-rw-r--r--pkgs/applications/graphics/djview/default.nix2
-rw-r--r--pkgs/applications/graphics/fbida/default.nix2
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix18
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix2
-rw-r--r--pkgs/applications/graphics/hugin/default.nix2
-rw-r--r--pkgs/applications/graphics/kipi-plugins/default.nix2
-rw-r--r--pkgs/applications/graphics/kuickshow/default.nix2
-rw-r--r--pkgs/applications/graphics/sane/frontends.nix2
-rw-r--r--pkgs/applications/graphics/sane/xsane.nix2
-rw-r--r--pkgs/applications/graphics/xara/default.nix2
-rw-r--r--pkgs/applications/graphics/xfig/default.nix2
-rw-r--r--pkgs/applications/graphics/xournal/default.nix2
-rw-r--r--pkgs/applications/misc/calibre/default.nix2
-rw-r--r--pkgs/applications/misc/googleearth/default.nix4
-rw-r--r--pkgs/applications/misc/gphoto2/default.nix2
-rw-r--r--pkgs/applications/misc/kde-wacomtablet/default.nix2
-rw-r--r--pkgs/applications/misc/nut/default.nix2
-rw-r--r--pkgs/applications/misc/qgis/default.nix2
-rw-r--r--pkgs/applications/misc/rsibreak/default.nix2
-rw-r--r--pkgs/applications/misc/taskwarrior/default.nix2
-rw-r--r--pkgs/applications/misc/truecrypt/default.nix2
-rw-r--r--pkgs/applications/misc/yakuake/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/links2/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/lynx/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/rekonq/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/w3m/default.nix9
-rw-r--r--pkgs/applications/networking/browsers/w3m/glibc214.patch60
-rw-r--r--pkgs/applications/networking/instant-messengers/linphone/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix2
-rw-r--r--pkgs/applications/networking/sync/rsync/default.nix2
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix2
-rw-r--r--pkgs/applications/office/basket/default.nix2
-rw-r--r--pkgs/applications/office/calligra/default.nix2
-rw-r--r--pkgs/applications/office/kmymoney/default.nix2
-rw-r--r--pkgs/applications/office/skrooge/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix2
-rw-r--r--pkgs/applications/science/math/ginac/default.nix2
-rw-r--r--pkgs/applications/science/math/yacas/default.nix2
-rw-r--r--pkgs/applications/science/misc/tulip/default.nix2
-rw-r--r--pkgs/applications/version-management/fossil/default.nix2
-rw-r--r--pkgs/applications/version-management/kdesvn/default.nix2
-rw-r--r--pkgs/applications/video/bangarang/default.nix2
-rw-r--r--pkgs/applications/video/dvdauthor/default.nix2
-rw-r--r--pkgs/applications/video/gpac/default.nix2
-rw-r--r--pkgs/applications/video/mplayer/default.nix2
-rw-r--r--pkgs/applications/video/mythtv/default.nix2
-rw-r--r--pkgs/applications/video/vlc/default.nix2
-rw-r--r--pkgs/applications/video/xbmc/default.nix90
-rw-r--r--pkgs/applications/video/xine-ui/default.nix2
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix2
-rw-r--r--pkgs/build-support/builder-defs/builder-defs.nix26
-rw-r--r--pkgs/build-support/cabal/default.nix10
-rw-r--r--pkgs/build-support/checker/default.nix4
-rw-r--r--pkgs/build-support/clang-wrapper/default.nix10
-rw-r--r--pkgs/build-support/clang-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/fetchhg/default.nix6
-rw-r--r--pkgs/build-support/fetchmtn/default.nix2
-rw-r--r--pkgs/build-support/fetchurl/mirrors.nix1
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/builder.sh2
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/default.nix2
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh4
-rw-r--r--pkgs/build-support/gcc-wrapper/buildergo.sh194
-rw-r--r--pkgs/build-support/gcc-wrapper/default.nix23
-rw-r--r--pkgs/build-support/gcc-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix4
-rw-r--r--pkgs/build-support/setup-hooks/autoreconf.sh2
-rw-r--r--pkgs/build-support/trivial-builders.nix2
-rw-r--r--pkgs/data/documentation/gnome-user-docs/default.nix2
-rw-r--r--pkgs/data/misc/gsettings-desktop-schemas/default.nix2
-rw-r--r--pkgs/data/misc/xkeyboard-config/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-session/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gvfs/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/zenity/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/GConf/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/ORBit2/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/gconfmm/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libIDL/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libbonobo/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libbonoboui/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnome/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomeui/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libunique/default.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kde-wallpapers.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kde-workspace.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/smokegen.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix4
-rw-r--r--pkgs/desktops/kde-4.7/kdegames.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdelibs.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdenetwork/kopete.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdeplasma-addons.nix2
-rw-r--r--pkgs/desktops/kde-4.7/oxygen-icons.nix2
-rw-r--r--pkgs/desktops/kde-4.7/support/akonadi/default.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-runtime.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-wallpapers.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-workspace.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/perlqt.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/qtruby.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokegen.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokekde.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix4
-rw-r--r--pkgs/desktops/kde-4.8/kdegames.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdelibs.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdenetwork/kopete.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdeplasma-addons.nix2
-rw-r--r--pkgs/desktops/kde-4.8/oxygen-icons.nix2
-rw-r--r--pkgs/desktops/kde-4.8/support/akonadi/default.nix2
-rw-r--r--pkgs/development/compilers/gcc/4.3/default.nix8
-rw-r--r--pkgs/development/compilers/gcc/4.4/default.nix26
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix34
-rw-r--r--pkgs/development/compilers/gcc/4.6/builder.sh18
-rw-r--r--pkgs/development/compilers/gcc/4.6/default.nix188
-rw-r--r--pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch211
-rw-r--r--pkgs/development/compilers/gcc/4.7/builder.sh15
-rw-r--r--pkgs/development/compilers/gcc/4.7/default.nix211
-rw-r--r--pkgs/development/compilers/gnatboot/default.nix4
-rw-r--r--pkgs/development/compilers/go/default.nix8
-rw-r--r--pkgs/development/compilers/mit-scheme/default.nix2
-rw-r--r--pkgs/development/compilers/tinycc/default.nix2
-rw-r--r--pkgs/development/compilers/vala/15.2.nix2
-rw-r--r--pkgs/development/compilers/vala/16.1.nix2
-rw-r--r--pkgs/development/compilers/vala/default.nix2
-rw-r--r--pkgs/development/interpreters/guile/1.8.nix4
-rw-r--r--pkgs/development/interpreters/guile/default.nix8
-rw-r--r--pkgs/development/interpreters/octave/hg.nix2
-rw-r--r--pkgs/development/interpreters/perl/5.16/default.nix63
-rw-r--r--pkgs/development/interpreters/perl/5.16/no-libutil.patch12
-rw-r--r--pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch152
-rw-r--r--pkgs/development/interpreters/perl/5.16/setup-hook.sh5
-rw-r--r--pkgs/development/libraries/GConf/3.x.nix2
-rw-r--r--pkgs/development/libraries/SDL/default.nix2
-rw-r--r--pkgs/development/libraries/acl/default.nix2
-rw-r--r--pkgs/development/libraries/aqbanking/default.nix2
-rw-r--r--pkgs/development/libraries/arts/default.nix2
-rw-r--r--pkgs/development/libraries/asc-support/default.nix2
-rw-r--r--pkgs/development/libraries/asf-support/default.nix2
-rw-r--r--pkgs/development/libraries/atk/2.6.x.nix2
-rw-r--r--pkgs/development/libraries/atkmm/2.22.x.nix2
-rw-r--r--pkgs/development/libraries/attica/default.nix2
-rw-r--r--pkgs/development/libraries/attr/default.nix2
-rw-r--r--pkgs/development/libraries/avahi/default.nix2
-rw-r--r--pkgs/development/libraries/boolstuff/default.nix2
-rw-r--r--pkgs/development/libraries/boost/1.44.nix6
-rw-r--r--pkgs/development/libraries/boost/1.46.nix6
-rw-r--r--pkgs/development/libraries/boost/1.47.nix10
-rw-r--r--pkgs/development/libraries/boost/1.49.nix10
-rw-r--r--pkgs/development/libraries/boost/1.51.nix10
-rw-r--r--pkgs/development/libraries/boost/1.52.nix10
-rw-r--r--pkgs/development/libraries/c-library/default.nix2
-rw-r--r--pkgs/development/libraries/caelum/default.nix2
-rw-r--r--pkgs/development/libraries/cloog-ppl/default.nix2
-rw-r--r--pkgs/development/libraries/clucene-core/2.x.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/0.10.8.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/default.nix2
-rw-r--r--pkgs/development/libraries/clutter/default.nix2
-rw-r--r--pkgs/development/libraries/cogl/default.nix2
-rw-r--r--pkgs/development/libraries/config-support/default.nix2
-rw-r--r--pkgs/development/libraries/dbus-glib/default.nix2
-rw-r--r--pkgs/development/libraries/dbus/default.nix4
-rw-r--r--pkgs/development/libraries/directfb/default.nix2
-rw-r--r--pkgs/development/libraries/eigen/2.0.nix8
-rw-r--r--pkgs/development/libraries/eigen/default.nix2
-rw-r--r--pkgs/development/libraries/error-support/default.nix2
-rw-r--r--pkgs/development/libraries/farsight2/default.nix2
-rw-r--r--pkgs/development/libraries/farstream/default.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg/default.nix4
-rw-r--r--pkgs/development/libraries/fltk/fltk13.nix2
-rw-r--r--pkgs/development/libraries/fmod/default.nix4
-rw-r--r--pkgs/development/libraries/funambol/default.nix2
-rw-r--r--pkgs/development/libraries/gamin/default.nix2
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/2.26.x.nix2
-rw-r--r--pkgs/development/libraries/gegl/default.nix2
-rw-r--r--pkgs/development/libraries/gettext/default.nix4
-rw-r--r--pkgs/development/libraries/gettext/no-gets.patch42
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix2
-rw-r--r--pkgs/development/libraries/glib/2.34.x.nix2
-rw-r--r--pkgs/development/libraries/glibc/2.13/common.nix19
-rw-r--r--pkgs/development/libraries/glibc/2.14/common.nix223
-rw-r--r--pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch43
-rw-r--r--pkgs/development/libraries/glibc/2.14/info.nix26
-rw-r--r--pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch21
-rw-r--r--pkgs/development/libraries/glibc/2.14/rpcgen-path.patch72
-rw-r--r--pkgs/development/libraries/glibc/2.17/builder.sh (renamed from pkgs/development/libraries/glibc/2.14/builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/common.nix171
-rw-r--r--pkgs/development/libraries/glibc/2.17/default.nix (renamed from pkgs/development/libraries/glibc/2.14/default.nix)8
-rw-r--r--pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch45
-rw-r--r--pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch (renamed from pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/info.nix26
-rw-r--r--pkgs/development/libraries/glibc/2.17/locales-builder.sh (renamed from pkgs/development/libraries/glibc/2.14/locales-builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/locales.nix (renamed from pkgs/development/libraries/glibc/2.14/locales.nix)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch (renamed from pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch)48
-rw-r--r--pkgs/development/libraries/glibc/2.17/rpcgen-path.patch54
-rw-r--r--pkgs/development/libraries/glibc/2.5/binutils-ld.patch27
-rw-r--r--pkgs/development/libraries/glibc/2.5/builder.sh57
-rw-r--r--pkgs/development/libraries/glibc/2.5/default.nix40
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch14
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-inline.patch1822
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-pwd.patch74
-rw-r--r--pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch14
-rw-r--r--pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch32
-rw-r--r--pkgs/development/libraries/glibc/2.7/builder.sh60
-rw-r--r--pkgs/development/libraries/glibc/2.7/default.nix57
-rw-r--r--pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch25
-rw-r--r--pkgs/development/libraries/glibc/2.9/binutils-2.20.patch42
-rw-r--r--pkgs/development/libraries/glibc/2.9/binutils-ld.patch33
-rw-r--r--pkgs/development/libraries/glibc/2.9/builder.sh85
-rw-r--r--pkgs/development/libraries/glibc/2.9/default.nix103
-rw-r--r--pkgs/development/libraries/glibc/2.9/headers.nix63
-rw-r--r--pkgs/development/libraries/glibc/2.9/headersbuilder.sh38
-rw-r--r--pkgs/development/libraries/glibc/2.9/info.nix47
-rw-r--r--pkgs/development/libraries/glibc/2.9/locale-override.patch72
-rw-r--r--pkgs/development/libraries/glibc/2.9/locales.nix67
-rw-r--r--pkgs/development/libraries/glibc/2.9/localesbuilder.sh50
-rw-r--r--pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch25
-rw-r--r--pkgs/development/libraries/glibc/2.9/rpcgen-path.patch72
-rw-r--r--pkgs/development/libraries/glibmm/2.30.x.nix2
-rw-r--r--pkgs/development/libraries/gmp/4.3.2.nix2
-rw-r--r--pkgs/development/libraries/gmp/5.0.5.nix2
-rw-r--r--pkgs/development/libraries/gmp/5.1.0.nix55
-rw-r--r--pkgs/development/libraries/gnutls/default.nix2
-rw-r--r--pkgs/development/libraries/gpgme/default.nix2
-rw-r--r--pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix2
-rw-r--r--pkgs/development/libraries/gtk+/2.24.x.nix6
-rw-r--r--pkgs/development/libraries/gtk+/3.2.x.nix2
-rw-r--r--pkgs/development/libraries/gtkmm/2.24.x.nix2
-rw-r--r--pkgs/development/libraries/gtkmm/3.2.x.nix2
-rw-r--r--pkgs/development/libraries/gupnp-igd/default.nix2
-rw-r--r--pkgs/development/libraries/gupnp/default.nix2
-rw-r--r--pkgs/development/libraries/gwenhywfar/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/cuda/default.nix2
-rw-r--r--pkgs/development/libraries/hspell/dicts.nix2
-rw-r--r--pkgs/development/libraries/hwloc/default.nix2
-rw-r--r--pkgs/development/libraries/ilbc/default.nix2
-rw-r--r--pkgs/development/libraries/imlib2/default.nix2
-rw-r--r--pkgs/development/libraries/itk/default.nix2
-rw-r--r--pkgs/development/libraries/jasper/default.nix2
-rw-r--r--pkgs/development/libraries/json-glib/default.nix2
-rw-r--r--pkgs/development/libraries/kdevplatform/default.nix2
-rw-r--r--pkgs/development/libraries/libbluray/default.nix2
-rw-r--r--pkgs/development/libraries/libcdr/default.nix2
-rw-r--r--pkgs/development/libraries/libchop/default.nix2
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/default.nix2
-rw-r--r--pkgs/development/libraries/libdevil/default.nix2
-rw-r--r--pkgs/development/libraries/libdiscid/default.nix2
-rw-r--r--pkgs/development/libraries/libdmtx/default.nix2
-rw-r--r--pkgs/development/libraries/libdrm/default.nix2
-rw-r--r--pkgs/development/libraries/libgnome-keyring/3.x.nix2
-rw-r--r--pkgs/development/libraries/libgnome-keyring/default.nix2
-rw-r--r--pkgs/development/libraries/libgphoto2/default.nix2
-rw-r--r--pkgs/development/libraries/libgpod/default.nix2
-rw-r--r--pkgs/development/libraries/libgsf/default.nix2
-rw-r--r--pkgs/development/libraries/libgtop/default.nix2
-rw-r--r--pkgs/development/libraries/libgweather/default.nix2
-rw-r--r--pkgs/development/libraries/libharu/default.nix2
-rw-r--r--pkgs/development/libraries/libical/default.nix2
-rw-r--r--pkgs/development/libraries/libidn/default.nix4
-rw-r--r--pkgs/development/libraries/libimobiledevice/default.nix2
-rw-r--r--pkgs/development/libraries/libktorrent/default.nix2
-rw-r--r--pkgs/development/libraries/liblastfm/default.nix2
-rw-r--r--pkgs/development/libraries/libmad/default.nix2
-rw-r--r--pkgs/development/libraries/libmms/default.nix2
-rw-r--r--pkgs/development/libraries/libmng/default.nix2
-rw-r--r--pkgs/development/libraries/libogg/default.nix2
-rw-r--r--pkgs/development/libraries/libopensc-dnie/default.nix4
-rw-r--r--pkgs/development/libraries/libpcap/default.nix2
-rw-r--r--pkgs/development/libraries/libplist/default.nix2
-rw-r--r--pkgs/development/libraries/libpng/12.nix2
-rw-r--r--pkgs/development/libraries/librdf/rasqal.nix2
-rw-r--r--pkgs/development/libraries/librdf/redland.nix2
-rw-r--r--pkgs/development/libraries/librsvg/default.nix2
-rw-r--r--pkgs/development/libraries/libsoup/default.nix2
-rw-r--r--pkgs/development/libraries/libssh/default.nix2
-rw-r--r--pkgs/development/libraries/libtasn1/default.nix4
-rw-r--r--pkgs/development/libraries/libtheora/default.nix2
-rw-r--r--pkgs/development/libraries/libvisio/default.nix2
-rw-r--r--pkgs/development/libraries/libvorbis/default.nix2
-rw-r--r--pkgs/development/libraries/libwpd/0.8.nix2
-rw-r--r--pkgs/development/libraries/libwpd/default.nix2
-rw-r--r--pkgs/development/libraries/libwpg/default.nix2
-rw-r--r--pkgs/development/libraries/libxklavier/default.nix2
-rw-r--r--pkgs/development/libraries/lirc/default.nix6
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix2
-rw-r--r--pkgs/development/libraries/mesa/default.nix2
-rw-r--r--pkgs/development/libraries/mythes/default.nix2
-rw-r--r--pkgs/development/libraries/ncurses/default.nix2
-rw-r--r--pkgs/development/libraries/ntrack/default.nix2
-rw-r--r--pkgs/development/libraries/ogrepaged/default.nix2
-rw-r--r--pkgs/development/libraries/openbabel/default.nix2
-rw-r--r--pkgs/development/libraries/opencv/default.nix2
-rw-r--r--pkgs/development/libraries/openssl/darwin-arch.patch30
-rw-r--r--pkgs/development/libraries/openssl/default.nix15
-rw-r--r--pkgs/development/libraries/pango/1.30.x.nix2
-rw-r--r--pkgs/development/libraries/pangomm/2.28.x.nix2
-rw-r--r--pkgs/development/libraries/pcre/8.30.nix38
-rw-r--r--pkgs/development/libraries/pcre/default.nix4
-rw-r--r--pkgs/development/libraries/pgen/default.nix2
-rw-r--r--pkgs/development/libraries/phonon-backend-gstreamer/default.nix2
-rw-r--r--pkgs/development/libraries/phonon-backend-vlc/default.nix2
-rw-r--r--pkgs/development/libraries/phonon/default.nix2
-rw-r--r--pkgs/development/libraries/physfs/default.nix2
-rw-r--r--pkgs/development/libraries/plib/default.nix2
-rw-r--r--pkgs/development/libraries/podofo/default.nix2
-rw-r--r--pkgs/development/libraries/polkit-qt-1/default.nix2
-rw-r--r--pkgs/development/libraries/poppler/default.nix2
-rw-r--r--pkgs/development/libraries/ppl/default.nix2
-rw-r--r--pkgs/development/libraries/prison/default.nix2
-rw-r--r--pkgs/development/libraries/pt-support/default.nix2
-rw-r--r--pkgs/development/libraries/ptable-support/default.nix2
-rw-r--r--pkgs/development/libraries/qca2/default.nix2
-rw-r--r--pkgs/development/libraries/qca2/ossl.nix2
-rw-r--r--pkgs/development/libraries/qhull/default.nix2
-rw-r--r--pkgs/development/libraries/qt-3/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix2
-rw-r--r--pkgs/development/libraries/rstore-support/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/liblapack/default.nix2
-rw-r--r--pkgs/development/libraries/sdf-support/default.nix2
-rw-r--r--pkgs/development/libraries/sglr/default.nix2
-rw-r--r--pkgs/development/libraries/sofia-sip/default.nix2
-rw-r--r--pkgs/development/libraries/soprano/default.nix2
-rw-r--r--pkgs/development/libraries/soqt/default.nix2
-rw-r--r--pkgs/development/libraries/spice/default.nix2
-rw-r--r--pkgs/development/libraries/sqlite/full.nix2
-rw-r--r--pkgs/development/libraries/strigi/default.nix2
-rw-r--r--pkgs/development/libraries/taglib-extras/default.nix2
-rw-r--r--pkgs/development/libraries/taglib/default.nix2
-rw-r--r--pkgs/development/libraries/telepathy/farstream/default.nix2
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix2
-rw-r--r--pkgs/development/libraries/tide-support/default.nix2
-rw-r--r--pkgs/development/libraries/tokyo-tyrant/default.nix2
-rw-r--r--pkgs/development/libraries/toolbuslib/default.nix2
-rw-r--r--pkgs/development/libraries/tremor/default.nix2
-rw-r--r--pkgs/development/libraries/v8/default.nix2
-rw-r--r--pkgs/development/libraries/vcdimager/default.nix2
-rw-r--r--pkgs/development/libraries/vxl/default.nix5
-rw-r--r--pkgs/development/libraries/wxGTK-2.8/default.nix2
-rw-r--r--pkgs/development/libraries/wxGTK-2.9/default.nix2
-rw-r--r--pkgs/development/libraries/xine-lib/default.nix2
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
-rw-r--r--pkgs/development/mobile/androidenv/build-app.nix2
-rw-r--r--pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix1
-rw-r--r--pkgs/development/perl-modules/generic/builder.sh4
-rw-r--r--pkgs/development/python-modules/generic/default.nix13
-rw-r--r--pkgs/development/python-modules/generic/wrap.sh2
-rw-r--r--pkgs/development/python-modules/python-sip/default.nix5
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix2
-rw-r--r--pkgs/development/tools/documentation/doxygen/1.7.nix2
-rw-r--r--pkgs/development/tools/documentation/doxygen/default.nix2
-rw-r--r--pkgs/development/tools/documentation/gnome-doc-utils/default.nix2
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.11.x.nix4
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.12.x.nix6
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix9
-rw-r--r--pkgs/development/tools/misc/binutils/dtneeded.patch12
-rw-r--r--pkgs/development/tools/misc/cscope/default.nix4
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix4
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix10
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix2
-rw-r--r--pkgs/development/tools/misc/gnum4/no-gets.patch26
-rw-r--r--pkgs/development/tools/misc/libtool/libtool2.nix2
-rw-r--r--pkgs/development/tools/misc/strace/default.nix2
-rw-r--r--pkgs/development/tools/misc/texinfo/default.nix2
-rw-r--r--pkgs/development/tools/misc/xxdiff/default.nix2
-rw-r--r--pkgs/development/tools/parsing/bison/bison-1.875.nix13
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.3.nix38
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.4.nix40
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.5.nix44
-rw-r--r--pkgs/development/tools/parsing/bison/default.nix (renamed from pkgs/development/tools/parsing/bison/bison-2.6.nix)6
-rw-r--r--pkgs/development/tools/parsing/flex/flex-2.5.35.nix2
-rw-r--r--pkgs/development/tools/phantomjs/default.nix2
-rw-r--r--pkgs/development/web/nodejs/build-node-package.nix2
-rw-r--r--pkgs/games/andyetitmoves/default.nix2
-rw-r--r--pkgs/games/freeciv/default.nix2
-rw-r--r--pkgs/games/naev/default.nix2
-rw-r--r--pkgs/games/prboom/default.nix2
-rw-r--r--pkgs/games/scorched3d/default.nix2
-rw-r--r--pkgs/games/torcs/default.nix2
-rw-r--r--pkgs/lib/customisation.nix8
-rw-r--r--pkgs/lib/debug.nix2
-rw-r--r--pkgs/lib/misc.nix20
-rw-r--r--pkgs/misc/my-env/default.nix6
-rw-r--r--pkgs/misc/source-and-tags/default.nix4
-rw-r--r--pkgs/misc/uboot/default.nix2
-rw-r--r--pkgs/misc/uboot/guruplug.nix2
-rw-r--r--pkgs/misc/uboot/sheevaplug.nix2
-rw-r--r--pkgs/os-specific/gnu/default.nix12
-rw-r--r--pkgs/os-specific/gnu/libpthread/default.nix2
-rw-r--r--pkgs/os-specific/gnu/mach/default.nix2
-rw-r--r--pkgs/os-specific/gnu/mig/default.nix4
-rw-r--r--pkgs/os-specific/gnu/unionfs/default.nix2
-rw-r--r--pkgs/os-specific/linux/alsa-utils/default.nix2
-rw-r--r--pkgs/os-specific/linux/busybox/default.nix5
-rw-r--r--pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch12
-rw-r--r--pkgs/os-specific/linux/cryptodev/default.nix2
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix2
-rw-r--r--pkgs/os-specific/linux/jujuutils/default.nix6
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.6.28.nix2
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.6.32.nix4
-rw-r--r--pkgs/os-specific/linux/kernel-headers/3.7.nix (renamed from pkgs/os-specific/linux/kernel-headers/3.3.5.nix)25
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix62
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix42
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix6
-rw-r--r--pkgs/os-specific/linux/klibc/default.nix2
-rw-r--r--pkgs/os-specific/linux/libcap/default.nix2
-rw-r--r--pkgs/os-specific/linux/libcgroup/default.nix2
-rw-r--r--pkgs/os-specific/linux/mdadm/default.nix2
-rw-r--r--pkgs/os-specific/linux/net-tools/config.h11
-rw-r--r--pkgs/os-specific/linux/net-tools/default.nix12
-rw-r--r--pkgs/os-specific/linux/net-tools/net-tools-labels.patch38
-rw-r--r--pkgs/os-specific/linux/pam/default.nix17
-rw-r--r--pkgs/os-specific/linux/uclibc/default.nix6
-rw-r--r--pkgs/os-specific/linux/udisks/default.nix2
-rw-r--r--pkgs/os-specific/linux/upower/default.nix2
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix8
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/default.nix2
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/gui.nix2
-rw-r--r--pkgs/os-specific/windows/jom/default.nix4
-rw-r--r--pkgs/os-specific/windows/w32api/default.nix2
-rw-r--r--pkgs/servers/gpm/default.nix2
-rw-r--r--pkgs/servers/gpsd/default.nix2
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix2
-rw-r--r--pkgs/servers/prayer/default.nix2
-rw-r--r--pkgs/servers/unfs3/default.nix2
-rw-r--r--pkgs/servers/x11/xorg/builder.sh4
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix8
-rw-r--r--pkgs/shells/bash/bash-4.2-patches.nix18
-rw-r--r--pkgs/shells/bash/default.nix4
-rw-r--r--pkgs/stdenv/adapters.nix95
-rw-r--r--pkgs/stdenv/default.nix1
-rw-r--r--pkgs/stdenv/generic/default.nix15
-rw-r--r--pkgs/stdenv/generic/setup.sh44
-rw-r--r--pkgs/stdenv/linux/bootstrap/armv6l/default.nix15
-rw-r--r--pkgs/stdenv/linux/default.nix58
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix269
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh28
-rw-r--r--pkgs/stdenv/nix/default.nix6
-rw-r--r--pkgs/tools/X11/xpra/default.nix2
-rw-r--r--pkgs/tools/admin/tigervnc/default.nix14
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix23
-rw-r--r--pkgs/tools/archivers/sharutils/default.nix7
-rw-r--r--pkgs/tools/backup/bup/default.nix2
-rw-r--r--pkgs/tools/bluetooth/obexd/default.nix2
-rw-r--r--pkgs/tools/compression/bzip2/builder.sh2
-rw-r--r--pkgs/tools/compression/gzip/default.nix22
-rw-r--r--pkgs/tools/compression/gzip/gets-undeclared.patch26
-rw-r--r--pkgs/tools/compression/xz/default.nix4
-rw-r--r--pkgs/tools/filesystems/ntfs-3g/default.nix2
-rw-r--r--pkgs/tools/graphics/argyllcms/default.nix2
-rw-r--r--pkgs/tools/graphics/enblend-enfuse/default.nix2
-rw-r--r--pkgs/tools/graphics/pfstools/default.nix2
-rw-r--r--pkgs/tools/graphics/qrencode/default.nix2
-rw-r--r--pkgs/tools/misc/coreutils/8.19.nix70
-rw-r--r--pkgs/tools/misc/coreutils/default.nix18
-rw-r--r--pkgs/tools/misc/file/511.nix17
-rw-r--r--pkgs/tools/misc/file/default.nix19
-rw-r--r--pkgs/tools/misc/findutils/default.nix2
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix6
-rw-r--r--pkgs/tools/misc/idutils/default.nix7
-rw-r--r--pkgs/tools/misc/ttf2pt1/default.nix2
-rw-r--r--pkgs/tools/misc/usbmuxd/default.nix2
-rw-r--r--pkgs/tools/misc/xburst-tools/default.nix2
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix2
-rw-r--r--pkgs/tools/networking/curl/default.nix4
-rw-r--r--pkgs/tools/networking/inetutils/default.nix14
-rw-r--r--pkgs/tools/networking/modemmanager/default.nix2
-rw-r--r--pkgs/tools/networking/network-manager-applet/default.nix2
-rw-r--r--pkgs/tools/networking/network-manager/default.nix2
-rw-r--r--pkgs/tools/networking/network-manager/pptp.nix2
-rw-r--r--pkgs/tools/networking/networkmanagement/default.nix2
-rw-r--r--pkgs/tools/networking/ntop/default.nix2
-rw-r--r--pkgs/tools/networking/openssh/default.nix1
-rw-r--r--pkgs/tools/networking/pptp/default.nix2
-rw-r--r--pkgs/tools/networking/surfraw/default.nix2
-rw-r--r--pkgs/tools/networking/wget/default.nix6
-rw-r--r--pkgs/tools/package-management/nix/default.nix6
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix6
-rw-r--r--pkgs/tools/security/ccrypt/default.nix2
-rw-r--r--pkgs/tools/security/pcsclite/default.nix2
-rw-r--r--pkgs/tools/security/pinentry/default.nix2
-rw-r--r--pkgs/tools/security/polkit-gnome/default.nix2
-rw-r--r--pkgs/tools/security/polkit-kde-agent/default.nix2
-rw-r--r--pkgs/tools/text/diffutils/default.nix22
-rw-r--r--pkgs/tools/text/diffutils/gets-undeclared.patch71
-rw-r--r--pkgs/tools/text/gawk/default.nix18
-rw-r--r--pkgs/tools/text/gnugrep/default.nix14
-rw-r--r--pkgs/tools/text/gnupatch/darwin-fix.patch60
-rw-r--r--pkgs/tools/text/gnupatch/default.nix17
-rw-r--r--pkgs/tools/text/groff/default.nix2
-rw-r--r--pkgs/tools/text/kdiff3/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix216
-rw-r--r--pkgs/top-level/platforms.nix104
-rw-r--r--pkgs/top-level/python-packages.nix8
-rw-r--r--pkgs/top-level/release-cross.nix162
-rw-r--r--pkgs/top-level/release-lib.nix2
-rw-r--r--pkgs/top-level/release-small.nix5
-rw-r--r--pkgs/top-level/release.nix4
530 files changed, 3021 insertions, 5204 deletions
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index 9bd793613c1..9ac62f58570 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
 
       # Then build the plugins.
       (
-        buildNativeInputs="$out $buildNativeInputs" # to find audacious
+        nativeBuildInputs="$out $nativeBuildInputs" # to find audacious
         source $stdenv/setup
         rm -rfv audacious-*
         src=$pluginsSrc
diff --git a/pkgs/applications/audio/id3v2/default.nix b/pkgs/applications/audio/id3v2/default.nix
index 8e7f573cc84..8a025ac6843 100644
--- a/pkgs/applications/audio/id3v2/default.nix
+++ b/pkgs/applications/audio/id3v2/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./id3v2-0.1.11-track-bad-free.patch ];
 
-  buildNativeInputs = [ groff ];
+  nativeBuildInputs = [ groff ];
   buildInputs = [ id3lib ];
 
   configurePhase = ''
diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix
index 082f5dd9ab9..bce7e0ef5ee 100644
--- a/pkgs/applications/audio/yoshimi/default.nix
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation  rec {
 
   buildInputs = [ alsaLib boost fftwSinglePrec fltk jackaudio libsndfile mesa
     minixml zlib ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   preConfigure = "cd src";
 
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index 08f0f48011c..fcec85b7fe5 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [ alsaLib fftw fltk13 minixml zlib ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   patches = [
     (fetchurl {
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 01b4ff547e8..eb364ec730e 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "ed-1.5";
+  name = "ed-1.7";
 
   src = fetchurl {
     url = "mirror://gnu/ed/${name}.tar.gz";
-    sha256 = "18gvhyhwpabmgv4lh21lg8vl3z7acdyhh2mr2kj9g75wksj39pcp";
+    sha256 = "0c908wb5pm48rjrrfbm5dhrqzys8f1dbvi90dn0vgwjzk80l2hl9";
   };
 
   /* FIXME: Tests currently fail on Darwin:
diff --git a/pkgs/applications/editors/emacs-modes/org/default.nix b/pkgs/applications/editors/emacs-modes/org/default.nix
index d3829bc9d11..e045b83a74d 100644
--- a/pkgs/applications/editors/emacs-modes/org/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ emacs ];
-  buildNativeInputs = [ texinfo texLive ];
+  nativeBuildInputs = [ texinfo texLive ];
 
   configurePhase =
     '' sed -i mk/default.mk \
diff --git a/pkgs/applications/editors/kdevelop/default.nix b/pkgs/applications/editors/kdevelop/default.nix
index 249ede5ebd0..14f9c1eb0d4 100644
--- a/pkgs/applications/editors/kdevelop/default.nix
+++ b/pkgs/applications/editors/kdevelop/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdevplatform kdebase_workspace okteta ];
 
-  buildNativeInputs = [ cmake pkgconfig automoc4 shared_mime_info gettext perl ];
+  nativeBuildInputs = [ cmake pkgconfig automoc4 shared_mime_info gettext perl ];
 
   patches =
     [ ( fetchurl {
diff --git a/pkgs/applications/editors/kile/default.nix b/pkgs/applications/editors/kile/default.nix
index a24c6b18d8c..6b14b40a2c9 100644
--- a/pkgs/applications/editors/kile/default.nix
+++ b/pkgs/applications/editors/kile/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0nx5fmjrxrndnzvknxnybd8qh15jzfxzbny2rljq3amjw02y9lc2";
   };
 
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
   buildInputs = [ kdelibs ];
 
   # for KDE 4.7 the nl translations fail since kile-2.1.2
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index 9e6b700f9ef..fb006afb7c2 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -13,7 +13,7 @@ composableDerivation {} {
 
     configureFlags = ["--enable-gui=auto" "--with-features=${args.features}"];
 
-    buildNativeInputs = [ncurses pkgconfig]
+    nativeBuildInputs = [ncurses pkgconfig]
       ++ [ gtk libX11 libXext libSM libXpm libXt libXaw libXau libXmu glib 
            libICE ];
 
@@ -27,11 +27,11 @@ composableDerivation {} {
       // edf { name = "xsmp"; } #Disable XSMP session management
       // edf { name = "xsmp_interact"; } #Disable XSMP interaction
       // edf { name = "mzscheme"; } #Include MzScheme interpreter.
-      // edf { name = "perl"; feat = "perlinterp"; enable = { buildNativeInputs = [perl]; };} #Include Perl interpreter.
-      // edf { name = "python"; feat = "pythoninterp"; enable = { buildNativeInputs = [python]; }; } #Include Python interpreter.
-      // edf { name = "tcl"; enable = { buildNativeInputs = [tcl]; }; } #Include Tcl interpreter.
-      // edf { name = "ruby"; feat = "rubyinterp"; enable = { buildNativeInputs = [ruby]; };} #Include Ruby interpreter.
-      // edf { name = "lua" ; feat = "luainterp"; enable = { buildNativeInputs = [lua]; configureFlags = ["--with-lua-prefix=${args.lua}"];};}
+      // edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
+      // edf { name = "python"; feat = "pythoninterp"; enable = { nativeBuildInputs = [python]; }; } #Include Python interpreter.
+      // edf { name = "tcl"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
+      // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
+      // edf { name = "lua" ; feat = "luainterp"; enable = { nativeBuildInputs = [lua]; configureFlags = ["--with-lua-prefix=${args.lua}"];};}
       // edf { name = "cscope"; } #Include cscope interface.
       // edf { name = "workshop"; } #Include Sun Visual Workshop support.
       // edf { name = "netbeans"; } #Disable NetBeans integration support.
@@ -42,7 +42,7 @@ composableDerivation {} {
       // edf { name = "fontset"; } #Include X fontset output support.
       // edf { name = "acl"; } #Don't check for ACL support.
       // edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
-      // edf { name = "nls"; enable = {buildNativeInputs = [gettext];}; } #Don't support NLS (gettext()).
+      // edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
       ;
 
   cfg = {
@@ -70,11 +70,11 @@ composableDerivation {} {
 
   postInstall = "
     rpath=`patchelf --print-rpath \$out/bin/vim`;
-    for i in $\buildNativeInputs; do
+    for i in $\nativeBuildInputs; do
       echo adding \$i/lib
       rpath=\$rpath:\$i/lib
     done
-    echo \$buildNativeInputs
+    echo \$nativeBuildInputs
     echo \$rpath
     patchelf --set-rpath \$rpath \$out/bin/{vim,gvim}
   ";
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index dec93327167..ff8da0e0947 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
  
   buildInputs = [ ncurses pkgconfig ];
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   configureFlags = [
     "--enable-multibyte"
diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index 13a36e258fd..5929f4c76c8 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ncurses boehmgc ];
-  buildNativeInputs = [ help2man perl ];
+  nativeBuildInputs = [ help2man perl ];
 
   # `help2man' wants to run Zile, which fails when cross-compiling.
-  crossAttrs.buildNativeInputs = [];
+  crossAttrs.nativeBuildInputs = [];
 
   # Tests can't be run because most of them rely on the ability to
   # fiddle with the terminal.
diff --git a/pkgs/applications/graphics/cinepaint/default.nix b/pkgs/applications/graphics/cinepaint/default.nix
index bea04f6dc2c..7b1a7f26239 100644
--- a/pkgs/applications/graphics/cinepaint/default.nix
+++ b/pkgs/applications/graphics/cinepaint/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./install.patch ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   NIX_LDFLAGS = "-llcms -ljpeg";
 
diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix
index 769acd2a3b6..ab421cee158 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
       libxslt docbook_xsl libart_lgpl
     ] ++ stdenv.lib.optional withGNOME libgnomeui;
 
-  buildNativeInputs = [ pkgconfig intltool perl ];
+  nativeBuildInputs = [ pkgconfig intltool perl ];
 
   configureFlags = stdenv.lib.optionalString withGNOME "--enable-gnome";
 
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index a293311e2a4..e64889ff52f 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1prnaywnbv0xpw6knqagzc4gn1vsj9kw2hvdasjwknc9ljiyl721";
   };
 
-  buildNativeInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
 
   buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
     jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index 0ac499f2681..f832513a824 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
 	buildInputs = [djvulibre qt4];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   patches = [ ./djview4-qt-4.8.patch ];
 
diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix
index 2685aad8cf7..927ca2ab679 100644
--- a/pkgs/applications/graphics/fbida/default.nix
+++ b/pkgs/applications/graphics/fbida/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1riia87v5nsx858xnlvc7sspr1p36adjqrdch1255ikr5xbv6h6x";
   };
 
-  buildNativeInputs = [ pkgconfig which ];
+  nativeBuildInputs = [ pkgconfig which ];
   buildInputs =
     [ libexif libjpeg libpng libungif freetype fontconfig libtiff libwebp
       imagemagick curl saneBackends
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 70a27030969..962cb387c73 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -36,7 +36,7 @@ let
  libLQR = pluginDerivation {
     name = "liblqr-1-0.4.1";
     # required by lqrPlugin, you don't havet to install this lib explicitely
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/liblqr-1-0.4.1.tar.bz2;
       sha256 = "02g90wag7xi5rjlmwq8h0qs666b1i2sa90s4303hmym40il33nlz";
@@ -50,7 +50,7 @@ rec {
        Video
     */
     name = "gap-2.6.0";
-    buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = ftp://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
       sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
@@ -74,7 +74,7 @@ rec {
        Filters/Generic/FFT Inverse
     */
     name = "fourier-0.3.3";
-    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.nativeBuildInputs;
     postInstall = "fail";
     installPhase = "installPlugins fourier";
     src = fetchurl {
@@ -91,7 +91,7 @@ rec {
       Filters/Enhance/Smart remove selection
     */
     name = "resynthesizer-0.16";
-    buildInputs = [ gimp pkgs.fftw ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgs.fftw ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-0.16.tar.gz;
       sha256 = "1k90a1jzswxmajn56rdxa4r60v9v34fmqsiwfdxqcvx3yf4yq96x";
@@ -105,7 +105,7 @@ rec {
 
   texturize = pluginDerivation {
     name = "texturize-2.1";
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://prdownloads.sourceforge.net/gimp-texturize/texturize-2.1_src.tgz;
       sha256 = "0cdjq25g3yfxx6bzx6nid21kq659s1vl9id4wxyjs2dhcv229cg3";
@@ -118,7 +118,7 @@ rec {
       Filters/Enhance/Wavelet sharpen
     */
     name = "wavelet-sharpen-0.1.2";
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
       sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
@@ -131,7 +131,7 @@ rec {
        Layer/Liquid Rescale
     */
     name = "lqr-plugin-0.6.1";
-    buildInputs = [ pkgconfig libLQR gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ pkgconfig libLQR gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/gimp-lqr-plugin-0.6.1.tar.bz2;
       sha256 = "00hklkpcimcbpjly4rjhfipaw096cpy768g9wixglwrsyqhil7l9";
@@ -146,7 +146,7 @@ rec {
   let imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough?
   in pluginDerivation {
       name = "gmic-1.3.2.0";
-      buildInputs = [ imagemagick pkgconfig gimp pkgs.fftwSinglePrec ] ++ gimp.buildNativeInputs;
+      buildInputs = [ imagemagick pkgconfig gimp pkgs.fftwSinglePrec ] ++ gimp.nativeBuildInputs;
       src = fetchurl {
         url = http://dfn.dl.sourceforge.net/sourceforge/gmic/gmic_1.3.2.0.tar.gz;
         sha256 = "0mxq664vzzc2l6k6sqm9syp34mihhi262i6fixk1g12lmc28797h";
@@ -172,7 +172,7 @@ rec {
   # or use the binary
   ufraw = pluginDerivation {
     name = "ufraw-0.15";
-    buildInputs = [pkgs.lcms gimp] ++ gimp.buildNativeInputs;
+    buildInputs = [pkgs.lcms gimp] ++ gimp.nativeBuildInputs;
       # --enable-mime - install mime files, see README for more information
       # --enable-extras - build extra (dcraw, nikon-curve) executables
       # --enable-dst-correction - enable DST correction for file timestamps.
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index 6caf0f05c51..c02bc6024df 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
       zlib libtool
     ];
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   postInstall = ''
     sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index 27b3c0c9b03..a9ff7ef25c3 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ panotools wxGTK libtiff libpng openexr boost tclap
     exiv2 gettext ilmbase mesa freeglut glew libXmu libXi ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   propagatedUserEnvPackages = [ enblendenfuse autopanosiftc ];
 
diff --git a/pkgs/applications/graphics/kipi-plugins/default.nix b/pkgs/applications/graphics/kipi-plugins/default.nix
index e551b152390..61a8380b1c5 100644
--- a/pkgs/applications/graphics/kipi-plugins/default.nix
+++ b/pkgs/applications/graphics/kipi-plugins/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
       libksane libxslt gettext opencv libgpod gdk_pixbuf qjson
     ];
 
-  buildNativeInputs = [ pkgconfig cmake automoc4 ];
+  nativeBuildInputs = [ pkgconfig cmake automoc4 ];
 
   meta = {
     description = "Photo Management Program";
diff --git a/pkgs/applications/graphics/kuickshow/default.nix b/pkgs/applications/graphics/kuickshow/default.nix
index b26ac12300b..7a410642958 100644
--- a/pkgs/applications/graphics/kuickshow/default.nix
+++ b/pkgs/applications/graphics/kuickshow/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs imlib ];
 
-  buildNativeInputs = [ cmake gettext pkgconfig ];
+  nativeBuildInputs = [ cmake gettext pkgconfig ];
 }
diff --git a/pkgs/applications/graphics/sane/frontends.nix b/pkgs/applications/graphics/sane/frontends.nix
index 1c768e29873..9e73a08e096 100644
--- a/pkgs/applications/graphics/sane/frontends.nix
+++ b/pkgs/applications/graphics/sane/frontends.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [saneBackends libX11 gtk pkgconfig] ++
-	(if (libusb != null) then [libusb] else []);
+	(if libusb != null then [libusb] else []);
 
   meta = {
     homepage = "http://www.sane-project.org/";
diff --git a/pkgs/applications/graphics/sane/xsane.nix b/pkgs/applications/graphics/sane/xsane.nix
index c4fdf3a0044..de8d4c33652 100644
--- a/pkgs/applications/graphics/sane/xsane.nix
+++ b/pkgs/applications/graphics/sane/xsane.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ] ++
-	(if (libusb != null) then [libusb] else []);
+	(if libusb != null then [libusb] else []);
 
   meta = {
     homepage = http://www.sane-project.org/;
diff --git a/pkgs/applications/graphics/xara/default.nix b/pkgs/applications/graphics/xara/default.nix
index 8a6bac4db2b..cd3a09887d0 100644
--- a/pkgs/applications/graphics/xara/default.nix
+++ b/pkgs/applications/graphics/xara/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "05xbzq1i1vw2mdsv7zjqfpxfv3g1j0g5kks0gq6sh373xd6y8lyh";
   };
     
-  buildNativeInputs = [ automake pkgconfig gettext perl zip ];
+  nativeBuildInputs = [ automake pkgconfig gettext perl zip ];
   buildInputs = [ wxGTK gtk libxml2 freetype pango ];
 
   configureFlags = "--disable-svnversion";
diff --git a/pkgs/applications/graphics/xfig/default.nix b/pkgs/applications/graphics/xfig/default.nix
index e4ab5798918..de7e6fd48c2 100644
--- a/pkgs/applications/graphics/xfig/default.nix
+++ b/pkgs/applications/graphics/xfig/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   buildInputs = [x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
 
-  buildNativeInputs = [ imake makeWrapper ];
+  nativeBuildInputs = [ imake makeWrapper ];
 
   NIX_CFLAGS_COMPILE = "-I${libXpm}/include/X11";
 
diff --git a/pkgs/applications/graphics/xournal/default.nix b/pkgs/applications/graphics/xournal/default.nix
index 990709c03e5..1f1c26c1152 100644
--- a/pkgs/applications/graphics/xournal/default.nix
+++ b/pkgs/applications/graphics/xournal/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     pango libX11 xproto zlib poppler poppler_data
   ];
 
-  buildNativeInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
 
   # Build with poppler-0.18.x
   patchFlags = "-p0";
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index b9b14848370..562a9dd52ad 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   inherit python;
 
-  buildNativeInputs = [ makeWrapper pkgconfig ];
+  nativeBuildInputs = [ makeWrapper pkgconfig ];
 
   buildInputs =
     [ python pyqt4 sip popplerQt4 libpng imagemagick libjpeg
diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix
index 8da4e9de8fd..08b868bca92 100644
--- a/pkgs/applications/misc/googleearth/default.nix
+++ b/pkgs/applications/misc/googleearth/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     sha256 = "0bcpmnlk03382x577qbnbw3i6y08hr3qmg85pqj35scnl6van74c";
   };
 
-  buildNativeInputs = [
+  nativeBuildInputs = [
     glibc
     glib
     stdenv.gcc.gcc
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
     chmod +x $out/bin/googleearth
 
     fullPath=
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath:$i/lib
     done
           
diff --git a/pkgs/applications/misc/gphoto2/default.nix b/pkgs/applications/misc/gphoto2/default.nix
index 022cb437c69..7c732ab677a 100644
--- a/pkgs/applications/misc/gphoto2/default.nix
+++ b/pkgs/applications/misc/gphoto2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "08x1p8xhl65r79a6gn1fi63z1lspd5j55l05diiyzcwfxvqwsm47";
   };
   
-  buildNativeInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext ];
   buildInputs = [ libgphoto2 libexif popt libjpeg readline libtool ];
   
   meta = {
diff --git a/pkgs/applications/misc/kde-wacomtablet/default.nix b/pkgs/applications/misc/kde-wacomtablet/default.nix
index 46730848024..22587a1bae0 100644
--- a/pkgs/applications/misc/kde-wacomtablet/default.nix
+++ b/pkgs/applications/misc/kde-wacomtablet/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = with stdenv.lib; {
     description = "KDE Wacom graphic tablet configuration tool";
diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix
index b89a35d2f81..157ecc0ffd8 100644
--- a/pkgs/applications/misc/nut/default.nix
+++ b/pkgs/applications/misc/nut/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ neon libusb openssl udev avahi freeipmi ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags =
     [ "--with-all"
diff --git a/pkgs/applications/misc/qgis/default.nix b/pkgs/applications/misc/qgis/default.nix
index 7e27736ee7e..834b3f0cfbe 100644
--- a/pkgs/applications/misc/qgis/default.nix
+++ b/pkgs/applications/misc/qgis/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gdal qt4 flex bison proj geos x11 sqlite gsl pyqt4 qwt
     fcgi ];
 
-  buildNativeInputs = [ cmake python];
+  nativeBuildInputs = [ cmake python];
 
   patches = [ ./r14988.diff ];
 
diff --git a/pkgs/applications/misc/rsibreak/default.nix b/pkgs/applications/misc/rsibreak/default.nix
index 8aab11beec3..fe8118b1976 100644
--- a/pkgs/applications/misc/rsibreak/default.nix
+++ b/pkgs/applications/misc/rsibreak/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yrf73r8mixskh8b531wb8dfs9z7rrw010xsrflhjhjmqh94h8mw";
   };
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   buildInputs = [ kdelibs kdebase_workspace ];
 
diff --git a/pkgs/applications/misc/taskwarrior/default.nix b/pkgs/applications/misc/taskwarrior/default.nix
index cab0c2b07de..dae574804b4 100644
--- a/pkgs/applications/misc/taskwarrior/default.nix
+++ b/pkgs/applications/misc/taskwarrior/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = "0diy72sgiyvfl6bdy7k3qwv3ijx2z1y477smkk6jsbbd9fsp2lfg";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "GTD (getting things done) implementation";
diff --git a/pkgs/applications/misc/truecrypt/default.nix b/pkgs/applications/misc/truecrypt/default.nix
index 40a4f841266..19fa85b279c 100644
--- a/pkgs/applications/misc/truecrypt/default.nix
+++ b/pkgs/applications/misc/truecrypt/default.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ]; 
-  makeFlags = if (wxGUI) then "" else "NOGUI=1";
+  makeFlags = if wxGUI then "" else "NOGUI=1";
 
   meta = {
     description = "Free Open-Source filesystem on-the-fly encryption";
diff --git a/pkgs/applications/misc/yakuake/default.nix b/pkgs/applications/misc/yakuake/default.nix
index e06f812a18a..c781a5619ae 100644
--- a/pkgs/applications/misc/yakuake/default.nix
+++ b/pkgs/applications/misc/yakuake/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     homepage = http://yakuake.kde.org;
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index 1587a2e3495..9334ff4bd41 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
     '';
 
   crossAttrs = {
-    propagatedBuildInputs = [ ncurses.hostDrv zlib.hostDrv openssl.hostDrv ];
+    propagatedBuildInputs = [ ncurses.crossDrv zlib.crossDrv openssl.crossDrv ];
     configureFlags = ''
       --enable-finger --enable-html-highlight
       --enable-gopher --enable-cgi --enable-bittorrent --enable-nntp
-      --with-openssl=${openssl.hostDrv}
-      --with-bzip2=${bzip2.hostDrv}
+      --with-openssl=${openssl.crossDrv}
+      --with-bzip2=${bzip2.crossDrv}
     '';
   };
 
diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix
index 49bc93b80d2..7efdf7ed015 100644
--- a/pkgs/applications/networking/browsers/links2/default.nix
+++ b/pkgs/applications/networking/browsers/links2/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals enableX11 [ libX11 libXau libXt ]
     ++ stdenv.lib.optional enableDirectFB [ directfb ];
 
-  buildNativeInputs = [ pkgconfig bzip2 ];
+  nativeBuildInputs = [ pkgconfig bzip2 ];
 
   configureFlags = [ "--with-ssl" ]
     ++ stdenv.lib.optional (enableX11 || enableFB || enableDirectFB) "--enable-graphics"
diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix
index c0175fc6a70..63760c94426 100644
--- a/pkgs/applications/networking/browsers/lynx/default.nix
+++ b/pkgs/applications/networking/browsers/lynx/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   configureFlags = if sslSupport then "--with-ssl" else "";
   
   buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl;
-  buildNativeInputs = [ ncurses ];
+  nativeBuildInputs = [ ncurses ];
 
   crossAttrs = {
     configureFlags = "--enable-widec" +
diff --git a/pkgs/applications/networking/browsers/rekonq/default.nix b/pkgs/applications/networking/browsers/rekonq/default.nix
index 4a46de14f9b..fe573559961 100644
--- a/pkgs/applications/networking/browsers/rekonq/default.nix
+++ b/pkgs/applications/networking/browsers/rekonq/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs qca2 qoauth ];
 
-  buildNativeInputs = [ gettext pkgconfig shared_desktop_ontologies ];
+  nativeBuildInputs = [ gettext pkgconfig shared_desktop_ontologies ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix
index 38ef20ec969..5953111fad5 100644
--- a/pkgs/applications/networking/browsers/w3m/default.nix
+++ b/pkgs/applications/networking/browsers/w3m/default.nix
@@ -19,9 +19,10 @@ stdenv.mkDerivation rec {
     sha256 = "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579";
   };
 
-  # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
-  # alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
-  patches = stdenv.lib.optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ];
+  patches = [ ./glibc214.patch ]
+    # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
+    # alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
+    ++ stdenv.lib.optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ];
 
   buildInputs = [ncurses boehmgc gettext zlib]
     ++ stdenv.lib.optional sslSupport openssl
@@ -36,6 +37,8 @@ stdenv.mkDerivation rec {
     substituteInPlace ./configure --replace /usr /no-such-path
   '';
 
+  enableParallelBuilding = false;
+
   meta = {
     homepage = http://w3m.sourceforge.net/;
     description = "A text-mode web browser";
diff --git a/pkgs/applications/networking/browsers/w3m/glibc214.patch b/pkgs/applications/networking/browsers/w3m/glibc214.patch
new file mode 100644
index 00000000000..37e466e2106
--- /dev/null
+++ b/pkgs/applications/networking/browsers/w3m/glibc214.patch
@@ -0,0 +1,60 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/w3m/files/w3m-0.5.3-glibc214.patch?revision=1.1
+
+--- a/istream.c.~1.27.~	2011-01-04 18:22:22.000000000 +0900
++++ b/istream.c	2011-06-24 08:15:23.522990618 +0900
+@@ -22,8 +22,8 @@
+ static void basic_close(int *handle);
+ static int basic_read(int *handle, char *buf, int len);
+ 
+-static void file_close(struct file_handle *handle);
+-static int file_read(struct file_handle *handle, char *buf, int len);
++static void file_close(struct afile_handle *handle);
++static int file_read(struct afile_handle *handle, char *buf, int len);
+ 
+ static int str_read(Str handle, char *buf, int len);
+ 
+@@ -114,7 +114,7 @@
+     stream = New(union input_stream);
+     init_base_stream(&stream->base, STREAM_BUF_SIZE);
+     stream->file.type = IST_FILE;
+-    stream->file.handle = New(struct file_handle);
++    stream->file.handle = New(struct afile_handle);
+     stream->file.handle->f = f;
+     if (closep)
+ 	stream->file.handle->close = closep;
+@@ -658,13 +658,13 @@
+ }
+ 
+ static void
+-file_close(struct file_handle *handle)
++file_close(struct afile_handle *handle)
+ {
+     handle->close(handle->f);
+ }
+ 
+ static int
+-file_read(struct file_handle *handle, char *buf, int len)
++file_read(struct afile_handle *handle, char *buf, int len)
+ {
+     return fread(buf, 1, len, handle->f);
+ }
+--- a/istream.h.~1.12.~	2003-10-21 01:41:56.000000000 +0900
++++ b/istream.h	2011-06-24 08:15:54.392991144 +0900
+@@ -20,7 +20,7 @@
+ 
+ typedef struct stream_buffer *StreamBuffer;
+ 
+-struct file_handle {
++struct afile_handle {
+     FILE *f;
+     void (*close) ();
+ };
+@@ -53,7 +53,7 @@
+ 
+ struct file_stream {
+     struct stream_buffer stream;
+-    struct file_handle *handle;
++    struct afile_handle *handle;
+     char type;
+     char iseos;
+     int (*read) ();
diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix
index 04e119afdb1..8882a4388b0 100644
--- a/pkgs/applications/networking/instant-messengers/linphone/default.nix
+++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gtk libglade libosip libexosip readline mediastreamer speex ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   configureFlags = "--enable-external-ortp --enable-external-mediastreamer";
 
diff --git a/pkgs/applications/networking/instant-messengers/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index 66a18dbdfe9..715f0e5c2de 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     cp -r * $out/libexec/skype/
 
     fullPath=
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath''${fullPath:+:}$i/lib
     done
 
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
index 25919875bd1..c7a0401f3ee 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0fk65f7q75z3wm5h4wad7g5sm2j6r8v2845b74ycl29br78ki2hf";
   };
 
-  buildNativeInputs = [pkgconfig libxslt];
+  nativeBuildInputs = [pkgconfig libxslt];
   buildInputs = [ libxml2 dbus_glib sqlite libsoup libnice telepathy_glib gnutls ];
 
   configureFlags = "--with-ca-certificates=/etc/ca-bundle.crt";
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
index 1e2ded5292a..c8c685196cd 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib telepathy_glib dbus_glib pidgin ];
 
-  buildNativeInputs = [ pkgconfig libxslt ];
+  nativeBuildInputs = [ pkgconfig libxslt ];
 
   meta = {
     description = "A Telepathy connection manager based on libpurple";
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
index 70e6293c9a3..5c1c399ab49 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
@@ -20,7 +20,7 @@ let
     text_ui = [ ktp.telepathy_logger_qt qt_gstreamer telepathy_logger ];
   };
 
-  extraBuildNativeInputs = {
+  extraNativeBuildInputs = {
     telepathy_logger_qt = [ flex bison ];
   };
 
@@ -37,7 +37,7 @@ let
           inherit sha256;
         };
 
-        buildNativeInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraBuildNativeInputs);
+        nativeBuildInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraNativeBuildInputs);
         buildInputs = [ kdelibs telepathy_qt ]
           ++ stdenv.lib.optional (name != "ktp-common-internals") ktp.common_internals
           ++ (stdenv.lib.attrByPath [ key ] [] extraBuildInputs);
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
index a820e0f8a99..4dacdb9f1ed 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ dbus_glib libxml2 sqlite telepathy_glib pkgconfig intltool ];
 
-  buildNativeInputs = [ libxslt ];
+  nativeBuildInputs = [ libxslt ];
 
   configureFlags = "--enable-call";
 
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
index 4d79f0c89d8..1b2081c4dd0 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
@@ -11,5 +11,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ telepathy_glib ];
 
-  buildNativeInputs = [ pkgconfig libxslt ];
+  nativeBuildInputs = [ pkgconfig libxslt ];
 }
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
index e8b120b9331..a60e207b752 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "11cmmdq31kivm6nsv61hxy3hxnnmbd8sj55xqwx9hyqzybh70dyf";
   };
 
-  buildNativeInputs = [pkgconfigUpstream libxslt python];
+  nativeBuildInputs = [pkgconfigUpstream libxslt python];
   buildInputs = [ libxml2 dbus_glib telepathy_glib sofia_sip];
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
index 3c100282aa4..4300ac15c99 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ glib libxml2 telepathy_glib avahi libsoup libuuid gnutls
     sqlite ];
 
-  buildNativeInputs = [ libxslt pkgconfigUpstream ];
+  nativeBuildInputs = [ libxslt pkgconfigUpstream ];
 
   configureFlags = "--disable-avahi-tests";
 
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix
index 09f85b9edfc..32b531528d0 100644
--- a/pkgs/applications/networking/sync/rsync/default.nix
+++ b/pkgs/applications/networking/sync/rsync/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   patches = [] ++ stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff";
 
   buildInputs = stdenv.lib.optional enableACLs acl;
-  buildNativeInputs = [perl];
+  nativeBuildInputs = [perl];
 
   meta = {
     homepage = http://samba.anu.edu.au/rsync/;
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index ea30903fb38..35dd2d2a7d0 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation (rec {
     done
   '' else "";
 
-  dontStrip = if ! ocaml.nativeCompilers then true else false;
+  dontStrip = !ocaml.nativeCompilers;
 
   meta = {
     homepage = http://www.cis.upenn.edu/~bcpierce/unison/;
diff --git a/pkgs/applications/office/basket/default.nix b/pkgs/applications/office/basket/default.nix
index fff93ba9969..023d133b4dd 100644
--- a/pkgs/applications/office/basket/default.nix
+++ b/pkgs/applications/office/basket/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs qimageblitz kdepimlibs gpgme ];
 
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
   
   meta = {
     description = "A multi-purpose note-taking application";
diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/applications/office/calligra/default.nix
index 152246ee58f..0769f324c15 100644
--- a/pkgs/applications/office/calligra/default.nix
+++ b/pkgs/applications/office/calligra/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0q6ydi7hzrzwqzb38gikdh1l2zf8qp4i3nkgyb01148bjwrhvf21";
   };
 
-  buildNativeInputs = [ cmake perl pkgconfig ];
+  nativeBuildInputs = [ cmake perl pkgconfig ];
 
   buildInputs = [ kdelibs attica zlib libpng boost mesa kdepimlibs
     createresources eigen qca2 exiv2 soprano marble lcms2 fontconfig freetype
diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix
index da815c5fb6b..d55c66a2624 100644
--- a/pkgs/applications/office/kmymoney/default.nix
+++ b/pkgs/applications/office/kmymoney/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ kdepimlibs perl boost gpgme gmpxx libalkimia libofx libical ];
-  buildNativeInputs = [ cmake automoc4 gettext shared_mime_info pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 gettext shared_mime_info pkgconfig ];
 
   KDEDIRS = libalkimia;
 
diff --git a/pkgs/applications/office/skrooge/default.nix b/pkgs/applications/office/skrooge/default.nix
index 44ffdf57db5..dfb4c243c8c 100644
--- a/pkgs/applications/office/skrooge/default.nix
+++ b/pkgs/applications/office/skrooge/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs grantlee qca2 libofx ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     inherit (kdelibs.meta) platforms;
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
index b444783ba21..f4b353296fd 100644
--- a/pkgs/applications/science/chemistry/avogadro/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 eigen zlib openbabel mesa libX11 ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   NIX_CFLAGS_COMPILE = "-include ${mesa}/include/GL/glu.h";
 
diff --git a/pkgs/applications/science/math/ginac/default.nix b/pkgs/applications/science/math/ginac/default.nix
index 081d2bd6253..9bffc5548dd 100644
--- a/pkgs/applications/science/math/ginac/default.nix
+++ b/pkgs/applications/science/math/ginac/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ cln ];
   buildInputs = [ readline ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--disable-rpath";
 
diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix
index 7b97e1a82c0..acc4740eb6b 100644
--- a/pkgs/applications/science/math/yacas/default.nix
+++ b/pkgs/applications/science/math/yacas/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # Perl is only for the documentation
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   patches = [ ./gcc43.patch ];
 
diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix
index 52b93c8e174..1402dc9b182 100644
--- a/pkgs/applications/science/misc/tulip/default.nix
+++ b/pkgs/applications/science/misc/tulip/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libxml2 freetype glew mesa qt4 libjpeg ];
 
-  buildNativeInputs = [ cmake makeWrapper ];
+  nativeBuildInputs = [ cmake makeWrapper ];
 
   # FIXME: "make check" needs Docbook's DTD 4.4, among other things.
   doCheck = false;
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 7e842aa72e5..368557e3c2c 100644
--- a/pkgs/applications/version-management/fossil/default.nix
+++ b/pkgs/applications/version-management/fossil/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ zlib openssl readline sqlite ];
-  buildNativeInputs = [ tcl ];
+  nativeBuildInputs = [ tcl ];
 
   doCheck = true;
 
diff --git a/pkgs/applications/version-management/kdesvn/default.nix b/pkgs/applications/version-management/kdesvn/default.nix
index 7761c45850e..29b8b306fe5 100644
--- a/pkgs/applications/version-management/kdesvn/default.nix
+++ b/pkgs/applications/version-management/kdesvn/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ apr aprutil subversion db4 kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     description = "KDE SVN front-end";
diff --git a/pkgs/applications/video/bangarang/default.nix b/pkgs/applications/video/bangarang/default.nix
index 0bc7476dc82..5dde88076a1 100644
--- a/pkgs/applications/video/bangarang/default.nix
+++ b/pkgs/applications/video/bangarang/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ kdelibs phonon soprano shared_desktop_ontologies kdemultimedia taglib gettext ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = with stdenv.lib; {
     description = "A media player for KDE based on Nepomuk and Phonon";
diff --git a/pkgs/applications/video/dvdauthor/default.nix b/pkgs/applications/video/dvdauthor/default.nix
index 2e115806315..6889e4d9ef8 100644
--- a/pkgs/applications/video/dvdauthor/default.nix
+++ b/pkgs/applications/video/dvdauthor/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec{
   };
 
   buildInputs = [ libpng freetype libdvdread libxml2 zlib fribidi imagemagick ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Tools for generating DVD files to be played on standalone DVD players";
diff --git a/pkgs/applications/video/gpac/default.nix b/pkgs/applications/video/gpac/default.nix
index 292010a3717..6a863a5e2c4 100644
--- a/pkgs/applications/video/gpac/default.nix
+++ b/pkgs/applications/video/gpac/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   # this is the bare minimum configuration, as I'm only interested in MP4Box
   # For most other functionality, this should probably be extended
-  buildNativeInputs = [ pkgconfig zlib ];
+  nativeBuildInputs = [ pkgconfig zlib ];
 
   meta = {
     description = "Open Source multimedia framework for research and academic purposes";
diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 357c6eec6e7..0c22379c577 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
     ++ optional libpngSupport libpng
     ;
 
-  buildNativeInputs = [ yasm ];
+  nativeBuildInputs = [ yasm ];
 
   postConfigure = ''
     echo CONFIG_MPEGAUDIODSP=yes >> config.mak
diff --git a/pkgs/applications/video/mythtv/default.nix b/pkgs/applications/video/mythtv/default.nix
index 59a2519edb4..a4fe07b2d05 100644
--- a/pkgs/applications/video/mythtv/default.nix
+++ b/pkgs/applications/video/mythtv/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     libX11 libXv libXrandr libXvMC libXmu libXinerama libXxf86vm libXmu
   ];
 
-  buildNativeInputs = [ pkgconfig which ];
+  nativeBuildInputs = [ pkgconfig which ];
 
   patches = [ ./settings.patch ];
 }
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 7d04a02f27f..5529fbeff83 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       libdc1394 libraw1394
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags =
     [ "--enable-alsa"
diff --git a/pkgs/applications/video/xbmc/default.nix b/pkgs/applications/video/xbmc/default.nix
new file mode 100644
index 00000000000..4c5dc25cf9c
--- /dev/null
+++ b/pkgs/applications/video/xbmc/default.nix
@@ -0,0 +1,90 @@
+{ stdenv, lib, fetchurl, makeWrapper
+, pkgconfig, cmake, gnumake, yasm, python
+, boost
+, gettext, pcre, yajl, fribidi
+, openssl, gperf
+, libX11, xproto, inputproto
+, libXt, libXmu, libXext, xextproto
+, libXinerama, libXrandr, randrproto
+, libXtst, libXfixes, fixesproto
+, SDL, SDL_image, SDL_mixer, alsaLib
+, mesa, glew, fontconfig, freetype, ftgl
+, libjpeg, jasper, libpng, libtiff
+, ffmpeg, libmpeg2, libsamplerate, libmad
+, libogg, libvorbis, flac
+, lzo, libcdio, libmodplug, libass
+, sqlite, mysql
+, curl, bzip2, zip, unzip, glxinfo, xdpyinfo
+, dbus_libs ? null, dbusSupport ? true
+, udev, udevSupport ? true
+, libusb ? null, usbSupport ? false
+, samba ? null, sambaSupport ? true
+# TODO: would be nice to have nfsSupport (needs libnfs library)
+, libvdpau ? null, vdpauSupport ? true
+}:
+
+assert dbusSupport  -> dbus_libs != null;
+assert udevSupport  -> udev != null;
+assert usbSupport   -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable
+assert sambaSupport -> samba != null;
+assert vdpauSupport -> libvdpau != null && ffmpeg.vdpauSupport;
+
+stdenv.mkDerivation rec {
+    name = "xbmc-11.0";
+
+    src = fetchurl {
+      url = "http://mirrors.xbmc.org/releases/source/${name}.tar.gz";
+      sha256 = "1fe5d310c16138f26e2b13bc545604e95f48ace6c8636f23e77da402cd7b0b19";
+    };
+
+    buildInputs = [
+      makeWrapper
+      pkgconfig cmake gnumake yasm python
+      boost
+      gettext pcre yajl fribidi
+      openssl gperf
+      libX11 xproto inputproto
+      libXt libXmu libXext xextproto
+      libXinerama libXrandr randrproto
+      libXtst libXfixes fixesproto
+      SDL SDL_image SDL_mixer alsaLib
+      mesa glew fontconfig freetype ftgl
+      libjpeg jasper libpng libtiff
+      ffmpeg libmpeg2 libsamplerate libmad
+      libogg libvorbis flac
+      lzo libcdio libmodplug libass
+      sqlite mysql
+      curl bzip2 zip unzip glxinfo xdpyinfo
+    ]
+    ++ lib.optional dbusSupport dbus_libs
+    ++ lib.optional udevSupport udev
+    ++ lib.optional usbSupport libusb
+    ++ lib.optional sambaSupport samba
+    ++ lib.optional vdpauSupport libvdpau;
+
+    dontUseCmakeConfigure = true;
+
+    configureFlags = [
+      "--enable-external-libraries"
+      "--disable-webserver"
+    ]
+    ++ lib.optional (! sambaSupport) "--disable-samba"
+    ++ lib.optional vdpauSupport "--enable-vdpau";
+
+    postInstall = ''
+      for p in $(ls $out/bin/) ; do
+        wrapProgram $out/bin/$p \
+          --prefix PATH ":" "${python}/bin" \
+          --prefix PATH ":" "${glxinfo}/bin" \
+          --prefix PATH ":" "${xdpyinfo}/bin" \
+          --prefix LD_LIBRARY_PATH ":" "${curl}/lib" \
+          --prefix LD_LIBRARY_PATH ":" "${libvdpau}/lib"
+      done
+    '';
+
+    meta = {
+      homepage = http://xbmc.org/;
+      description = "XBMC Media Center";
+      license = "GPLv2";
+    };
+}
diff --git a/pkgs/applications/video/xine-ui/default.nix b/pkgs/applications/video/xine-ui/default.nix
index 821e1c7bb0c..9307b9e1d1b 100644
--- a/pkgs/applications/video/xine-ui/default.nix
+++ b/pkgs/applications/video/xine-ui/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1i3byriqav06b55kwzs4dkzrjw7mmmcv0rc7jzb52hn8qp8xz34x";
   };
   
-  buildNativeInputs = [ pkgconfig shared_mime_info ];
+  nativeBuildInputs = [ pkgconfig shared_mime_info ];
 
   buildInputs =
     [ xineLib libpng readline ncurses curl lirc libjpeg
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index 79ea777eead..195ee5d45c0 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = "make";
   
-  buildNativeInputs = [ makeWrapper pythonPackages.wrapPython ];
+  nativeBuildInputs = [ makeWrapper pythonPackages.wrapPython ];
 
   # patch the runner script in order to make wrapPythonPrograms work and run the program using a syscall
   # example code: /etc/nixos/nixpkgs/pkgs/development/interpreters/spidermonkey/1.8.0-rc1.nix
diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix
index 7d0f138880d..3c5d7af621c 100644
--- a/pkgs/build-support/builder-defs/builder-defs.nix
+++ b/pkgs/build-support/builder-defs/builder-defs.nix
@@ -20,21 +20,21 @@ let inherit (builtins) head tail trace; in
                 else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" 
                 else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || 
 			(hasSuffixHack ".tbz" s) then "tbz2"
-                else if (hasSuffixHack ".tar.Z" s) then "tZ" 
-                else if (hasSuffixHack ".tar.lzma" s) then "tar.lzma"
-                else if (hasSuffixHack ".tar.xz" s) then "tar.xz"
+                else if hasSuffixHack ".tar.Z" s then "tZ" 
+                else if hasSuffixHack ".tar.lzma" s then "tar.lzma"
+                else if hasSuffixHack ".tar.xz" s then "tar.xz"
                 else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip"
-                else if (hasSuffixHack "-cvs-export" s) then "cvs-dir"
-                else if (hasSuffixHack "-git-export" s) then "git-dir"
-                else if (hasSuffixHack ".nar.bz2" s) then "narbz2"
-                else if (hasSuffixHack ".rpm" s) then "rpm"
+                else if hasSuffixHack "-cvs-export" s then "cvs-dir"
+                else if hasSuffixHack "-git-export" s then "git-dir"
+                else if hasSuffixHack ".nar.bz2" s then "narbz2"
+                else if hasSuffixHack ".rpm" s then "rpm"
 
                 # Mostly for manually specified directories..
-                else if (hasSuffixHack "/" s) then "dir"
+                else if hasSuffixHack "/" s then "dir"
 
                 # Last block - for single files!! It should be always after .tar.*
-                else if (hasSuffixHack ".bz2" s) then "plain-bz2"
-                else if (hasSuffixHack ".gz" s) then "plain-gz"
+                else if hasSuffixHack ".bz2" s then "plain-bz2"
+                else if hasSuffixHack ".gz" s then "plain-gz"
 
 		# For bootstrap calls
 		else if (s ==("" + (substring 0 0 s))) then "empty"
@@ -391,7 +391,7 @@ let inherit (builtins) head tail trace; in
 
         cmakeFlags = attrByPath ["cmakeFlags"] [] args;
 
-        cmakeRPathFlag = if (attrByPath ["cmakeSkipRpath "] true args) then " -DCMAKE_SKIP_BUILD_RPATH=ON " else "";
+        cmakeRPathFlag = if attrByPath ["cmakeSkipRpath "] true args then " -DCMAKE_SKIP_BUILD_RPATH=ON " else "";
 
         cmakeBuildDir = attrByPath ["cmakeBuildDir"] "build" args;
 
@@ -508,7 +508,7 @@ let inherit (builtins) head tail trace; in
         );
 
 	builderDefsPackage = bd: func:
-	  if (builtins.isFunction func) then 
+	  if builtins.isFunction func then 
 	    (foldArgs 
 	      (x: y: ((func (bd // x // y)) // y))
               (innerBuilderDefsPackage bd)
@@ -588,7 +588,7 @@ let inherit (builtins) head tail trace; in
      url = srcInfo.url;
      sha256 = srcInfo.hash;
    } // 
-   (if (srcInfo ? downloadName) then {name = srcInfo.downloadName;} else {}));
+   (if srcInfo ? downloadName then {name = srcInfo.downloadName;} else {}));
 
    fetchGitFromSrcInfo = srcInfo: fetchgit {
      url = srcInfo.url;
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index a5884786b00..a4ef093d0c6 100644
--- a/pkgs/build-support/cabal/default.nix
+++ b/pkgs/build-support/cabal/default.nix
@@ -88,12 +88,12 @@
             configurePhase = ''
               eval "$preConfigure"
 
-              ${lib.optionalString (lib.attrByPath ["jailbreak"] false self) "${jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal && "
-              }for i in Setup.hs Setup.lhs; do
+              ${lib.optionalString (lib.attrByPath ["jailbreak"] false self) "${jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal"}
+              for i in Setup.hs Setup.lhs; do
                 test -f $i && ghc --make $i
               done
 
-              for p in $extraBuildInputs $propagatedBuildNativeInputs; do
+              for p in $extraBuildInputs $propagatedNativeBuildInputs; do
                 if [ -d "$p/include" ]; then
                   extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
                 fi
@@ -145,8 +145,8 @@
             '';
 
             postFixup = ''
-              if test -f $out/nix-support/propagated-build-native-inputs; then
-                ln -s $out/nix-support/propagated-build-native-inputs $out/nix-support/propagated-user-env-packages
+              if test -f $out/nix-support/propagated-native-build-inputs; then
+                ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
               fi
             '';
 
diff --git a/pkgs/build-support/checker/default.nix b/pkgs/build-support/checker/default.nix
index 4f95c3b95ee..66f8c45e37b 100644
--- a/pkgs/build-support/checker/default.nix
+++ b/pkgs/build-support/checker/default.nix
@@ -8,14 +8,14 @@ with lib;
 
 let 
   findInList = p: list: default:
-       if (list == []) then default else
+       if list == [] then default else
        if (p (head list)) then (head list) else
        findInList p (tail list) default;
   
 
   checkAttrInclusion = s: a: b:
 	(
-	if (! isAttrs b) then s else
+	if ! isAttrs b then s else
 	if (lib.attrByPath ["_type"] "" b) == "option" then "" else
 	findInList (x : x != "") 
 		( map (x: if (x == "servicesProposal") # this attr will be checked at another place ( -> upstart-jobs/default.nix )
diff --git a/pkgs/build-support/clang-wrapper/default.nix b/pkgs/build-support/clang-wrapper/default.nix
index 165e3bace90..9f560d0d2fb 100644
--- a/pkgs/build-support/clang-wrapper/default.nix
+++ b/pkgs/build-support/clang-wrapper/default.nix
@@ -47,11 +47,11 @@ stdenv.mkDerivation {
     else shell;
 
   crossAttrs = {
-    shell = shell.hostDrv + shell.hostDrv.shellPath;
-    libc = libc.hostDrv;
-    coreutils = coreutils.hostDrv;
-    binutils = binutils.hostDrv;
-    clang = clang.hostDrv;
+    shell = shell.crossDrv + shell.crossDrv.shellPath;
+    libc = libc.crossDrv;
+    coreutils = coreutils.crossDrv;
+    binutils = binutils.crossDrv;
+    clang = clang.crossDrv;
     #
     # This is not the best way to do this. I think the reference should be
     # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
diff --git a/pkgs/build-support/clang-wrapper/utils.sh b/pkgs/build-support/clang-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/clang-wrapper/utils.sh
+++ b/pkgs/build-support/clang-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix
index 537867f215b..1aebb7ecc87 100644
--- a/pkgs/build-support/fetchhg/default.nix
+++ b/pkgs/build-support/fetchhg/default.nix
@@ -2,16 +2,16 @@
 
 # TODO: statically check if mercurial as the https support if the url starts woth https.
 stdenv.mkDerivation {
-  name = "hg-archive" + (if (name != null) then "-${name}" else "");
+  name = "hg-archive" + (if name != null then "-${name}" else "");
   builder = ./builder.sh;
   buildInputs = [mercurial];
 
   # Nix <= 0.7 compatibility.
   id = md5;
 
-  outputHashAlgo = if (md5 != null) then "md5" else "sha256";
+  outputHashAlgo = if md5 != null then "md5" else "sha256";
   outputHashMode = "recursive";
-  outputHash = if (md5 != null) then md5 else sha256;
+  outputHash = if md5 != null then md5 else sha256;
   
   inherit url tag;
   preferLocalBuild = true;
diff --git a/pkgs/build-support/fetchmtn/default.nix b/pkgs/build-support/fetchmtn/default.nix
index 80d9091e01d..daead9ad6d2 100644
--- a/pkgs/build-support/fetchmtn/default.nix
+++ b/pkgs/build-support/fetchmtn/default.nix
@@ -10,7 +10,7 @@
 
 stdenv.mkDerivation {
   builder = ./builder.sh;
-  buildNativeInputs = [monotone];
+  nativeBuildInputs = [monotone];
 
   outputHashAlgo = "sha256";
   outputHashMode = "recursive";
diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix
index 98dd7d8fb8e..23404e6da5d 100644
--- a/pkgs/build-support/fetchurl/mirrors.nix
+++ b/pkgs/build-support/fetchurl/mirrors.nix
@@ -118,7 +118,6 @@ rec {
   ];
 
   savannah = [
-    ftp://ftp.twaren.net/Unix/NonGNU/
     ftp://mirror.csclub.uwaterloo.ca/nongnu/
     ftp://mirror.publicns.net/pub/nongnu/
     ftp://savannah.c3sl.ufpr.br/
diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh
index fae37342940..5a5bd45a8f8 100644
--- a/pkgs/build-support/gcc-cross-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh
@@ -28,7 +28,7 @@ if test -z "$nativeLibc"; then
 
     echo "$cflagsCompile -B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
 
-    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
+    echo "-L$libc/lib -rpath $libc/lib -rpath-link $libc/lib" > $out/nix-support/libc-ldflags
 
     # The dynamic linker is passed in `ldflagsBefore' to allow
     # explicit overrides of the dynamic linker by callers to gcc/ld
diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix
index be071607d8b..b2e30be10ef 100644
--- a/pkgs/build-support/gcc-cross-wrapper/default.nix
+++ b/pkgs/build-support/gcc-cross-wrapper/default.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
   utils = ./utils.sh;
   addFlags = ./add-flags;
   inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
-  crossConfig = if (cross != null) then cross.config else null;
+  crossConfig = if cross != null then cross.config else null;
   gccLibs = if gcc != null then gccLibs else null;
   name = chosenName;
   langC = if nativeTools then true else gcc.langC;
diff --git a/pkgs/build-support/gcc-cross-wrapper/utils.sh b/pkgs/build-support/gcc-cross-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/gcc-cross-wrapper/utils.sh
+++ b/pkgs/build-support/gcc-cross-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/gcc-upc-wrapper/utils.sh b/pkgs/build-support/gcc-upc-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/gcc-upc-wrapper/utils.sh
+++ b/pkgs/build-support/gcc-upc-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index ad2b8003f09..ed7ad0a50b7 100644
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -31,7 +31,7 @@ if test -z "$nativeLibc"; then
     # The dynamic linker is passed in `ldflagsBefore' to allow
     # explicit overrides of the dynamic linker by callers to gcc/ld
     # (the *last* value counts, so ours should come first).
-    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
+    echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before
 fi
 
 if test -n "$nativeTools"; then
@@ -152,6 +152,8 @@ fi
 
 mkGccWrapper $out/bin/gcj $gccPath/gcj || true
 
+mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true
+
 mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true
 mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
 mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
diff --git a/pkgs/build-support/gcc-wrapper/buildergo.sh b/pkgs/build-support/gcc-wrapper/buildergo.sh
deleted file mode 100644
index cb6bfd7f051..00000000000
--- a/pkgs/build-support/gcc-wrapper/buildergo.sh
+++ /dev/null
@@ -1,194 +0,0 @@
-source $stdenv/setup
-
-
-mkdir -p $out/bin
-mkdir -p $out/nix-support
-
-
-if test -z "$nativeLibc"; then
-    dynamicLinker="$libc/lib/$dynamicLinker"
-    echo $dynamicLinker > $out/nix-support/dynamic-linker
-
-    if test -e $libc/lib/32/ld-linux.so.2; then
-        echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
-    fi
-
-    # The "-B$libc/lib/" flag is a quick hack to force gcc to link
-    # against the crt1.o from our own glibc, rather than the one in
-    # /usr/lib.  (This is only an issue when using an `impure'
-    # compiler/linker, i.e., one that searches /usr/lib and so on.)
-    #
-    # Unfortunately, setting -B appears to override the default search
-    # path. Thus, the gcc-specific "../includes-fixed" directory is
-    # now longer searched and glibc's <limits.h> header fails to
-    # compile, because it uses "#include_next <limits.h>" to find the
-    # limits.h file in ../includes-fixed. To remedy the problem,
-    # another -idirafter is necessary to add that directory again.
-    echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
-
-    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
-
-    # The dynamic linker is passed in `ldflagsBefore' to allow
-    # explicit overrides of the dynamic linker by callers to gcc/ld
-    # (the *last* value counts, so ours should come first).
-    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
-fi
-
-if test -n "$nativeTools"; then
-    gccPath="$nativePrefix/bin"
-    ldPath="$nativePrefix/bin"
-else
-    if test -e "$gcc/lib64"; then
-        gccLDFlags="$gccLDFlags -L$gcc/lib64"
-    fi
-    gccLDFlags="$gccLDFlags -L$gcc/lib"
-    if [ -n "$langVhdl" ]; then
-        gccLDFlags="$gccLDFlags -L$zlib/lib"
-    fi
-    echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
-
-    # GCC shows $gcc/lib in `gcc -print-search-dirs', but not
-    # $gcc/lib64 (even though it does actually search there...)..
-    # This confuses libtool.  So add it to the compiler tool search
-    # path explicitly.
-    if test -e "$gcc/lib64"; then
-        gccCFlags="$gccCFlags -B$gcc/lib64"
-    fi
-
-    # Find the gcc libraries path (may work only without multilib)
-    if [ -n "$langAda" ]; then
-        basePath=`echo $gcc/lib/*/*/*`
-        gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude"
-
-        gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib"
-        echo "$gnatCFlags" > $out/nix-support/gnat-cflags
-    fi
-    echo "$gccCFlags" > $out/nix-support/gcc-cflags
-    
-    gccPath="$gcc/bin"
-    ldPath="$binutils/bin"
-fi
-
-
-doSubstitute() {
-    local src=$1
-    local dst=$2
-    # Can't use substitute() here, because replace may not have been
-    # built yet (in the bootstrap).
-    sed \
-        -e "s^@out@^$out^g" \
-        -e "s^@shell@^$shell^g" \
-        -e "s^@gcc@^$gcc^g" \
-        -e "s^@gccProg@^$gccProg^g" \
-        -e "s^@gnatProg@^$gnatProg^g" \
-        -e "s^@gnatlinkProg@^$gnatlinkProg^g" \
-        -e "s^@binutils@^$binutils^g" \
-        -e "s^@coreutils@^$coreutils^g" \
-        -e "s^@libc@^$libc^g" \
-        -e "s^@ld@^$ldPath/ld^g" \
-        < "$src" > "$dst" 
-}
-
-
-# Make wrapper scripts around gcc, g++, and gfortran.  Also make symlinks
-# cc, c++, and f77.
-mkGccWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gccProg="$src"
-    doSubstitute "$gccWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-mkGnatWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gnatProg="$src"
-    doSubstitute "$gnatWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-mkGnatLinkWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gnatlinkProg="$src"
-    doSubstitute "$gnatlinkWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-if mkGccWrapper $out/bin/gcc $gccPath/gcc
-then
-    ln -sv gcc $out/bin/cc
-fi
-
-if mkGccWrapper $out/bin/g++ $gccPath/g++
-then
-    ln -sv g++ $out/bin/c++
-fi
-
-if mkGccWrapper $out/bin/gfortran $gccPath/gfortran
-then
-    ln -sv gfortran $out/bin/g77
-    ln -sv gfortran $out/bin/f77
-fi
-
-mkGccWrapper $out/bin/gcj $gccPath/gcj || true
-
-mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true
-
-mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true
-mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
-mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
-mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true
-
-if [ -f $gccPath/ghdl ]; then
-    ln -sf $gccPath/ghdl $out/bin/ghdl
-fi
-
-# Create a symlink to as (the assembler).  This is useful when a
-# gcc-wrapper is installed in a user environment, as it ensures that
-# the right assembler is called.
-ln -s $ldPath/as $out/bin/as
-
-
-# Make a wrapper around the linker.
-doSubstitute "$ldWrapper" "$out/bin/ld"
-chmod +x "$out/bin/ld"
-
-
-# Emit a setup hook.  Also store the path to the original GCC and
-# Glibc.
-test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
-test -n "$libc" && echo $libc > $out/nix-support/orig-libc
-
-doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
-
-doSubstitute "$setupHook" "$out/nix-support/setup-hook"
-
-cp -p $utils $out/nix-support/utils.sh
-
-
-# Propagate the wrapped gcc so that if you install the wrapper, you get
-# tools like gcov, the manpages, etc. as well (including for binutils
-# and Glibc).
-if test -z "$nativeTools"; then
-    echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
-fi
diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix
index 5e50a5c7dfb..87617621e64 100644
--- a/pkgs/build-support/gcc-wrapper/default.nix
+++ b/pkgs/build-support/gcc-wrapper/default.nix
@@ -25,7 +25,7 @@ let
   langGo = if nativeTools then false else gcc ? langGo && gcc.langGo;
 in
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name =
     (if name != "" then name else gccName + "-wrapper") +
     (if gcc != null && gccVersion != "" then "-" + gccVersion else "");
@@ -50,17 +50,17 @@ stdenv.mkDerivation ({
   langFortran = if nativeTools then false else gcc ? langFortran;
   langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
   langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
-  zlib = if (gcc != null && gcc ? langVhdl) then zlib else null;
+  zlib = if gcc != null && gcc ? langVhdl then zlib else null;
   shell = if shell == "" then stdenv.shell else
     if builtins.isAttrs shell then (shell + shell.shellPath)
     else shell;
 
   crossAttrs = {
-    shell = shell.hostDrv + shell.hostDrv.shellPath;
-    libc = libc.hostDrv;
-    coreutils = coreutils.hostDrv;
-    binutils = binutils.hostDrv;
-    gcc = gcc.hostDrv;
+    shell = shell.crossDrv + shell.crossDrv.shellPath;
+    libc = libc.crossDrv;
+    coreutils = coreutils.crossDrv;
+    binutils = binutils.crossDrv;
+    gcc = gcc.crossDrv;
     #
     # This is not the best way to do this. I think the reference should be
     # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
@@ -85,15 +85,10 @@ stdenv.mkDerivation ({
     if !nativeLibc then
       (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
        if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
-       if stdenv.isArm then "ld-linux.so.3" else
+       # ARM with a wildcard, which can be "" or "-armhf".
+       if stdenv.isArm then "ld-linux*.so.3" else
        if stdenv.system == "powerpc-linux" then "ld.so.1" else
        if stdenv.system == "mips64el-linux" then "ld.so.1" else
        abort "don't know the name of the dynamic linker for this platform")
     else "";
 }
-#  This go wrapper should be reworked in stdenv-updates.
-// (if langGo then
-{
-  inherit langGo;
-  builder = ./buildergo.sh;
-} else {}))
diff --git a/pkgs/build-support/gcc-wrapper/utils.sh b/pkgs/build-support/gcc-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/gcc-wrapper/utils.sh
+++ b/pkgs/build-support/gcc-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 2c0ca37553d..051989a096e 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -22,7 +22,7 @@ in
 stdenv.mkDerivation {
   name = "initrd";
   builder = ./make-initrd.sh;
-  buildNativeInputs = inputsFun stdenv.platform.uboot;
+  nativeBuildInputs = inputsFun stdenv.platform.uboot;
 
   makeUInitrd = makeUInitrdFun stdenv.platform.uboot;
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
   pathsFromGraph = ./paths-from-graph.pl;
 
   crossAttrs = {
-    buildNativeInputs = inputsFun stdenv.cross.platform.uboot;
+    nativeBuildInputs = inputsFun stdenv.cross.platform.uboot;
     makeUInitrd = makeUInitrdFun stdenv.cross.platform.uboot;
   };
 }
diff --git a/pkgs/build-support/setup-hooks/autoreconf.sh b/pkgs/build-support/setup-hooks/autoreconf.sh
index 027c8322163..f70a1087084 100644
--- a/pkgs/build-support/setup-hooks/autoreconf.sh
+++ b/pkgs/build-support/setup-hooks/autoreconf.sh
@@ -1,7 +1,7 @@
 preConfigurePhases+=" autoreconfPhase"
 
 for i in @autoconf@ @automake@ @libtool@; do
-    findInputs $i nativePkgs propagated-build-native-inputs
+    findInputs $i nativePkgs propagated-native-build-inputs
 done
 
 autoreconfPhase() {
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 474d43c30ff..5ae2e7b4fc9 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -55,7 +55,7 @@ rec {
         mkdir -p $out/nix-support
         cp ${script} $out/nix-support/setup-hook
       '' + stdenv.lib.optionalString (deps != []) ''
-        echo ${toString deps} > $out/nix-support/propagated-build-native-inputs
+        echo ${toString deps} > $out/nix-support/propagated-native-build-inputs
       '' + stdenv.lib.optionalString (substitutions != {}) ''
         substituteAll ${script} $out/nix-support/setup-hook
       '');
diff --git a/pkgs/data/documentation/gnome-user-docs/default.nix b/pkgs/data/documentation/gnome-user-docs/default.nix
index f92882b9a83..9e6639c0a0a 100644
--- a/pkgs/data/documentation/gnome-user-docs/default.nix
+++ b/pkgs/data/documentation/gnome-user-docs/default.nix
@@ -8,5 +8,5 @@ stdenv.mkDerivation {
     sha256 = "1ka0nw2kc85p10y8x31v0wv06a88k7qrgafp4ys04y9fzz0rkcjj";
   };
 
-  buildNativeInputs = [ itstool libxml2 gettext ];
+  nativeBuildInputs = [ itstool libxml2 gettext ];
 }
diff --git a/pkgs/data/misc/gsettings-desktop-schemas/default.nix b/pkgs/data/misc/gsettings-desktop-schemas/default.nix
index 4527b2fec0b..c934863d75d 100644
--- a/pkgs/data/misc/gsettings-desktop-schemas/default.nix
+++ b/pkgs/data/misc/gsettings-desktop-schemas/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) maintainers platforms;
diff --git a/pkgs/data/misc/xkeyboard-config/default.nix b/pkgs/data/misc/xkeyboard-config/default.nix
index 67bb79725fb..15574a1dc36 100644
--- a/pkgs/data/misc/xkeyboard-config/default.nix
+++ b/pkgs/data/misc/xkeyboard-config/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gettext ];
 
-  buildNativeInputs = [ perl perlXMLParser intltool xkbcomp ];
+  nativeBuildInputs = [ perl perlXMLParser intltool xkbcomp ];
 
   patches = [ ./eo.patch ];
 
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 a1dbf78bba2..fffffcb0c2d 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
     sha256 = "cc7f15e54e2640697b58c26e74cc3f6ebadeb4ef6622bffe9c1e6874cc3478d6";
   };
   
-  buildNativeInputs = [ pkgconfig intltool iconnamingutils gtk ];
+  nativeBuildInputs = [ pkgconfig intltool iconnamingutils gtk ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
index a0c11d1b85e..f31875bed91 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
@@ -13,5 +13,5 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ glib libtasn1 ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
index a1427d82283..6ca2a9142c1 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
       libtasn1 libtool libcanberra
     ];
 
-  buildNativeInputs = [ pkgconfig intltool which ];
+  nativeBuildInputs = [ pkgconfig intltool which ];
   configureFlags = "--disable-scrollkeeper";
 
   NIX_CFLAGS_COMPILE="-I${GConf}/include/gconf/2";
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
index 8704d22d2f2..ccabff27549 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
@@ -13,5 +13,5 @@ stdenv.mkDerivation {
     [ dbus_glib gtk libXau libXtst inputproto libglade startup_notification
       GConf upower
     ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
index 47ddde9029f..dca3b3a16a2 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
@@ -14,5 +14,5 @@ stdenv.mkDerivation {
       pulseaudio
     ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gvfs/default.nix b/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
index bae6c19c6ea..9e7949047c7 100644
--- a/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
       libgnome_keyring libsoup avahi libtool libxslt docbook_xsl
     ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   enableParallelBuilding = true;
 }
diff --git a/pkgs/desktops/gnome-2/desktop/zenity/default.nix b/pkgs/desktops/gnome-2/desktop/zenity/default.nix
index 9e678514689..3ab8838c97b 100644
--- a/pkgs/desktops/gnome-2/desktop/zenity/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/zenity/default.nix
@@ -12,5 +12,5 @@ stdenv.mkDerivation {
   configureFlags = "--disable-scrollkeeper";
   buildInputs = [ gtk libglade libxml2 libxslt libX11 ];
 
-  buildNativeInputs = [ pkgconfig intltool gnome_doc_utils which ];
+  nativeBuildInputs = [ pkgconfig intltool gnome_doc_utils which ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix
index a75e089b508..4769247a516 100644
--- a/pkgs/desktops/gnome-2/platform/GConf/default.nix
+++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   buildInputs = [ ORBit2 dbus_libs dbus_glib libxml2 polkit gtk ];
   propagatedBuildInputs = [ glib ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--with-gtk=2.0";
 }
diff --git a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
index e58dd38e369..ec6931724bc 100644
--- a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
+++ b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
@@ -9,6 +9,6 @@ stdenv.mkDerivation rec {
     sha256 = "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libIDL ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/gconfmm/default.nix b/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
index 0597da92e68..8f6075375d6 100644
--- a/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
+++ b/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "a5e0092bb73371a3ca76b2ecae794778f3a9409056fee9b28ec1db072d8e6108";
   };
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ GConf gtkmm glibmm ];
 
diff --git a/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix b/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
index 38b816ccc77..93bb44c54e1 100644
--- a/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
+++ b/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gdk.patch ];
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ gtkglext gtkmm gtk mesa gdk_pixbuf ];
 
diff --git a/pkgs/desktops/gnome-2/platform/libIDL/default.nix b/pkgs/desktops/gnome-2/platform/libIDL/default.nix
index 5783976d9a2..64f2b19c3e9 100644
--- a/pkgs/desktops/gnome-2/platform/libIDL/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libIDL/default.nix
@@ -11,5 +11,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib gettext ];
 
-  buildNativeInputs = [ flex bison pkgconfig ];
+  nativeBuildInputs = [ flex bison pkgconfig ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libbonobo/default.nix b/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
index bd268e5ec43..79c41f924d3 100644
--- a/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = "export USER=`whoami`";
-  buildNativeInputs = [ flex bison pkgconfig intltool procps ];
+  nativeBuildInputs = [ flex bison pkgconfig intltool procps ];
   buildInputs = [ libxml2 ];
   propagatedBuildInputs = [ popt glib ORBit2 ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix b/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
index 6eefd42b38d..55a4ecec695 100644
--- a/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1kbgqh7bw0fdx4f1a1aqwpff7gp5mwhbaz60c6c98bc4djng5dgs";
   };
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs = [ bison popt gtk libxml2 GConf libglade libtool ];
   propagatedBuildInputs = [ libbonobo libgnomecanvas libgnome ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnome/default.nix b/pkgs/desktops/gnome-2/platform/libgnome/default.nix
index 76f213b5fa8..37dbfd12961 100644
--- a/pkgs/desktops/gnome-2/platform/libgnome/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnome/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "197pnq8y0knqjhm2fg4j6hbqqm3qfzfnd0irhwxpk1b4hqb3kimj";
   };
   
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ popt zlib intltool GConf gnome_vfs libcanberra libtool ];
   propagatedBuildInputs = [ glib libbonobo ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix b/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
index bf2c0360aa2..dd6ebbb9174 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
@@ -10,6 +10,6 @@ stdenv.mkDerivation rec {
   };
   
   buildInputs = [ libglade ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   propagatedBuildInputs = [ libart_lgpl gtk ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix b/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
index 379602c6ea3..cc8db43ad13 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "03rwbli76crkjl6gp422wrc9lqpl174k56cp9i96b7l8jlj2yddf";
   };
   
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs =
     [ xlibs.xlibs libxml2 GConf pango glib libgnome_keyring libglade libtool ];
 
diff --git a/pkgs/desktops/gnome-2/platform/libunique/default.nix b/pkgs/desktops/gnome-2/platform/libunique/default.nix
index 2661307c9d2..6b9cee80042 100644
--- a/pkgs/desktops/gnome-2/platform/libunique/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libunique/default.nix
@@ -9,6 +9,6 @@ stdenv.mkDerivation rec {
     sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ gtk ];
 }
diff --git a/pkgs/desktops/kde-4.7/kde-wallpapers.nix b/pkgs/desktops/kde-4.7/kde-wallpapers.nix
index 97773ffadcd..57f2b643aa4 100644
--- a/pkgs/desktops/kde-4.7/kde-wallpapers.nix
+++ b/pkgs/desktops/kde-4.7/kde-wallpapers.nix
@@ -1,7 +1,7 @@
 { kde, cmake }:
 
 kde {
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./files/kde-wallpapers-buildsystem.patch ];
 
diff --git a/pkgs/desktops/kde-4.7/kde-workspace.nix b/pkgs/desktops/kde-4.7/kde-workspace.nix
index 1ece3f49076..82730702989 100644
--- a/pkgs/desktops/kde-4.7/kde-workspace.nix
+++ b/pkgs/desktops/kde-4.7/kde-workspace.nix
@@ -15,7 +15,7 @@ kde {
       libusb python libqalculate kdepimlibs pam prison akonadi
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure =
    ''
diff --git a/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix b/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
index 72676e35f71..7028b9db228 100644
--- a/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
+++ b/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
@@ -3,7 +3,7 @@
 kde {
   buildInputs = [ kdelibs xscreensaver kde_workspace eigen libkexiv2 libXt ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure = "cp -v ${./FindXscreensaver.cmake} cmake/modules/FindXscreensaver.cmake";
 
diff --git a/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix b/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
index df26eb2717e..43f54b552e5 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
+++ b/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patchPhase = "sed -e /RPATH/d -i CMakeLists.txt";
 
diff --git a/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix b/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
index 0d0aa816a94..29e25093d11 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
+++ b/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
@@ -2,8 +2,8 @@
 
 kde {
   propagatedBuildInputs = [ qt4 phonon qimageblitz ];
-  buildNativeInputs = [ cmake ];
-  propagatedBuildNativeInputs = [ smokegen ];
+  nativeBuildInputs = [ cmake ];
+  propagatedNativeBuildInputs = [ smokegen ];
 
   meta = {
     description = "C++ parser used to generate language bindings for Qt/KDE";
diff --git a/pkgs/desktops/kde-4.7/kdegames.nix b/pkgs/desktops/kde-4.7/kdegames.nix
index 03ecfbd88b4..dfca49be12f 100644
--- a/pkgs/desktops/kde-4.7/kdegames.nix
+++ b/pkgs/desktops/kde-4.7/kdegames.nix
@@ -7,7 +7,7 @@ kde rec {
 
   pythonPath = [ pythonPackages.twisted pykde4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # TODO: ggz
 
diff --git a/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix b/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
index b6b659c3947..c03c82469e6 100644
--- a/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
+++ b/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
@@ -6,7 +6,7 @@ kde {
   buildInputs =
     [ kdelibs exiv2 shared_desktop_ontologies kde_baseapps libkipi libjpeg ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Gwenview, the KDE image viewer";
diff --git a/pkgs/desktops/kde-4.7/kdelibs.nix b/pkgs/desktops/kde-4.7/kdelibs.nix
index 429fbb2a709..41a648d1056 100644
--- a/pkgs/desktops/kde-4.7/kdelibs.nix
+++ b/pkgs/desktops/kde-4.7/kdelibs.nix
@@ -15,7 +15,7 @@ kde {
 
   propagatedBuildInputs = [ qt4 soprano strigi phonon ];
 
-  propagatedBuildNativeInputs = [ automoc4 cmake perl shared_mime_info ];
+  propagatedNativeBuildInputs = [ automoc4 cmake perl shared_mime_info ];
 
   # TODO: make sonnet plugins (dictionaries) really work.
   # There are a few hardcoded paths.
diff --git a/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix b/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
index 704f6d04dfe..440e8595704 100644
--- a/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
+++ b/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
@@ -7,7 +7,7 @@ kde {
     jasper libidn mediastreamer msilbc libxml2 libxslt giflib libgadu boost qca2
     gpgme sqlite ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   KDEDIRS = libktorrent;
 
diff --git a/pkgs/desktops/kde-4.7/kdeplasma-addons.nix b/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
index ddffa48dc55..30a32b465b6 100644
--- a/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
+++ b/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
@@ -11,7 +11,7 @@ kde {
     attica python qca2 qimageblitz kdepimlibs
     libqalculate libXtst shared_desktop_ontologies marble libkexiv2];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "KDE Plasma Addons";
diff --git a/pkgs/desktops/kde-4.7/oxygen-icons.nix b/pkgs/desktops/kde-4.7/oxygen-icons.nix
index f2a5e666232..1f7572b4d8e 100644
--- a/pkgs/desktops/kde-4.7/oxygen-icons.nix
+++ b/pkgs/desktops/kde-4.7/oxygen-icons.nix
@@ -5,7 +5,7 @@ kde {
   outputHashMode = "recursive";
   outputHash = "0c12c72bcf41cfaf03f85fc1ae27e44d8cecac3deb504ab1de4c30f4fc9e3cd0";
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "KDE Oxygen theme icons";
diff --git a/pkgs/desktops/kde-4.7/support/akonadi/default.nix b/pkgs/desktops/kde-4.7/support/akonadi/default.nix
index 38ec7f85907..cf515509602 100644
--- a/pkgs/desktops/kde-4.7/support/akonadi/default.nix
+++ b/pkgs/desktops/kde-4.7/support/akonadi/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 soprano libxslt boost ];
 
-  buildNativeInputs = [ cmake automoc4 shared_mime_info ];
+  nativeBuildInputs = [ cmake automoc4 shared_mime_info ];
 
   enableParallelBuilding = true;
   
diff --git a/pkgs/desktops/kde-4.8/kde-runtime.nix b/pkgs/desktops/kde-4.8/kde-runtime.nix
index b219bd4599a..f8246190462 100644
--- a/pkgs/desktops/kde-4.8/kde-runtime.nix
+++ b/pkgs/desktops/kde-4.8/kde-runtime.nix
@@ -9,7 +9,7 @@ kde {
       samba (libcanberra.override { gtk = null; }) ntrack libjpeg qca2 pulseaudio
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   passthru.propagatedUserEnvPackages = [ virtuoso ];
 
diff --git a/pkgs/desktops/kde-4.8/kde-wallpapers.nix b/pkgs/desktops/kde-4.8/kde-wallpapers.nix
index 803b027668a..ad4c22c632d 100644
--- a/pkgs/desktops/kde-4.8/kde-wallpapers.nix
+++ b/pkgs/desktops/kde-4.8/kde-wallpapers.nix
@@ -1,7 +1,7 @@
 { kde, cmake }:
 
 kde {
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./files/kde-wallpapers-buildsystem.patch ];
 
diff --git a/pkgs/desktops/kde-4.8/kde-workspace.nix b/pkgs/desktops/kde-4.8/kde-workspace.nix
index 1a86eacb336..97192e55be3 100644
--- a/pkgs/desktops/kde-4.8/kde-workspace.nix
+++ b/pkgs/desktops/kde-4.8/kde-workspace.nix
@@ -16,7 +16,7 @@ kde {
       kactivities
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure =
    ''
diff --git a/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix b/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
index 72676e35f71..7028b9db228 100644
--- a/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
+++ b/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
@@ -3,7 +3,7 @@
 kde {
   buildInputs = [ kdelibs xscreensaver kde_workspace eigen libkexiv2 libXt ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure = "cp -v ${./FindXscreensaver.cmake} cmake/modules/FindXscreensaver.cmake";
 
diff --git a/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix b/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
index 2c1378f1049..f2b5462f33e 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ smokeqt perl ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches =
     # The order is important
diff --git a/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix b/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
index 5dd25899e74..723732f6104 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ smokeqt ruby ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   # The second patch is not ready for upstream submmission. I should add an
   # option() instead.
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix b/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
index e32ed57c907..8b5da2a641d 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./smokegen-nix.patch ];
 
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix b/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
index 6f1b7a0b708..0e823a95e3b 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
@@ -3,7 +3,7 @@
 kde {
   # attica, akonadi and kdepimlibs are disabled due to smokegen crash
   buildInputs = [ smokeqt kdelibs shared_desktop_ontologies ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DQTDEFINES_FILE=${smokeqt}/share/smokegen/qtdefines";
   meta = {
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix b/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
index 0d0aa816a94..29e25093d11 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
@@ -2,8 +2,8 @@
 
 kde {
   propagatedBuildInputs = [ qt4 phonon qimageblitz ];
-  buildNativeInputs = [ cmake ];
-  propagatedBuildNativeInputs = [ smokegen ];
+  nativeBuildInputs = [ cmake ];
+  propagatedNativeBuildInputs = [ smokegen ];
 
   meta = {
     description = "C++ parser used to generate language bindings for Qt/KDE";
diff --git a/pkgs/desktops/kde-4.8/kdegames.nix b/pkgs/desktops/kde-4.8/kdegames.nix
index 03ecfbd88b4..dfca49be12f 100644
--- a/pkgs/desktops/kde-4.8/kdegames.nix
+++ b/pkgs/desktops/kde-4.8/kdegames.nix
@@ -7,7 +7,7 @@ kde rec {
 
   pythonPath = [ pythonPackages.twisted pykde4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # TODO: ggz
 
diff --git a/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix b/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
index b6b659c3947..c03c82469e6 100644
--- a/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
+++ b/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
@@ -6,7 +6,7 @@ kde {
   buildInputs =
     [ kdelibs exiv2 shared_desktop_ontologies kde_baseapps libkipi libjpeg ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Gwenview, the KDE image viewer";
diff --git a/pkgs/desktops/kde-4.8/kdelibs.nix b/pkgs/desktops/kde-4.8/kdelibs.nix
index 31df83e5ee9..0e7c9cfdbea 100644
--- a/pkgs/desktops/kde-4.8/kdelibs.nix
+++ b/pkgs/desktops/kde-4.8/kdelibs.nix
@@ -15,7 +15,7 @@ kde {
 
   propagatedBuildInputs = [ qt4 soprano strigi phonon ];
 
-  propagatedBuildNativeInputs = [ automoc4 cmake perl shared_mime_info ];
+  propagatedNativeBuildInputs = [ automoc4 cmake perl shared_mime_info ];
 
   # TODO: make sonnet plugins (dictionaries) really work.
   # There are a few hardcoded paths.
diff --git a/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix b/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
index ec48b96fe19..d1d9f0c8e03 100644
--- a/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
+++ b/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
@@ -7,7 +7,7 @@ kde {
     jasper libidn mediastreamer msilbc libxml2 libxslt giflib libgadu boost qca2
     gpgme sqlite ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   KDEDIRS = libktorrent;
 
diff --git a/pkgs/desktops/kde-4.8/kdeplasma-addons.nix b/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
index 9d70579d6d2..a69002bff28 100644
--- a/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
+++ b/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
@@ -11,7 +11,7 @@ kde {
     attica python qca2 qimageblitz kdepimlibs libdbusmenu_qt
     libqalculate libXtst shared_desktop_ontologies marble libkexiv2];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "KDE Plasma Addons";
diff --git a/pkgs/desktops/kde-4.8/oxygen-icons.nix b/pkgs/desktops/kde-4.8/oxygen-icons.nix
index c821e2a7aac..52e5e5f6bb0 100644
--- a/pkgs/desktops/kde-4.8/oxygen-icons.nix
+++ b/pkgs/desktops/kde-4.8/oxygen-icons.nix
@@ -5,7 +5,7 @@ kde {
   outputHashMode = "recursive";
   outputHash = "3984dac79aa7398578bcd9d69d74988bd992807518d46cd1dabc03867044c8a4";
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "KDE Oxygen theme icons";
diff --git a/pkgs/desktops/kde-4.8/support/akonadi/default.nix b/pkgs/desktops/kde-4.8/support/akonadi/default.nix
index b939eb19b5e..9a9e8a87066 100644
--- a/pkgs/desktops/kde-4.8/support/akonadi/default.nix
+++ b/pkgs/desktops/kde-4.8/support/akonadi/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 soprano libxslt boost ];
 
-  buildNativeInputs = [ cmake automoc4 shared_mime_info ];
+  nativeBuildInputs = [ cmake automoc4 shared_mime_info ];
 
   enableParallelBuilding = true;
   
diff --git a/pkgs/development/compilers/gcc/4.3/default.nix b/pkgs/development/compilers/gcc/4.3/default.nix
index 4b9fd616d84..73680996a83 100644
--- a/pkgs/development/compilers/gcc/4.3/default.nix
+++ b/pkgs/development/compilers/gcc/4.3/default.nix
@@ -47,9 +47,9 @@ let
       " --enable-threads=posix" +
       " --enable-nls"
       );
-  stageNameAddon = if (crossStageStatic) then "-stage-static" else
+  stageNameAddon = if crossStageStatic then "-stage-static" else
     "-stage-final";
-  crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+  crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 in
 
 stdenv.mkDerivation ({
@@ -85,7 +85,7 @@ stdenv.mkDerivation ({
     
   inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
     binutilsCross libcCross;
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   buildInputs = [texinfo gmp mpfr]
     ++ (optionals langTreelang [bison flex])
@@ -129,7 +129,7 @@ stdenv.mkDerivation ({
       enableMultilib; };
 
   # ghdl does not build fine with parallel building
-  enableParallelBuilding = if langVhdl then false else true;
+  enableParallelBuilding = !langVhdl;
 
   meta = {
     homepage = "http://gcc.gnu.org/";
diff --git a/pkgs/development/compilers/gcc/4.4/default.nix b/pkgs/development/compilers/gcc/4.4/default.nix
index d962d4ac347..804a797bac1 100644
--- a/pkgs/development/compilers/gcc/4.4/default.nix
+++ b/pkgs/development/compilers/gcc/4.4/default.nix
@@ -84,9 +84,9 @@ let version = "4.4.6";
         " --enable-nls" +
         " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
         );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 
 in
 
@@ -124,7 +124,7 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
     libcCross;
 
-  buildNativeInputs = [ texinfo which ];
+  nativeBuildInputs = [ texinfo which ];
 
   buildInputs = [ gmp mpfr gettext ]
     ++ (optional (ppl != null) ppl)
@@ -163,11 +163,11 @@ stdenv.mkDerivation ({
       )
     }
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   # Needed for the cross compilation to work
   AR = "ar";
@@ -189,13 +189,13 @@ stdenv.mkDerivation ({
     configureFlags = "
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -211,7 +211,7 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     ";
@@ -243,7 +243,7 @@ stdenv.mkDerivation ({
       enableMultilib version; };
 
   # ghdl does not build fine with parallel building
-  enableParallelBuilding = if langVhdl then false else true;
+  enableParallelBuilding = !langVhdl;
 
   meta = {
     homepage = http://gcc.gnu.org/;
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index 9cf38718a47..cb0432b6672 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -78,7 +78,7 @@ let version = "4.5.4";
       withArch +
       withCpu +
       withAbi +
-      (if (crossMingw && crossStageStatic) then
+      (if crossMingw && crossStageStatic then
         " --with-headers=${libcCross}/include" +
         " --with-gcc" +
         " --with-gnu-as" +
@@ -115,9 +115,9 @@ let version = "4.5.4";
           " --enable-nls" +
           " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
         );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 
 in
 
@@ -146,7 +146,7 @@ stdenv.mkDerivation ({
 
   postPatch =
     if (stdenv.system == "i586-pc-gnu"
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (cross != null && cross.config == "i586-pc-gnu"
@@ -189,7 +189,7 @@ stdenv.mkDerivation ({
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -205,7 +205,7 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which ]
+  nativeBuildInputs = [ texinfo which ]
     ++ optional (perl != null) perl;
     
   buildInputs = [ gmp mpfr mpc libelf gettext ]
@@ -237,7 +237,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -255,11 +255,11 @@ stdenv.mkDerivation ({
     ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
       if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   crossAttrs = {
     AR = "${stdenv.cross.config}-ar";
@@ -277,13 +277,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -299,7 +299,7 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     '';
@@ -391,7 +391,7 @@ stdenv.mkDerivation ({
 
 // optionalAttrs (cross != null || libcCross != null) {
   # `builder.sh' sets $CPP, which leads configure to use "gcc -E" instead of,
-  # say, "i586-pc-gnu-gcc -E" when building `gcc.hostDrv'.
+  # say, "i586-pc-gnu-gcc -E" when building `gcc.crossDrv'.
   # FIXME: Fix `builder.sh' directly in the next stdenv-update.
   postUnpack = "unset CPP";
 }
diff --git a/pkgs/development/compilers/gcc/4.6/builder.sh b/pkgs/development/compilers/gcc/4.6/builder.sh
index 6cd64bc58f2..2bb18541739 100644
--- a/pkgs/development/compilers/gcc/4.6/builder.sh
+++ b/pkgs/development/compilers/gcc/4.6/builder.sh
@@ -196,6 +196,15 @@ postConfigure() {
 }
 
 
+preInstall() {
+    # Make ‘lib64’ a symlink to ‘lib’.
+    if [ -n "$is64bit" ]; then
+        mkdir -p $out/lib
+        ln -s lib $out/lib64
+    fi
+}
+
+
 postInstall() {
     # Remove precompiled headers for now.  They are very big and
     # probably not very useful yet.
@@ -234,13 +243,4 @@ postInstall() {
     eval "$postInstallGhdl"
 }
 
-
-if test -z "$targetConfig" && test -z "$crossConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
 genericBuild
diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix
index c94a9285b29..b2456eb33c2 100644
--- a/pkgs/development/compilers/gcc/4.6/default.nix
+++ b/pkgs/development/compilers/gcc/4.6/default.nix
@@ -51,7 +51,10 @@ let version = "4.6.3";
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
-    patches = [ ]
+    patches =
+      [ # Fix building on Glibc 2.16.
+        ./siginfo_t_fix.patch
+      ]
       ++ optional (cross != null) ./libstdc++-target.patch
       ++ optional noSysDirs ./no-sys-dirs.patch
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
@@ -84,71 +87,95 @@ let version = "4.6.3";
 
     javaAwtGtk = langJava && gtk != null;
 
+    /* Platform flags */
+    platformFlags = let
+        gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
+        gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
+        gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
+        gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
+        gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+      in 
+        (withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat);
+
     /* Cross-gcc settings */
-    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
     crossMingw = (cross != null && cross.libc == "msvcrt");
-
-    crossConfigureFlags =
-      "--target=${cross.config}" +
-      withArch +
-      withCpu +
-      withAbi +
-      (if (crossMingw && crossStageStatic) then
-        " --with-headers=${libcCross}/include" +
-        " --with-gcc" +
-        " --with-gnu-as" +
-        " --with-gnu-ld" +
-        " --with-gnu-ld" +
-        " --disable-shared" +
-        " --disable-nls" +
-        " --disable-debug" +
-        " --enable-sjlj-exceptions" +
-        " --enable-threads=win32" +
-        " --disable-win32-registry"
-        else if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-libquadmath" +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        (if crossMingw then
-          " --enable-threads=win32" +
-          " --enable-sjlj-exceptions" +
-          " --enable-hash-synchronization" +
-          " --disable-libssp" +
+    crossConfigureFlags = let
+        gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
+        gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
+        gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
+        gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+      in
+        "--target=${cross.config}" +
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        (if crossMingw && crossStageStatic then
+          " --with-headers=${libcCross}/include" +
+          " --with-gcc" +
+          " --with-gnu-as" +
+          " --with-gnu-ld" +
+          " --with-gnu-ld" +
+          " --disable-shared" +
           " --disable-nls" +
-          " --with-dwarf2" +
-          # I think noone uses shared gcc libs in mingw, so we better do the same.
-          # In any case, mingw32 g++ linking is broken by default with shared libs,
-          # unless adding "-lsupc++" to any linking command. I don't know why.
+          " --disable-debug" +
+          " --enable-sjlj-exceptions" +
+          " --enable-threads=win32" +
+          " --disable-win32-registry"
+          else if crossStageStatic then
+          " --disable-libssp --disable-nls" +
+          " --without-headers" +
+          " --disable-threads " +
+          " --disable-libmudflap " +
+          " --disable-libgomp " +
+          " --disable-libquadmath" +
           " --disable-shared" +
-          (if cross.config == "x86_64-w64-mingw32" then
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else "")
-          else (if cross.libc == "uclibc" then
-            # In uclibc cases, libgomp needs an additional '-ldl'
-            # and as I don't know how to pass it, I disable libgomp.
-            " --disable-libgomp" else "") +
-          " --enable-threads=posix" +
-          " --enable-nls" +
-          " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-        );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+          " --disable-decimal-float" # libdecnumber requires libc
+          else
+          " --with-headers=${libcCross}/include" +
+          " --enable-__cxa_atexit" +
+          " --enable-long-long" +
+          (if crossMingw then
+            " --enable-threads=win32" +
+            " --enable-sjlj-exceptions" +
+            " --enable-hash-synchronization" +
+            " --disable-libssp" +
+            " --disable-nls" +
+            " --with-dwarf2" +
+            # I think noone uses shared gcc libs in mingw, so we better do the same.
+            # In any case, mingw32 g++ linking is broken by default with shared libs,
+            # unless adding "-lsupc++" to any linking command. I don't know why.
+            " --disable-shared" +
+            (if cross.config == "x86_64-w64-mingw32" then
+              # To keep ABI compatibility with upstream mingw-w64
+              " --enable-fully-dynamic-string"
+              else "")
+            else (if cross.libc == "uclibc" then
+              # In uclibc cases, libgomp needs an additional '-ldl'
+              # and as I don't know how to pass it, I disable libgomp.
+              " --disable-libgomp" else "") +
+            " --enable-threads=posix" +
+            " --enable-nls" +
+            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
+          );
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
+
+  bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
 
 in
 
@@ -169,7 +196,7 @@ stdenv.mkDerivation ({
 
   postPatch =
     if (stdenv.isGNU
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (crossGNU && libcCross != null))
@@ -211,7 +238,7 @@ stdenv.mkDerivation ({
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -224,10 +251,10 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
+  inherit noSysDirs staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which gettext ]
+  nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
@@ -270,7 +297,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -286,14 +313,18 @@ stdenv.mkDerivation ({
         )
       )
     }
-    ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
-      if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
+    ${if !bootstrap then "--disable-bootstrap" else ""}
+    ${if cross == null then platformFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
+
+  buildFlags = if bootstrap then
+    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
+    else "";
 
   installTargets =
     if stripped
@@ -317,13 +348,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -340,10 +371,11 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     '';
+    buildFlags = "";
   };
 
 
@@ -403,6 +435,8 @@ stdenv.mkDerivation ({
 
   enableParallelBuilding = true;
 
+  inherit (stdenv) is64bit;
+
   meta = {
     homepage = http://gcc.gnu.org/;
     license = "GPLv3+";  # runtime support libraries are typically LGPLv3+
diff --git a/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch
new file mode 100644
index 00000000000..1409c552c7d
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch
@@ -0,0 +1,211 @@
+Partly taken from:
+http://gcc.gnu.org/git/?p=gcc.git;a=patch;h=5617a3db5d04630d0bfb71a3578894b4442f266d
+
+Adapted to gcc 4.6.3. Original commit text follows.
+
+From 5617a3db5d04630d0bfb71a3578894b4442f266d Mon Sep 17 00:00:00 2001
+From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 20 Apr 2012 07:44:50 +0000
+Subject: [PATCH] 	struct siginfo vs. siginfo_t
+
+gcc/
+	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
+	siginfo_t instead of struct siginfo.
+	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
+	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
+	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
+	(ia64_handle_unwabi): Likewise.
+	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
+	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
+	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
+	(sh_fallback_frame_state): Likewise.
+	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186610 138bc75d-0d04-0410-961f-82ee72b054a4
+
+diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
+index 4c811dc..8c04b3b 100644
+--- a/gcc/config/alpha/linux-unwind.h
++++ b/gcc/config/alpha/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Alpha Linux.
+-   Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
+index 88c8285..15bb2f1 100644
+--- a/gcc/config/bfin/linux-unwind.h
++++ b/gcc/config/bfin/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Blackfin.
+-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+ 	char retcode[8];
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+ 
+diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
+index ad0ccfa..02b1897 100644
+--- a/gcc/config/i386/linux-unwind.h
++++ b/gcc/config/i386/linux-unwind.h
+@@ -136,9 +136,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
+index 93f762d..da31259 100644
+--- a/gcc/config/ia64/linux-unwind.h
++++ b/gcc/config/ia64/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for IA64 Linux.
+-   Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
+ 
+    This file is part of GCC.
+ 
+@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame_ = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame_->sc;
+@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame->sc;
+diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
+index 02f7cd5..094ff58 100644
+--- a/gcc/config/mips/linux-unwind.h
++++ b/gcc/config/mips/linux-unwind.h
+@@ -1,5 +1,6 @@
+ /* DWARF2 EH unwinding support for MIPS Linux.
+-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software
++   Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
+       struct rt_sigframe {
+ 	u_int32_t ass[4];  /* Argument save space for o32.  */
+ 	u_int32_t trampoline[2];
+-	struct siginfo info;
++	siginfo_t info;
+ 	_sig_ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
+index a0560e9..38b4eda 100644
+--- a/gcc/config/pa/linux-unwind.h
++++ b/gcc/config/pa/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for PA Linux.
+-   Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   int i;
+   struct sigcontext *sc;
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *frame;
+ 
+diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
+index 94ed95d..5a78e31 100644
+--- a/gcc/config/sh/linux-unwind.h
++++ b/gcc/config/sh/linux-unwind.h
+@@ -1,5 +1,6 @@
+ /* DWARF2 EH unwinding support for SH Linux.
+-   Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 Free Software Foundation,
++   Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
+ 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
+     {
+       struct rt_sigframe {
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+ 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
+index 32e9349..2456497 100644
+--- a/gcc/config/xtensa/linux-unwind.h
++++ b/gcc/config/xtensa/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Xtensa.
+-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+ 
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *rt_;
+ 
+-- 
+1.7.3.4
+
diff --git a/pkgs/development/compilers/gcc/4.7/builder.sh b/pkgs/development/compilers/gcc/4.7/builder.sh
index 4ae7a1c193b..37400fba5bf 100644
--- a/pkgs/development/compilers/gcc/4.7/builder.sh
+++ b/pkgs/development/compilers/gcc/4.7/builder.sh
@@ -71,7 +71,7 @@ if test "$noSysDirs" = "1"; then
         unset CPATH
         if test -z "$crossStageStatic"; then
             EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
-            EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib"
+            EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
         fi
     else
         if test -z "$NIX_GCC_CROSS"; then
@@ -95,7 +95,9 @@ if test "$noSysDirs" = "1"; then
             NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include
 
             # The path to the Glibc binaries such as `crti.o'.
-            glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
+            glibc_dir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)"
+            glibc_libdir="$glibc_dir/lib"
+            configureFlags="$configureFlags --with-native-system-header-dir=$glibc_dir/include"
 
             extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
             extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
@@ -237,13 +239,4 @@ postInstall() {
     eval "$postInstallGhdl"
 }
 
-
-if test -z "$targetConfig" && test -z "$crossConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
 genericBuild
diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix
index 5ab7166204e..62a86751a71 100644
--- a/pkgs/development/compilers/gcc/4.7/default.nix
+++ b/pkgs/development/compilers/gcc/4.7/default.nix
@@ -85,74 +85,104 @@ let version = "4.7.2";
 
     javaAwtGtk = langJava && gtk != null;
 
+    /* Platform flags */
+    platformFlags = let
+        gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
+        gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
+        gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
+        gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
+        gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
+        gccMode = stdenv.lib.attrByPath [ "platform" "gcc" "mode" ] null stdenv;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in 
+        (withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode);
+
     /* Cross-gcc settings */
-    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-    gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
-    withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
     crossMingw = (cross != null && cross.libc == "msvcrt");
-
-    crossConfigureFlags =
-      "--target=${cross.config}" +
-      withArch +
-      withCpu +
-      withAbi +
-      withMode +
-      (if (crossMingw && crossStageStatic) then
-        " --with-headers=${libcCross}/include" +
-        " --with-gcc" +
-        " --with-gnu-as" +
-        " --with-gnu-ld" +
-        " --with-gnu-ld" +
-        " --disable-shared" +
-        " --disable-nls" +
-        " --disable-debug" +
-        " --enable-sjlj-exceptions" +
-        " --enable-threads=win32" +
-        " --disable-win32-registry"
-        else if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-libquadmath" +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        (if crossMingw then
-          " --enable-threads=win32" +
-          " --enable-sjlj-exceptions" +
-          " --enable-hash-synchronization" +
-          " --disable-libssp" +
+    crossConfigureFlags = let
+        gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
+        gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
+        gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
+        gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
+        gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
+        gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in
+        "--target=${cross.config}" +
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode +
+        (if crossMingw && crossStageStatic then
+          " --with-headers=${libcCross}/include" +
+          " --with-gcc" +
+          " --with-gnu-as" +
+          " --with-gnu-ld" +
+          " --with-gnu-ld" +
+          " --disable-shared" +
           " --disable-nls" +
-          " --with-dwarf2" +
-          # I think noone uses shared gcc libs in mingw, so we better do the same.
-          # In any case, mingw32 g++ linking is broken by default with shared libs,
-          # unless adding "-lsupc++" to any linking command. I don't know why.
+          " --disable-debug" +
+          " --enable-sjlj-exceptions" +
+          " --enable-threads=win32" +
+          " --disable-win32-registry"
+          else if crossStageStatic then
+          " --disable-libssp --disable-nls" +
+          " --without-headers" +
+          " --disable-threads " +
+          " --disable-libmudflap " +
+          " --disable-libgomp " +
+          " --disable-libquadmath" +
           " --disable-shared" +
-          (if cross.config == "x86_64-w64-mingw32" then
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else "")
-          else (if cross.libc == "uclibc" then
-            # In uclibc cases, libgomp needs an additional '-ldl'
-            # and as I don't know how to pass it, I disable libgomp.
-            " --disable-libgomp" else "") +
-          " --enable-threads=posix" +
-          " --enable-nls" +
-          " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-        );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+          " --disable-decimal-float" # libdecnumber requires libc
+          else
+          " --with-headers=${libcCross}/include" +
+          " --enable-__cxa_atexit" +
+          " --enable-long-long" +
+          (if crossMingw then
+            " --enable-threads=win32" +
+            " --enable-sjlj-exceptions" +
+            " --enable-hash-synchronization" +
+            " --disable-libssp" +
+            " --disable-nls" +
+            " --with-dwarf2" +
+            # I think noone uses shared gcc libs in mingw, so we better do the same.
+            # In any case, mingw32 g++ linking is broken by default with shared libs,
+            # unless adding "-lsupc++" to any linking command. I don't know why.
+            " --disable-shared" +
+            (if cross.config == "x86_64-w64-mingw32" then
+              # To keep ABI compatibility with upstream mingw-w64
+              " --enable-fully-dynamic-string"
+              else "")
+            else (if cross.libc == "uclibc" then
+              # In uclibc cases, libgomp needs an additional '-ldl'
+              # and as I don't know how to pass it, I disable libgomp.
+              " --disable-libgomp" else "") +
+            " --enable-threads=posix" +
+            " --enable-nls" +
+            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
+          );
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
+
+  bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
 
 in
 
@@ -173,7 +203,7 @@ stdenv.mkDerivation ({
 
   postPatch =
     if (stdenv.isGNU
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (crossGNU && libcCross != null))
@@ -212,7 +242,7 @@ stdenv.mkDerivation ({
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -225,10 +255,10 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
+  inherit noSysDirs staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which gettext ]
+  nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
@@ -275,7 +305,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -294,21 +324,36 @@ stdenv.mkDerivation ({
     ${if (stdenv ? glibc && cross == null)
       then " --with-native-system-header-dir=${stdenv.glibc}/include"
       else ""}
-    ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
-      if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
+    ${if !bootstrap then "--disable-bootstrap" else ""}
+    ${if cross == null then platformFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
+
+  buildFlags = if bootstrap then
+    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
+    else "";
 
   installTargets =
     if stripped
     then "install-strip"
     else "install";
 
-  crossAttrs = {
+  crossAttrs = let
+    xgccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null stdenv.cross;
+    xgccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null stdenv.cross;
+    xgccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null stdenv.cross;
+    xgccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null stdenv.cross;
+    xgccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null stdenv.cross;
+    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
+    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
+    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
+    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
+    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
+  in {
     AR = "${stdenv.cross.config}-ar";
     LD = "${stdenv.cross.config}-ld";
     CC = "${stdenv.cross.config}-gcc";
@@ -324,13 +369,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -347,10 +392,14 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
-      ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
+      ${xwithArch}
+      ${xwithCpu}
+      ${xwithAbi}
+      ${xwithFpu}
+      ${xwithFloat}
     '';
+    buildFlags = "";
   };
 
 
diff --git a/pkgs/development/compilers/gnatboot/default.nix b/pkgs/development/compilers/gnatboot/default.nix
index 79208743ae4..1de0c88a6bc 100644
--- a/pkgs/development/compilers/gnatboot/default.nix
+++ b/pkgs/development/compilers/gnatboot/default.nix
@@ -3,12 +3,12 @@
 stdenv.mkDerivation {
   name = "gentoo-gnatboot-4.1";
 
-  src = if (stdenv.system == "i686-linux") then
+  src = if stdenv.system == "i686-linux" then
     fetchurl {
       url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2";
       sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr";
     }
-    else if (stdenv.system == "x86_64-linux") then
+    else if stdenv.system == "x86_64-linux" then
     fetchurl {
       url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2";
       sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4";
diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix
index 60ea7981931..955daa0ad9f 100644
--- a/pkgs/development/compilers/go/default.nix
+++ b/pkgs/development/compilers/go/default.nix
@@ -54,9 +54,9 @@ stdenv.mkDerivation {
   patches = [ ./cacert.patch ];
 
   GOOS = "linux";
-  GOARCH = if (stdenv.system == "i686-linux") then "386"
-          else if (stdenv.system == "x86_64-linux") then "amd64"
-          else if (stdenv.system == "armv5tel-linux") then "arm"
+  GOARCH = if stdenv.system == "i686-linux" then "386"
+          else if stdenv.system == "x86_64-linux" then "amd64"
+          else if stdenv.system == "armv5tel-linux" then "arm"
           else throw "Unsupported system";
   GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
 
@@ -74,7 +74,7 @@ stdenv.mkDerivation {
     for a in go gofmt godoc; do
 	    wrapProgram "$out/bin/$a" \
 	      --set "GOROOT" $out/share/go \
-        ${if (stdenv.system == "armv5tel-linux") then "--set GOARM $GOARM" else ""}
+        ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
     done
 
     # Copy the emacs configuration for Go files.
diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix
index 7572dda7711..29950aa9e3d 100644
--- a/pkgs/development/compilers/mit-scheme/default.nix
+++ b/pkgs/development/compilers/mit-scheme/default.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation {
          $out/lib/mit-scheme${arch}
     '';
 
-  buildNativeInputs = [ makeWrapper gnum4 texinfo texLive automake ];
+  nativeBuildInputs = [ makeWrapper gnum4 texinfo texLive automake ];
 
   # XXX: The `check' target doesn't exist.
   doCheck = false;
diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index 058d84a12de..f607edd0f02 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -11,7 +11,7 @@ let version = "0.9.25"; in
       sha256 = "0dfycf80x73dz67c97j1ry29wrv35393ai5ry46i1x1fzfq6rv8v";
     };
 
-    buildNativeInputs = [ perl texinfo ];
+    nativeBuildInputs = [ perl texinfo ];
 
     patches =
       [ (fetchurl {
diff --git a/pkgs/development/compilers/vala/15.2.nix b/pkgs/development/compilers/vala/15.2.nix
index 822102b7bd4..529ccea6bc8 100644
--- a/pkgs/development/compilers/vala/15.2.nix
+++ b/pkgs/development/compilers/vala/15.2.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g71zq6dpqrw2f40wfzdf18fdw41ymr17laqniy2kr622hkxdi8w";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig xz ];
 
   buildInputs = [ glib ];
 
diff --git a/pkgs/development/compilers/vala/16.1.nix b/pkgs/development/compilers/vala/16.1.nix
index 54e6af8798d..f054c59d2e4 100644
--- a/pkgs/development/compilers/vala/16.1.nix
+++ b/pkgs/development/compilers/vala/16.1.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n708n9ixyy9qrzyv1wf4ybvcclx43ib9ki028wwpvkz6kv8zqlb";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig xz ];
 
   buildInputs = [ glib ];
 
diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix
index a60a71e3580..bce86ac5984 100644
--- a/pkgs/development/compilers/vala/default.nix
+++ b/pkgs/development/compilers/vala/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "09i2s0dwmrk147ind2dx7nq845g12fp6fsjqrphhrr0dbi0zzgh3";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig xz ];
 
   buildInputs = [ glib ];
 
diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix
index bf1efbbb1a9..f44f71020b4 100644
--- a/pkgs/development/interpreters/guile/1.8.nix
+++ b/pkgs/development/interpreters/guile/1.8.nix
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   # GCC 4.6 raises a number of set-but-unused warnings.
   configureFlags = [ "--disable-error-on-warning" ];
 
-  buildNativeInputs = [ makeWrapper gawk ];
+  nativeBuildInputs = [ makeWrapper gawk ];
   propagatedBuildInputs = [ readline gmp libtool ];
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index e5c8f268548..d09e995e95c 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -14,7 +14,7 @@
     sha256 = "0f53pxkia4v17n0avwqlcjpy0n89hkazm2xsa6p84lv8k6k8y9vg";
   };
 
-  buildNativeInputs = [ makeWrapper gawk pkgconfig ];
+  nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
   buildInputs = [ readline libtool libunistring libffi ];
   propagatedBuildInputs = [ gmp boehmgc ]
 
@@ -25,13 +25,17 @@
     ++ [ libtool libunistring ];
 
   # A native Guile 2.0 is needed to cross-build Guile.
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
 
   patches = [ ./disable-gc-sensitive-tests.patch ] ++
     (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
 
+  # Explicitly link against libgcc_s, to work around the infamous
+  # "libgcc_s.so.1 must be installed for pthread_cancel to work".
+  LDFLAGS = "-lgcc_s";
+
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
 
diff --git a/pkgs/development/interpreters/octave/hg.nix b/pkgs/development/interpreters/octave/hg.nix
index f414dd71965..f44efb94358 100644
--- a/pkgs/development/interpreters/octave/hg.nix
+++ b/pkgs/development/interpreters/octave/hg.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation ({
       license = "GPL-3";
     };
 } // (
-  if (config.octave.devVersion or false) then {
+  if config.octave.devVersion or false then {
     name = "octave-hg"; # developement version mercurial repo
     # REGION AUTO UPDATE:   { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; }
     src = sourceFromHead "octave-03b414516dd8.tar.gz"
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix
new file mode 100644
index 00000000000..288de63b4ae
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl }:
+
+let
+
+  libc = if stdenv.gcc.libc or null != null then stdenv.gcc.libc else "/usr";
+
+in
+
+stdenv.mkDerivation rec {
+  name = "perl-5.16.2";
+
+  src = fetchurl {
+    url = "mirror://cpan/src/${name}.tar.gz";
+    sha256 = "03nh8bqnjsdd5izjv3n2yfcxw4ck0llwww36jpbjbjgixwpqpy4f";
+  };
+
+  patches =
+    [ # Do not look in /usr etc. for dependencies.
+      ./no-sys-dirs.patch
+    ]
+    ++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch;
+
+  # Build a thread-safe Perl with a dynamic libperls.o.  We need the
+  # "installstyle" option to ensure that modules are put under
+  # $out/lib/perl5 - this is the general default, but because $out
+  # contains the string "perl", Configure would select $out/lib.
+  # Miniperl needs -lm. perl needs -lrt.
+  configureFlags =
+    [ "-de"
+      "-Dcc=gcc"
+      "-Uinstallusrbinperl"
+      "-Dinstallstyle=lib/perl5"
+      "-Duseshrplib"
+      "-Dlocincpth=${libc}/include"
+      "-Dloclibpth=${libc}/lib"
+    ]
+    ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
+
+  configureScript = "${stdenv.shell} ./Configure";
+
+  dontAddPrefix = true;
+
+  enableParallelBuilding = true;
+
+  preConfigure =
+    ''
+      configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
+
+      ${stdenv.lib.optionalString stdenv.isArm ''
+        configureFlagsArray=(-Dldflags="-lm -lrt")
+      ''}
+    '';
+
+  preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
+    ''
+      # Make Cwd work on NixOS (where we don't have a /bin/pwd).
+      substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
+    '';
+
+  setupHook = ./setup-hook.sh;
+
+  passthru.libPrefix = "lib/perl5/site_perl";
+}
diff --git a/pkgs/development/interpreters/perl/5.16/no-libutil.patch b/pkgs/development/interpreters/perl/5.16/no-libutil.patch
new file mode 100644
index 00000000000..9b749bccf32
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/no-libutil.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
+--- perl-5.14.2-orig/Configure	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/Configure	2012-02-16 17:24:50.779839039 +0100
+@@ -1368,7 +1368,7 @@
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+ libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
+-libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
++libswanted="$libswanted m crypt sec c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
diff --git a/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
new file mode 100644
index 00000000000..54ffb28e206
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
@@ -0,0 +1,152 @@
+diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
+--- perl-5.14.2-orig/Configure	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/Configure	2012-01-20 17:05:23.089223129 +0100
+@@ -106,15 +106,7 @@
+ fi
+ 
+ : Proper PATH setting
+-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
+-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
+-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
+-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
+-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
+-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
+-paths="$paths /sbin /usr/sbin /usr/libexec"
+-paths="$paths /system/gnu_library/bin"
++paths=''
+ 
+ for p in $paths
+ do
+@@ -1311,8 +1303,7 @@
+ archname=''
+ : Possible local include directories to search.
+ : Set locincpth to "" in a hint file to defeat local include searches.
+-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
++locincpth=""
+ :
+ : no include file wanted by default
+ inclwanted=''
+@@ -1328,17 +1319,12 @@
+ archobjs=''
+ libnames=''
+ : change the next line if compiling for Xenix/286 on Xenix/386
+-xlibpth='/usr/lib/386 /lib/386'
++xlibpth=''
+ : Possible local library directories to search.
+-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
+-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
++loclibpth=""
+ 
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
+-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+-test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+-test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
++glibpth=""
+ 
+ : Private path used by Configure to find libraries.  Its value
+ : is prepended to libpth. This variable takes care of special
+@@ -1371,8 +1357,6 @@
+ libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+-glibpth="/usr/shlib $glibpth"
+ : Do not use vfork unless overridden by a hint file.
+ usevfork=false
+ 
+@@ -2380,7 +2364,6 @@
+ zip
+ "
+ pth=`echo $PATH | sed -e "s/$p_/ /g"`
+-pth="$pth /lib /usr/lib"
+ for file in $loclist; do
+ 	eval xxx=\$$file
+ 	case "$xxx" in
+@@ -4785,7 +4768,7 @@
+ : Set private lib path
+ case "$plibpth" in
+ '') if ./mips; then
+-		plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
++		plibpth="$incpath/usr/lib"
+ 	fi;;
+ esac
+ case "$libpth" in
+@@ -8390,13 +8373,8 @@
+ echo " "
+ case "$sysman" in
+ '') 
+-	syspath='/usr/share/man/man1 /usr/man/man1'
+-	syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+-	syspath="$syspath /usr/man/u_man/man1"
+-	syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+-	syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+-	syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+-	sysman=`./loc . /usr/man/man1 $syspath`
++	syspath=''
++	sysman=''
+ 	;;
+ esac
+ if $test -d "$sysman"; then
+@@ -19721,9 +19699,10 @@
+ case "$full_ar" in
+ '') full_ar=$ar ;;
+ esac
++full_ar=ar
+ 
+ : Store the full pathname to the sed program for use in the C program
+-full_sed=$sed
++full_sed=sed
+ 
+ : see what type gids are declared as in the kernel
+ echo " "
+diff -ru -x '*~' perl-5.14.2-orig/ext/Errno/Errno_pm.PL perl-5.14.2/ext/Errno/Errno_pm.PL
+--- perl-5.14.2-orig/ext/Errno/Errno_pm.PL	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/ext/Errno/Errno_pm.PL	2012-01-20 17:02:07.938138311 +0100
+@@ -137,11 +137,7 @@
+ 	if ($dep =~ /(\S+errno\.h)/) {
+ 	     $file{$1} = 1;
+ 	}
+-    } elsif ($^O eq 'linux' &&
+-	      $Config{gccversion} ne '' && 
+-	      $Config{gccversion} !~ /intel/i
+-	      # might be using, say, Intel's icc
+-	     ) {
++    } elsif (0) {
+ 	# Some Linuxes have weird errno.hs which generate
+ 	# no #file or #line directives
+ 	my $linux_errno_h = -e '/usr/include/errno.h' ?
+diff -ru -x '*~' perl-5.14.2-orig/hints/freebsd.sh perl-5.14.2/hints/freebsd.sh
+--- perl-5.14.2-orig/hints/freebsd.sh	2011-09-19 15:18:22.000000000 +0200
++++ perl-5.14.2/hints/freebsd.sh	2012-01-20 17:10:37.267924044 +0100
+@@ -118,21 +118,21 @@
+         objformat=`/usr/bin/objformat`
+         if [ x$objformat = xaout ]; then
+             if [ -e /usr/lib/aout ]; then
+-                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+-                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
++                libpth=""
++                glibpth=""
+             fi
+             lddlflags='-Bshareable'
+         else
+-            libpth="/usr/lib /usr/local/lib"
+-            glibpth="/usr/lib /usr/local/lib"
++            libpth=""
++            glibpth=""
+             ldflags="-Wl,-E "
+             lddlflags="-shared "
+         fi
+         cccdlflags='-DPIC -fPIC'
+         ;;
+ *)
+-       libpth="/usr/lib /usr/local/lib"
+-       glibpth="/usr/lib /usr/local/lib"
++       libpth=""
++       glibpth=""
+        ldflags="-Wl,-E "
+         lddlflags="-shared "
+         cccdlflags='-DPIC -fPIC'
diff --git a/pkgs/development/interpreters/perl/5.16/setup-hook.sh b/pkgs/development/interpreters/perl/5.16/setup-hook.sh
new file mode 100644
index 00000000000..6a144a7f780
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/setup-hook.sh
@@ -0,0 +1,5 @@
+addPerlLibPath () {
+    addToSearchPath PERL5LIB $1/lib/perl5/site_perl
+}
+
+envHooks=(${envHooks[@]} addPerlLibPath)
diff --git a/pkgs/development/libraries/GConf/3.x.nix b/pkgs/development/libraries/GConf/3.x.nix
index 4f6d5a9a04a..82c0c1f2c43 100644
--- a/pkgs/development/libraries/GConf/3.x.nix
+++ b/pkgs/development/libraries/GConf/3.x.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ glib dbus_glib ];
   buildInputs = [ polkit gtk3 libxml2 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--disable-orbit";
 
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 7205e0fa7ea..8ff643ce5b1 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   configureFlags = configureFlagsFun { inherit alsaLib; };
 
   crossAttrs = {
-      configureFlags = configureFlagsFun { alsaLib = alsaLib.hostDrv; };
+      configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
   };
 
   passthru = {inherit openglSupport;};
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index 3ccb5691980..bc0821f39fd 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "09aj30m49ivycl3irram8c3givc0crivjm3ymw0nhfaxrwhlb186";
   };
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
   buildInputs = [ attr ];
 
   # Upstream use C++-style comments in C code. Remove them.
diff --git a/pkgs/development/libraries/aqbanking/default.nix b/pkgs/development/libraries/aqbanking/default.nix
index 6c6e3013717..0ddb1aaa749 100644
--- a/pkgs/development/libraries/aqbanking/default.nix
+++ b/pkgs/development/libraries/aqbanking/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gwenhywfar gmp zlib ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--with-gwen-dir=${gwenhywfar}";
 
diff --git a/pkgs/development/libraries/arts/default.nix b/pkgs/development/libraries/arts/default.nix
index 50c270f534e..8af92cf5eea 100644
--- a/pkgs/development/libraries/arts/default.nix
+++ b/pkgs/development/libraries/arts/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     --enable-final
   '';
 
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   buildInputs =
     [glib kdelibs libX11 libXext zlib libjpeg libpng qt3];
diff --git a/pkgs/development/libraries/asc-support/default.nix b/pkgs/development/libraries/asc-support/default.nix
index a078faaceb1..a2b2588d9cc 100644
--- a/pkgs/development/libraries/asc-support/default.nix
+++ b/pkgs/development/libraries/asc-support/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
 
   buildInputs = [aterm toolbuslib asfSupport errorSupport ptSupport sglr tideSupport cLibrary configSupport ptableSupport rstoreSupport ];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 }  
diff --git a/pkgs/development/libraries/asf-support/default.nix b/pkgs/development/libraries/asf-support/default.nix
index e2b7a14e819..9a712a869af 100644
--- a/pkgs/development/libraries/asf-support/default.nix
+++ b/pkgs/development/libraries/asf-support/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm errorSupport ptSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/atk/2.6.x.nix b/pkgs/development/libraries/atk/2.6.x.nix
index eba56776bd2..4dd0ae1eeaf 100644
--- a/pkgs/development/libraries/atk/2.6.x.nix
+++ b/pkgs/development/libraries/atk/2.6.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "eff663f90847620bb68c9c2cbaaf7f45e2ff44163b9ab3f10d15be763680491f";
   };
 
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   propagatedBuildInputs = [ glib ];
 
diff --git a/pkgs/development/libraries/atkmm/2.22.x.nix b/pkgs/development/libraries/atkmm/2.22.x.nix
index 66237c4c7b9..b25432491fb 100644
--- a/pkgs/development/libraries/atkmm/2.22.x.nix
+++ b/pkgs/development/libraries/atkmm/2.22.x.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ atk glibmm ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/attica/default.nix b/pkgs/development/libraries/attica/default.nix
index a719537dd2f..9a5002551cb 100644
--- a/pkgs/development/libraries/attica/default.nix
+++ b/pkgs/development/libraries/attica/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
   
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
   
   meta = with stdenv.lib; {
     description = "A library to access Open Collaboration Service providers";
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index adc53086306..3c5855ea284 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "07qf6kb2zk512az481bbnsk9jycn477xpva1a726n5pzlzf9pmnw";
   };
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk";
 
diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix
index 0789ef0ea7c..39a03e0b002 100644
--- a/pkgs/development/libraries/avahi/default.nix
+++ b/pkgs/development/libraries/avahi/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     ++ (stdenv.lib.optional qt4Support qt4)
     ++ libiconvOrEmpty;
 
-  buildNativeInputs = [ pkgconfig gettext intltool ];
+  nativeBuildInputs = [ pkgconfig gettext intltool ];
 
   configureFlags =
     [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
diff --git a/pkgs/development/libraries/boolstuff/default.nix b/pkgs/development/libraries/boolstuff/default.nix
index c05fddc18cf..9b5c25d4ca4 100644
--- a/pkgs/development/libraries/boolstuff/default.nix
+++ b/pkgs/development/libraries/boolstuff/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0akwb57lnzq1ak32k6mdxbma2gj0pqhj8y9m6hq79djb9s3mxvmn";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = { 
     description = "Library for operations on boolean expression binary trees";
diff --git a/pkgs/development/libraries/boost/1.44.nix b/pkgs/development/libraries/boost/1.44.nix
index ad09adc8606..e0235cd8b39 100644
--- a/pkgs/development/libraries/boost/1.44.nix
+++ b/pkgs/development/libraries/boost/1.44.nix
@@ -29,7 +29,7 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
+  cflags = if enablePIC then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
 
 in
 
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
   ];
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -85,7 +85,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.46.nix b/pkgs/development/libraries/boost/1.46.nix
index 0a64efdeb3b..54a9d8d6c56 100644
--- a/pkgs/development/libraries/boost/1.46.nix
+++ b/pkgs/development/libraries/boost/1.46.nix
@@ -28,7 +28,7 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
+  cflags = if enablePIC then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
 
 in
 
@@ -60,7 +60,7 @@ stdenv.mkDerivation {
   installPhase = ":";
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -74,7 +74,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.47.nix b/pkgs/development/libraries/boost/1.47.nix
index 4b0c4d3f140..c63ee94fa9b 100644
--- a/pkgs/development/libraries/boost/1.47.nix
+++ b/pkgs/development/libraries/boost/1.47.nix
@@ -29,11 +29,11 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
+  cflags = if enablePIC && enableExceptions then
              "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
@@ -70,7 +70,7 @@ stdenv.mkDerivation {
   installPhase = ":";
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -84,7 +84,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.49.nix b/pkgs/development/libraries/boost/1.49.nix
index a86670927aa..dfad38b30a5 100644
--- a/pkgs/development/libraries/boost/1.49.nix
+++ b/pkgs/development/libraries/boost/1.49.nix
@@ -29,11 +29,11 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
+  cflags = if enablePIC && enableExceptions then
              "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
   installPhase = ":";
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -85,7 +85,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.51.nix b/pkgs/development/libraries/boost/1.51.nix
index 8b040dd8647..d5e5c5f931d 100644
--- a/pkgs/development/libraries/boost/1.51.nix
+++ b/pkgs/development/libraries/boost/1.51.nix
@@ -27,11 +27,11 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
+  cflags = if enablePIC && enableExceptions then
              "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
@@ -66,7 +66,7 @@ stdenv.mkDerivation {
   installPhase = ":";
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -80,7 +80,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.52.nix b/pkgs/development/libraries/boost/1.52.nix
index 367c2426b78..352a2d4aac9 100644
--- a/pkgs/development/libraries/boost/1.52.nix
+++ b/pkgs/development/libraries/boost/1.52.nix
@@ -27,11 +27,11 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
+  cflags = if enablePIC && enableExceptions then
              "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
   '';
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -85,7 +85,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/c-library/default.nix b/pkgs/development/libraries/c-library/default.nix
index 96bb82f54be..714e8b66089 100644
--- a/pkgs/development/libraries/c-library/default.nix
+++ b/pkgs/development/libraries/c-library/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
   
   buildInputs = [aterm];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   dontStrip = isMingw;
 }  
diff --git a/pkgs/development/libraries/caelum/default.nix b/pkgs/development/libraries/caelum/default.nix
index 75eb5109b45..e48ed5a7692 100644
--- a/pkgs/development/libraries/caelum/default.nix
+++ b/pkgs/development/libraries/caelum/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ois ogre boost ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix
index d9dae7bfd41..aa594a8e2bc 100644
--- a/pkgs/development/libraries/cloog-ppl/default.nix
+++ b/pkgs/development/libraries/cloog-ppl/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--with-ppl=${ppl}";
 
   crossAttrs = {
-    configureFlags = "--with-ppl=${ppl.hostDrv}";
+    configureFlags = "--with-ppl=${ppl.crossDrv}";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix
index 72460184df2..97c7a4c9f53 100644
--- a/pkgs/development/libraries/clucene-core/2.x.nix
+++ b/pkgs/development/libraries/clucene-core/2.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   buildInputs = [ boost zlib ];
 
diff --git a/pkgs/development/libraries/clutter-gtk/0.10.8.nix b/pkgs/development/libraries/clutter-gtk/0.10.8.nix
index b44801928e9..182040f5c41 100644
--- a/pkgs/development/libraries/clutter-gtk/0.10.8.nix
+++ b/pkgs/development/libraries/clutter-gtk/0.10.8.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ clutter gtk ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/clutter-gtk/default.nix b/pkgs/development/libraries/clutter-gtk/default.nix
index a48ff93ce22..3e13ff2da7e 100644
--- a/pkgs/development/libraries/clutter-gtk/default.nix
+++ b/pkgs/development/libraries/clutter-gtk/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ clutter gtk3 ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/clutter/default.nix b/pkgs/development/libraries/clutter/default.nix
index 52a9eaa98fa..6c6891fb279 100644
--- a/pkgs/development/libraries/clutter/default.nix
+++ b/pkgs/development/libraries/clutter/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "0bzsvnharawfg525lpavrp55mq4aih5nb01dwwqwnccg8hk9z2fw";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs =
     [ libX11 mesa libXext libXfixes libXdamage libXcomposite libXi cogl pango
       atk json_glib
diff --git a/pkgs/development/libraries/cogl/default.nix b/pkgs/development/libraries/cogl/default.nix
index 11a6e374e2e..b697ed87edc 100644
--- a/pkgs/development/libraries/cogl/default.nix
+++ b/pkgs/development/libraries/cogl/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1ix87hz3qxqysqwx58wbc46lzchlmfs08fjzbf3l6mmsqj8gs9pc";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs =
     [ mesa glib gdk_pixbuf libXfixes libXcomposite libXdamage ];
diff --git a/pkgs/development/libraries/config-support/default.nix b/pkgs/development/libraries/config-support/default.nix
index 72b1bea7b20..d25accd4664 100644
--- a/pkgs/development/libraries/config-support/default.nix
+++ b/pkgs/development/libraries/config-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 5fccc7ad66b..47e83e7780c 100644
--- a/pkgs/development/libraries/dbus-glib/default.nix
+++ b/pkgs/development/libraries/dbus-glib/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "04fiwld5yaxyggxlvdmbaqkngh4fn8gfkkqckcp3274bpgb82z19";
   };
 
-  buildNativeInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext ];
 
   buildInputs = [ expat ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
 
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index 0b8029c94db..5716ac6648a 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -17,7 +17,7 @@ in rec {
   libs = stdenv.mkDerivation {
     name = "dbus-library-" + version;
 
-    buildNativeInputs = [ pkgconfig ];
+    nativeBuildInputs = [ pkgconfig ];
 
     buildInputs = [ expat ];
 
@@ -48,7 +48,7 @@ in rec {
 
     configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
 
-    buildNativeInputs = [ pkgconfig ];
+    nativeBuildInputs = [ pkgconfig ];
 
     buildInputs = [ expat libs ]
       ++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
diff --git a/pkgs/development/libraries/directfb/default.nix b/pkgs/development/libraries/directfb/default.nix
index 9b4241aa3be..7092e08ec60 100644
--- a/pkgs/development/libraries/directfb/default.nix
+++ b/pkgs/development/libraries/directfb/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   patches = [ ./ftbfs.patch ];
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   buildInputs = [ zlib libjpeg freetype giflib libpng ]
     ++ stdenv.lib.optional enableSDL SDL
diff --git a/pkgs/development/libraries/eigen/2.0.nix b/pkgs/development/libraries/eigen/2.0.nix
index 6884aca16fc..9cf0a3c350c 100644
--- a/pkgs/development/libraries/eigen/2.0.nix
+++ b/pkgs/development/libraries/eigen/2.0.nix
@@ -5,15 +5,15 @@ let
 in
 stdenv.mkDerivation {
   name = "eigen-${v}";
-  
+
   src = fetchurl {
     url = "http://bitbucket.org/eigen/eigen/get/${v}.tar.bz2";
     name = "eigen-${v}.tar.bz2";
     sha256 = "1akcb4g5hvc664gfc6sxb6f6jrm55fgks6017wg0smyvmm6k09v0";
   };
-  
-  buildNativeInputs = [ cmake ];
-  
+
+  nativeBuildInputs = [ cmake ];
+
   meta = with stdenv.lib; {
     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
     license = licenses.lgpl3Plus;
diff --git a/pkgs/development/libraries/eigen/default.nix b/pkgs/development/libraries/eigen/default.nix
index 56f66aba8f8..5653eec6d41 100644
--- a/pkgs/development/libraries/eigen/default.nix
+++ b/pkgs/development/libraries/eigen/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     sha256 = "1hywvbn4a8f96fjn3cvd6nxzh5jvh05s1r263d9vqlgn25dxrzay";
   };
   
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
   
   meta = with stdenv.lib; {
     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
diff --git a/pkgs/development/libraries/error-support/default.nix b/pkgs/development/libraries/error-support/default.nix
index da59c3bb9b4..766a0dbef1d 100644
--- a/pkgs/development/libraries/error-support/default.nix
+++ b/pkgs/development/libraries/error-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/farsight2/default.nix b/pkgs/development/libraries/farsight2/default.nix
index cbb21073685..3467ac2cc3b 100644
--- a/pkgs/development/libraries/farsight2/default.nix
+++ b/pkgs/development/libraries/farsight2/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnice python pygobject gst_python gupnp_igd ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ gstreamer gst_plugins_base ];
 
diff --git a/pkgs/development/libraries/farstream/default.nix b/pkgs/development/libraries/farstream/default.nix
index 3babcb82833..87764483f47 100644
--- a/pkgs/development/libraries/farstream/default.nix
+++ b/pkgs/development/libraries/farstream/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnice python pygobject gupnp_igd ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ gstreamer gst_plugins_base gst_python 
     gst_plugins_good gst_plugins_bad gst_ffmpeg
diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix
index 3b5e28a2ee7..b37fcdf4436 100644
--- a/pkgs/development/libraries/ffmpeg/default.nix
+++ b/pkgs/development/libraries/ffmpeg/default.nix
@@ -74,6 +74,10 @@ stdenv.mkDerivation rec {
       ];
   };
 
+  passthru = {
+    inherit vdpauSupport;
+  };
+
   meta = {
     homepage = http://www.ffmpeg.org/;
     description = "A complete, cross-platform solution to record, convert and stream audio and video";
diff --git a/pkgs/development/libraries/fltk/fltk13.nix b/pkgs/development/libraries/fltk/fltk13.nix
index d3d89e6a907..3ab267ad6b4 100644
--- a/pkgs/development/libraries/fltk/fltk13.nix
+++ b/pkgs/development/libraries/fltk/fltk13.nix
@@ -14,7 +14,7 @@ composableDerivation.composableDerivation {} {
 
   propagatedBuildInputs = [ x11 inputproto libXi freeglut ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   flags =
     # this could be tidied up (?).. eg why does it require freeglut without glSupport?
diff --git a/pkgs/development/libraries/fmod/default.nix b/pkgs/development/libraries/fmod/default.nix
index f73480b3ce4..d85a24fa63a 100644
--- a/pkgs/development/libraries/fmod/default.nix
+++ b/pkgs/development/libraries/fmod/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation {
   name = "fmod-42204";
-  src = if (stdenv.system == "i686-linux") then
+  src = if stdenv.system == "i686-linux" then
     fetchurl {
       url = http://www.fmod.org/index.php/release/version/fmodapi42204linux.tar.gz;
       sha256 = "64eedc5b37c597eb925de446106d75cab0b5a79697d5ec048d34702812c08563";
-    } else if (stdenv.system == "x86_64-linux") then
+    } else if stdenv.system == "x86_64-linux" then
     fetchurl {
       url = http://www.fmod.org/index.php/release/version/fmodapi42204linux64.tar.gz;
       sha256 = "3f2eec8265838a1005febe07c4971660e85010e4622911890642dc438746edf3";
diff --git a/pkgs/development/libraries/funambol/default.nix b/pkgs/development/libraries/funambol/default.nix
index 589ffaba3f9..98049e0ca35 100644
--- a/pkgs/development/libraries/funambol/default.nix
+++ b/pkgs/development/libraries/funambol/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib curl ];
 
-  buildNativeInputs = [ automake libtool autoconf unzip ];
+  nativeBuildInputs = [ automake libtool autoconf unzip ];
 
   meta = {
     description = "SyncML client sdk by Funambol project";
diff --git a/pkgs/development/libraries/gamin/default.nix b/pkgs/development/libraries/gamin/default.nix
index a212946c67f..6d94eee865f 100644
--- a/pkgs/development/libraries/gamin/default.nix
+++ b/pkgs/development/libraries/gamin/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "18cr51y5qacvs2fc2p1bqv32rs8bzgs6l67zhasyl45yx055y218";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ python glib ];
 
diff --git a/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix b/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix
index 07e66df33b5..2876c9b9434 100644
--- a/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   # !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
   buildInputs = [ libX11 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
 
diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix
index 5da6e3e40f4..a30d5c78e7f 100644
--- a/pkgs/development/libraries/gegl/default.nix
+++ b/pkgs/development/libraries/gegl/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk bzip2 intltool ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = { 
     description = "Graph-based image processing framework";
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 73366b2bdc9..5468c9f2336 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation (rec {
     sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k";
   };
 
+  patches = [ ./no-gets.patch ];
+
   configureFlags = [ "--disable-csharp" ]
      ++ (stdenv.lib.optionals stdenv.isCygwin
           [ # We have a static libiconv, so we can only build the static lib.
@@ -34,7 +36,7 @@ stdenv.mkDerivation (rec {
       
   crossAttrs = {
     buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
-      stdenv.gccCross.libc.libiconv.hostDrv;
+      stdenv.gccCross.libc.libiconv.crossDrv;
     # Gettext fails to guess the cross compiler
     configureFlags = "CXX=${stdenv.cross.config}-g++";
   };
diff --git a/pkgs/development/libraries/gettext/no-gets.patch b/pkgs/development/libraries/gettext/no-gets.patch
new file mode 100644
index 00000000000..9daa48eae64
--- /dev/null
+++ b/pkgs/development/libraries/gettext/no-gets.patch
@@ -0,0 +1,42 @@
+hack until gzip pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/gettext-tools/libgettextpo/stdio.in.h
++++ b/gettext-tools/libgettextpo/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+--- a/gettext-tools/gnulib-lib/stdio.in.h
++++ b/gettext-tools/gnulib-lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+--- a/gettext-runtime/gnulib-lib/stdio.in.h
++++ b/gettext-runtime/gnulib-lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 107a583d102..2c651980eda 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     sed -e "s@${glib}/lib/gio/modules@$out/lib/gio/modules@g" -i $(find . -name Makefile)
   '';
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   propagatedBuildInputs =
     [ glib libtool gnutls2 libproxy libgcrypt libtasn1 gsettings_desktop_schemas ];
 }
diff --git a/pkgs/development/libraries/glib/2.34.x.nix b/pkgs/development/libraries/glib/2.34.x.nix
index 7fb61ac20e2..69ed44aecca 100644
--- a/pkgs/development/libraries/glib/2.34.x.nix
+++ b/pkgs/development/libraries/glib/2.34.x.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation (rec {
   # configure script looks for d-bus but it is only needed for tests
   buildInputs = [ libiconvOrNull ];
 
-  buildNativeInputs = [ perl pkgconfig gettext python ];
+  nativeBuildInputs = [ perl pkgconfig gettext python ];
 
   propagatedBuildInputs = [ pcre zlib libffi ];
 
diff --git a/pkgs/development/libraries/glibc/2.13/common.nix b/pkgs/development/libraries/glibc/2.13/common.nix
index cc8c5373ff5..8be076f335c 100644
--- a/pkgs/development/libraries/glibc/2.13/common.nix
+++ b/pkgs/development/libraries/glibc/2.13/common.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation ({
   inherit kernelHeaders installLocales;
 
   # The host/target system.
-  crossConfig = if (cross != null) then cross.config else null;
+  crossConfig = if cross != null then cross.config else null;
 
   inherit (stdenv) is64bit;
 
@@ -102,14 +102,16 @@ stdenv.mkDerivation ({
     "-C"
     "--enable-add-ons"
     "--sysconfdir=/etc"
-    "--localedir=/var/run/current-system/sw/lib/locale" ] ++
-    (stdenv.lib.optional (stdenv.name == "stdenv") "libc_cv_ssp=no") ++ [
+    "--localedir=/var/run/current-system/sw/lib/locale"
+    "libc_cv_ssp=no"
     (if kernelHeaders != null
      then "--with-headers=${kernelHeaders}/include"
      else "--without-headers")
     (if profilingLibraries
      then "--enable-profile"
      else "--disable-profile")
+  ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [
+    "--enable-kernel=2.6.35"
   ] ++ stdenv.lib.optionals (cross != null) [
     (if cross.withTLS then "--with-tls" else "--without-tls")
     (if cross.float == "soft" then "--without-fp" else "--with-fp")
@@ -118,7 +120,8 @@ stdenv.mkDerivation ({
         && cross.platform.kernelMajor == "2.6") [
     "--enable-kernel=2.6.0"
     "--with-__thread"
-  ] ++ stdenv.lib.optionals stdenv.isArm [
+  ] ++ stdenv.lib.optionals (cross == null &&
+       (stdenv.system == "armv5tel-linux")) [
     "--host=arm-linux-gnueabi"
     "--build=arm-linux-gnueabi"
     "--without-fp"
@@ -126,6 +129,14 @@ stdenv.mkDerivation ({
     # To avoid linking with -lgcc_s (dynamic link)
     # so the glibc does not depend on its compiler store path
     "libc_cv_as_needed=no"
+  ] ++ stdenv.lib.optionals (cross == null && stdenv.platform.name == "raspberrypi") [
+    "--host=arm-linux-gnueabi"
+    "--build=arm-linux-gnueabi"
+    "--with-fp"
+
+    # To avoid linking with -lgcc_s (dynamic link)
+    # so the glibc does not depend on its compiler store path
+    "libc_cv_as_needed=no"
   ];
 
   installFlags = [ "sysconfdir=$(out)/etc" ];
diff --git a/pkgs/development/libraries/glibc/2.14/common.nix b/pkgs/development/libraries/glibc/2.14/common.nix
deleted file mode 100644
index ab3ef7c42f4..00000000000
--- a/pkgs/development/libraries/glibc/2.14/common.nix
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Build configuration used to build glibc, Info files, and locale
-   information.  */
-
-cross :
-
-{ name, fetchurl, stdenv, installLocales ? false
-, gccCross ? null, kernelHeaders ? null
-, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
-, profilingLibraries ? false, meta
-, preConfigure ? "", ... }@args :
-
-let
-  # For GNU/Hurd, see below.
-  version = if hurdHeaders != null then "20111025" else "2.14.1";
-
-  needsPortsNative = stdenv.isMips || stdenv.isArm;
-  needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
-  needsPorts = if (stdenv ? cross) && stdenv.cross != null then true
-    else if cross == null then needsPortsNative
-    else needsPortsCross;
-
-  srcPorts = fetchurl {
-    url = "mirror://gnu/glibc/glibc-ports-2.14.1.tar.bz2";
-    sha256 = "1acs4sd5mjzmssmd0md6dfqwnziph2am7v09mbnnd8aadpxhm0qw";
-  };
-
-in
-
-assert (cross != null) -> (gccCross != null);
-
-assert (mig != null) -> (machHeaders != null);
-assert (machHeaders != null) -> (hurdHeaders != null);
-assert (hurdHeaders != null) -> (libpthreadHeaders != null);
-assert (hurdHeaders != null) -> (fetchgit != null);
-
-stdenv.mkDerivation ({
-  inherit kernelHeaders installLocales;
-
-  # The host/target system.
-  crossConfig = if (cross != null) then cross.config else null;
-
-  inherit (stdenv) is64bit;
-
-  enableParallelBuilding = true;
-
-  patches =
-    stdenv.lib.optional (fetchgit == null)
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-  ++ [
-    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
-    ./rpcgen-path.patch
-
-    /* Allow nixos and nix handle the locale-archive. */
-    ./nix-locale-archive.patch
-
-    /* don't use /etc/ld.so.cache, for non-nixos systems */
-    ./dont_use_system_ld_so_cache.patch
-
-    /* Without this patch many KDE binaries crash. */
-    ./glibc-elf-localscope.patch
-  ];
-
-  postPatch = ''
-    # Needed for glibc to build with the gnumake 3.82
-    # http://comments.gmane.org/gmane.linux.lfs.support/31227
-    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
-
-    # nscd needs libgcc, and we don't want it dynamically linked
-    # because we don't want it to depend on bootstrap-tools libs.
-    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
-  '';
-
-  configureFlags = [
-    "-C"
-    "--enable-add-ons"
-    "--sysconfdir=/etc"
-    "--localedir=/var/run/current-system/sw/lib/locale"
-    "libc_cv_ssp=no"
-    (if kernelHeaders != null
-     then "--with-headers=${kernelHeaders}/include"
-     else "--without-headers")
-    (if profilingLibraries
-     then "--enable-profile"
-     else "--disable-profile")
-  ] ++ stdenv.lib.optionals (cross != null) [
-    (if cross.withTLS then "--with-tls" else "--without-tls")
-    (if cross.float == "soft" then "--without-fp" else "--with-fp")
-    "--enable-kernel=2.6.0"
-    "--with-__thread"
-  ] ++ stdenv.lib.optionals stdenv.isArm [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-
-    # To avoid linking with -lgcc_s (dynamic link)
-    # so the glibc does not depend on its compiler store path
-    "libc_cv_as_needed=no"
-  ];
-
-  installFlags = [ "sysconfdir=$(out)/etc" ];
-  
-  buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
-    ++ stdenv.lib.optional (mig != null) mig;
-
-  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
-  # bootstrap.
-  BASH_SHELL = "/bin/sh";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
-}
-
-# Remove the `gccCross' attribute so that the *native* glibc store path
-# doesn't depend on whether `gccCross' is null or not.
-// (removeAttrs args [ "gccCross" ]) //
-
-{
-  name = name + "-${version}" +
-    stdenv.lib.optionalString (cross != null) "-${cross.config}";
-
-  src =
-    if hurdHeaders != null
-    then fetchgit {
-      # Shamefully the "official" glibc won't build on GNU, so use the one
-      # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
-      # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
-      url = "git://git.sv.gnu.org/hurd/glibc.git";
-      sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca";
-      rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793";
-    }
-    else fetchurl {
-      url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
-      sha256 = "0fsvf5d6sib483rp7asdy8hs0dysxqkrvw316c82hsxy7vxa51bf";
-    };
-
-  # `fetchurl' is a function and thus should not be passed to the
-  # `derivation' primitive.
-  fetchurl = null;
-
-  # Remove absolute paths from `configure' & co.; build out-of-tree.
-  preConfigure = ''
-    export PWD_P=$(type -tP pwd)
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    ${if needsPorts then "tar xvf ${srcPorts}" else ""}
-
-    mkdir ../build
-    cd ../build
-
-    configureScript="`pwd`/../$sourceRoot/configure"
-
-    ${preConfigure}
-  '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-
-    longDescription =
-      '' Any Unix-like operating system needs a C library: the library which
-         defines the "system calls" and other basic facilities such as
-         open, malloc, printf, exit...
-
-         The GNU C library is used as the C library in the GNU system and
-         most systems with the Linux kernel.
-      '';
-
-    license = "LGPLv2+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    #platforms = stdenv.lib.platforms.linux;
-  } // meta;
-}
-
-//
-
-(if hurdHeaders != null
- then {
-   # Work around the fact that the configure snippet that looks for
-   # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
-   # glibc expects Mach, Hurd, and pthread headers to be in the same place.
-   CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
-
-   # `fetchgit' is a function and thus should not be passed to the
-   # `derivation' primitive.
-   fetchgit = null;
-
-   # Install NSS stuff in the right place.
-   # XXX: This will be needed for all new glibcs and isn't Hurd-specific.
-   makeFlags = ''vardbdir="$out/var/db"'';
- }
- else { }))
diff --git a/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch b/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch
deleted file mode 100644
index 444eb8251e4..00000000000
--- a/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c
---- glibc-2.13-orig/elf/ldconfig.c	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/elf/ldconfig.c	2012-04-10 23:28:45.957492340 -0400
-@@ -51,7 +51,7 @@
- #endif
- 
- #ifndef LD_SO_CONF
--# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
-+# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
- #endif
- 
- /* Get libc version number.  */
-diff -Naur glibc-2.13-orig/elf/Makefile glibc-2.13/elf/Makefile
---- glibc-2.13-orig/elf/Makefile	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/elf/Makefile	2012-04-10 23:27:05.666477442 -0400
-@@ -459,11 +459,11 @@
- $(objpfx)sprof: $(libdl)
- 
- $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
--SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
--CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-+PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
-+CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
- 		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
--CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
--CFLAGS-cache.c = $(SYSCONF-FLAGS)
-+CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
-+CFLAGS-cache.c = $(PREFIX-FLAGS)
- 
- CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
- 
-diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h
---- glibc-2.13-orig/sysdeps/generic/dl-cache.h	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/sysdeps/generic/dl-cache.h	2012-04-10 23:28:20.077488815 -0400
-@@ -29,7 +29,7 @@
- #endif
- 
- #ifndef LD_SO_CACHE
--# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
-+# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
- #endif
- 
- #ifndef add_system_dir
diff --git a/pkgs/development/libraries/glibc/2.14/info.nix b/pkgs/development/libraries/glibc/2.14/info.nix
deleted file mode 100644
index 75bd996d9bc..00000000000
--- a/pkgs/development/libraries/glibc/2.14/info.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, texinfo, perl }:
-
-let build = import ./common.nix;
-in
-  /* null cross builder */
-  build null {
-    name = "glibc-info";
-
-    inherit fetchurl stdenv;
-
-    configureFlags = [ "--enable-add-ons" ];
-
-    buildInputs = [ texinfo perl ];
-
-    buildPhase = "make info";
-
-    # I don't know why the info is not generated in 'build'
-    # Somehow building the info still does not work, because the final
-    # libc.info hasn't a Top node.
-    installPhase = ''
-      mkdir -p "$out/share/info"
-      cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
-    '';
-
-    meta.description = "GNU Info manual of the GNU C Library";
-  }
diff --git a/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch
deleted file mode 100644
index e48dc2bc0a6..00000000000
--- a/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c
---- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c	2010-05-19 22:38:20.000000000 +0200
-+++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c	2010-08-05 18:39:54.259556327 +0200
-@@ -505,8 +505,6 @@
- 	  int no_data = 0;
- 	  int no_inet6_data = 0;
- 	  service_user *nip = NULL;
--	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
--	  enum nss_status status = NSS_STATUS_UNAVAIL;
- 	  int no_more;
- 	  int old_res_options;
- 
-@@ -702,6 +700,8 @@
- 
- 	  while (!no_more)
- 	    {
-+ 	      enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+ 	      enum nss_status status = NSS_STATUS_UNAVAIL;
- 	      no_data = 0;
- 	      nss_gethostbyname4_r fct4
- 		= __nss_lookup_function (nip, "gethostbyname4_r");
diff --git a/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
deleted file mode 100644
index fbb03dd5fad..00000000000
--- a/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
-(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
-patch makes it run any `cpp' command found in $PATH.
-
---- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
-+++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
-@@ -79,7 +79,7 @@ static const char *cmdname;
- 
- static const char *svcclosetime = "120";
- static int cppDefined;	/* explicit path for C preprocessor */
--static const char *CPP = SUNOS_CPP;
-+static const char *CPP = "cpp";
- static const char CPPFLAGS[] = "-C";
- static char *pathbuf;
- static int cpp_pid;
-@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
- static void open_output (const char *infile, const char *outfile);
- static void add_warning (void);
- static void clear_args (void);
--static void find_cpp (void);
- static void open_input (const char *infile, const char *define);
- static int check_nettype (const char *name, const char *list_to_check[]);
- static void c_output (const char *infile, const char *define,
-@@ -327,31 +326,6 @@ clear_args (void)
-   argcount = FIXEDARGS;
- }
- 
--/* make sure that a CPP exists */
--static void
--find_cpp (void)
--{
--  struct stat buf;
--
--  if (stat (CPP, &buf) < 0)
--    {				/* /lib/cpp or explicit cpp does not exist */
--      if (cppDefined)
--	{
--	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
--	  crash ();
--	}
--      else
--	{			/* try the other one */
--	  CPP = SVR4_CPP;
--	  if (stat (CPP, &buf) < 0)
--	    {			/* can't find any cpp */
--	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
--	      crash ();
--	    }
--	}
--    }
--}
--
- /*
-  * Open input file with given define for C-preprocessor
-  */
-@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
-   switch (cpp_pid)
-     {
-     case 0:
--      find_cpp ();
-       putarg (0, CPP);
-       putarg (1, CPPFLAGS);
-       addarg (define);
-@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
-       close (1);
-       dup2 (pd[1], 1);
-       close (pd[0]);
--      execv (arglist[0], (char **) arglist);
-+      execvp (arglist[0], (char **) arglist);
-       perror ("execv");
-       exit (1);
-     case -1:
diff --git a/pkgs/development/libraries/glibc/2.14/builder.sh b/pkgs/development/libraries/glibc/2.17/builder.sh
index e68e13f9bec..e68e13f9bec 100644
--- a/pkgs/development/libraries/glibc/2.14/builder.sh
+++ b/pkgs/development/libraries/glibc/2.17/builder.sh
diff --git a/pkgs/development/libraries/glibc/2.17/common.nix b/pkgs/development/libraries/glibc/2.17/common.nix
new file mode 100644
index 00000000000..18077510f94
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/common.nix
@@ -0,0 +1,171 @@
+/* Build configuration used to build glibc, Info files, and locale
+   information.  */
+
+cross:
+
+{ name, fetchurl, stdenv, installLocales ? false
+, gccCross ? null, kernelHeaders ? null
+, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
+, mig ? null
+, profilingLibraries ? false, meta
+, preConfigure ? "", ... }@args:
+
+let
+
+  version = "2.17";
+
+in
+
+assert cross != null -> gccCross != null;
+assert mig != null -> machHeaders != null;
+assert machHeaders != null -> hurdHeaders != null;
+assert hurdHeaders != null -> libpthreadHeaders != null;
+
+stdenv.mkDerivation ({
+  inherit kernelHeaders installLocales;
+
+  # The host/target system.
+  crossConfig = if cross != null then cross.config else null;
+
+  inherit (stdenv) is64bit;
+
+  enableParallelBuilding = true;
+
+  patches =
+    [ /* Have rpcgen(1) look for cpp(1) in $PATH.  */
+      ./rpcgen-path.patch
+
+      /* Allow NixOS and Nix to handle the locale-archive. */
+      ./nix-locale-archive.patch
+
+      /* Don't use /etc/ld.so.cache, for non-NixOS systems.  Currently
+         disabled on GNU/Hurd, which uses a more recent libc snapshot. */
+      ./dont-use-system-ld-so-cache.patch
+
+      /* Without this patch many KDE binaries crash. */
+      ./glibc-elf-localscope.patch
+    ];
+
+  postPatch = ''
+    # Needed for glibc to build with the gnumake 3.82
+    # http://comments.gmane.org/gmane.linux.lfs.support/31227
+    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+
+    # nscd needs libgcc, and we don't want it dynamically linked
+    # because we don't want it to depend on bootstrap-tools libs.
+    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+  '';
+
+  configureFlags =
+    [ "-C"
+      "--enable-add-ons"
+      "--enable-obsolete-rpc"
+      "--sysconfdir=/etc"
+      "--localedir=/var/run/current-system/sw/lib/locale"
+      "libc_cv_ssp=no"
+      (if kernelHeaders != null
+       then "--with-headers=${kernelHeaders}/include"
+       else "--without-headers")
+      (if profilingLibraries
+       then "--enable-profile"
+       else "--disable-profile")
+    ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [
+      "--enable-kernel=2.6.35"
+    ] ++ stdenv.lib.optionals (cross != null) [
+      (if cross.withTLS then "--with-tls" else "--without-tls")
+      (if cross.float == "soft" then "--without-fp" else "--with-fp")
+    ] ++ stdenv.lib.optionals (cross != null
+          && cross.platform ? kernelMajor
+          && cross.platform.kernelMajor == "2.6") [
+      "--enable-kernel=2.6.0"
+      "--with-__thread"
+    ] ++ stdenv.lib.optionals (cross == null && stdenv.isArm) [
+      "--host=arm-linux-gnueabi"
+      "--build=arm-linux-gnueabi"
+
+      # To avoid linking with -lgcc_s (dynamic link)
+      # so the glibc does not depend on its compiler store path
+      "libc_cv_as_needed=no"
+    ];
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+
+  buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
+    ++ stdenv.lib.optional (mig != null) mig;
+
+  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
+  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
+  # bootstrap.
+  BASH_SHELL = "/bin/sh";
+
+  # Workaround for this bug:
+  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
+  # I.e. when gcc is compiled with --with-arch=i686, then the
+  # preprocessor symbol `__i686' will be defined to `1'.  This causes
+  # the symbol __i686.get_pc_thunk.dx to be mangled.
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
+}
+
+# Remove the `gccCross' attribute so that the *native* glibc store path
+# doesn't depend on whether `gccCross' is null or not.
+// (removeAttrs args [ "gccCross" "fetchurl" ]) //
+
+{
+  name = name + "-${version}" +
+    stdenv.lib.optionalString (cross != null) "-${cross.config}";
+
+  src = fetchurl {
+    url = "mirror://gnu/glibc/glibc-${version}.tar.gz";
+    sha256 = "0ym3zk9ii64279wgw7pw9xkbxczy2ci7ka6mnfs05rhlainhicm3";
+  };
+
+  # Remove absolute paths from `configure' & co.; build out-of-tree.
+  preConfigure = ''
+    export PWD_P=$(type -tP pwd)
+    for i in configure io/ftwtest-sh; do
+        # Can't use substituteInPlace here because replace hasn't been
+        # built yet in the bootstrap.
+        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
+    done
+
+    mkdir ../build
+    cd ../build
+
+    configureScript="`pwd`/../$sourceRoot/configure"
+
+    makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.gcc.libc}/lib"
+
+    ${preConfigure}
+  '';
+
+  meta = {
+    homepage = http://www.gnu.org/software/libc/;
+    description = "The GNU C Library"
+      + stdenv.lib.optionalString (hurdHeaders != null) ", for GNU/Hurd";
+
+    longDescription =
+      '' Any Unix-like operating system needs a C library: the library which
+         defines the "system calls" and other basic facilities such as
+         open, malloc, printf, exit...
+
+         The GNU C library is used as the C library in the GNU system and
+         most systems with the Linux kernel.
+      '';
+
+    license = "LGPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    #platforms = stdenv.lib.platforms.linux;
+  } // meta;
+}
+
+// stdenv.lib.optionalAttrs (hurdHeaders != null) {
+  # Work around the fact that the configure snippet that looks for
+  # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
+  # glibc expects Mach, Hurd, and pthread headers to be in the same place.
+  CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
+
+  # Install NSS stuff in the right place.
+  # XXX: This will be needed for all new glibcs and isn't Hurd-specific.
+  makeFlags = ''vardbdir="$out/var/db"'';
+})
diff --git a/pkgs/development/libraries/glibc/2.14/default.nix b/pkgs/development/libraries/glibc/2.17/default.nix
index 1b4e43b1013..0a0752570f3 100644
--- a/pkgs/development/libraries/glibc/2.14/default.nix
+++ b/pkgs/development/libraries/glibc/2.17/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, kernelHeaders
 , machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
+, mig ? null
 , installLocales ? true
 , profilingLibraries ? false
 , gccCross ? null
@@ -14,7 +14,9 @@ let
   cross = if gccCross != null then gccCross.target else null;
 in
   build cross ({
-    name = "glibc${if debugSymbols then "-debug" else ""}";
+    name = "glibc"
+      + stdenv.lib.optionalString (hurdHeaders != null) "-hurd"
+      + stdenv.lib.optionalString debugSymbols "-debug";
 
     inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
       gccCross;
@@ -54,7 +56,7 @@ in
 
   (if hurdHeaders != null
    then rec {
-     inherit machHeaders hurdHeaders libpthreadHeaders mig fetchgit;
+     inherit machHeaders hurdHeaders libpthreadHeaders mig;
 
      propagatedBuildInputs = [ machHeaders hurdHeaders libpthreadHeaders ];
 
diff --git a/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch b/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch
new file mode 100644
index 00000000000..95f53773320
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch
@@ -0,0 +1,45 @@
+diff -ru glibc-2.16.0-orig/elf/ldconfig.c glibc-2.16.0/elf/ldconfig.c
+--- glibc-2.16.0-orig/elf/ldconfig.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/elf/ldconfig.c	2012-09-18 11:59:27.463284814 -0400
+@@ -50,7 +50,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CONF
+-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
++# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
+ #endif
+ 
+ /* Get libc version number.  */
+diff -ru glibc-2.16.0-orig/elf/Makefile glibc-2.16.0/elf/Makefile
+--- glibc-2.16.0-orig/elf/Makefile	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/elf/Makefile	2012-09-18 12:03:30.031955196 -0400
+@@ -415,12 +415,12 @@
+ 
+ $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o)
+ 
+-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+-CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
++PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
++CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
+ 		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+-CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
+-CFLAGS-cache.c = $(SYSCONF-FLAGS)
+-CFLAGS-rtld.c = $(SYSCONF-FLAGS)
++CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
++CFLAGS-cache.c = $(PREFIX-FLAGS)
++CFLAGS-rtld.c = $(PREFIX-FLAGS)
+ 
+ CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+ 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
+diff -ru glibc-2.16.0-orig/sysdeps/generic/dl-cache.h glibc-2.16.0/sysdeps/generic/dl-cache.h
+--- glibc-2.16.0-orig/sysdeps/generic/dl-cache.h	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/sysdeps/generic/dl-cache.h	2012-09-18 11:59:27.465284809 -0400
+@@ -28,7 +28,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
+ #endif
+ 
+ #ifndef add_system_dir
diff --git a/pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch b/pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch
index 98f7f81087b..98f7f81087b 100644
--- a/pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch
+++ b/pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch
diff --git a/pkgs/development/libraries/glibc/2.17/info.nix b/pkgs/development/libraries/glibc/2.17/info.nix
new file mode 100644
index 00000000000..322f07f0236
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/info.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, texinfo, perl }:
+
+let build = import ./common.nix; in
+
+/* null cross builder */
+build null {
+  name = "glibc-info";
+
+  inherit fetchurl stdenv;
+
+  configureFlags = [ "--enable-add-ons" ];
+
+  buildInputs = [ texinfo perl ];
+
+  buildPhase = "make info";
+
+  # I don't know why the info is not generated in 'build'
+  # Somehow building the info still does not work, because the final
+  # libc.info hasn't a Top node.
+  installPhase = ''
+    mkdir -p "$out/share/info"
+    cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
+  '';
+
+  meta.description = "GNU Info manual of the GNU C Library";
+}
diff --git a/pkgs/development/libraries/glibc/2.14/locales-builder.sh b/pkgs/development/libraries/glibc/2.17/locales-builder.sh
index d732e208fa2..d732e208fa2 100644
--- a/pkgs/development/libraries/glibc/2.14/locales-builder.sh
+++ b/pkgs/development/libraries/glibc/2.17/locales-builder.sh
diff --git a/pkgs/development/libraries/glibc/2.14/locales.nix b/pkgs/development/libraries/glibc/2.17/locales.nix
index b7eae50ca38..b7eae50ca38 100644
--- a/pkgs/development/libraries/glibc/2.14/locales.nix
+++ b/pkgs/development/libraries/glibc/2.17/locales.nix
diff --git a/pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch b/pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch
index aca904f7ff4..88c8adef922 100644
--- a/pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch
+++ b/pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch
@@ -1,8 +1,7 @@
-diff --git a/locale/loadarchive.c b/locale/loadarchive.c
-index d545f17..0d8638a 100644
---- a/locale/loadarchive.c
-+++ b/locale/loadarchive.c
-@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h)
+diff -ru glibc-2.16.0-orig/locale/loadarchive.c glibc-2.16.0/locale/loadarchive.c
+--- glibc-2.16.0-orig/locale/loadarchive.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/loadarchive.c	2012-09-18 11:57:57.277515212 -0400
+@@ -123,6 +123,25 @@
  }
  
  
@@ -14,13 +13,13 @@ index d545f17..0d8638a 100644
 +  char *path2 = getenv ("LOCALE_ARCHIVE");
 +  const char *usualpath = "/usr/lib/locale/locale-archive";
 +  if (path)
-+    fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (path2 && fd < 0)
-+    fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (fd < 0)
-+    fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (fd < 0)
-+    fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  return fd;
 +}
 +
@@ -28,29 +27,29 @@ index d545f17..0d8638a 100644
  /* Find the locale *NAMEP in the locale archive, and return the
     internalized data structure for its CATEGORY data.  If this locale has
     already been loaded from the archive, just returns the existing data
-@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+@@ -202,7 +221,7 @@
        archmapped = &headmap;
  
        /* The archive has never been opened.  */
--      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+-      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +      fd = open_locale_archive ();
        if (fd < 0)
  	/* Cannot open the archive, for whatever reason.  */
  	return NULL;
-@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+@@ -393,8 +412,7 @@
  	  if (fd == -1)
  	    {
  	      struct stat64 st;
--	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+-	      fd = open_not_cancel_2 (archfname,
+-				      O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +	      fd = open_locale_archive ();
  	      if (fd == -1)
  		/* Cannot open the archive, for whatever reason.  */
  		return NULL;
-diff --git a/locale/programs/locale.c b/locale/programs/locale.c
-index 77262b7..fddc00d 100644
---- a/locale/programs/locale.c
-+++ b/locale/programs/locale.c
-@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b)
+diff -ru glibc-2.16.0-orig/locale/programs/locale.c glibc-2.16.0/locale/programs/locale.c
+--- glibc-2.16.0-orig/locale/programs/locale.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/programs/locale.c	2012-09-18 11:53:03.719920947 -0400
+@@ -628,6 +628,20 @@
  		  ((const struct nameent *) b)->name);
  }
  
@@ -71,7 +70,7 @@ index 77262b7..fddc00d 100644
  
  static int
  write_archive_locales (void **all_datap, char *linebuf)
-@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf)
+@@ -641,7 +655,7 @@
    int fd, ret = 0;
    uint32_t cnt;
  
@@ -80,11 +79,10 @@ index 77262b7..fddc00d 100644
    if (fd < 0)
      return 0;
  
-diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
-index 85ba77d..3ad2af8 100644
---- a/locale/programs/locarchive.c
-+++ b/locale/programs/locarchive.c
-@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
+diff -ru glibc-2.16.0-orig/locale/programs/locarchive.c glibc-2.16.0/locale/programs/locarchive.c
+--- glibc-2.16.0-orig/locale/programs/locarchive.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/programs/locarchive.c	2012-09-18 11:53:03.720920942 -0400
+@@ -509,6 +509,20 @@
    *ah = new_ah;
  }
  
@@ -105,7 +103,7 @@ index 85ba77d..3ad2af8 100644
  
  void
  open_archive (struct locarhandle *ah, bool readonly)
-@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+@@ -528,7 +542,7 @@
    while (1)
      {
        /* Open the archive.  We must have exclusive write access.  */
diff --git a/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch
new file mode 100644
index 00000000000..fd81ab5324e
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch
@@ -0,0 +1,54 @@
+diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
+--- glibc-2.17-orig/sunrpc/rpc_main.c	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/sunrpc/rpc_main.c	2012-12-29 00:21:04.124698455 +0100
+@@ -77,7 +77,7 @@
+ 
+ static const char *svcclosetime = "120";
+ static int cppDefined;	/* explicit path for C preprocessor */
+-static const char *CPP = "/lib/cpp";
++static const char *CPP = "cpp";
+ static const char CPPFLAGS[] = "-C";
+ static char *pathbuf;
+ static int cpp_pid;
+@@ -106,7 +106,6 @@
+ static void open_output (const char *infile, const char *outfile);
+ static void add_warning (void);
+ static void clear_args (void);
+-static void find_cpp (void);
+ static void open_input (const char *infile, const char *define);
+ static int check_nettype (const char *name, const char *list_to_check[]);
+ static void c_output (const char *infile, const char *define,
+@@ -318,25 +317,6 @@
+   argcount = FIXEDARGS;
+ }
+ 
+-/* make sure that a CPP exists */
+-static void
+-find_cpp (void)
+-{
+-  struct stat buf;
+-
+-  if (stat (CPP, &buf) == 0)
+-    return;
+-
+-  if (cppDefined) /* user specified cpp but it does not exist */
+-    {
+-      fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+-      crash ();
+-    }
+-
+-  /* fall back to system CPP */
+-  CPP = "cpp";
+-}
+-
+ /*
+  * Open input file with given define for C-preprocessor
+  */
+@@ -355,7 +335,6 @@
+   switch (cpp_pid)
+     {
+     case 0:
+-      find_cpp ();
+       putarg (0, CPP);
+       putarg (1, CPPFLAGS);
+       addarg (define);
diff --git a/pkgs/development/libraries/glibc/2.5/binutils-ld.patch b/pkgs/development/libraries/glibc/2.5/binutils-ld.patch
deleted file mode 100644
index 4cd7ab3cec3..00000000000
--- a/pkgs/development/libraries/glibc/2.5/binutils-ld.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Sat, 31 Jan 2009 00:21:15 +0000
-Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
-
-	newer linker scripts.
----
- ChangeLog    |    5 +++++
- elf/Makefile |    4 ++--
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index 8079fe9..e44ff1d 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
- 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
- 		  LC_ALL=C \
- 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
--		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- 		  > $@.lds
- 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
- 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\
---
-1.6.4
-
diff --git a/pkgs/development/libraries/glibc/2.5/builder.sh b/pkgs/development/libraries/glibc/2.5/builder.sh
deleted file mode 100644
index bc80af83b92..00000000000
--- a/pkgs/development/libraries/glibc/2.5/builder.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-# glibc cannot have itself in its rpath.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-
-postUnpack() {
-    cd $sourceRoot/..
-}
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        substituteInPlace "$i" \
-            --replace "@PWD@" "pwd"
-    done
-
-    # Fix shell code that tries to determine whether GNU ld is recent enough.
-    substituteInPlace configure --replace '2.1[3-9]*)' '2.1[3-9]*|2.[2-9][0-9]*)'
-
-    mkdir ../build
-    cd ../build
-
-    configureScript=../$sourceRoot/configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-    export NIX_DONT_SET_RPATH=1
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
-    fi
-    rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.5/default.nix b/pkgs/development/libraries/glibc/2.5/default.nix
deleted file mode 100644
index 8b8c204a480..00000000000
--- a/pkgs/development/libraries/glibc/2.5/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation {
-  name = "glibc-2.5";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.5.tar.bz2;
-    md5 = "1fb29764a6a650a4d5b409dda227ac9f";
-  };
-
-  patches = [ ./glibc-pwd.patch ./glibc-getcwd-param-MAX.patch ./glibc-inline.patch
-              ./x86-fnstsw.patch ./binutils-ld.patch ./make-3-82-fix.patch ];
-
-  inherit kernelHeaders installLocales;
-
-  inherit (stdenv) is64bit;
-
-  configureFlags="--enable-add-ons
-    --with-headers=${kernelHeaders}/include
-    --disable-sanity-checks
-    ${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch b/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch
deleted file mode 100644
index 8543dbbf1d7..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-2006-06-18  Mike Frysinger  <vapier@gentoo.org>
-
-	* sysdeps/unix/sysv/linux/getcwd.c: Include sys/param.h.
-
---- glibc-old/sysdeps/unix/sysv/linux/getcwd.c
-+++ glibc-new/sysdeps/unix/sysv/linux/getcwd.c
-@@ -24,6 +24,7 @@
- #include <limits.h>
- #include <stdlib.h>
- #include <unistd.h>
-+#include <sys/param.h>
- 
- #include <sysdep.h>
- #include <sys/syscall.h>
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-inline.patch b/pkgs/development/libraries/glibc/2.5/glibc-inline.patch
deleted file mode 100644
index 19e400e0d50..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-inline.patch
+++ /dev/null
@@ -1,1822 +0,0 @@
---- libc/mach/mach/mig_support.h.jj	2001-07-06 06:55:35.000000000 +0200
-+++ libc/mach/mach/mig_support.h	2006-11-07 11:18:32.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1993,94,97,99,2001 Free Software Foundation, Inc.
-+/* Copyright (C) 1993,94,97,99,2001,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -67,12 +67,12 @@ extern void mig_reply_setup (const mach_
- /* Idiocy support function.  */
- extern vm_size_t mig_strncpy (char *__dst, const char *__src, vm_size_t __len);
- extern vm_size_t __mig_strncpy (char *__dst, const char *__src, vm_size_t);
--extern __inline vm_size_t
-+__extern_inline vm_size_t
- __mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
- {
-   return __stpncpy (__dst, __src, __len) - __dst;
- }
--extern __inline vm_size_t
-+__extern_inline vm_size_t
- mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
- {
-   return __mig_strncpy (__dst, __src, __len);
---- libc/mach/lock-intern.h.jj	2001-07-06 06:55:34.000000000 +0200
-+++ libc/mach/lock-intern.h	2006-11-06 21:05:34.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
-+/* Copyright (C) 1994, 1996, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -22,7 +22,7 @@
- #include <machine-lock.h>
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/include/stdlib.h.jj	2006-01-14 13:08:56.000000000 +0100
-+++ libc/include/stdlib.h	2006-11-06 21:08:02.000000000 +0100
-@@ -139,43 +139,43 @@ libc_hidden_proto (____strtoll_l_interna
- libc_hidden_proto (____strtoul_l_internal)
- libc_hidden_proto (____strtoull_l_internal)
- 
--extern __inline double
-+__extern_inline double
- __NTH (__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   __locale_t __loc))
- {
-   return ____strtod_l_internal (__nptr, __endptr, 0, __loc);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (__strtol_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   int __base, __locale_t __loc))
- {
-   return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (__strtoul_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, int __base, __locale_t __loc))
- {
-   return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--extern __inline float
-+__extern_inline float
- __NTH (__strtof_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   __locale_t __loc))
- {
-   return ____strtof_l_internal (__nptr, __endptr, 0, __loc);
- }
--extern __inline long double
-+__extern_inline long double
- __NTH (__strtold_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, __locale_t __loc))
- {
-   return ____strtold_l_internal (__nptr, __endptr, 0, __loc);
- }
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (__strtoll_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, int __base, __locale_t __loc))
- {
-   return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (__strtoull_l (__const char * __restrict __nptr,
- 		     char **__restrict __endptr, int __base, __locale_t __loc))
- {
---- libc/include/ctype.h.jj	2004-03-16 11:09:04.000000000 +0100
-+++ libc/include/ctype.h	2006-11-06 21:06:24.000000000 +0100
-@@ -15,7 +15,7 @@ extern int __isctype (int __c, int __mas
- #  include <bits/libc-tsd.h>
- 
- #  ifndef CTYPE_EXTERN_INLINE	/* Used by ctype/ctype-info.c, which see.  */
--#   define CTYPE_EXTERN_INLINE extern inline
-+#   define CTYPE_EXTERN_INLINE __extern_inline
- #  endif
- 
- __libc_tsd_define (extern, CTYPE_B)
---- libc/include/sys/stat.h.jj	2006-02-12 22:29:08.000000000 +0100
-+++ libc/include/sys/stat.h	2006-11-06 21:07:01.000000000 +0100
-@@ -19,13 +19,13 @@ hidden_proto (__lxstat64)
- hidden_proto (__xstat)
- hidden_proto (__xstat64)
- #endif
--extern __inline__ int __stat (__const char *__path, struct stat *__statbuf)
-+__extern_inline int __stat (__const char *__path, struct stat *__statbuf)
- {
-   return __xstat (_STAT_VER, __path, __statbuf);
- }
- libc_hidden_proto (__xmknod)
--extern __inline__ int __mknod (__const char *__path, __mode_t __mode,
--			       __dev_t __dev)
-+__extern_inline int __mknod (__const char *__path, __mode_t __mode,
-+			     __dev_t __dev)
- {
-   return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
- }
---- libc/stdlib/stdlib.h.jj	2006-10-31 23:05:34.000000000 +0100
-+++ libc/stdlib/stdlib.h	2006-11-06 21:16:09.000000000 +0100
-@@ -324,18 +324,18 @@ extern unsigned long long int __strtoull
- /* Define inline functions which call the internal entry points.  */
- 
- __BEGIN_NAMESPACE_STD
--extern __inline double
-+__extern_inline double
- __NTH (strtod (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtod_internal (__nptr, __endptr, 0);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (strtol (__const char *__restrict __nptr, char **__restrict __endptr,
- 	       int __base))
- {
-   return __strtol_internal (__nptr, __endptr, __base, 0);
- }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-@@ -345,13 +345,13 @@ __END_NAMESPACE_STD
- 
- # ifdef __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--extern __inline float
-+__extern_inline float
- __NTH (strtof (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtof_internal (__nptr, __endptr, 0);
- }
- #  ifndef __LDBL_COMPAT
--extern __inline long double
-+__extern_inline long double
- __NTH (strtold (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtold_internal (__nptr, __endptr, 0);
-@@ -361,13 +361,13 @@ __END_NAMESPACE_C99
- # endif
- 
- # ifdef __USE_BSD
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
- 	       int __base))
- {
-   return __strtoll_internal (__nptr, __endptr, __base, 0);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-@@ -377,13 +377,13 @@ __NTH (strtouq (__const char *__restrict
- 
- # if defined __USE_MISC || defined __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-   return __strtoll_internal (__nptr, __endptr, __base, 0);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
- 		 int __base))
- {
-@@ -393,17 +393,17 @@ __END_NAMESPACE_C99
- # endif
- 
- __BEGIN_NAMESPACE_STD
--extern __inline double
-+__extern_inline double
- __NTH (atof (__const char *__nptr))
- {
-   return strtod (__nptr, (char **) NULL);
- }
--extern __inline int
-+__extern_inline int
- __NTH (atoi (__const char *__nptr))
- {
-   return (int) strtol (__nptr, (char **) NULL, 10);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (atol (__const char *__nptr))
- {
-   return strtol (__nptr, (char **) NULL, 10);
-@@ -412,7 +412,7 @@ __END_NAMESPACE_STD
- 
- # if defined __USE_MISC || defined __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (atoll (__const char *__nptr))
- {
-   return strtoll (__nptr, (char **) NULL, 10);
---- libc/stdlib/bits/stdlib.h.jj	2005-08-22 17:06:07.000000000 +0200
-+++ libc/stdlib/bits/stdlib.h	2006-11-07 11:18:39.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for stdlib functions.
--   Copyright (C) 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -28,7 +28,7 @@ extern char *__REDIRECT_NTH (__realpath_
- 			     (__const char *__restrict __name,
- 			      char *__restrict __resolved), realpath) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- __NTH (realpath (__const char *__restrict __name, char *__restrict __resolved))
- {
-   if (__bos (__resolved) != (size_t) -1)
-@@ -44,7 +44,7 @@ extern int __REDIRECT_NTH (__ptsname_r_a
- 					       size_t __buflen), ptsname_r)
-      __nonnull ((2));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -59,7 +59,7 @@ extern int __wctomb_chk (char *__s, wcha
- extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar),
- 			   wctomb) __wur;
- 
--extern __always_inline __wur int
-+__extern_always_inline __wur int
- __NTH (wctomb (char *__s, wchar_t __wchar))
- {
-   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
-@@ -83,7 +83,7 @@ extern size_t __REDIRECT_NTH (__mbstowcs
- 			       __const char *__restrict __src,
- 			       size_t __len), mbstowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src,
- 		 size_t __len))
- {
-@@ -104,7 +104,7 @@ extern size_t __REDIRECT_NTH (__wcstombs
- 			       __const wchar_t *__restrict __src,
- 			       size_t __len), wcstombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src,
- 		 size_t __len))
- {
-     --- libc/stdlib/gmp.h.jj	2002-08-27 00:39:44.000000000 +0200
-+++ libc/stdlib/gmp.h	2006-11-07 15:02:06.000000000 +0100
-@@ -1,6 +1,6 @@
- /* gmp.h -- Definitions for GNU multiple precision functions.
- 
--Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
-+Copyright (C) 1991, 1993, 1994, 1995, 1996, 2006 Free Software Foundation, Inc.
- 
- This file is part of the GNU MP Library.
- 
-@@ -21,6 +21,8 @@ MA 02111-1307, USA. */
- 
- #ifndef __GMP_H__
- 
-+#include <features.h>
-+
- #ifndef __GNU_MP__
- #define __GNU_MP__ 2
- #define __need_size_t
-@@ -41,7 +43,7 @@ MA 02111-1307, USA. */
- 
- #ifndef _EXTERN_INLINE
- #ifdef __GNUC__
--#define _EXTERN_INLINE extern __inline__
-+#define _EXTERN_INLINE __extern_inline
- #else
- #define _EXTERN_INLINE static
- #endif
---- libc/ctype/ctype.h.jj	2004-09-08 00:23:45.000000000 +0200
-+++ libc/ctype/ctype.h	2006-11-07 11:18:56.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004
-+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2006
-    	Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-@@ -187,13 +187,13 @@ __exctype (_tolower);
- # endif
- 
- # ifdef __USE_EXTERN_INLINES
--extern __inline int
-+__extern_inline int
- __NTH (tolower (int __c))
- {
-   return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
- }
- 
--extern __inline int
-+__extern_inline int
- __NTH (toupper (int __c))
- {
-   return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
---- libc/nptl/sysdeps/pthread/bits/libc-lock.h.jj	2006-10-24 10:14:03.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/bits/libc-lock.h	2006-11-07 10:45:52.000000000 +0100
-@@ -1,5 +1,6 @@
- /* libc-internal interface for mutex locks.  NPTL version.
--   Copyright (C) 1996-2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-+   Copyright (C) 1996-2001, 2002, 2003, 2005, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -408,7 +409,7 @@ extern void _pthread_cleanup_pop_restore
- 
- 
- /* Normal cleanup handling, based on C cleanup attribute.  */
--extern __inline void
-+__extern_inline void
- __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
- {
-   if (f->__do_it)
---- libc/nptl/sysdeps/pthread/pthread.h.jj	2006-06-05 01:59:07.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/pthread.h	2006-11-07 10:49:27.000000000 +0100
-@@ -572,7 +572,7 @@ class __pthread_cleanup_class
-    function the compiler is free to decide inlining the change when
-    needed or fall back on the copy which must exist somewhere
-    else.  */
--extern __inline void
-+__extern_inline void
- __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
- {
-   if (__frame->__do_it)
-@@ -1103,7 +1103,7 @@ extern int pthread_atfork (void (*__prep
- 
- #ifdef __USE_EXTERN_INLINES
- /* Optimizations.  */
--extern __inline int
-+__extern_inline int
- __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
- {
-   return __thread1 == __thread2;
---- libc/nptl/sysdeps/pthread/allocalim.h.jj	2006-05-02 08:16:07.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/allocalim.h	2006-11-07 10:46:28.000000000 +0100
-@@ -21,8 +21,7 @@
- #include <limits.h>
- 
- 
--extern int
--__always_inline
-+__extern_always_inline int
- __libc_use_alloca (size_t size)
- {
-   return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1)
---- libc/nptl/sysdeps/pthread/gai_misc.h.jj	2006-09-05 17:23:12.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/gai_misc.h	2006-11-06 21:17:39.000000000 +0100
-@@ -76,7 +76,7 @@
- #define gai_start_notify_thread __gai_start_notify_thread
- #define gai_create_helper_thread __gai_create_helper_thread
- 
--extern inline void
-+__extern_inline void
- __gai_start_notify_thread (void)
- {
-   sigset_t ss;
-@@ -85,7 +85,7 @@ __gai_start_notify_thread (void)
-   INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8);
- }
- 
--extern inline int
-+__extern_inline int
- __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/nptl/sysdeps/unix/sysv/linux/aio_misc.h.jj	2006-03-02 18:32:45.000000000 +0100
-+++ libc/nptl/sysdeps/unix/sysv/linux/aio_misc.h	2006-11-06 21:18:34.000000000 +0100
-@@ -27,7 +27,7 @@
- # define aio_start_notify_thread __aio_start_notify_thread
- # define aio_create_helper_thread __aio_create_helper_thread
- 
--extern inline void
-+__extern_inline void
- __aio_start_notify_thread (void)
- {
-   sigset_t ss;
-@@ -36,7 +36,7 @@ __aio_start_notify_thread (void)
-   INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8);
- }
- 
--extern inline int
-+__extern_inline int
- __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/resolv/gai_misc.c.jj	2006-08-03 10:01:53.000000000 +0200
-+++ libc/resolv/gai_misc.c	2006-11-07 10:49:55.000000000 +0100
-@@ -30,7 +30,7 @@
- #ifndef gai_create_helper_thread
- # define gai_create_helper_thread __gai_create_helper_thread
- 
--extern inline int
-+__extern_inline int
- __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/bits/mathinline.h.jj	1997-10-13 05:53:18.000000000 +0200
-+++ libc/bits/mathinline.h	2006-11-07 10:51:05.000000000 +0100
-@@ -1,6 +1,6 @@
- /* This file should provide inline versions of math functions.
- 
--   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-+   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
- 
-    This file should define __MATH_INLINES if functions are actually defined as
-    inlines.  */
---- libc/bits/string.h.jj	1997-10-13 05:53:19.000000000 +0200
-+++ libc/bits/string.h	2006-11-07 10:50:54.000000000 +0100
-@@ -1,6 +1,6 @@
- /* This file should provide inline versions of string functions.
- 
--   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-+   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
- 
-    This file should define __STRING_INLINES if functions are actually defined
-    as inlines.  */
---- libc/bits/sigset.h.jj	2001-07-06 06:55:50.000000000 +0200
-+++ libc/bits/sigset.h	2006-11-07 11:19:08.000000000 +0100
-@@ -1,5 +1,6 @@
- /* __sig_atomic_t, __sigset_t, and related definitions.  Generic/BSD version.
--   Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1991, 1992, 1994, 1996, 1997, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -38,7 +39,7 @@ typedef unsigned long int __sigset_t;
- #define _SIGSET_H_fns 1
- 
- #ifndef _EXTERN_INLINE
--# define _EXTERN_INLINE extern __inline
-+# define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Return a mask that includes SIG only.  The cast to `sigset_t' avoids
---- libc/misc/sys/cdefs.h.jj	2006-01-14 21:14:36.000000000 +0100
-+++ libc/misc/sys/cdefs.h	2006-11-06 21:00:45.000000000 +0100
-@@ -279,6 +279,18 @@
- # define __always_inline __inline
- #endif
- 
-+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
-+   inline semantics.  */
-+#if __GNUC_PREREQ (4,3) && defined (__STDC_VERSION__) \
-+    && __STDC_VERSION__ >= 199901L
-+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
-+# define __extern_always_inline \
-+  extern __always_inline __inline __attribute__ ((__gnu_inline__))
-+#else
-+# define __extern_inline extern __inline
-+# define __extern_always_inline extern __always_inline
-+#endif
-+
- /* It is possible to compile containing GCC extensions even if GCC is
-    run in pedantic mode if the uses are carefully marked using the
-    `__extension__' keyword.  But this is not generally available before
---- libc/libio/bits/stdio.h.jj	2004-09-08 00:23:44.000000000 +0200
-+++ libc/libio/bits/stdio.h	2006-11-06 21:23:07.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimizing macros and inline functions for stdio functions.
--   Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1998, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __STDIO_INLINE inline
- #else
--# define __STDIO_INLINE extern __inline
-+# define __STDIO_INLINE __extern_inline
- #endif
- 
- 
---- libc/libio/bits/stdio2.h.jj	2005-03-19 01:14:58.000000000 +0100
-+++ libc/libio/bits/stdio2.h	2006-11-06 21:22:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for stdio functions.
--   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -75,7 +75,7 @@ extern int __vprintf_chk (int __flag, __
- extern char *__gets_chk (char *__str, size_t) __wur;
- extern char *__REDIRECT (__gets_alias, (char *__str), gets) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- gets (char *__str)
- {
-   if (__bos (__str) != (size_t) -1)
-@@ -89,7 +89,7 @@ extern char *__REDIRECT (__fgets_alias,
- 			 (char *__restrict __s, int __n,
- 			  FILE *__restrict __stream), fgets) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -105,7 +105,7 @@ extern char *__REDIRECT (__fgets_unlocke
- 			 (char *__restrict __s, int __n,
- 			  FILE *__restrict __stream), fgets_unlocked) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
---- libc/argp/argp.h.jj	2006-04-22 17:08:26.000000000 +0200
-+++ libc/argp/argp.h	2006-11-06 21:24:08.000000000 +0100
-@@ -558,7 +558,7 @@ extern void *__argp_input (__const struc
- # endif
- 
- # ifndef ARGP_EI
--#  define ARGP_EI extern __inline__
-+#  define ARGP_EI __extern_inline
- # endif
- 
- ARGP_EI void
---- libc/argp/argp-fmtstream.h.jj	2005-09-27 23:45:41.000000000 +0200
-+++ libc/argp/argp-fmtstream.h	2006-11-07 11:19:12.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Word-wrapping and line-truncating streams.
--   Copyright (C) 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Written by Miles Bader <miles@gnu.ai.mit.edu>.
- 
-@@ -203,7 +203,7 @@ extern int __argp_fmtstream_ensure (argp
- #endif
- 
- #ifndef ARGP_FS_EI
--#define ARGP_FS_EI extern inline
-+#define ARGP_FS_EI __extern_inline
- #endif
- 
- ARGP_FS_EI size_t
---- libc/locale/programs/locfile.c.jj	2006-05-10 04:12:39.000000000 +0200
-+++ libc/locale/programs/locfile.c	2006-11-07 15:13:20.000000000 +0100
-@@ -33,6 +33,11 @@
- #include "locfile.h"
- #include "simple-hash.h"
- 
-+/* This prototype is needed to export locfile_hash from this object
-+   when using ISO C99 inline semantics.  */
-+struct keyword_t;
-+const struct keyword_t *locfile_hash (const char *str, unsigned int len);
-+
- #include "locfile-kw.h"
- 
- 
---- libc/locale/programs/charmap.c.jj	2006-08-19 19:50:52.000000000 +0200
-+++ libc/locale/programs/charmap.c	2006-11-07 15:11:05.000000000 +0100
-@@ -35,6 +35,10 @@
- 
- #include <assert.h>
- 
-+/* This prototype is needed to export charmap_hash from this object
-+   when using ISO C99 inline semantics.  */
-+struct keyword_t;
-+const struct keyword_t *charmap_hash (const char *str, unsigned int len);
- 
- /* Define the lookup function.  */
- #include "charmap-kw.h"
---- libc/io/sys/stat.h.jj	2006-01-06 13:14:05.000000000 +0100
-+++ libc/io/sys/stat.h	2006-11-06 21:27:03.000000000 +0100
-@@ -430,28 +430,28 @@ extern int __xmknodat (int __ver, int __
- #if defined __GNUC__ && __GNUC__ >= 2
- /* Inlined versions of the real stat and mknod functions.  */
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (stat (__const char *__path, struct stat *__statbuf))
- {
-   return __xstat (_STAT_VER, __path, __statbuf);
- }
- 
- # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
--extern __inline__ int
-+__extern_inline int
- __NTH (lstat (__const char *__path, struct stat *__statbuf))
- {
-   return __lxstat (_STAT_VER, __path, __statbuf);
- }
- # endif
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (fstat (int __fd, struct stat *__statbuf))
- {
-   return __fxstat (_STAT_VER, __fd, __statbuf);
- }
- 
- # ifdef __USE_ATFILE
--extern __inline__ int
-+__extern_inline int
- __NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
- 		int __flag))
- {
-@@ -460,7 +460,7 @@ __NTH (fstatat (int __fd, __const char *
- # endif
- 
- # if defined __USE_MISC || defined __USE_BSD
--extern __inline__ int
-+__extern_inline int
- __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
- {
-   return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
-@@ -468,7 +468,7 @@ __NTH (mknod (__const char *__path, __mo
- # endif
- 
- # ifdef __USE_ATFILE
--extern __inline__ int
-+__extern_inline int
- __NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
- 		__dev_t __dev))
- {
-@@ -479,28 +479,28 @@ __NTH (mknodat (int __fd, __const char *
- # if defined __USE_LARGEFILE64 \
-   && (! defined __USE_FILE_OFFSET64 \
-       || (defined __REDIRECT_NTH && defined __OPTIMIZE__))
--extern __inline__ int
-+__extern_inline int
- __NTH (stat64 (__const char *__path, struct stat64 *__statbuf))
- {
-   return __xstat64 (_STAT_VER, __path, __statbuf);
- }
- 
- #  if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
--extern __inline__ int
-+__extern_inline int
- __NTH (lstat64 (__const char *__path, struct stat64 *__statbuf))
- {
-   return __lxstat64 (_STAT_VER, __path, __statbuf);
- }
- #  endif
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
- {
-   return __fxstat64 (_STAT_VER, __fd, __statbuf);
- }
- 
- #  ifdef __USE_GNU
--extern __inline__ int
-+__extern_inline int
- __NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
- 		  int __flag))
- {
---- libc/wcsmbs/wchar.h.jj	2006-09-27 17:56:30.000000000 +0200
-+++ libc/wcsmbs/wchar.h	2006-11-06 21:28:28.000000000 +0100
-@@ -326,19 +326,19 @@ __END_NAMESPACE_C99
-    locales must use ASCII encoding for the values in the ASCII range
-    and because the wchar_t encoding is always ISO 10646.  */
- extern wint_t __btowc_alias (int __c) __asm ("btowc");
--extern __inline wint_t
-+__extern_inline wint_t
- __NTH (btowc (int __c))
- { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
- 	  ? (wint_t) __c : __btowc_alias (__c)); }
- 
- extern int __wctob_alias (wint_t __c) __asm ("wctob");
--extern __inline int
-+__extern_inline int
- __NTH (wctob (wint_t __wc))
- { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
- 	  ? (int) __wc : __wctob_alias (__wc)); }
- # endif
- 
--extern __inline size_t
-+__extern_inline size_t
- __NTH (mbrlen (__const char *__restrict __s, size_t __n,
- 	       mbstate_t *__restrict __ps))
- { return (__ps != NULL
-@@ -548,38 +548,38 @@ extern unsigned long long int __wcstoull
- /* Define inline functions which call the internal entry points.  */
- __BEGIN_NAMESPACE_C99
- 
--extern __inline double
-+__extern_inline double
- __NTH (wcstod (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr))
- { return __wcstod_internal (__nptr, __endptr, 0); }
--extern __inline long int
-+__extern_inline long int
- __NTH (wcstol (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr, int __base))
- { return __wcstol_internal (__nptr, __endptr, __base, 0); }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (wcstoul (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr, int __base))
- { return __wcstoul_internal (__nptr, __endptr, __base, 0); }
- __END_NAMESPACE_C99
- 
- # ifdef __USE_GNU
--extern __inline float
-+__extern_inline float
- __NTH (wcstof (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr))
- { return __wcstof_internal (__nptr, __endptr, 0); }
- #  ifndef __LDBL_COMPAT
--extern __inline long double
-+__extern_inline long double
- __NTH (wcstold (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr))
- { return __wcstold_internal (__nptr, __endptr, 0); }
- #  endif
- __extension__
--extern __inline long long int
-+__extern_inline long long int
- __NTH (wcstoq (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr, int __base))
- { return __wcstoll_internal (__nptr, __endptr, __base, 0); }
- __extension__
--extern __inline unsigned long long int
-+__extern_inline unsigned long long int
- __NTH (wcstouq (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr, int __base))
- { return __wcstoull_internal (__nptr, __endptr, __base, 0); }
---- libc/wcsmbs/bits/wchar2.h.jj	2006-01-14 13:09:47.000000000 +0100
-+++ libc/wcsmbs/bits/wchar2.h	2006-11-06 21:29:19.000000000 +0100
-@@ -30,7 +30,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemcp
- 				 __const wchar_t *__restrict __s2, size_t __n),
- 				wmemcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		size_t __n))
- {
-@@ -46,7 +46,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemmo
- 						   __const wchar_t *__s2,
- 						   size_t __n), wmemmove);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		 size_t __n))
- {
-@@ -65,7 +65,7 @@ extern wchar_t *__REDIRECT_NTH (__wmempc
- 				 __const wchar_t *__restrict __s2,
- 				 size_t __n), wmempcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		 size_t __n))
- {
-@@ -81,7 +81,7 @@ extern wchar_t *__wmemset_chk (wchar_t *
- extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
- 						  size_t __n), wmemset);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
- {
-   if (__bos0 (__s) != (size_t) -1)
-@@ -97,7 +97,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscpy
- 				(wchar_t *__restrict __dest,
- 				 __const wchar_t *__restrict __src), wcscpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -112,7 +112,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpcpy
- 						 __const wchar_t *__src),
- 				wcpcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -129,7 +129,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsncp
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcsncpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
-@@ -148,7 +148,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpncp
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcpncpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
-@@ -166,7 +166,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscat
- 				(wchar_t *__restrict __dest,
- 				 __const wchar_t *__restrict __src), wcscat);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -183,7 +183,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsnca
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcsncat);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -246,7 +246,7 @@ extern wchar_t *__REDIRECT (__fgetws_ali
- 			    (wchar_t *__restrict __s, int __n,
- 			     __FILE *__restrict __stream), fgetws) __wur;
- 
--extern __always_inline __wur wchar_t *
-+__extern_always_inline __wur wchar_t *
- fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -264,7 +264,7 @@ extern wchar_t *__REDIRECT (__fgetws_unl
- 			     __FILE *__restrict __stream), fgetws_unlocked)
-   __wur;
- 
--extern __always_inline __wur wchar_t *
-+__extern_always_inline __wur wchar_t *
- fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -281,7 +281,7 @@ extern size_t __REDIRECT_NTH (__wcrtomb_
- 			      (char *__restrict __s, wchar_t __wchar,
- 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
- 
--extern __always_inline __wur size_t
-+__extern_always_inline __wur size_t
- __NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
- {
-   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
-@@ -307,7 +307,7 @@ extern size_t __REDIRECT_NTH (__mbsrtowc
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      mbsrtowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
- 		  size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -330,7 +330,7 @@ extern size_t __REDIRECT_NTH (__wcsrtomb
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      wcsrtombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
- 		  size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -352,7 +352,7 @@ extern size_t __REDIRECT_NTH (__mbsnrtow
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      mbsnrtowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
- 		   size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -376,7 +376,7 @@ extern size_t __REDIRECT_NTH (__wcsnrtom
- 			       size_t __nwc, size_t __len,
- 			       mbstate_t *__restrict __ps), wcsnrtombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
- 		   size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
- {
---- libc/socket/bits/socket2.h.jj	2005-08-08 21:00:53.000000000 +0200
-+++ libc/socket/bits/socket2.h	2006-11-06 21:29:59.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for socket functions.
--   Copyright (C) 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -26,7 +26,7 @@ extern ssize_t __recv_chk (int __fd, voi
- extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n,
- 					  int __flags), recv);
- 
--extern __always_inline ssize_t
-+__extern_always_inline ssize_t
- recv (int __fd, void *__buf, size_t __n, int __flags)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -44,7 +44,7 @@ extern ssize_t __REDIRECT (__recvfrom_al
- 			    int __flags, __SOCKADDR_ARG __addr,
- 			    socklen_t *__restrict __addr_len), recvfrom);
- 
--extern __always_inline ssize_t
-+__extern_always_inline ssize_t
- recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
- 	  __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
- {
---- libc/posix/bits/unistd.h.jj	2006-08-24 08:47:31.000000000 +0200
-+++ libc/posix/bits/unistd.h	2006-11-06 21:30:39.000000000 +0100
-@@ -26,7 +26,7 @@ extern ssize_t __read_chk (int __fd, voi
- extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
- 					  size_t __nbytes), read) __wur;
- 
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- read (int __fd, void *__buf, size_t __nbytes)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -48,7 +48,7 @@ extern ssize_t __REDIRECT (__pread64_ali
- 			    __off64_t __offset), pread64) __wur;
- 
- # ifndef __USE_FILE_OFFSET64
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -57,7 +57,7 @@ pread (int __fd, void *__buf, size_t __n
-   return __pread_alias (__fd, __buf, __nbytes, __offset);
- }
- # else
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -68,7 +68,7 @@ pread (int __fd, void *__buf, size_t __n
- # endif
- 
- # ifdef __USE_LARGEFILE64
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -89,7 +89,7 @@ extern ssize_t __REDIRECT_NTH (__readlin
- 				char *__restrict __buf, size_t __len), readlink)
-      __nonnull ((1, 2)) __wur;
- 
--extern __always_inline __nonnull ((1, 2)) __wur ssize_t
-+__extern_always_inline __nonnull ((1, 2)) __wur ssize_t
- __NTH (readlink (__const char *__restrict __path, char *__restrict __buf,
- 		 size_t __len))
- {
-@@ -111,7 +111,7 @@ extern ssize_t __REDIRECT_NTH (__readlin
- 			       readlinkat)
-      __nonnull ((2, 3)) __wur;
- 
--extern __always_inline __nonnull ((2, 3)) __wur ssize_t
-+__extern_always_inline __nonnull ((2, 3)) __wur ssize_t
- __NTH (readlinkat (int __fd, __const char *__restrict __path,
- 		   char *__restrict __buf, size_t __len))
- {
-@@ -127,7 +127,7 @@ extern char *__getcwd_chk (char *__buf, 
- extern char *__REDIRECT_NTH (__getcwd_alias,
- 			     (char *__buf, size_t __size), getcwd) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- __NTH (getcwd (char *__buf, size_t __size))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -142,7 +142,7 @@ extern char *__getwd_chk (char *__buf, s
- extern char *__REDIRECT_NTH (__getwd_alias, (char *__buf), getwd)
-      __nonnull ((1)) __wur;
- 
--extern __always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
-+__extern_always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
- __NTH (getwd (char *__buf))
- {
-   if (__bos (__buf) != (size_t) -1)
-@@ -156,7 +156,7 @@ extern size_t __confstr_chk (int __name,
- extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf,
- 						size_t __len), confstr);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (confstr (int __name, char *__buf, size_t __len))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -171,7 +171,7 @@ extern int __getgroups_chk (int __size, 
- extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]),
- 			   getgroups) __wur;
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (getgroups (int __size, __gid_t __list[]))
- {
-   if (__bos (__list) != (size_t) -1
-@@ -188,7 +188,7 @@ extern int __REDIRECT_NTH (__ttyname_r_a
- 					       size_t __buflen), ttyname_r)
-      __nonnull ((2));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -204,7 +204,7 @@ extern int __getlogin_r_chk (char *__buf
- extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
- 		       getlogin_r) __nonnull ((1));
- 
--extern __always_inline int
-+__extern_always_inline int
- getlogin_r (char *__buf, size_t __buflen)
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -221,7 +221,7 @@ extern int __gethostname_chk (char *__bu
- extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
- 			   gethostname) __nonnull ((1));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (gethostname (char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -239,7 +239,7 @@ extern int __REDIRECT_NTH (__getdomainna
- 						   size_t __buflen),
- 			   getdomainname) __nonnull ((1)) __wur;
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (getdomainname (char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
---- libc/string/bits/string3.h.jj	2005-08-08 21:02:31.000000000 +0200
-+++ libc/string/bits/string3.h	2006-11-07 11:19:17.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-+/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -151,7 +151,7 @@ extern char *__REDIRECT_NTH (__stpncpy_a
- 					       __const char *__src,
- 					       size_t __n), stpncpy);
- 
--extern __always_inline char *
-+__extern_always_inline char *
- __NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
---- libc/string/bits/string2.h.jj	2004-05-28 08:39:13.000000000 +0200
-+++ libc/string/bits/string2.h	2006-11-07 11:19:24.000000000 +0100
-@@ -0,0 +1,18 @@
-+/*  DO NOT EDIT THIS FILE.
-+
-+    It has been auto-edited by fixincludes from:
-+
-+	"fixinc/tests/inc/bits/string2.h"
-+
-+    This had to be done to correct non-standard usages in the
-+    original, manufacturer supplied header file.  */
-+
-+
-+
-+#if defined( GLIBC_C99_INLINE_3_CHECK )
-+# if defined(__cplusplus) || __STDC_VERSION__ >= 19901L
-+#  define __STRING_INLINE inline
-+# else
-+#  define __STRING_INLINE extern __inline
-+# endif
-+#endif  /* GLIBC_C99_INLINE_3_CHECK */
-@@ -1,5 +1,5 @@
- /* Machine-independant string function optimizations.
--   Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1997-2003, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
- 
-@@ -43,7 +43,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/string/argz.h.jj	2004-09-08 00:23:43.000000000 +0200
-+++ libc/string/argz.h	2006-11-07 11:19:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Routines for dealing with '\0' separated arg vectors.
--   Copyright (C) 1995,96,97,98,99,2000,2004 Free Software Foundation, Inc.
-+   Copyright (C) 1995,96,97,98,99,2000,2004,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -160,7 +160,7 @@ extern char *argz_next (__const char *__
- 			__const char *__restrict __entry) __THROW;
- 
- #ifdef __USE_EXTERN_INLINES
--extern inline char *
-+__extern_inline char *
- __NTH (__argz_next (__const char *__argz, size_t __argz_len,
- 		    __const char *__entry))
- {
-@@ -174,7 +174,7 @@ __NTH (__argz_next (__const char *__argz
-   else
-     return __argz_len > 0 ? (char *) __argz : 0;
- }
--extern inline char *
-+__extern_inline char *
- __NTH (argz_next (__const char *__argz, size_t __argz_len,
- 		  __const char *__entry))
- {
---- libc/math/bits/cmathcalls.h.jj	2001-07-06 06:55:35.000000000 +0200
-+++ libc/math/bits/cmathcalls.h	2006-11-07 11:19:39.000000000 +0100
-@@ -1,6 +1,6 @@
- /* Prototype declarations for complex math functions;
-    helper file for <complex.h>.
--   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
-+   Copyright (C) 1997, 1998, 2001, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -135,21 +135,21 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_c
- #if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
- 
- /* Imaginary part of Z.  */
--extern __inline _Mdouble_
-+__extern_inline _Mdouble_
- __MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
- {
-   return __imag__ __z;
- }
- 
- /* Real part of Z.  */
--extern __inline _Mdouble_
-+__extern_inline _Mdouble_
- __MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
- {
-   return __real__ __z;
- }
- 
- /* Complex conjugate of Z.  */
--extern __inline _Mdouble_complex_
-+__extern_inline _Mdouble_complex_
- __MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
- {
-   return __extension__ ~__z;
---- libc/math/math_private.h.jj	2005-11-21 16:43:03.000000000 +0100
-+++ libc/math/math_private.h	2006-11-06 21:33:45.000000000 +0100
-@@ -192,7 +192,7 @@ extern int    __kernel_rem_pio2 (double*
- extern double __copysign (double x, double __y);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline double __copysign (double x, double y)
-+__extern_inline double __copysign (double x, double y)
- { return __builtin_copysign (x, y); }
- #endif
- 
-@@ -239,7 +239,7 @@ extern int   __kernel_rem_pio2f (float*,
- extern float __copysignf (float x, float __y);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline float __copysignf (float x, float y)
-+__extern_inline float __copysignf (float x, float y)
- { return __builtin_copysignf (x, y); }
- #endif
- 
-@@ -307,7 +307,7 @@ extern long double __logbl (long double 
- extern long double __significandl (long double x);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline long double __copysignl (long double x, long double y)
-+__extern_inline long double __copysignl (long double x, long double y)
- { return __builtin_copysignl (x, y); }
- #endif
- 
---- libc/hurd/hurd.h.jj	2002-01-02 10:52:20.000000000 +0100
-+++ libc/hurd/hurd.h	2006-11-07 11:19:51.000000000 +0100
-@@ -1,4 +1,5 @@
--/* Copyright (C) 1993,94,95,96,97,98,99,2001,02 Free Software Foundation, Inc.
-+/* Copyright (C) 1993,94,95,96,97,98,99,2001,2002,2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -44,7 +45,7 @@
- #include <errno.h>
- 
- #ifndef _HURD_H_EXTERN_INLINE
--#define _HURD_H_EXTERN_INLINE extern __inline
-+#define _HURD_H_EXTERN_INLINE __extern_inline
- #endif
- 
- _HURD_H_EXTERN_INLINE int
---- libc/hurd/hurd/port.h.jj	2001-07-06 06:54:47.000000000 +0200
-+++ libc/hurd/hurd/port.h	2006-11-07 11:19:58.000000000 +0100
-@@ -1,5 +1,6 @@
- /* Lightweight user references for ports.
--   Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
-+   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -55,7 +56,7 @@ struct hurd_port
- 
- 
- #ifndef _HURD_PORT_H_EXTERN_INLINE
--#define _HURD_PORT_H_EXTERN_INLINE extern __inline
-+#define _HURD_PORT_H_EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/hurd/hurd/threadvar.h.jj	2002-09-02 09:08:53.000000000 +0200
-+++ libc/hurd/hurd/threadvar.h	2006-11-07 10:54:40.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Internal per-thread variables for the Hurd.
--   Copyright (C) 1994,95,97,98,99,2001,02 Free Software Foundation, Inc.
-+   Copyright (C) 1994,95,97,98,99,2001,02,06 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -74,7 +74,7 @@ enum __hurd_threadvar_index
- 
- 
- #ifndef _HURD_THREADVAR_H_EXTERN_INLINE
--#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline
-+#define _HURD_THREADVAR_H_EXTERN_INLINE __extern_inline
- #endif
- 
- /* Return the location of the value for the per-thread variable with index
---- libc/hurd/hurd/fd.h.jj	2006-03-06 08:59:07.000000000 +0100
-+++ libc/hurd/hurd/fd.h	2006-11-07 10:53:18.000000000 +0100
-@@ -52,7 +52,7 @@ extern struct mutex _hurd_dtable_lock; /
- #include <hurd/signal.h>
- 
- #ifndef _HURD_FD_H_EXTERN_INLINE
--#define _HURD_FD_H_EXTERN_INLINE extern __inline
-+#define _HURD_FD_H_EXTERN_INLINE __extern_inline
- #endif
- 
- /* Returns the descriptor cell for FD.  If FD is invalid or unused, return
---- libc/hurd/hurd/signal.h.jj	2002-02-18 21:57:11.000000000 +0100
-+++ libc/hurd/hurd/signal.h	2006-11-07 10:54:13.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Implementing POSIX.1 signals under the Hurd.
--   Copyright (C) 1993,94,95,96,98,99,2002 Free Software Foundation, Inc.
-+   Copyright (C) 1993,94,95,96,98,99,2002,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -126,7 +126,7 @@ extern struct hurd_sigstate *_hurd_self_
-      __attribute__ ((__const__));
- 
- #ifndef _HURD_SIGNAL_H_EXTERN_INLINE
--#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline
-+#define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline
- #endif
- 
- _HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
---- libc/hurd/hurd/userlink.h.jj	2001-07-06 06:54:47.000000000 +0200
-+++ libc/hurd/hurd/userlink.h	2006-11-07 10:53:37.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Support for chains recording users of a resource; `struct hurd_userlink'.
--   Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1995, 1997, 1999, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -71,7 +71,7 @@ struct hurd_userlink
- 
- 
- #ifndef _HURD_USERLINK_H_EXTERN_INLINE
--#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline
-+#define _HURD_USERLINK_H_EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/mach/alpha/machine-sp.h.jj	2001-07-06 06:55:56.000000000 +0200
-+++ libc/sysdeps/mach/alpha/machine-sp.h	2006-11-07 10:55:42.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  Alpha version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -23,7 +23,7 @@
- /* Return the current stack pointer.  */
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- _EXTERN_INLINE void *
---- libc/sysdeps/mach/alpha/machine-lock.h.jj	2003-02-26 01:01:15.000000000 +0100
-+++ libc/sysdeps/mach/alpha/machine-lock.h	2006-11-07 11:20:04.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  Alpha version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/mach/i386/machine-lock.h.jj	2001-07-06 06:56:00.000000000 +0200
-+++ libc/sysdeps/mach/i386/machine-lock.h	2006-11-07 10:56:10.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  i386 version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile int __spin_lock_t;
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/mach/powerpc/machine-sp.h.jj	2002-08-27 00:39:44.000000000 +0200
-+++ libc/sysdeps/mach/powerpc/machine-sp.h	2006-11-07 10:56:59.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  PowerPC version.
--   Copyright (C) 2001 Free Software Foundation, Inc.
-+   Copyright (C) 2001, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -27,7 +27,7 @@
- # ifdef _HURD_THREADVAR_H_EXTERN_INLINE
- #  define _EXTERN_INLINE _HURD_THREADVAR_H_EXTERN_INLINE
- # else
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/mach/powerpc/machine-lock.h.jj	2002-02-17 08:13:25.000000000 +0100
-+++ libc/sysdeps/mach/powerpc/machine-lock.h	2006-11-07 10:56:40.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  PowerPC version.
--   Copyright (C) 1994,97,2002 Free Software Foundation, Inc.
-+   Copyright (C) 1994,97,2002,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/alpha/fpu/bits/mathinline.h.jj	2005-02-08 05:37:48.000000000 +0100
-+++ libc/sysdeps/alpha/fpu/bits/mathinline.h	2006-11-07 10:59:08.000000000 +0100
-@@ -1,5 +1,6 @@
- /* Inline math functions for Alpha.
--   Copyright (C) 1996, 1997, 1999-2001, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1996, 1997, 1999-2001, 2004, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by David Mosberger-Tang.
- 
-@@ -25,7 +26,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
---- libc/sysdeps/ia64/fpu/bits/mathinline.h.jj	2004-09-08 23:44:02.000000000 +0200
-+++ libc/sysdeps/ia64/fpu/bits/mathinline.h	2006-11-07 10:59:49.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for ia64.
--   Copyright (C) 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
---- libc/sysdeps/i386/fpu/bits/mathinline.h.jj	2004-09-08 00:23:42.000000000 +0200
-+++ libc/sysdeps/i386/fpu/bits/mathinline.h	2006-11-07 11:00:56.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for i387.
--   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
-+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006
-    Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
-@@ -26,7 +26,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/i386/i486/bits/string.h.jj	2004-12-15 21:30:16.000000000 +0100
-+++ libc/sysdeps/i386/i486/bits/string.h	2006-11-07 11:01:34.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimized, inlined string functions.  i486 version.
--   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004
-+   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2006
-    	Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-@@ -35,7 +35,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/generic/inttypes.h.jj	2004-09-08 00:23:42.000000000 +0200
-+++ libc/sysdeps/generic/inttypes.h	2006-11-07 11:02:59.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
-+/* Copyright (C) 1997-2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -330,7 +330,7 @@ extern long int __strtol_internal (__con
- 				   int __base, int __group) __THROW;
- #   define __strtol_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -345,7 +345,7 @@ extern unsigned long int __strtoul_inter
- 					     int __base, int __group) __THROW;
- #   define __strtoul_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -359,7 +359,7 @@ extern long int __wcstol_internal (__con
- 				   int __base, int __group) __THROW;
- #   define __wcstol_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -376,7 +376,7 @@ extern unsigned long int __wcstoul_inter
- 					     int __base, int __group) __THROW;
- #   define __wcstoul_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -393,7 +393,7 @@ extern long long int __strtoll_internal 
- 					 int __base, int __group) __THROW;
- #   define __strtoll_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -411,7 +411,7 @@ extern unsigned long long int __strtoull
- 						   int __group) __THROW;
- #   define __strtoull_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -427,7 +427,7 @@ extern long long int __wcstoll_internal 
- 					 int __base, int __group) __THROW;
- #   define __wcstoll_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -446,7 +446,7 @@ extern unsigned long long int __wcstoull
- 						   int __group) __THROW;
- #   define __wcstoull_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
---- libc/sysdeps/generic/machine-sp.h.jj	2001-07-06 06:55:49.000000000 +0200
-+++ libc/sysdeps/generic/machine-sp.h	2006-11-07 11:06:02.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  Stub version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -23,7 +23,7 @@
- /* Return the current stack pointer.  */
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- _EXTERN_INLINE void *
---- libc/sysdeps/generic/machine-lock.h.jj	2001-07-06 06:55:49.000000000 +0200
-+++ libc/sysdeps/generic/machine-lock.h	2006-11-07 11:02:08.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  Stub version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef volatile int __spin_lock_t;
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/generic/allocalim.h.jj	2002-10-09 11:19:59.000000000 +0200
-+++ libc/sysdeps/generic/allocalim.h	2006-11-07 11:03:22.000000000 +0100
-@@ -1,4 +1,4 @@
--extern inline int __libc_use_alloca (size_t size)
-+__extern_inline int __libc_use_alloca (size_t size)
- {
-   return size <= __MAX_ALLOCA_CUTOFF;
- }
---- libc/sysdeps/pthread/aio_misc.c.jj	2006-01-04 00:12:54.000000000 +0100
-+++ libc/sysdeps/pthread/aio_misc.c	2006-11-07 11:06:31.000000000 +0100
-@@ -33,7 +33,7 @@
- #ifndef aio_create_helper_thread
- # define aio_create_helper_thread __aio_create_helper_thread
- 
--extern inline int
-+__extern_inline int
- __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg)
- {
-   pthread_attr_t attr;
---- libc/sysdeps/s390/bits/string.h.jj	2005-01-28 22:44:42.000000000 +0100
-+++ libc/sysdeps/s390/bits/string.h	2006-11-07 11:07:05.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimized, inlined string functions.  S/390 version.
--   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
-+   Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
-    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
-    This file is part of the GNU C Library.
- 
-@@ -34,7 +34,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/s390/fpu/bits/mathinline.h.jj	2006-02-01 04:00:20.000000000 +0100
-+++ libc/sysdeps/s390/fpu/bits/mathinline.h	2006-11-07 11:07:37.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for s390.
--   Copyright (C) 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
---- libc/sysdeps/powerpc/fpu/bits/mathinline.h.jj	2006-11-06 20:53:15.000000000 +0100
-+++ libc/sysdeps/powerpc/fpu/bits/mathinline.h	2006-11-07 11:08:04.000000000 +0100
-@@ -25,7 +25,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif  /* __cplusplus */
- 
- #if defined __GNUC__ && !defined _SOFT_FLOAT
---- libc/sysdeps/x86_64/fpu/bits/mathinline.h.jj	2004-09-08 00:18:59.000000000 +0200
-+++ libc/sysdeps/x86_64/fpu/bits/mathinline.h	2006-11-07 11:10:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for x86-64.
--   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
- 
-@@ -25,7 +25,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/sparc/fpu/bits/mathinline.h.jj	2006-01-14 13:09:02.000000000 +0100
-+++ libc/sysdeps/sparc/fpu/bits/mathinline.h	2006-11-07 11:10:57.000000000 +0100
-@@ -131,7 +131,7 @@
- # ifdef __cplusplus
- #  define __MATH_INLINE __inline
- # else
--#  define __MATH_INLINE extern __inline
-+#  define __MATH_INLINE __extern_inline
- # endif  /* __cplusplus */
- 
- /* The gcc, version 2.7 or below, has problems with all this inlining
---- libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h.jj	2004-09-11 18:28:10.000000000 +0200
-+++ libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h	2006-11-07 11:12:07.000000000 +0100
-@@ -1,5 +1,5 @@
- /* System-specific socket constants and types.  4.4 BSD version.
--   Copyright (C) 1991,92,1994-2002,2004 Free Software Foundation, Inc.
-+   Copyright (C) 1991,92,1994-2002,2004,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -227,7 +227,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
- 				      struct cmsghdr *__cmsg) __THROW;
- #ifdef __USE_EXTERN_INLINES
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- _EXTERN_INLINE struct cmsghdr *
- __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
---- libc/sysdeps/unix/sysv/linux/ia64/ioperm.c.jj	2004-03-18 00:17:58.000000000 +0100
-+++ libc/sysdeps/unix/sysv/linux/ia64/ioperm.c	2006-11-07 11:13:23.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
-+/* Copyright (C) 1999, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
- 
-@@ -51,7 +51,7 @@ static struct
-   }
- io;
- 
--__inline__ unsigned long int
-+static __always_inline unsigned long int
- io_offset (unsigned long int port)
- {
- 	return ((port >> 2) << 12) | (port & 0xfff);
---- libc/sysdeps/unix/sysv/linux/bits/socket.h.jj	2006-04-02 19:25:37.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/bits/socket.h	2006-11-07 11:15:04.000000000 +0100
-@@ -264,7 +264,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
- 				      struct cmsghdr *__cmsg) __THROW;
- #ifdef __USE_EXTERN_INLINES
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- _EXTERN_INLINE struct cmsghdr *
- __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
---- libc/sysdeps/unix/sysv/linux/bits/sigset.h.jj	2001-07-06 06:56:14.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/bits/sigset.h	2006-11-07 11:14:48.000000000 +0100
-@@ -1,5 +1,6 @@
- /* __sig_atomic_t, __sigset_t, and related definitions.  Linux version.
--   Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1991, 1992, 1994, 1996, 1997, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -43,7 +44,7 @@ typedef struct
- # define _SIGSET_H_fns 1
- 
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- 
- /* Return a mask that includes the bit for SIG only.  */
---- libc/sysdeps/unix/sysv/linux/sys/sysmacros.h.jj	2004-09-08 00:18:59.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/sys/sysmacros.h	2006-11-07 11:15:53.000000000 +0100
-@@ -0,0 +1,18 @@
-+/*  DO NOT EDIT THIS FILE.
-+
-+    It has been auto-edited by fixincludes from:
-+
-+	"fixinc/tests/inc/sys/sysmacros.h"
-+
-+    This had to be done to correct non-standard usages in the
-+    original, manufacturer supplied header file.  */
-+
-+
-+
-+#if defined( GLIBC_C99_INLINE_4_CHECK )
-+__extension__ 
-+#if __STDC_VERSION__ < 19901L
-+extern
-+#endif
-+ __inline unsigned int
-+#endif  /* GLIBC_C99_INLINE_4_CHECK */
-@@ -1,5 +1,6 @@
- /* Definitions of macros to access `dev_t' values.
--   Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1996, 1997, 1999, 2003, 2004, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -27,30 +28,30 @@
-    they need.  */
- #ifdef __GLIBC_HAVE_LONG_LONG
- __extension__
--extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
-+__extern_inline unsigned int gnu_dev_major (unsigned long long int __dev)
-      __THROW;
- __extension__
--extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
-+__extern_inline unsigned int gnu_dev_minor (unsigned long long int __dev)
-      __THROW;
- __extension__
--extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
-+__extern_inline unsigned long long int gnu_dev_makedev (unsigned int __major,
- 							unsigned int __minor)
-      __THROW;
- 
- # if defined __GNUC__ && __GNUC__ >= 2
--__extension__ extern __inline unsigned int
-+__extension__ __extern_inline unsigned int
- __NTH (gnu_dev_major (unsigned long long int __dev))
- {
-   return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
- }
- 
--__extension__ extern __inline unsigned int
-+__extension__ __extern_inline unsigned int
- __NTH (gnu_dev_minor (unsigned long long int __dev))
- {
-   return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
- }
- 
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
- {
-   return ((__minor & 0xff) | ((__major & 0xfff) << 8)
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch b/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch
deleted file mode 100644
index 07039718477..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-diff -ruN glibc-20050110/configure glibc-20050110.patched/configure
---- glibc-20050110/configure	2005-01-05 10:39:53.000000000 +0100
-+++ glibc-20050110.patched/configure	2005-01-18 13:33:01.000000000 +0100
-@@ -1393,7 +1393,7 @@
- ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
- 
- 
--if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
-+if test "`cd $srcdir; @PWD@`" = "`@PWD@`"; then
-   { { echo "$as_me:$LINENO: error: you must configure in a separate build directory" >&5
- echo "$as_me: error: you must configure in a separate build directory" >&2;}
-    { (exit 1); exit 1; }; }
-diff -ruN glibc-20050110/io/ftwtest-sh glibc-20050110.patched/io/ftwtest-sh
---- glibc-20050110/io/ftwtest-sh	2004-02-09 21:12:23.000000000 +0100
-+++ glibc-20050110.patched/io/ftwtest-sh	2005-01-18 13:33:15.000000000 +0100
-@@ -120,7 +120,7 @@
-     sort > $testout
- 
- # perhaps $tmp involves some symlinks...
--tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd`
-+tmpreal=`cd $tmp; @PWD@ 2>/dev/null || /usr/bin/pwd`
- 
- cat <<EOF | cmp $testout - || exit 1
- base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-@@ -138,7 +138,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
-     sort > $testout
-@@ -160,7 +160,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
-     sort > $testout
-@@ -182,7 +182,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
-     sort > $testout
-diff -ruN glibc-20050110/scripts/rellns-sh glibc-20050110.patched/scripts/rellns-sh
---- glibc-20050110/scripts/rellns-sh	1999-12-19 00:40:25.000000000 +0100
-+++ glibc-20050110.patched/scripts/rellns-sh	2005-01-18 13:35:53.245937423 +0100
-@@ -22,13 +22,13 @@
-   exit 1
- fi
- 
--if test -x /bin/pwd; then
--  pwd=/bin/pwd
--elif test -x /usr/bin/pwd; then
--  pwd=/usr/bin/pwd
--else
-+#if test -x /bin/pwd; then
-+#  pwd=/bin/pwd
-+#elif test -x /usr/bin/pwd; then
-+#  pwd=/usr/bin/pwd
-+#else
-   pwd='pwd'
--fi
-+#fi
- 
- # Make both paths absolute.
- if test -d $1; then
diff --git a/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch b/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch
deleted file mode 100644
index 816e0aa528b..00000000000
--- a/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- glibc-2.5/manual/Makefile.orig	2011-01-26 17:03:14.000000000 +0100
-+++ glibc-2.5/manual/Makefile	2011-01-26 17:04:30.000000000 +0100
-@@ -232,7 +232,10 @@
- .PHONY: stubs
- stubs: $(objpfx)stubs
- endif
--$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
-+$(objpfx)stubs ../po/manual.pot:
-+	$(make-target-directory)
-+	touch $@
-+$(objpfx)stamp%:
- 	$(make-target-directory)
- 	touch $@
- 
diff --git a/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch b/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch
deleted file mode 100644
index 45deb1d2d71..00000000000
--- a/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-# --- T2-COPYRIGHT-NOTE-BEGIN ---
-# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
-# 
-# T2 SDE: package/.../glibc/x86-fnstsw.patch
-# Copyright (C) 2008 The T2 SDE Project
-# 
-# More information can be found in the files COPYING and README.
-# 
-# This patch file is dual-licensed. It is available under the license the
-# patched project is licensed under, as long as it is an OpenSource license
-# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
-# of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-# --- T2-COPYRIGHT-NOTE-END ---
-
-Fix more strict checking in binutils since 2.18.50.0.3:
-  sysdeps/i386/fpu/ftestexcept.c:33: Error: suffix or operands invalid for `fnstsw'
-
-  - Rene Rebe <rene@exactcode.de>
-
---- glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c.vanilla	2008-09-02 12:45:07.000000000 +0200
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-09-02 12:46:37.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
--  int temp;
-+  short temp;
-   int xtemp = 0;
- 
-   /* Get current exceptions.  */
diff --git a/pkgs/development/libraries/glibc/2.7/builder.sh b/pkgs/development/libraries/glibc/2.7/builder.sh
deleted file mode 100644
index d5a43229bfa..00000000000
--- a/pkgs/development/libraries/glibc/2.7/builder.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-# glibc cannot have itself in its rpath.
-export NIX_NO_SELF_RPATH=1
-export NIX_DONT_SET_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.
-export BASH_SHELL=$SHELL
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-    
-    mkdir ../build
-    cd ../build
-    
-    configureScript=../$sourceRoot/configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make localedata/install-locales
-    fi
-    rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.7/default.nix b/pkgs/development/libraries/glibc/2.7/default.nix
deleted file mode 100644
index 7eb34e88899..00000000000
--- a/pkgs/development/libraries/glibc/2.7/default.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation {
-  name = "glibc-2.7";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = mirror://gnu/glibc/glibc-2.7.tar.bz2;
-    sha256 = "06j5q20l11x8kcrl9bg15xgb1pw0w82pazikxf4zvq2fmhiaa922";
-  };
-
-  inherit kernelHeaders installLocales;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-       
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-       
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-  ];
-
-  # `--with-tls --without-__thread' enables support for TLS but causes
-  # it not to be used.  Required if we don't want to barf on 2.4
-  # kernels.  Or something.
-  configureFlags="--enable-add-ons
-    --with-headers=${kernelHeaders}/include
-    ${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-}
diff --git a/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch
deleted file mode 100644
index 4d29082f941..00000000000
--- a/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -rc glibc-2.7-orig/sysdeps/posix/getaddrinfo.c glibc-2.7/sysdeps/posix/getaddrinfo.c
-*** glibc-2.7-orig/sysdeps/posix/getaddrinfo.c	2007-10-17 18:05:12.000000000 +0200
---- glibc-2.7/sysdeps/posix/getaddrinfo.c	2008-04-08 12:17:09.000000000 +0200
-***************
-*** 498,505 ****
-  	  int no_data = 0;
-  	  int no_inet6_data = 0;
-  	  service_user *nip = NULL;
-- 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-- 	  enum nss_status status = NSS_STATUS_UNAVAIL;
-  	  int no_more;
-  	  int old_res_options;
-  
---- 498,503 ----
-***************
-*** 689,694 ****
---- 687,694 ----
-  
-  	  while (!no_more)
-  	    {
-+               enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+               enum nss_status status = NSS_STATUS_UNAVAIL;
-  	      nss_gethostbyname3_r fct = NULL;
-  	      if (req->ai_flags & AI_CANONNAME)
-  		/* No need to use this function if we do not look for
diff --git a/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch b/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch
deleted file mode 100644
index ab3d6144d6e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Support GNU Binutils 2.20 and beyond.  Patch from
-http://sourceware.org/ml/libc-alpha/2009-09/msg00009.html .
-
-diff --git a/configure b/configure
-index 48e6952..b1d84d7 100755
---- a/configure
-+++ b/configure
-@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; }
-   ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-   case $ac_prog_version in
-     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
--    2.1[3-9]*)
-+    2.1[3-9]*|[2-9].[2-9]*)
-        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- 
-@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; }
-   ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
-   case $ac_prog_version in
-     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
--    2.1[3-9]*)
-+    2.1[3-9]*|[2-9].[2-9]*)
-        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- 
-diff --git a/configure.in b/configure.in
-index 4584afe..7c4f71f 100644
---- a/configure.in
-+++ b/configure.in
-@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
- # Accept binutils 2.13 or newer.
- AC_CHECK_PROG_VER(AS, $AS, --version,
- 		  [GNU assembler.* \([0-9]*\.[0-9.]*\)],
--		  [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
-+		  [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
- AC_CHECK_PROG_VER(LD, $LD, --version,
- 		  [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
--		  [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
-+		  [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
- 
- # We need the physical current working directory.  We cannot use the
- # "pwd -P" shell builtin since that's not portable.  Instead we try to
diff --git a/pkgs/development/libraries/glibc/2.9/binutils-ld.patch b/pkgs/development/libraries/glibc/2.9/binutils-ld.patch
deleted file mode 100644
index ae70f145ce0..00000000000
--- a/pkgs/development/libraries/glibc/2.9/binutils-ld.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Sat, 31 Jan 2009 00:21:15 +0000
-Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
-
-	newer linker scripts.
----
- ChangeLog    |    5 +++++
- elf/Makefile |    4 ++--
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index 8079fe9..e44ff1d 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -1,4 +1,4 @@
--# Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc.
-+# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
- # This file is part of the GNU C Library.
- 
- # The GNU C Library is free software; you can redistribute it and/or
-@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
- 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
- 		  LC_ALL=C \
- 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
--		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- 		  > $@.lds
- 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
- 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\
--- 
-1.6.4
-
diff --git a/pkgs/development/libraries/glibc/2.9/builder.sh b/pkgs/development/libraries/glibc/2.9/builder.sh
deleted file mode 100644
index c81a3ac2a9e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/builder.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    if test -n "$crossConfig"; then
-        sed -i s/-lgcc_eh//g Makeconfig
-    fi
-
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-    if test -n "$crossConfig"; then
-        cat > config.cache << "EOF"
-libc_cv_forced_unwind=yes
-libc_cv_c_cleanup=yes
-libc_cv_gnu89_inline=yes
-EOF
-        export BUILD_CC=gcc
-        export CC="${crossConfig}-gcc"
-        export AR="${crossConfig}-ar"
-        export RANLIB="${crossConfig}-ranlib"
-        configureFlags="${configureFlags} --cache-file=config.cache"
-
-        # Disable the native stripping, because it breaks libc_nonshared.a
-        dontStrip=1
-    fi
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-
-    export NIX_DONT_SET_RPATH=1
-    unset CFLAGS
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make localedata/install-locales
-    fi
-    test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/default.nix b/pkgs/development/libraries/glibc/2.9/default.nix
deleted file mode 100644
index 7d42825206e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/default.nix
+++ /dev/null
@@ -1,103 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-, gccCross ? null
-}:
-let
-    cross = if gccCross != null then gccCross.target else null;
-in
-stdenv.mkDerivation rec {
-  name = "glibc-2.9" +
-    stdenv.lib.optionalString (cross != null) "-${cross.config}";
-
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit kernelHeaders installLocales;
-  crossConfig = if (cross != null) then cross.config else null;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-
-    /* Make it possible to override the locale-archive in NixOS. */
-    ./locale-override.patch
-
-    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
-    ./rpcgen-path.patch
-
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-
-    ./binutils-ld.patch
-  ];
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--with-headers=${kernelHeaders}/include"
-    (if profilingLibraries then "--enable-profile" else "--disable-profile")
-  ] ++ stdenv.lib.optionals (cross != null) [
-    "--with-tls"
-    "--enable-kernel=2.6.0"
-    "--without-fp"
-    "--with-__thread"
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  buildNativeInputs = stdenv.lib.optionals (cross != null) [ gccCross ];
-
-  preInstall = if (cross != null) then ''
-    mkdir -p $out/lib
-    ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
-  '' else "";
-
-  postInstall = if (cross != null) then ''
-    rm $out/lib/libgcc_s.so.1
-  '' else "";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/headers.nix b/pkgs/development/libraries/glibc/2.9/headers.nix
deleted file mode 100644
index 7adeb11c8bc..00000000000
--- a/pkgs/development/libraries/glibc/2.9/headers.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation rec {
-  name = "glibc-headers-2.9";
-
-  builder = ./headersbuilder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit kernelHeaders;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--with-headers=${kernelHeaders}/include"
-    "--disable-sanity-checks"
-    "--enable-hacker-mode"
-    (if profilingLibraries then "--enable-profile" else "--disable-profile")
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  buildPhase = "true";
-
-  # I took some tricks from crosstool-0.43
-  installPhase = ''
-    make cross-compiling=yes CFLAGS=-DBOOTSTRAP_GCC install-headers
-    mkdir -p $out/include/gnu
-    touch $out/include/gnu/stubs.h
-    cp ../include/features.h $out/include/features.h
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-  '';
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/headersbuilder.sh b/pkgs/development/libraries/glibc/2.9/headersbuilder.sh
deleted file mode 100644
index 23f4bd4cc61..00000000000
--- a/pkgs/development/libraries/glibc/2.9/headersbuilder.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/info.nix b/pkgs/development/libraries/glibc/2.9/info.nix
deleted file mode 100644
index cc79bbece3d..00000000000
--- a/pkgs/development/libraries/glibc/2.9/info.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv, fetchurl, texinfo, perl }:
-
-stdenv.mkDerivation rec {
-  name = "glibc-info-2.9";
-  
-  src = fetchurl {
-    url = http://nixos.org/tarballs/glibc-2.9-20081208.tar.bz2;
-    sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h";
-  };
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  preConfigure = ''
-    export PWD_P=$(type -tP pwd)
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-    mkdir ../build
-    cd ../build
-    
-    configureScript=../$sourceRoot/configure
-  '';
-
-  configureFlags = [ "--enable-add-ons" ];
-
-  buildInputs = [ texinfo perl ];
-
-  buildPhase = "make info";
-
-  # I don't know why the info is not generated in 'build'
-  # Somehow building the info still does not work, because the final
-  # libc.info hasn't a Top node.
-  installPhase = ''
-    mkdir -p $out/share/info
-    cp ../$sourceRoot/manual/*.info $out/share/info
-  '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "Locale information for the GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/locale-override.patch b/pkgs/development/libraries/glibc/2.9/locale-override.patch
deleted file mode 100644
index 108d0e35dac..00000000000
--- a/pkgs/development/libraries/glibc/2.9/locale-override.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c
-*** glibc-2.9-20081208-orig/locale/loadarchive.c	2005-09-09 18:56:52.000000000 +0200
---- glibc-2.9-20081208/locale/loadarchive.c	2009-04-19 13:54:26.000000000 +0200
-***************
-*** 124,129 ****
---- 124,142 ----
-  }
-  
-  
-+ static int
-+ open_locale_archive ()
-+ {
-+   int fd = -1;
-+   char *path = getenv ("LOCALE_ARCHIVE");
-+   if (path)
-+     fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
-+   if (fd < 0)
-+     fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-+   return fd;
-+ }
-+ 
-+ 
-  /* Find the locale *NAMEP in the locale archive, and return the
-     internalized data structure for its CATEGORY data.  If this locale has
-     already been loaded from the archive, just returns the existing data
-***************
-*** 203,209 ****
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
---- 216,222 ----
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_locale_archive ();
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
-***************
-*** 394,400 ****
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
---- 407,413 ----
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_locale_archive ();
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
-diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h
-*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h	2006-10-11 18:24:05.000000000 +0200
---- glibc-2.9-20081208/sysdeps/generic/unsecvars.h	2009-04-19 13:55:34.000000000 +0200
-***************
-*** 16,21 ****
---- 16,22 ----
-    "LD_SHOW_AUXV\0"							      \
-    "LD_USE_LOAD_BIAS\0"							      \
-    "LOCALDOMAIN\0"							      \
-+   "LOCALE_ARCHIVE\0"							      \
-    "LOCPATH\0"								      \
-    "MALLOC_TRACE\0"							      \
-    "NIS_PATH\0"								      \
diff --git a/pkgs/development/libraries/glibc/2.9/locales.nix b/pkgs/development/libraries/glibc/2.9/locales.nix
deleted file mode 100644
index a1fe9f82f14..00000000000
--- a/pkgs/development/libraries/glibc/2.9/locales.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This function builds just the `lib/locale/locale-archive' file from
-   Glibc and nothing else.  If `allLocales' is true, all supported
-   locales are included; otherwise, just the locales listed in
-   `locales'.  See localedata/SUPPORTED in the Glibc source tree for
-   the list of all supported locales:
-   http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
-*/
-
-{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
-
-stdenv.mkDerivation rec {
-  name = "glibc-locales-2.9";
-
-  builder = ./localesbuilder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit (stdenv) is64bit;
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--without-headers"
-    "--disable-profile"
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  # Awful hack: `localedef' doesn't allow the path to `locale-archive'
-  # to be overriden, but you *can* specify a prefix, i.e. it will use
-  # <prefix>/<path-to-glibc>/lib/locale/locale-archive.  So we use
-  # $TMPDIR as a prefix, meaning that the locale-archive is placed in
-  # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
-  buildPhase =
-    ''
-      mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
-      make localedata/install-locales \
-          LOCALEDEF="localedef --prefix=$TMPDIR" \
-          localedir=$out/lib/locale \
-          ${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""}
-    '';
-
-  installPhase =
-    ''
-      mkdir -p $out/lib/locale
-      cp $TMPDIR/nix/store/*/lib/locale/locale-archive $out/lib/locale/
-    '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "Locale information for the GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/localesbuilder.sh b/pkgs/development/libraries/glibc/2.9/localesbuilder.sh
deleted file mode 100644
index a28f6bcbaeb..00000000000
--- a/pkgs/development/libraries/glibc/2.9/localesbuilder.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-
-    export NIX_DONT_SET_RPATH=1
-    unset CFLAGS
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch
deleted file mode 100644
index dc09b509870..00000000000
--- a/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c
-*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c	2008-07-30 21:14:22.000000000 +0200
---- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c	2008-12-10 11:39:32.000000000 +0100
-***************
-*** 505,512 ****
-  	  int no_data = 0;
-  	  int no_inet6_data = 0;
-  	  service_user *nip = NULL;
-- 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-- 	  enum nss_status status = NSS_STATUS_UNAVAIL;
-  	  int no_more;
-  	  int old_res_options;
-  
---- 505,510 ----
-***************
-*** 702,707 ****
---- 700,707 ----
-  
-  	  while (!no_more)
-  	    {
-+ 	      enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+ 	      enum nss_status status = NSS_STATUS_UNAVAIL;
-  	      nss_gethostbyname4_r fct4
-  		= __nss_lookup_function (nip, "gethostbyname4_r");
-  	      if (fct4 != NULL)
diff --git a/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch
deleted file mode 100644
index fbb03dd5fad..00000000000
--- a/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
-(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
-patch makes it run any `cpp' command found in $PATH.
-
---- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
-+++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
-@@ -79,7 +79,7 @@ static const char *cmdname;
- 
- static const char *svcclosetime = "120";
- static int cppDefined;	/* explicit path for C preprocessor */
--static const char *CPP = SUNOS_CPP;
-+static const char *CPP = "cpp";
- static const char CPPFLAGS[] = "-C";
- static char *pathbuf;
- static int cpp_pid;
-@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
- static void open_output (const char *infile, const char *outfile);
- static void add_warning (void);
- static void clear_args (void);
--static void find_cpp (void);
- static void open_input (const char *infile, const char *define);
- static int check_nettype (const char *name, const char *list_to_check[]);
- static void c_output (const char *infile, const char *define,
-@@ -327,31 +326,6 @@ clear_args (void)
-   argcount = FIXEDARGS;
- }
- 
--/* make sure that a CPP exists */
--static void
--find_cpp (void)
--{
--  struct stat buf;
--
--  if (stat (CPP, &buf) < 0)
--    {				/* /lib/cpp or explicit cpp does not exist */
--      if (cppDefined)
--	{
--	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
--	  crash ();
--	}
--      else
--	{			/* try the other one */
--	  CPP = SVR4_CPP;
--	  if (stat (CPP, &buf) < 0)
--	    {			/* can't find any cpp */
--	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
--	      crash ();
--	    }
--	}
--    }
--}
--
- /*
-  * Open input file with given define for C-preprocessor
-  */
-@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
-   switch (cpp_pid)
-     {
-     case 0:
--      find_cpp ();
-       putarg (0, CPP);
-       putarg (1, CPPFLAGS);
-       addarg (define);
-@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
-       close (1);
-       dup2 (pd[1], 1);
-       close (pd[0]);
--      execv (arglist[0], (char **) arglist);
-+      execvp (arglist[0], (char **) arglist);
-       perror ("execv");
-       exit (1);
-     case -1:
diff --git a/pkgs/development/libraries/glibmm/2.30.x.nix b/pkgs/development/libraries/glibmm/2.30.x.nix
index 4792ae790be..a544543d7e3 100644
--- a/pkgs/development/libraries/glibmm/2.30.x.nix
+++ b/pkgs/development/libraries/glibmm/2.30.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "15zqgx6rashyhxk89qjqq05p6m40akpgzyjk8bfb3jk68rc2nn39";
   };
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   propagatedBuildInputs = [glib libsigcxx];
 
   meta = {
diff --git a/pkgs/development/libraries/gmp/4.3.2.nix b/pkgs/development/libraries/gmp/4.3.2.nix
index d25b6941153..df7bd0ea3b9 100644
--- a/pkgs/development/libraries/gmp/4.3.2.nix
+++ b/pkgs/development/libraries/gmp/4.3.2.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck";
   };
 
-  buildNativeInputs = [ m4 ];
+  nativeBuildInputs = [ m4 ];
 
   # Prevent the build system from using sub-architecture-specific
   # instructions (e.g., SSE2 on i686).
diff --git a/pkgs/development/libraries/gmp/5.0.5.nix b/pkgs/development/libraries/gmp/5.0.5.nix
index 98ebe5fcc25..dba5cafdf57 100644
--- a/pkgs/development/libraries/gmp/5.0.5.nix
+++ b/pkgs/development/libraries/gmp/5.0.5.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./ignore-bad-cpuid.patch ];
 
-  buildNativeInputs = [ m4 ];
+  nativeBuildInputs = [ m4 ];
 
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
diff --git a/pkgs/development/libraries/gmp/5.1.0.nix b/pkgs/development/libraries/gmp/5.1.0.nix
new file mode 100644
index 00000000000..270788198f6
--- /dev/null
+++ b/pkgs/development/libraries/gmp/5.1.0.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, m4, cxx ? true }:
+
+stdenv.mkDerivation rec {
+  name = "gmp-5.1.0";
+
+  src = fetchurl {
+    urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
+    sha256 = "15n7xxgasbxdch8ii8z9ic6fxc2ysk3q8iavf55abjp5iylspnfz";
+  };
+
+  nativeBuildInputs = [ m4 ];
+
+  configureFlags =
+    # Build a "fat binary", with routines for several sub-architectures
+    # (x86), except on Solaris where some tests crash with "Memory fault".
+    # See <http://hydra.nixos.org/build/2760931>, for instance.
+    (stdenv.lib.optional (!stdenv.isSunOS) "--enable-fat")
+    ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]);
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "GMP, the GNU multiple precision arithmetic library";
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
+    homepage = http://gmplib.org/;
+    license = "LGPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix
index a1c1f3f357f..c1dab82e37a 100644
--- a/pkgs/development/libraries/gnutls/default.nix
+++ b/pkgs/development/libraries/gnutls/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation (rec {
   buildInputs = [ zlib lzo ]
     ++ stdenv.lib.optional guileBindings guile;
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   propagatedBuildInputs = [ nettle libtasn1 ];
 
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 2f1411a0bda..4ba4cbb3347 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   
   propagatedBuildInputs = [ libgpgerror glib libassuan pth ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--with-gpg=${gpgPath}";
 }
diff --git a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
index 8bfeb8a4bea..c3510a69a12 100644
--- a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
+++ b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gstreamer gst_plugins_base glib qt4 ];
   propagatedBuildInputs = [ boost ];
-  buildNativeInputs = [ cmake automoc4 flex bison pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 flex bison pkgconfig ];
 
   cmakeFlags = "-DUSE_QT_PLUGIN_DIR=OFF -DUSE_GST_PLUGIN_DIR=OFF";
 
diff --git a/pkgs/development/libraries/gtk+/2.24.x.nix b/pkgs/development/libraries/gtk+/2.24.x.nix
index 2bf657e04e7..c259f700573 100644
--- a/pkgs/development/libraries/gtk+/2.24.x.nix
+++ b/pkgs/development/libraries/gtk+/2.24.x.nix
@@ -8,16 +8,16 @@ assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
 stdenv.mkDerivation rec {
-  name = "gtk+-2.24.13";
+  name = "gtk+-2.24.14";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/2.24/${name}.tar.xz";
-    sha256 = "35e1a01e46b02970b02ee9f299390d0aa57c1215ad2667bcd584b72f4ea6513d";
+    sha256 = "8bd1b8b511a3004e8972badf467ce829e6855cdff15540b9344dc934c68008ac";
   };
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   propagatedBuildInputs =
     [ xlibs.xlibs glib atk pango gdk_pixbuf cairo
diff --git a/pkgs/development/libraries/gtk+/3.2.x.nix b/pkgs/development/libraries/gtk+/3.2.x.nix
index 9f333c03fab..cace1b626f4 100644
--- a/pkgs/development/libraries/gtk+/3.2.x.nix
+++ b/pkgs/development/libraries/gtk+/3.2.x.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   propagatedBuildInputs =
     [ xlibs.xlibs glib atk pango gdk_pixbuf cairo
diff --git a/pkgs/development/libraries/gtkmm/2.24.x.nix b/pkgs/development/libraries/gtkmm/2.24.x.nix
index 56d151101c5..ec7f01a8be5 100644
--- a/pkgs/development/libraries/gtkmm/2.24.x.nix
+++ b/pkgs/development/libraries/gtkmm/2.24.x.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0gcm91sc1a05c56kzh74l370ggj0zz8nmmjvjaaxgmhdq8lpl369";
   };
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ glibmm gtk atkmm cairomm pangomm ];
 
diff --git a/pkgs/development/libraries/gtkmm/3.2.x.nix b/pkgs/development/libraries/gtkmm/3.2.x.nix
index 890d4a34519..d3681b4b386 100644
--- a/pkgs/development/libraries/gtkmm/3.2.x.nix
+++ b/pkgs/development/libraries/gtkmm/3.2.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1wkljr2vjvjg5mggi4rvk9k4j2kzh8lc106k2yp8gqjlhk2xm5b1";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ glibmm gtk3 atkmm cairomm pangomm ];
 
diff --git a/pkgs/development/libraries/gupnp-igd/default.nix b/pkgs/development/libraries/gupnp-igd/default.nix
index a8bb065d7eb..20a5f2d9c94 100644
--- a/pkgs/development/libraries/gupnp-igd/default.nix
+++ b/pkgs/development/libraries/gupnp-igd/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib python pygobject ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.gupnp.org/;
diff --git a/pkgs/development/libraries/gupnp/default.nix b/pkgs/development/libraries/gupnp/default.nix
index 5679591878a..c70d8fcb0c2 100644
--- a/pkgs/development/libraries/gupnp/default.nix
+++ b/pkgs/development/libraries/gupnp/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   propagatedBuildInputs = [ libxml2 libsoup gssdp ];
   buildInputs = [ glib libuuid ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.gupnp.org/;
diff --git a/pkgs/development/libraries/gwenhywfar/default.nix b/pkgs/development/libraries/gwenhywfar/default.nix
index 207b81997af..724524e2b26 100644
--- a/pkgs/development/libraries/gwenhywfar/default.nix
+++ b/pkgs/development/libraries/gwenhywfar/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 gtk ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   QTDIR = qt4;
 }
diff --git a/pkgs/development/libraries/haskell/cuda/default.nix b/pkgs/development/libraries/haskell/cuda/default.nix
index 3baa02d2674..bb7f0e23fbf 100644
--- a/pkgs/development/libraries/haskell/cuda/default.nix
+++ b/pkgs/development/libraries/haskell/cuda/default.nix
@@ -21,7 +21,7 @@ cabal.mkDerivation (self: {
       test -f $i && ghc --make $i
     done
   
-    for p in $extraBuildInputs $propagatedBuildNativeInputs; do
+    for p in $extraBuildInputs $propagatedNativeBuildInputs; do
       if [ -d "$p/include" ]; then
         extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
       fi
diff --git a/pkgs/development/libraries/hspell/dicts.nix b/pkgs/development/libraries/hspell/dicts.nix
index a7f0d19865c..fd456ca6209 100644
--- a/pkgs/development/libraries/hspell/dicts.nix
+++ b/pkgs/development/libraries/hspell/dicts.nix
@@ -2,7 +2,7 @@
 
 let
   dict = a: stdenv.mkDerivation ({
-    inherit (hspell) src patchPhase buildNativeInputs;
+    inherit (hspell) src patchPhase nativeBuildInputs;
     meta = hspell.meta // {
       description = "${a.buildFlags} Hebrew dictionary";
     } // (if a ? meta then a.meta else {});
diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix
index de4270008f3..3c5f198cea6 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # Filter out `null' inputs.  This allows users to `.override' the
   # derivation and set optional dependencies to `null'.
diff --git a/pkgs/development/libraries/ilbc/default.nix b/pkgs/development/libraries/ilbc/default.nix
index 3ab4e7e738c..d77b5d46a79 100644
--- a/pkgs/development/libraries/ilbc/default.nix
+++ b/pkgs/development/libraries/ilbc/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "0zf4mvi3jzx6zjrfl2rbhl2m68pzbzpf1vbdmn7dqbfpcb67jpdy";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   unpackPhase = ''
     mkdir -v ${name}
diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix
index 83adb16bbc8..d77e2052f81 100644
--- a/pkgs/development/libraries/imlib2/default.nix
+++ b/pkgs/development/libraries/imlib2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ x11 libjpeg libtiff libungif libpng bzip2 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     platforms = stdenv.lib.platforms.gnu; # random choice
diff --git a/pkgs/development/libraries/itk/default.nix b/pkgs/development/libraries/itk/default.nix
index 6be998b691a..bfe10490fc7 100644
--- a/pkgs/development/libraries/itk/default.nix
+++ b/pkgs/development/libraries/itk/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ cmake xz ];
+  nativeBuildInputs = [ cmake xz ];
   buildInputs = [ libX11 libuuid ];
 
   meta = {
diff --git a/pkgs/development/libraries/jasper/default.nix b/pkgs/development/libraries/jasper/default.nix
index 8cf4cc7991f..4046c05f79e 100644
--- a/pkgs/development/libraries/jasper/default.nix
+++ b/pkgs/development/libraries/jasper/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "154l7zk7yh3v8l2l6zm5s2alvd2fzkp6c9i18iajfbna5af5m43b";
   };
 
-  buildNativeInputs = [unzip];
+  nativeBuildInputs = [unzip];
   propagatedBuildInputs = [ libjpeg ];
 
   configureFlags = "--enable-shared";
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index ad3af7778ff..8ca1445b1f6 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://live.gnome.org/JsonGlib;
diff --git a/pkgs/development/libraries/kdevplatform/default.nix b/pkgs/development/libraries/kdevplatform/default.nix
index 367987d5dee..2ff2fac296d 100644
--- a/pkgs/development/libraries/kdevplatform/default.nix
+++ b/pkgs/development/libraries/kdevplatform/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ kdelibs qt4 phonon ];
   buildInputs = [ apr aprutil subversion boost qjson ];
 
-  buildNativeInputs = [ cmake automoc4 gettext pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 gettext pkgconfig ];
 
   meta = {
     maintainers = [ stdenv.lib.maintainers.urkud ];
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index b0252617d7d..6c139242f3e 100644
--- a/pkgs/development/libraries/libbluray/default.nix
+++ b/pkgs/development/libraries/libbluray/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     sha256 = "551b623e76c2dba44b5490fb42ccdc491b28cd42841de28237b8edbed0f0711c";
   };
 
-  buildNativeInputs = [autoconf automake libtool];
+  nativeBuildInputs = [autoconf automake libtool];
   buildInputs = stdenv.lib.optionals withAACS [jdk ant libaacs];
   NIX_LDFLAGS = stdenv.lib.optionalString withAACS "-laacs";
 
diff --git a/pkgs/development/libraries/libcdr/default.nix b/pkgs/development/libraries/libcdr/default.nix
index 823a4839e80..d2d68640560 100644
--- a/pkgs/development/libraries/libcdr/default.nix
+++ b/pkgs/development/libraries/libcdr/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libwpg libwpd lcms2 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   CXXFLAGS="--std=gnu++0x"; # For c++11 constants in lcms2.h
 
diff --git a/pkgs/development/libraries/libchop/default.nix b/pkgs/development/libraries/libchop/default.nix
index 4f0c83f2702..7f3c0257339 100644
--- a/pkgs/development/libraries/libchop/default.nix
+++ b/pkgs/development/libraries/libchop/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g";
   };
 
-  buildNativeInputs = [ pkgconfig gperf ];
+  nativeBuildInputs = [ pkgconfig gperf ];
   buildInputs =
     [ zlib bzip2 lzo
       libgcrypt
diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix
index aeb9331c8ad..6fa6ca4b6f8 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DWITH_DOC=OFF";
   
diff --git a/pkgs/development/libraries/libdevil/default.nix b/pkgs/development/libraries/libdevil/default.nix
index 12008bcbccb..6efb785b657 100644
--- a/pkgs/development/libraries/libdevil/default.nix
+++ b/pkgs/development/libraries/libdevil/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr mesa libX11 ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
 
diff --git a/pkgs/development/libraries/libdiscid/default.nix b/pkgs/development/libraries/libdiscid/default.nix
index 3ee43ba3bee..b8f79f2ae69 100644
--- a/pkgs/development/libraries/libdiscid/default.nix
+++ b/pkgs/development/libraries/libdiscid/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libdiscid-0.2.2";
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ cmake ];
 
   src = fetchurl {
diff --git a/pkgs/development/libraries/libdmtx/default.nix b/pkgs/development/libraries/libdmtx/default.nix
index 97622bb7b24..970a1cf05e9 100644
--- a/pkgs/development/libraries/libdmtx/default.nix
+++ b/pkgs/development/libraries/libdmtx/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0iin2j3ad7ldj32dwc04g28k54iv3lrc5121rgyphm7l9hvigbvk";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ imagemagick ];
 
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index 3a1e101aa43..a2546bf2d69 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1slgi61n4dlsfli47ql354fd1ppj7n40jd94wvnsdqx0mna9syrd";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libpthreadstubs libpciaccess udev ];
 
   patches = stdenv.lib.optional stdenv.isDarwin ./libdrm-apple.patch;
diff --git a/pkgs/development/libraries/libgnome-keyring/3.x.nix b/pkgs/development/libraries/libgnome-keyring/3.x.nix
index a8b8e98ced9..54a023a16f8 100644
--- a/pkgs/development/libraries/libgnome-keyring/3.x.nix
+++ b/pkgs/development/libraries/libgnome-keyring/3.x.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib dbus_libs libgcrypt ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) platforms maintainers;
diff --git a/pkgs/development/libraries/libgnome-keyring/default.nix b/pkgs/development/libraries/libgnome-keyring/default.nix
index 05a21f3c82e..4aadafff844 100644
--- a/pkgs/development/libraries/libgnome-keyring/default.nix
+++ b/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib dbus_libs libgcrypt ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) platforms maintainers;
diff --git a/pkgs/development/libraries/libgphoto2/default.nix b/pkgs/development/libraries/libgphoto2/default.nix
index b55da62c9fb..3edc8d0ac6c 100644
--- a/pkgs/development/libraries/libgphoto2/default.nix
+++ b/pkgs/development/libraries/libgphoto2/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "14h20s0kwqr1nsj90dgjwzs0r3h7z1cpmnivrikd0rrg4m2jvcsr";
   };
   
-  buildNativeInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext ];
   buildInputs = [ libtool libjpeg ];
 
   # These are mentioned in the Requires line of libgphoto's pkg-config file.
diff --git a/pkgs/development/libraries/libgpod/default.nix b/pkgs/development/libraries/libgpod/default.nix
index e271e966180..0ad46e2ed5f 100644
--- a/pkgs/development/libraries/libgpod/default.nix
+++ b/pkgs/development/libraries/libgpod/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ glib libxml2 sqlite zlib sg3_utils
     gdk_pixbuf taglib libimobiledevice python pygobject mutagen ];
 
-  buildNativeInputs = [ gettext perlXMLParser intltool pkgconfig perl
+  nativeBuildInputs = [ gettext perlXMLParser intltool pkgconfig perl
     libimobiledevice.swig ];
 
   meta = {
diff --git a/pkgs/development/libraries/libgsf/default.nix b/pkgs/development/libraries/libgsf/default.nix
index 0acd4a77b46..147ea283dda 100644
--- a/pkgs/development/libraries/libgsf/default.nix
+++ b/pkgs/development/libraries/libgsf/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "05zvaazf0d584nfirwsz7889lbsl4v781hslv3kda6akiwbwdhdz";
   };
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
   buildInputs =
     [ perl perlXMLParser gettext bzip2 python ]
     ++ stdenv.lib.optionals gnomeSupport [ gnome_vfs gdk_pixbuf ];
diff --git a/pkgs/development/libraries/libgtop/default.nix b/pkgs/development/libraries/libgtop/default.nix
index f214c7acf73..b592f458c6c 100644
--- a/pkgs/development/libraries/libgtop/default.nix
+++ b/pkgs/development/libraries/libgtop/default.nix
@@ -8,5 +8,5 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig perl intltool ];
+  nativeBuildInputs = [ pkgconfig perl intltool ];
 }
diff --git a/pkgs/development/libraries/libgweather/default.nix b/pkgs/development/libraries/libgweather/default.nix
index 4a4da810ae6..5e7a4cff741 100644
--- a/pkgs/development/libraries/libgweather/default.nix
+++ b/pkgs/development/libraries/libgweather/default.nix
@@ -9,5 +9,5 @@ stdenv.mkDerivation {
   };
   configureFlags = if stdenv ? glibc then "--with-zoneinfo-dir=${stdenv.glibc}/share/zoneinfo" else "";
   propagatedBuildInputs = [ libxml2 gtk3 libsoup GConf3 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/development/libraries/libharu/default.nix b/pkgs/development/libraries/libharu/default.nix
index 3b8c4be54e0..db1aa4a7473 100644
--- a/pkgs/development/libraries/libharu/default.nix
+++ b/pkgs/development/libraries/libharu/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
           sha256 = "1993vskpycyr43rwdp8f688fc5zvllrqq935r7rhsgbqbipkk73h";
         };
 
-        buildNativeInputs = [ patchutils ];
+        nativeBuildInputs = [ patchutils ];
 
         buildCommand = "filterdiff -x '*/CHANGES' $src > $out";
       })
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 80f3a1b8e71..59d352cf730 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
     rev = "1130";
     sha256 = "56caf19abdf44807fda75a67ef0886319551e53c4e4ece4da4fc862e34c64e1a";
   };
-  buildNativeInputs = [ perl cmake ];
+  nativeBuildInputs = [ perl cmake ];
 
   patches = [ ./respect-env-tzdir.patch ];
 }
diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix
index 6da91d98d13..94e785ee53b 100644
--- a/pkgs/development/libraries/libidn/default.nix
+++ b/pkgs/development/libraries/libidn/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "libidn-1.24";
+  name = "libidn-1.25";
 
   src = fetchurl {
     url = "mirror://gnu/libidn/${name}.tar.gz";
-    sha256 = "1zrmbwxvgmv7d37sdnlfn4lf3pxc7vgng3lhl18pkjry0v30h5ys";
+    sha256 = "05j7qcj7gb791k6ya2pwr7cq9yxgi0bjqiiwf9yq6pbai8r2brkz";
   };
 
   doCheck = ! stdenv.isDarwin;
diff --git a/pkgs/development/libraries/libimobiledevice/default.nix b/pkgs/development/libraries/libimobiledevice/default.nix
index b4bb3b47a35..a21d9bf7b5d 100644
--- a/pkgs/development/libraries/libimobiledevice/default.nix
+++ b/pkgs/development/libraries/libimobiledevice/default.nix
@@ -4,7 +4,7 @@
 stdenv.mkDerivation rec {
   name = "libimobiledevice-1.0.6";
 
-  buildNativeInputs = [ python libplist.swig pkgconfig ];
+  nativeBuildInputs = [ python libplist.swig pkgconfig ];
   buildInputs = [ readline ];
   propagatedBuildInputs = [ usbmuxd glib gnutls libgcrypt libtasn1 libplist ];
 
diff --git a/pkgs/development/libraries/libktorrent/default.nix b/pkgs/development/libraries/libktorrent/default.nix
index 083fbf13c81..a452cb7609e 100644
--- a/pkgs/development/libraries/libktorrent/default.nix
+++ b/pkgs/development/libraries/libktorrent/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1b4ibkba27ivvjsh5s93xwlcgzvvwsgl6mcd8g96d1al05n2ccw9";
   };
 
-  buildNativeInputs = [ cmake automoc4 gettext ];
+  nativeBuildInputs = [ cmake automoc4 gettext ];
   buildInputs = [ kdelibs phonon gmp qca2 boost libgcrypt ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix
index 24b93221d11..b1e8342ca91 100644
--- a/pkgs/development/libraries/liblastfm/default.nix
+++ b/pkgs/development/libraries/liblastfm/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   prefixKey = "--prefix ";
   propagatedBuildInputs = [ qt4 libsamplerate fftwSinglePrec ];
-  buildNativeInputs = [ ruby pkgconfig which ];
+  nativeBuildInputs = [ ruby pkgconfig which ];
 
   configureFlags = "--release";
 
diff --git a/pkgs/development/libraries/libmad/default.nix b/pkgs/development/libraries/libmad/default.nix
index 178e65d2506..6e2e2c949cc 100644
--- a/pkgs/development/libraries/libmad/default.nix
+++ b/pkgs/development/libraries/libmad/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   patches = [ ./001-mips_removal_h_constraint.patch ./pkgconfig.patch ];
 
-  buildNativeInputs = [ autoconf ];
+  nativeBuildInputs = [ autoconf ];
 
   # The -fforce-mem flag has been removed in GCC 4.3.
   preConfigure = ''
diff --git a/pkgs/development/libraries/libmms/default.nix b/pkgs/development/libraries/libmms/default.nix
index 8d24ddbb630..0f6d220861c 100644
--- a/pkgs/development/libraries/libmms/default.nix
+++ b/pkgs/development/libraries/libmms/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://libmms.sourceforge.net;
diff --git a/pkgs/development/libraries/libmng/default.nix b/pkgs/development/libraries/libmng/default.nix
index 5a73fd417f9..fcaf95672e1 100644
--- a/pkgs/development/libraries/libmng/default.nix
+++ b/pkgs/development/libraries/libmng/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "unmaintained/autogen.sh";
 
-  buildNativeInputs = [ automake110x autoconf libtool ];
+  nativeBuildInputs = [ automake110x autoconf libtool ];
 
   propagatedBuildInputs = [ zlib libpng libjpeg lcms ];
 
diff --git a/pkgs/development/libraries/libogg/default.nix b/pkgs/development/libraries/libogg/default.nix
index e407b75c8bb..f3c2d3b766d 100644
--- a/pkgs/development/libraries/libogg/default.nix
+++ b/pkgs/development/libraries/libogg/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0jy79ffkl34vycnwfsj4svqsdg1lwy2l1rr49y8r4d44kh12a5r3";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   meta = {
     homepage = http://xiph.org/ogg/;
diff --git a/pkgs/development/libraries/libopensc-dnie/default.nix b/pkgs/development/libraries/libopensc-dnie/default.nix
index ad524c21ff1..d229933111e 100644
--- a/pkgs/development/libraries/libopensc-dnie/default.nix
+++ b/pkgs/development/libraries/libopensc-dnie/default.nix
@@ -7,11 +7,11 @@ assert opensc.name == "opensc-0.11.7";
 stdenv.mkDerivation rec {
   name = "libopensc-dnie-1.4.6-2";
   
-  src = if (stdenv.system == "i686-linux") then (fetchurl {
+  src = if stdenv.system == "i686-linux" then (fetchurl {
       url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar;
       sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i";
     })
-    else if (stdenv.system == "x86_64-linux") then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
+    else if stdenv.system == "x86_64-linux" then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
       sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9";
     })
     else throw "Architecture not supported";
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index 8f786469a55..73a7cd2e4bb 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1gfy00zv6blplw3405q46khmjhdnp6ylblvygjjjk5skgvpscdd1";
   };
   
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   
   configureFlags = "--with-pcap=linux";
 
diff --git a/pkgs/development/libraries/libplist/default.nix b/pkgs/development/libraries/libplist/default.nix
index 81626959938..95da6dfb749 100644
--- a/pkgs/development/libraries/libplist/default.nix
+++ b/pkgs/development/libraries/libplist/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libplist-1.3";
 
-  buildNativeInputs = [ cmake swig2 ];
+  nativeBuildInputs = [ cmake swig2 ];
 
   patches = [ ./swig.patch ];
 
diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix
index ebdb9e756aa..031e2aa1a91 100644
--- a/pkgs/development/libraries/libpng/12.nix
+++ b/pkgs/development/libraries/libpng/12.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib ];
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   passthru = { inherit zlib; };
 
diff --git a/pkgs/development/libraries/librdf/rasqal.nix b/pkgs/development/libraries/librdf/rasqal.nix
index bcab7e03917..9b65487ccfb 100644
--- a/pkgs/development/libraries/librdf/rasqal.nix
+++ b/pkgs/development/libraries/librdf/rasqal.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1drjcy1k9g72iis0ghllzn7n0w03bahhrd2p5hs39anbm6mr0yk9";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ gmp pcre libxml2 ];
 
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index e825e1d852b..47e25877be9 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "1i460q9gslb7l75hjwc6w2kp2wk7fgp8lr7phamg33c6j013y30k";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 ]
     ++ stdenv.lib.optional withMysql mysql
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 3f84a69e3f4..0da30203876 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
   buildInputs = [ libxml2 libgsf bzip2 libcroco ];
   propagatedBuildInputs = [ glib gtk ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # It wants to add loaders and update the loaders.cache in gdk-pixbuf
   # Patching the Makefiles to it creates rsvg specific loaders and the
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 87aaafabcc4..08784a0f257 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libxml2 ]
     ++ stdenv.lib.optionals gnomeSupport [ libgnome_keyring sqlite ];
   passthru.propagatedUserEnvPackages = [ glib_networking ];
diff --git a/pkgs/development/libraries/libssh/default.nix b/pkgs/development/libraries/libssh/default.nix
index f8621f3b78b..c2b812744c9 100644
--- a/pkgs/development/libraries/libssh/default.nix
+++ b/pkgs/development/libraries/libssh/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib libgcrypt ];
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DWITH_GCRYPT=ON";
 
diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix
index f70f7d34801..f5c07f47379 100644
--- a/pkgs/development/libraries/libtasn1/default.nix
+++ b/pkgs/development/libraries/libtasn1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "libtasn1-2.12";
+  name = "libtasn1-2.13";
 
   src = fetchurl {
     url = "mirror://gnu/libtasn1/${name}.tar.gz";
-    sha256 = "0p8w38l04fgm82iqgl1abhb1ajp04v116bi6fd7lc3n80657l98f";
+    sha256 = "14asfhi35pwc67v7abbwim344h444237bjaqp92gwhhx7m44cvm5";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libtheora/default.nix b/pkgs/development/libraries/libtheora/default.nix
index e846b213ee0..cb936747417 100644
--- a/pkgs/development/libraries/libtheora/default.nix
+++ b/pkgs/development/libraries/libtheora/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation ({
   propagatedBuildInputs = [libogg libvorbis];
 
   crossAttrs = {
-    propagatedBuildInputs = [libogg.hostDrv tremor.hostDrv];
+    propagatedBuildInputs = [libogg.crossDrv tremor.crossDrv];
     configureFlags = "--disable-examples";
   };
 }
diff --git a/pkgs/development/libraries/libvisio/default.nix b/pkgs/development/libraries/libvisio/default.nix
index 99146cd02cc..77e7e0a56f6 100644
--- a/pkgs/development/libraries/libvisio/default.nix
+++ b/pkgs/development/libraries/libvisio/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1iqkz280mi066bdccyxagkqm41i270nx01cacvgjq2pflgd3njd1";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ boost libwpd libwpg ];
 
   configureFlags = "--disable-werror";
diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix
index efb210d6576..b1277b87e6a 100644
--- a/pkgs/development/libraries/libvorbis/default.nix
+++ b/pkgs/development/libraries/libvorbis/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1gby6hapz9njx4l9g0pndyk4q83z5fgrgc30mfwfgx7bllspsk43";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
   propagatedBuildInputs = [ libogg ];
 
   meta = {
diff --git a/pkgs/development/libraries/libwpd/0.8.nix b/pkgs/development/libraries/libwpd/0.8.nix
index ceaa0d36d4b..536db35fb4e 100644
--- a/pkgs/development/libraries/libwpd/0.8.nix
+++ b/pkgs/development/libraries/libwpd/0.8.nix
@@ -12,5 +12,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib libgsf libxml2 ];
 
-  buildNativeInputs = [ pkgconfig bzip2 ];
+  nativeBuildInputs = [ pkgconfig bzip2 ];
 }
diff --git a/pkgs/development/libraries/libwpd/default.nix b/pkgs/development/libraries/libwpd/default.nix
index d857b6e17ea..1c56022de58 100644
--- a/pkgs/development/libraries/libwpd/default.nix
+++ b/pkgs/development/libraries/libwpd/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ glib libgsf libxml2 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/libwpg/default.nix b/pkgs/development/libraries/libwpg/default.nix
index d140b8b8a0c..a97b8fc2fd8 100644
--- a/pkgs/development/libraries/libwpg/default.nix
+++ b/pkgs/development/libraries/libwpg/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libwpd ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://libwpg.sourceforge.net;
diff --git a/pkgs/development/libraries/libxklavier/default.nix b/pkgs/development/libraries/libxklavier/default.nix
index b50399d4f10..ac5c6146cba 100644
--- a/pkgs/development/libraries/libxklavier/default.nix
+++ b/pkgs/development/libraries/libxklavier/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   # TODO: enable xmodmap support, needs xmodmap DB
   propagatedBuildInputs = [ libX11 libXi xkeyboard_config libxml2 libICE glib libxkbfile isocodes ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = ''
     --with-xkb-base=${xkeyboard_config}/etc/X11/xkb
diff --git a/pkgs/development/libraries/lirc/default.nix b/pkgs/development/libraries/lirc/default.nix
index 20ef82401e6..75f175a5b2d 100644
--- a/pkgs/development/libraries/lirc/default.nix
+++ b/pkgs/development/libraries/lirc/default.nix
@@ -10,5 +10,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ alsaLib ];
 
-  configureFlags = "--with-driver=none --enable-sandboxed";
+  configureFlags = [
+    "--with-driver=devinput"
+    "--sysconfdir=$(out)/etc"
+    "--enable-sandboxed"
+  ];
 }
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index 3d5dff53ff4..f7f8514a396 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
 # TODO: make it load plugins from *_PLUGIN_PATH
-  buildNativeInputs = [pkgconfig intltool];
+  nativeBuildInputs = [pkgconfig intltool];
 
   propagatedBuildInputs = [alsaLib ffmpeg speex ortp pulseaudio xorg.libX11
     xorg.libXv xorg.libXext libv4l libtheora libvpx gsm ];
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index f72638677d1..d3f7afbd308 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
   buildInputs = [ expat libdrm libXxf86vm libXfixes libXdamage glproto dri2proto
     libxml2Python libX11 libXext libxcb libXt udev ];
 
-  buildNativeInputs = [ pkgconfig python makedepend file flex bison ];
+  nativeBuildInputs = [ pkgconfig python makedepend file flex bison ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/mythes/default.nix b/pkgs/development/libraries/mythes/default.nix
index ff06f2a0050..8fc160ae11d 100644
--- a/pkgs/development/libraries/mythes/default.nix
+++ b/pkgs/development/libraries/mythes/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ hunspell ];
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   meta = {
     homepage = http://hunspell.sourceforge.net/;
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index a6b9a69e6e1..569d7fe2a32 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation (rec {
     ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
   '';
 
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/ntrack/default.nix b/pkgs/development/libraries/ntrack/default.nix
index 95bde495c0e..13ab00e41be 100644
--- a/pkgs/development/libraries/ntrack/default.nix
+++ b/pkgs/development/libraries/ntrack/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnl qt4 ];
 
-  buildNativeInputs = [ pkgconfig python ];
+  nativeBuildInputs = [ pkgconfig python ];
 
   configureFlags = "--without-gobject CFLAGS=--std=gnu99";
 
diff --git a/pkgs/development/libraries/ogrepaged/default.nix b/pkgs/development/libraries/ogrepaged/default.nix
index 6b2b9c9e4a6..f508637dfef 100644
--- a/pkgs/development/libraries/ogrepaged/default.nix
+++ b/pkgs/development/libraries/ogrepaged/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ois ogre libX11 boost ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   cmakeFlags = "-DPAGEDGEOMETRY_BUILD_SAMPLES=OFF";
 
diff --git a/pkgs/development/libraries/openbabel/default.nix b/pkgs/development/libraries/openbabel/default.nix
index 455dbceff23..e6df13eed34 100644
--- a/pkgs/development/libraries/openbabel/default.nix
+++ b/pkgs/development/libraries/openbabel/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   # TODO : separate lib and apps
   buildInputs = [ zlib libxml2 eigen python cairo ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = {
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index 207c14bdce0..09a36247348 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/openssl/darwin-arch.patch b/pkgs/development/libraries/openssl/darwin-arch.patch
index 5d5a3afdd1d..63db3efc084 100644
--- a/pkgs/development/libraries/openssl/darwin-arch.patch
+++ b/pkgs/development/libraries/openssl/darwin-arch.patch
@@ -1,20 +1,12 @@
-diff -ru openssl-1.0.0g-orig/Configure openssl-1.0.0g/Configure
---- openssl-1.0.0g-orig/Configure	2011-12-19 18:04:38.000000000 +0100
-+++ openssl-1.0.0g/Configure	2012-01-23 13:45:23.644170171 +0100
-@@ -549,11 +549,11 @@
- 
- ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
- "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
--"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin-ppc-cc","cc:-O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin64-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"debug-darwin-i386-cc","cc:-g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin64-x86_64-cc","cc:-O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+diff -ru -x '*~' openssl-1.0.1c-orig/Configure openssl-1.0.1c/Configure
+--- openssl-1.0.1c-orig/Configure	2012-03-14 23:20:40.000000000 +0100
++++ openssl-1.0.1c/Configure	2012-12-18 17:29:30.268090633 +0100
+@@ -579,7 +579,7 @@
+ "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-x86_64-cc","cc:-O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
  "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
- 
- ##### A/UX
+ # iPhoneOS/iOS
+ "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 48574a332c8..1e4b7d2e009 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -2,7 +2,7 @@
 , withCryptodev ? false, cryptodevHeaders }:
 
 let
-  name = "openssl-1.0.0i";
+  name = "openssl-1.0.1c";
 
   opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
     (throw "openssl needs its platform name cross building" null)
@@ -30,7 +30,7 @@ let
         ]
 
     ++ stdenv.lib.optional stdenv.isDarwin ./darwin-arch.patch;
-  
+
 in
 
 stdenv.mkDerivation {
@@ -41,30 +41,33 @@ stdenv.mkDerivation {
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha1 = "b7aa11cbd7d264c2b1f44e3d55b334fb33f7b674";
+    sha256 = "1gjy6a7d8nszi9wq8jdzx3cffn0nss23h3cw2ywlw4cb9v6v77ia";
   };
 
   patches = patchesCross false;
 
   buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders;
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   # On x86_64-darwin, "./config" misdetects the system as
   # "darwin-i386-cc".  So specify the system type explicitly.
   configureScript =
     if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc" else "./config";
 
-  configureFlags = "shared --libdir=lib" +
+  configureFlags = "shared --libdir=lib --openssldir=etc/ssl" +
     stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS";
 
   makeFlags = "MANDIR=$(out)/share/man";
 
+  # Parallel building is broken in OpenSSL.
+  #enableParallelBuilding = true;
+
   postInstall =
     ''
       # If we're building dynamic libraries, then don't install static
       # libraries.
-      if [ -n "$(echo $out/lib/*.so)" ]; then
+      if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib)" ]; then
           rm $out/lib/*.a
       fi
     ''; # */
diff --git a/pkgs/development/libraries/pango/1.30.x.nix b/pkgs/development/libraries/pango/1.30.x.nix
index 7168c1b6c9d..2fd828a8737 100644
--- a/pkgs/development/libraries/pango/1.30.x.nix
+++ b/pkgs/development/libraries/pango/1.30.x.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optional stdenv.isDarwin gettext;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ x11 glib cairo libpng ];
 
diff --git a/pkgs/development/libraries/pangomm/2.28.x.nix b/pkgs/development/libraries/pangomm/2.28.x.nix
index 5cd4744fed3..7f4d14dfbac 100644
--- a/pkgs/development/libraries/pangomm/2.28.x.nix
+++ b/pkgs/development/libraries/pangomm/2.28.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "10kcdpg080m393f1vz0km41kd3483fkyabprm59gvjwklxkcp3bp";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ pango glibmm cairomm libpng ];
 
   meta = {
diff --git a/pkgs/development/libraries/pcre/8.30.nix b/pkgs/development/libraries/pcre/8.30.nix
deleted file mode 100644
index 2f636492eb6..00000000000
--- a/pkgs/development/libraries/pcre/8.30.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
-
-stdenv.mkDerivation rec {
-  name = "pcre-8.30";
-
-  src = fetchurl {
-    url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "c1113fd7db934e97ad8b3917d432e5b642e9eb9afd127eb797804937c965f4ac";
-  };
-
-  # The compiler on Darwin crashes with an internal error while building the
-  # C++ interface. Disabling optimizations on that platform remedies the
-  # problem. In case we ever update the Darwin GCC version, the exception for
-  # that platform ought to be removed.
-  configureFlags = ''
-    ${if unicodeSupport then "--enable-unicode-properties" else ""}
-    ${if !cplusplusSupport then "--disable-cpp" else ""}
-  '' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0";
-
-  doCheck = !stdenv.isCygwin;                   # XXX: test failure on Cygwin
-
-  meta = {
-    homepage = "http://www.pcre.org/";
-    description = "A library for Perl Compatible Regular Expressions";
-    license = "BSD-3";
-
-    longDescription = ''
-      The PCRE library is a set of functions that implement regular
-      expression pattern matching using the same syntax and semantics as
-      Perl 5. PCRE has its own native API, as well as a set of wrapper
-      functions that correspond to the POSIX regular expression API. The
-      PCRE library is free, even for building proprietary software.
-    '';
-
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-}
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index edfe26740de..e59c249348a 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
 
 stdenv.mkDerivation rec {
-  name = "pcre-8.21";
+  name = "pcre-8.31";
 
   src = fetchurl {
     url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "1qwrqldbwszbmr4cw4f0xmcl889cmmjbf58l9vxn89zw26fm1f54";
+    sha256 = "5778a02535473c7ee7838ea598c19f451e63cf5eec0bf0307a688301c9078c3c";
   };
 
   # The compiler on Darwin crashes with an internal error while building the
diff --git a/pkgs/development/libraries/pgen/default.nix b/pkgs/development/libraries/pgen/default.nix
index 91c9f16f5c8..53dc7a768ee 100644
--- a/pkgs/development/libraries/pgen/default.nix
+++ b/pkgs/development/libraries/pgen/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation ( rec {
   };
 
   buildInputs = [aterm toolbuslib cLibrary configSupport ptSupport ptableSupport errorSupport tideSupport sdfSupport sglr ascSupport asfSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } // ( if isMingw then { NIX_CFLAGS_COMPILE = "-O2 -Wl,--stack=0x2300000"; } else {} ) )
diff --git a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
index b2677eb1e7a..24a261065eb 100644
--- a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
+++ b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ phonon qt4 gstreamer gst_plugins_base ];
 
-  buildNativeInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
 
   meta = {
     homepage = http://phonon.kde.org/;
diff --git a/pkgs/development/libraries/phonon-backend-vlc/default.nix b/pkgs/development/libraries/phonon-backend-vlc/default.nix
index faa88f8854f..97e778cc1f5 100644
--- a/pkgs/development/libraries/phonon-backend-vlc/default.nix
+++ b/pkgs/development/libraries/phonon-backend-vlc/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     sha256 = "1233szd05ahaxyk1sjis374n90m40svfks2aq9jx3g3lxygzwmi2";
   };
 
-  buildNativeInputs = [ cmake automoc4 xz ];
+  nativeBuildInputs = [ cmake automoc4 xz ];
 
   buildInputs = [ qt4 vlc_ phonon ];
 
diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix
index 2c70957746d..bd74b937276 100644
--- a/pkgs/development/libraries/phonon/default.nix
+++ b/pkgs/development/libraries/phonon/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 pulseaudio ];
 
-  buildNativeInputs = [ cmake automoc4 ];
+  nativeBuildInputs = [ cmake automoc4 ];
 
   meta = {
     homepage = http://phonon.kde.org/;
diff --git a/pkgs/development/libraries/physfs/default.nix b/pkgs/development/libraries/physfs/default.nix
index fef902fec03..501516e8a5b 100644
--- a/pkgs/development/libraries/physfs/default.nix
+++ b/pkgs/development/libraries/physfs/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "02dwy0vsn2dp31f15vxd3yxxr1rgy25ab7ncavyh73i290qnsadf";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patchPhase = ''
     sed s,-Werror,, -i CMakeLists.txt
diff --git a/pkgs/development/libraries/plib/default.nix b/pkgs/development/libraries/plib/default.nix
index 679db72802c..5e15a63735e 100644
--- a/pkgs/development/libraries/plib/default.nix
+++ b/pkgs/development/libraries/plib/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
   };
 
-  NIX_CFLAGS_COMPILE = if (enablePIC) then "-fPIC" else "";
+  NIX_CFLAGS_COMPILE = if enablePIC then "-fPIC" else "";
 
   propagatedBuildInputs = [
     mesa freeglut SDL
diff --git a/pkgs/development/libraries/podofo/default.nix b/pkgs/development/libraries/podofo/default.nix
index 44ae11a6317..6b79482c330 100644
--- a/pkgs/development/libraries/podofo/default.nix
+++ b/pkgs/development/libraries/podofo/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0icpxh1l1dpviq2zwy764dhg8y03zwyf4pgw4s7kb165nvh9v5kv";
   };
   propagatedBuildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
   buildInputs = [ lua5 stdenv.gcc.libc ];
   cmakeFlags = "-DPODOFO_BUILD_SHARED=ON -DPODOFO_BUILD_STATIC=OFF";
 
diff --git a/pkgs/development/libraries/polkit-qt-1/default.nix b/pkgs/development/libraries/polkit-qt-1/default.nix
index 0c1a0a79584..13bc992d026 100644
--- a/pkgs/development/libraries/polkit-qt-1/default.nix
+++ b/pkgs/development/libraries/polkit-qt-1/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./polkit-install.patch ];
 
-  buildNativeInputs = [ cmake automoc4 ];
+  nativeBuildInputs = [ cmake automoc4 ];
 
   propagatedBuildInputs = [ polkit glib qt4 ];
 
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index d2ad4061567..2512979bfa3 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals gtkSupport [ glib gtk ]
     ++ stdenv.lib.optional qt4Support qt4;
 
-  buildNativeInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkgconfig cmake ];
 
   cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
 
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 8cad9022d91..b24b4e06cb9 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1sxviip4yk6gp453pid5scy1ba66dzdpr02i1416yk7lkv0x3yz3";
   };
 
-  buildNativeInputs = [ perl gnum4 ];
+  nativeBuildInputs = [ perl gnum4 ];
   propagatedBuildInputs = [ gmpxx ];
 
   configureFlags = "--disable-watchdog";
diff --git a/pkgs/development/libraries/prison/default.nix b/pkgs/development/libraries/prison/default.nix
index ca8ba46d7dc..7beb93eb462 100644
--- a/pkgs/development/libraries/prison/default.nix
+++ b/pkgs/development/libraries/prison/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 qrencode libdmtx ];
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "Qt4 library for QR-codes";
diff --git a/pkgs/development/libraries/pt-support/default.nix b/pkgs/development/libraries/pt-support/default.nix
index c2264eebddc..063fdd7cc04 100644
--- a/pkgs/development/libraries/pt-support/default.nix
+++ b/pkgs/development/libraries/pt-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation ( rec {
   };
 
   buildInputs = [aterm toolbuslib errorSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 } // ( if isMingw then { NIX_CFLAGS_COMPILE = "-O2 -Wl,--stack=0x2300000"; } else {} ) )
diff --git a/pkgs/development/libraries/ptable-support/default.nix b/pkgs/development/libraries/ptable-support/default.nix
index c95a82d4287..357d288c732 100644
--- a/pkgs/development/libraries/ptable-support/default.nix
+++ b/pkgs/development/libraries/ptable-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm ptSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/qca2/default.nix b/pkgs/development/libraries/qca2/default.nix
index 6af622c0a15..1da9ef193b5 100644
--- a/pkgs/development/libraries/qca2/default.nix
+++ b/pkgs/development/libraries/qca2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ qt4 ];
   
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
 
   preBuild =
     ''
diff --git a/pkgs/development/libraries/qca2/ossl.nix b/pkgs/development/libraries/qca2/ossl.nix
index 1e0c583b7a5..153d3ba5746 100644
--- a/pkgs/development/libraries/qca2/ossl.nix
+++ b/pkgs/development/libraries/qca2/ossl.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 =  "ef2c0307e8834e1e7cb23b6fea1cc22486328a37186301a6c11161b1c93d834b";
   };
   buildInputs = [ qt4 qca2 openssl ];
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
   dontAddPrefix = true;
   configureFlags="--no-separate-debug-info --with-qca=${qca2}
     --with-openssl-inc=${openssl}/include --with-openssl-lib=${openssl}/lib";
diff --git a/pkgs/development/libraries/qhull/default.nix b/pkgs/development/libraries/qhull/default.nix
index 6d15ce576ff..b81dbda1586 100644
--- a/pkgs/development/libraries/qhull/default.nix
+++ b/pkgs/development/libraries/qhull/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "127zpjp6sm8c101hz239k82lpxqcqf4ksdyfqc2py2sm22kclpm3";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DMAN_INSTALL_DIR=share/man/man1 -DDOC_INSTALL_DIR=share/doc/qhull";
 
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index ba796259f70..91eec5fcd31 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
     sha256 = "0jd4g3bwkgk2s4flbmgisyihm7cam964gzb3pawjlkhas01zghz8";
   };
 
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
   propagatedBuildInputs = [x11 libXft libXrender zlib libjpeg libpng];
 
   configureFlags = "
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 0acf5c07bbd..ee449f6471b 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -93,7 +93,7 @@ stdenv.mkDerivation rec {
       mysql postgresql sqlite libjpeg libmng libtiff icu ]
     ++ optionals gtkStyle [ gtk gdk_pixbuf ];
 
-  buildNativeInputs = [ perl pkgconfig which ];
+  nativeBuildInputs = [ perl pkgconfig which ];
 
   prefixKey = "-prefix ";
 
diff --git a/pkgs/development/libraries/rstore-support/default.nix b/pkgs/development/libraries/rstore-support/default.nix
index 95c6d0a0b52..c18f52e84d7 100644
--- a/pkgs/development/libraries/rstore-support/default.nix
+++ b/pkgs/development/libraries/rstore-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix
index 9f25011b76f..029deecb93a 100644
--- a/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ atlasMaybeShared ];
   buildInputs = [ gfortran cmake ];
-  buildNativeInputs = [ python ];
+  nativeBuildInputs = [ python ];
 
   cmakeFlags = [
     "-DUSE_OPTIMIZED_BLAS=ON"
diff --git a/pkgs/development/libraries/sdf-support/default.nix b/pkgs/development/libraries/sdf-support/default.nix
index 0604a099d3c..8095650b12f 100644
--- a/pkgs/development/libraries/sdf-support/default.nix
+++ b/pkgs/development/libraries/sdf-support/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
 
   buildInputs = [aterm toolbuslib errorSupport ptSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/sglr/default.nix b/pkgs/development/libraries/sglr/default.nix
index 449667c6b52..f6c14eae464 100644
--- a/pkgs/development/libraries/sglr/default.nix
+++ b/pkgs/development/libraries/sglr/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib cLibrary configSupport ptSupport ptableSupport errorSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/sofia-sip/default.nix b/pkgs/development/libraries/sofia-sip/default.nix
index 3ce49e8ffaf..950d1302dad 100644
--- a/pkgs/development/libraries/sofia-sip/default.nix
+++ b/pkgs/development/libraries/sofia-sip/default.nix
@@ -9,5 +9,5 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ glib openssl ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/soprano/default.nix b/pkgs/development/libraries/soprano/default.nix
index 7705ee1893d..7a3d6eacde5 100644
--- a/pkgs/development/libraries/soprano/default.nix
+++ b/pkgs/development/libraries/soprano/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   # We disable the Java backend, since we do not need them and they make the closure size much bigger
   buildInputs = [ qt4 clucene_core librdf_redland libiodbc ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = {
     homepage = http://soprano.sourceforge.net/;
diff --git a/pkgs/development/libraries/soqt/default.nix b/pkgs/development/libraries/soqt/default.nix
index 60b148f870e..80fbb53953a 100644
--- a/pkgs/development/libraries/soqt/default.nix
+++ b/pkgs/development/libraries/soqt/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ coin3d qt4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.coin3d.org/;
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index fc2e5bb72c5..2bcb9e593b8 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
                   libXrandr libXfixes libXrender libXext libXinerama
                   python pyparsing ];
 
-  buildNativeInputs = [ pkgconfig spice_protocol ];
+  nativeBuildInputs = [ pkgconfig spice_protocol ];
 
   NIX_CFLAGS_COMPILE = "-fno-stack-protector";
 
diff --git a/pkgs/development/libraries/sqlite/full.nix b/pkgs/development/libraries/sqlite/full.nix
index ccb960643bd..c6ef448ea12 100644
--- a/pkgs/development/libraries/sqlite/full.nix
+++ b/pkgs/development/libraries/sqlite/full.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ readline ncurses ];
-  buildNativeInputs = [ tcl ];
+  nativeBuildInputs = [ tcl ];
 
   doCheck = true;
   checkTarget = "test";
diff --git a/pkgs/development/libraries/strigi/default.nix b/pkgs/development/libraries/strigi/default.nix
index 6d7212f5c5c..465a5d80ae0 100644
--- a/pkgs/development/libraries/strigi/default.nix
+++ b/pkgs/development/libraries/strigi/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ zlib bzip2 stdenv.gcc.libc libxml2 qt4 exiv2 clucene_core fam dbus_tools ];
 
-  buildNativeInputs = [ cmake pkgconfig perl ];
+  nativeBuildInputs = [ cmake pkgconfig perl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/taglib-extras/default.nix b/pkgs/development/libraries/taglib-extras/default.nix
index de0c7ba2b75..05fe67eb9d7 100644
--- a/pkgs/development/libraries/taglib-extras/default.nix
+++ b/pkgs/development/libraries/taglib-extras/default.nix
@@ -7,5 +7,5 @@ stdenv.mkDerivation rec {
     sha256 = "0cln49ws9svvvals5fzxjxlzqm0fzjfymn7yfp4jfcjz655nnm7y";
   };
   buildInputs = [ taglib ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 }
diff --git a/pkgs/development/libraries/taglib/default.nix b/pkgs/development/libraries/taglib/default.nix
index 8157ca269aa..0842836ccec 100644
--- a/pkgs/development/libraries/taglib/default.nix
+++ b/pkgs/development/libraries/taglib/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = "-DWITH_ASF=ON -DWITH_MP4=ON";
 
   buildInputs = [zlib];
-  buildNativeInputs = [cmake];
+  nativeBuildInputs = [cmake];
 
   meta = {
     homepage = http://developer.kde.org/~wheeler/taglib.html;
diff --git a/pkgs/development/libraries/telepathy/farstream/default.nix b/pkgs/development/libraries/telepathy/farstream/default.nix
index a183737dc9b..b6b96a2439f 100644
--- a/pkgs/development/libraries/telepathy/farstream/default.nix
+++ b/pkgs/development/libraries/telepathy/farstream/default.nix
@@ -13,5 +13,5 @@ stdenv.mkDerivation rec {
   buildInputs = [ gst_plugins_base gst_python pygobject ];
 
   propagatedBuildInputs = [ dbus_glib farstream telepathy_glib gstreamer ];
-  buildNativeInputs = [ pkgconfig python libxslt];
+  nativeBuildInputs = [ pkgconfig python libxslt];
 }
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 64067a61e3e..a4c90cd1c61 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0rwyxjk6646r43mvsg01q7rfsah0ni05fa8gxzlx1zhj76db95yh";
   };
 
-  buildNativeInputs = [ cmake pkgconfig python libxslt ];
+  nativeBuildInputs = [ cmake pkgconfig python libxslt ];
   propagatedBuildInputs = [ qt4 dbus_glib telepathy_farstream telepathy_glib ];
   preBuild = ''
     NIX_CFLAGS_COMPILE+=" `pkg-config --cflags dbus-glib-1`"
diff --git a/pkgs/development/libraries/tide-support/default.nix b/pkgs/development/libraries/tide-support/default.nix
index a778535f362..d30d316c0dc 100644
--- a/pkgs/development/libraries/tide-support/default.nix
+++ b/pkgs/development/libraries/tide-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];    
+  nativeBuildInputs = [pkgconfig];    
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/tokyo-tyrant/default.nix b/pkgs/development/libraries/tokyo-tyrant/default.nix
index 63319213312..b623c773142 100644
--- a/pkgs/development/libraries/tokyo-tyrant/default.nix
+++ b/pkgs/development/libraries/tokyo-tyrant/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "13xqcinhydqmh7231qlir6pymacjwcf98drybkhd9597kzxp1bs2";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ tokyocabinet ];
 
   doCheck = false;                                # FIXME
diff --git a/pkgs/development/libraries/toolbuslib/default.nix b/pkgs/development/libraries/toolbuslib/default.nix
index 4d184b11abd..16680f0134c 100644
--- a/pkgs/development/libraries/toolbuslib/default.nix
+++ b/pkgs/development/libraries/toolbuslib/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
   
   buildInputs = [aterm] ++ (if isMingw then [w32api] else []);
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw; 
 }  
diff --git a/pkgs/development/libraries/tremor/default.nix b/pkgs/development/libraries/tremor/default.nix
index 2770fadf004..d55ea6166e8 100644
--- a/pkgs/development/libraries/tremor/default.nix
+++ b/pkgs/development/libraries/tremor/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "161411cbefa1527da7a8fc087e78d8e21d19143d3a6eb42fb281e5026aad7568";
   };
 
-  buildNativeInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
   propagatedBuildInputs = [ libogg ];
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index 1fd6179183f..1634be1363a 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       ln -sv ${gyp}/bin/gyp build/gyp/gyp
     '';
 
-    buildNativeInputs = stdenv.lib.optional (system == "i686-linux") which;
+    nativeBuildInputs = stdenv.lib.optional (system == "i686-linux") which;
     buildInputs = [ readline python ];
 
     buildFlags = [
diff --git a/pkgs/development/libraries/vcdimager/default.nix b/pkgs/development/libraries/vcdimager/default.nix
index 6940f88ffbe..58b9d2f2573 100644
--- a/pkgs/development/libraries/vcdimager/default.nix
+++ b/pkgs/development/libraries/vcdimager/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1526jxynslg07i50v3c3afhc8swbd4si8y6s8m3h1wrz6mkplp87";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ libxml2 popt ];
 
diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix
index 01ccb23b77c..2f169f3f25d 100644
--- a/pkgs/development/libraries/vxl/default.nix
+++ b/pkgs/development/libraries/vxl/default.nix
@@ -9,7 +9,10 @@ stdenv.mkDerivation {
 
   buildInputs = [ cmake unzip libtiff expat zlib libpng libjpeg ];
 
-  cmakeFlags = "-DBUILD_TESTING=OFF " + (if (stdenv.system == "x86_64-linux") then
+  # BUILD_OUL wants old linux headers for videodev.h, not available
+  # in stdenv linux headers
+  cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF "
+    + (if stdenv.system == "x86_64-linux" then
       "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
     else
       "");
diff --git a/pkgs/development/libraries/wxGTK-2.8/default.nix b/pkgs/development/libraries/wxGTK-2.8/default.nix
index 43bcfea4f2e..10907726954 100644
--- a/pkgs/development/libraries/wxGTK-2.8/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.8/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   buildInputs = [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer gst_plugins_base GConf ]
     ++ optional withMesa mesa;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [
     "--enable-gtk2"
diff --git a/pkgs/development/libraries/wxGTK-2.9/default.nix b/pkgs/development/libraries/wxGTK-2.9/default.nix
index 21a80d8951f..fca5a4a278e 100644
--- a/pkgs/development/libraries/wxGTK-2.9/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.9/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   buildInputs = [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer gst_plugins_base GConf ]
     ++ optional withMesa mesa;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [
     "--enable-gtk2"
diff --git a/pkgs/development/libraries/xine-lib/default.nix b/pkgs/development/libraries/xine-lib/default.nix
index 4ae48a4c04e..45c60acfa89 100644
--- a/pkgs/development/libraries/xine-lib/default.nix
+++ b/pkgs/development/libraries/xine-lib/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1mjk686h1qzqj51h4xs4xvagfgnnhm8czbzzjvr5w034pr8n8rg1";
   };
 
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   buildInputs = [
     xorg.libX11 xorg.libXv xorg.libXinerama xorg.libxcb xorg.libXext
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 5e1ddf83951..ec47c35c153 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-static-libgcc";
 
   crossAttrs = {
-    dontStrip = if static then true else false;
+    dontStrip = static;
   } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
     configurePhase=''
       installFlags="BINARY_PATH=$out/bin INCLUDE_PATH=$out/include LIBRARY_PATH=$out/lib"
diff --git a/pkgs/development/mobile/androidenv/build-app.nix b/pkgs/development/mobile/androidenv/build-app.nix
index 571cd2be623..d4df64e79c0 100644
--- a/pkgs/development/mobile/androidenv/build-app.nix
+++ b/pkgs/development/mobile/androidenv/build-app.nix
@@ -6,7 +6,7 @@
 assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null;
 
 let
-  platformName = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then "linux"
+  platformName = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then "linux"
     else if stdenv.system == "x86_64-darwin" then "macosx"
     else throw "Platform: ${stdenv.system} is not supported!";
 
diff --git a/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix b/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
index 9385981e2c3..70c2a294d6f 100644
--- a/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
+++ b/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
@@ -21,7 +21,6 @@ buildPerlPackage rec {
   doCheck = !stdenv.isDarwin;
 
   meta = {
-    homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
     license = "perl5";
   };
 }
diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh
index df2fe853b4a..7c51bf1b591 100644
--- a/pkgs/development/perl-modules/generic/builder.sh
+++ b/pkgs/development/perl-modules/generic/builder.sh
@@ -33,8 +33,8 @@ postFixup() {
     # dependencies in the user environment (since Perl modules don't
     # have something like an RPATH, so the only way to find the
     # dependencies is to have them in the PERL5LIB variable).
-    if test -e $out/nix-support/propagated-build-native-inputs; then
-        ln -s $out/nix-support/propagated-build-native-inputs $out/nix-support/propagated-user-env-packages
+    if test -e $out/nix-support/propagated-native-build-inputs; then
+        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
     fi
 }
 
diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix
index 70bf92f0ae9..f72fbff1806 100644
--- a/pkgs/development/python-modules/generic/default.nix
+++ b/pkgs/development/python-modules/generic/default.nix
@@ -23,7 +23,7 @@
     ''
       easy_install --always-unzip --prefix="$out" .
     ''
-    
+
 , preConfigure ? "true"
 
 , buildPhase ? "true"
@@ -100,7 +100,16 @@ python.stdenv.mkDerivation (attrs // {
     ''
       wrapPythonPrograms
 
-      for inputsfile in propagated-build-inputs propagated-build-native-inputs; do
+      # If a user installs a Python package, she probably also wants its
+      # dependencies in the user environment (since Python modules don't
+      # have something like an RPATH, so the only way to find the
+      # dependencies is to have them in the PYTHONPATH variable).
+      if test -e $out/nix-support/propagated-build-inputs; then
+          ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
+      fi
+
+      createBuildInputsPth build-inputs "$buildInputStrings"
+      for inputsfile in propagated-build-inputs propagated-native-build-inputs; do
         if test -e $out/nix-support/$inputsfile; then
             createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
         fi
diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh
index d42be146955..6b02369927b 100644
--- a/pkgs/development/python-modules/generic/wrap.sh
+++ b/pkgs/development/python-modules/generic/wrap.sh
@@ -37,7 +37,7 @@ _addToPythonPath() {
     pythonPathsSeen[$dir]=1
     addToSearchPath program_PYTHONPATH $dir/lib/@libPrefix@/site-packages
     addToSearchPath program_PATH $dir/bin
-    local prop="$dir/nix-support/propagated-build-native-inputs"
+    local prop="$dir/nix-support/propagated-native-build-inputs"
     if [ -e $prop ]; then
         local i
         for i in $(cat $prop); do
diff --git a/pkgs/development/python-modules/python-sip/default.nix b/pkgs/development/python-modules/python-sip/default.nix
index 34daf294358..7c1eca02745 100644
--- a/pkgs/development/python-modules/python-sip/default.nix
+++ b/pkgs/development/python-modules/python-sip/default.nix
@@ -4,7 +4,10 @@ stdenv.mkDerivation rec {
   name = "sip-4.13.2";
   
   src = fetchurl {
-    url = "http://www.riverbankcomputing.co.uk/static/Downloads/sip4/${name}.tar.gz";
+    urls = [
+      "http://www.riverbankcomputing.co.uk/static/Downloads/sip4/${name}.tar.gz"
+      "http://pkgs.fedoraproject.org/repo/pkgs/sip/${name}.tar.gz/5a12ea8e8a09b879ed2b3817e30fbc84/${name}.tar.gz"
+    ];
     sha256 = "1gzff61bi22g6fkdg9iya4q2qfdkwxs19v4rhhf8x4bm7hszbhsb";
   };
   
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index c437d171aa9..84e1000f6b9 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation (rec {
 
   # Perl is needed for `cg_annotate'.
   # GDB is needed to provide a sane default for `--db-command'.
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin) gdb;
 
   configureFlags =
diff --git a/pkgs/development/tools/documentation/doxygen/1.7.nix b/pkgs/development/tools/documentation/doxygen/1.7.nix
index 86f2e8cf2b2..f530ed70e37 100644
--- a/pkgs/development/tools/documentation/doxygen/1.7.nix
+++ b/pkgs/development/tools/documentation/doxygen/1.7.nix
@@ -47,6 +47,6 @@ stdenv.mkDerivation {
     '';
 
     maintainers = [stdenv.lib.maintainers.simons];
-    platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
+    platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix
index 07893987bbf..047da44a793 100644
--- a/pkgs/development/tools/documentation/doxygen/default.nix
+++ b/pkgs/development/tools/documentation/doxygen/default.nix
@@ -47,6 +47,6 @@ stdenv.mkDerivation {
     '';
 
     maintainers = [stdenv.lib.maintainers.simons];
-    platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
+    platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
index ad1be726578..374002e8d6c 100644
--- a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
+++ b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
@@ -14,5 +14,5 @@ stdenv.mkDerivation {
   pythonPath = [ libxml2Python ];
   postInstall = "wrapPythonPrograms";
 
-  buildNativeInputs = [ pkgconfig intltool pythonPackages.wrapPython ];
+  nativeBuildInputs = [ pkgconfig intltool pythonPackages.wrapPython ];
 }
diff --git a/pkgs/development/tools/misc/automake/automake-1.11.x.nix b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
index 7c9d06baa54..91c27deb8b8 100644
--- a/pkgs/development/tools/misc/automake/automake-1.11.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? true}:
+{ stdenv, fetchurl, perl, autoconf, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "automake-1.11.6";
@@ -19,8 +19,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [perl autoconf makeWrapper];
 
-  inherit doCheck;
-
   # Disable indented log output from Make, otherwise "make.test" will
   # fail.
   preCheck = "unset NIX_INDENT_MAKE";
diff --git a/pkgs/development/tools/misc/automake/automake-1.12.x.nix b/pkgs/development/tools/misc/automake/automake-1.12.x.nix
index e2db84d2fc3..bd609c4a40d 100644
--- a/pkgs/development/tools/misc/automake/automake-1.12.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.12.x.nix
@@ -1,7 +1,7 @@
-{stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? true}:
+{ stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? false }:
 
 stdenv.mkDerivation rec {
-  name = "automake-1.12.2";
+  name = "automake-1.12.4";
 
   # TODO: Remove the `aclocal' wrapper when $ACLOCAL_PATH support is
   # available upstream; see
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/automake/${name}.tar.xz";
-    sha256 = "5fb56e918189b377a22368e19baaf70252bd85a9969ed5f8a8373f49e8faf07f";
+    sha256 = "0wppdm0wfizs6nmiwlkigcmh2pn33dywdkl7b407j3pvwn622vsi";
   };
 
   buildInputs = [perl autoconf makeWrapper];
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 353cd9f40bc..c3f9de4bc89 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, noSysDirs, zlib, cross ? null, gold ? false, bison ? null, flex2535 ? null, bc ? null, dejagnu ? null }:
 
-let basename = "binutils-2.21.1a"; in
+let basename = "binutils-2.23.1"; in
 stdenv.mkDerivation rec {
   name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "0m7nmd7gc9d9md43wbrv65hz6lbi2crqwryzpigv19ray1lzmv6d";
+    sha256 = "06bs5v5ndb4g5qx96d52lc818gkbskd1m0sz57314v887sqfbcia";
   };
 
   patches = [
@@ -14,6 +14,11 @@ stdenv.mkDerivation rec {
     # RUNPATH instead of RPATH on binaries.  This is important because
     # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime.
     ./new-dtags.patch
+
+    # Since binutils 2.22, DT_NEEDED flags aren't copied for dynamic outputs.
+    # That requires upstream changes for things to work. So we can patch it to
+    # get the old behaviour by now.
+    ./dtneeded.patch
   ];
 
   buildInputs =
diff --git a/pkgs/development/tools/misc/binutils/dtneeded.patch b/pkgs/development/tools/misc/binutils/dtneeded.patch
new file mode 100644
index 00000000000..3754ec569ee
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/dtneeded.patch
@@ -0,0 +1,12 @@
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index 15f8ebf..f71241e 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -298,6 +298,7 @@ main (int argc, char **argv)
+   lang_init ();
+   ldemul_before_parse ();
+   lang_has_input_file = FALSE;
++  input_flags.add_DT_NEEDED_for_dynamic = TRUE;
+   parse_args (argc, argv);
+ 
+   if (config.hash_table_size != 0)
diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix
index b9d2c10f537..3a83b1ba325 100644
--- a/pkgs/development/tools/misc/cscope/default.nix
+++ b/pkgs/development/tools/misc/cscope/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--with-ncurses=${ncurses}";
 
   buildInputs = [ ncurses ];
-  buildNativeInputs = [ pkgconfig emacs ];
+  nativeBuildInputs = [ pkgconfig emacs ];
 
   postInstall = ''
     # Install Emacs mode.
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     postInstall = "";
-    propagatedBuildInputs = [ ncurses.hostDrv ];
+    propagatedBuildInputs = [ ncurses.crossDrv ];
   };
 
   meta = {
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 61b4647552d..5a1a19068a7 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -21,14 +21,14 @@ stdenv.mkDerivation rec {
 
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
   # as the host-bzip2 will be in the path.
-  buildNativeInputs = [m4 bison flex gettext bzip2];
+  nativeBuildInputs = [m4 bison flex gettext bzip2];
   buildInputs = [zlib bzip2];
 
   crossAttrs = {
 
     /* Having bzip2 will harm, because anything using elfutils 
        as buildInput cross-building, will not be able to run 'bzip2' */
-    propagatedBuildInputs = [ zlib.hostDrv ];
+    propagatedBuildInputs = [ zlib.crossDrv ];
 
     # This program does not cross-build fine. So I only cross-build some parts
     # I need for the linux perf tool.
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 08fde14eb53..a220f653abf 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -11,8 +11,8 @@ let
   basename = "gdb-7.5";
 
   # Whether (cross-)building for GNU/Hurd.  This is an approximation since
-  # having `stdenv ? cross' doesn't tell us if we're building `hostDrv' and
-  # `buildDrv'.
+  # having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
+  # `nativeDrv'.
   isGNU =
       stdenv.system == "i686-gnu"
       || (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   # I think python is not a native input, but I leave it
   # here while I will not need it cross building
-  buildNativeInputs = [ texinfo python ]
+  nativeBuildInputs = [ texinfo python ]
     ++ stdenv.lib.optional isGNU mig;
 
   buildInputs = [ ncurses readline gmp mpfr expat ]
@@ -51,8 +51,8 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     # Do not add --with-python here to avoid cross building it.
     configureFlags =
-      '' --with-gmp=${gmp.hostDrv} --with-mpfr=${mpfr.hostDrv} --with-system-readline
-         --with-expat --with-libexpat-prefix=${expat.hostDrv} --without-python
+      '' --with-gmp=${gmp.crossDrv} --with-mpfr=${mpfr.crossDrv} --with-system-readline
+         --with-expat --with-libexpat-prefix=${expat.crossDrv} --without-python
       '' + stdenv.lib.optionalString (target != null)
          " --target=${target.config}";
   };
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index 1f026f12f52..d1b0d0e376e 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     && !stdenv.isSunOS;                    # XXX: `test-setlocale2.sh' fails
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ];
+  patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ./no-gets.patch ];
 
   meta = {
     homepage = http://www.gnu.org/software/m4/;
diff --git a/pkgs/development/tools/misc/gnum4/no-gets.patch b/pkgs/development/tools/misc/gnum4/no-gets.patch
new file mode 100644
index 00000000000..456c08b56c3
--- /dev/null
+++ b/pkgs/development/tools/misc/gnum4/no-gets.patch
@@ -0,0 +1,26 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/m4/files/m4-1.4.16-no-gets.patch?revision=1.1
+
+https://bugs.gentoo.org/424978
+
+hack until m4 pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix
index 403381af485..4c3500c65a2 100644
--- a/pkgs/development/tools/misc/libtool/libtool2.nix
+++ b/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation (rec {
     sha256 = "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk";
   };
 
-  buildNativeInputs = [ lzma m4 perl ];
+  nativeBuildInputs = [ lzma m4 perl ];
 
   # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
   # "fixed" path in generated files!
diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix
index 3589ffb5a07..d5bb2b06e12 100644
--- a/pkgs/development/tools/misc/strace/default.nix
+++ b/pkgs/development/tools/misc/strace/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764";
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     homepage = http://strace.sourceforge.net/;
diff --git a/pkgs/development/tools/misc/texinfo/default.nix b/pkgs/development/tools/misc/texinfo/default.nix
index 111f2d14200..9a41d296342 100644
--- a/pkgs/development/tools/misc/texinfo/default.nix
+++ b/pkgs/development/tools/misc/texinfo/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ncurses ];
-  buildNativeInputs = [ lzma ];
+  nativeBuildInputs = [ lzma ];
 
   # Disabled because we don't have zdiff in the stdenv bootstrap.
   #doCheck = true;
diff --git a/pkgs/development/tools/misc/xxdiff/default.nix b/pkgs/development/tools/misc/xxdiff/default.nix
index 1a44cd4bcbf..461c602a886 100644
--- a/pkgs/development/tools/misc/xxdiff/default.nix
+++ b/pkgs/development/tools/misc/xxdiff/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = "7ae7d81becc25b1adabc9383bb5b9005dddb31510cdc404ce8a0d6ff6c3dc47e";
   };
 
-  buildNativeInputs = [ flex bison qt4 ];
+  nativeBuildInputs = [ flex bison qt4 ];
 
   buildInputs = [ qt4 ];
 
diff --git a/pkgs/development/tools/parsing/bison/bison-1.875.nix b/pkgs/development/tools/parsing/bison/bison-1.875.nix
deleted file mode 100644
index 3ee12a252ce..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-1.875.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-assert m4 != null;
-
-stdenv.mkDerivation {
-  name = "bison-1.875";
-  src = fetchurl {
-    url = mirror://gnu/bison/bison-1.875.tar.bz2;
-    md5 = "b7f8027b249ebd4dd0cc948943a71af0";
-  };
-  buildInputs = [m4];
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.3.nix b/pkgs/development/tools/parsing/bison/bison-2.3.nix
deleted file mode 100644
index fcf4ed10795..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.3.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-assert m4 != null;
-
-stdenv.mkDerivation {
-  name = "bison-2.3";
-  src = fetchurl {
-    url = mirror://gnu/bison/bison-2.3.tar.bz2;
-    md5 = "c18640c6ec31a169d351e3117ecce3ec";
-  };
-
-  buildNativeInputs = [m4];
-  propagatedBuildInputs = [m4];
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv2+";
-  };
- 
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.4.nix b/pkgs/development/tools/parsing/bison/bison-2.4.nix
deleted file mode 100644
index a79a5e96381..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.4.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-stdenv.mkDerivation rec {
-  name = "bison-2.4.3";
-
-  src = fetchurl {
-    url = "mirror://gnu/bison/${name}.tar.bz2";
-    sha256 = "019s3pdzggb71g7p7dgajhh53gh0h6nfl4yrzrs0jzsc37ph4lwk";
-  };
-
-  buildNativeInputs = [m4];
-
-  doCheck = true;
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-  };
-
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.5.nix b/pkgs/development/tools/parsing/bison/bison-2.5.nix
deleted file mode 100644
index ea50b859020..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.5.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ stdenv, fetchurl, m4, perl }:
-
-stdenv.mkDerivation rec {
-  name = "bison-2.5";
-
-  src = fetchurl {
-    url = "mirror://gnu/bison/${name}.tar.bz2";
-    sha256 = "1f1rai3v6k6xjii94964iq0alhc2hxwapqa363nfj8rbxvv0sdqa";
-  };
-
-  buildNativeInputs = [ m4 ]
-    ++ stdenv.lib.optional doCheck perl;
-  propagatedBuildInputs = [ m4 ];
-
-  M4 = "${m4}/bin/m4";
-
-  doCheck = true;
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-  };
-
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.6.nix b/pkgs/development/tools/parsing/bison/default.nix
index ea43d30410e..b397a22443a 100644
--- a/pkgs/development/tools/parsing/bison/bison-2.6.nix
+++ b/pkgs/development/tools/parsing/bison/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
-  name = "bison-2.6.2";
+  name = "bison-2.6.5";
 
   src = fetchurl {
     url = "mirror://gnu/bison/${name}.tar.xz";
-    sha256 = "79503f80397c30ac81b62eca5ffeaccaed72fdfeddb76257efcf8c3ca24be03d";
+    sha256 = "8640d5b51aad462db6863711f333a9159836853e0b1e79fdef708c6efb5cd52b";
   };
 
-  buildNativeInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl;
+  nativeBuildInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl;
   propagatedBuildInputs = [ m4 ];
 
   doCheck = true;
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix b/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
index 66ece227c92..21180e7d185 100644
--- a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "0ysff249mwhq0053bw3hxh58djc0gy7vjan2z1krrf9n5d5vvv0b";
   };
   buildInputs = [yacc];
-  propagatedBuildNativeInputs = [m4];
+  propagatedNativeBuildInputs = [m4];
 
   crossAttrs = {
     preConfigure = ''
diff --git a/pkgs/development/tools/phantomjs/default.nix b/pkgs/development/tools/phantomjs/default.nix
index 33b99e12de5..5d9433cc5ca 100644
--- a/pkgs/development/tools/phantomjs/default.nix
+++ b/pkgs/development/tools/phantomjs/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
             sha256 = "1m14czhi3b388didn0a881glsx8bnsg9gnxgj5lghr4l5mgqyrd7";
           };
 
-  buildNativeInputs = stdenv.lib.optional (stdenv.system == "x86_64-linux") upx;
+  nativeBuildInputs = stdenv.lib.optional (stdenv.system == "x86_64-linux") upx;
 
   buildPhase = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
     upx -d bin/phantomjs
diff --git a/pkgs/development/web/nodejs/build-node-package.nix b/pkgs/development/web/nodejs/build-node-package.nix
index 95d10db167f..e90e9446846 100644
--- a/pkgs/development/web/nodejs/build-node-package.nix
+++ b/pkgs/development/web/nodejs/build-node-package.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation ({
     runHook postBuild
   '';
 
-  buildNativeInputs = neededNatives;
+  nativeBuildInputs = neededNatives;
 
   installPhase = ''
     runHook preInstall
diff --git a/pkgs/games/andyetitmoves/default.nix b/pkgs/games/andyetitmoves/default.nix
index 6234d3702f7..cf3f6e1563b 100644
--- a/pkgs/games/andyetitmoves/default.nix
+++ b/pkgs/games/andyetitmoves/default.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     cp -r * $out/opt/andyetitmoves/
 
     fullPath=${stdenv.gcc.gcc}/lib64
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath''${fullPath:+:}$i/lib
     done
 
diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix
index 7aaf3238308..049f10ad15b 100644
--- a/pkgs/games/freeciv/default.nix
+++ b/pkgs/games/freeciv/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n3ak0y9hj9kha0r3cdbi8zb47vrgal1jsbblamqgwwwgzy8cri3";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ zlib bzip2 ]
     ++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype ]
diff --git a/pkgs/games/naev/default.nix b/pkgs/games/naev/default.nix
index 2e25cf4afb6..4516afaef6d 100644
--- a/pkgs/games/naev/default.nix
+++ b/pkgs/games/naev/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ SDL SDL_mixer openal libxml2 libvorbis libpng mesa zlib ];
 
-  buildNativeInputs = [ pkgconfig makeWrapper ];
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
 
   NIX_CFLAGS_COMPILE="-include ${zlib}/include/zlib.h";
 
diff --git a/pkgs/games/prboom/default.nix b/pkgs/games/prboom/default.nix
index f66e2295a22..95ad53cb1ae 100644
--- a/pkgs/games/prboom/default.nix
+++ b/pkgs/games/prboom/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ SDL SDL_mixer SDL_net mesa ];
   crossAttrs = {
-    propagatedBuildInputs = [ SDL.hostDrv SDL_mixer.hostDrv SDL_net.hostDrv ];
+    propagatedBuildInputs = [ SDL.crossDrv SDL_mixer.crossDrv SDL_net.crossDrv ];
     configureFlags = "--disable-gl --disable-cpu-opt --without-x --disable-sdltest
       ac_cv_type_uid_t=yes ac_cv_type_gid_t=yes";
 
diff --git a/pkgs/games/scorched3d/default.nix b/pkgs/games/scorched3d/default.nix
index 63fae5df0fc..3848f22ed20 100644
--- a/pkgs/games/scorched3d/default.nix
+++ b/pkgs/games/scorched3d/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     [ mesa openal freealut wxGTK freetype fftwSinglePrec SDL_net zlib libpng libjpeg
     libogg libvorbis ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   patches = [ ./file-existence.patch ];
 
diff --git a/pkgs/games/torcs/default.nix b/pkgs/games/torcs/default.nix
index da4fd01d3a9..f5b713ae337 100644
--- a/pkgs/games/torcs/default.nix
+++ b/pkgs/games/torcs/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ mesa freeglut libX11 plib openal freealut libXrandr xproto
     libXext libSM libICE libXi libXt libXrender libXxf86vm libpng zlib libvorbis ];
 
-  buildNativeInputs = [ bash ];
+  nativeBuildInputs = [ bash ];
 
   installTargets = "install datainstall";
 
diff --git a/pkgs/lib/customisation.nix b/pkgs/lib/customisation.nix
index 54965ffb580..18cec3209f9 100644
--- a/pkgs/lib/customisation.nix
+++ b/pkgs/lib/customisation.nix
@@ -34,7 +34,7 @@ rec {
   overrideDerivation = drv: f:
     let
       # Filter out special attributes.
-      drop = [ "meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
+      drop = [ "meta" "passthru" "outPath" "drvPath" "crossDrv" "nativeDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
               # also drop functions such as .merge .override etc
              ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
       attrs = removeAttrs drv drop;
@@ -44,10 +44,10 @@ rec {
         passthru = if drv ? passthru then drv.passthru else {};
       }
       //
-      (if (drv ? hostDrv && drv ? buildDrv)
+      (if (drv ? crossDrv && drv ? nativeDrv)
        then {
-         hostDrv = overrideDerivation drv.hostDrv f;
-         buildDrv = overrideDerivation drv.buildDrv f;
+         crossDrv = overrideDerivation drv.crossDrv f;
+         nativeDrv = overrideDerivation drv.nativeDrv f;
        }
        else { });
 
diff --git a/pkgs/lib/debug.nix b/pkgs/lib/debug.nix
index b78f946c5d4..d627bc861ab 100644
--- a/pkgs/lib/debug.nix
+++ b/pkgs/lib/debug.nix
@@ -95,7 +95,7 @@ rec {
           else if isInt x then true
           else if x == null then true
           else true; # a (store) path?
-    in if (traverse x) then x else throw "else never reached";
+    in if traverse x then x else throw "else never reached";
 
   # example: (traceCallXml "myfun" id 3) will output something like
   # calling myfun arg 1: 3 result: 3
diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index 39a3ad258b0..79504f7d886 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -53,7 +53,7 @@ rec {
           f :        # the function applied to the arguments
           initial :  # you pass attrs, the functions below are passing a function taking the fix argument
     let
-        takeFixed = if (isFunction initial) then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
+        takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
         tidy = args : 
             let # apply all functions given in "applyPreTidy" in sequence
                 applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
@@ -106,11 +106,11 @@ rec {
   # shortcut for attrByPath ["name"] default attrs
   maybeAttrNullable = name: default: attrs:
     if attrs == null then default else 
-    if (__hasAttr name attrs) then (__getAttr name attrs) else default;
+    if __hasAttr name attrs then (__getAttr name attrs) else default;
 
   # shortcut for attrByPath ["name"] default attrs
   maybeAttr = name: default: attrs:
-    if (__hasAttr name attrs) then (__getAttr name attrs) else default;
+    if __hasAttr name attrs then (__getAttr name attrs) else default;
 
 
   # Return the second argument if the first one is true or the empty version
@@ -120,14 +120,14 @@ rec {
     else if builtins.isList val then []
     else if builtins.isAttrs val then {}
     # else if builtins.isString val then ""
-    else if (val == true || val == false) then false
+    else if val == true || val == false then false
     else null;
 
     
   # Return true only if there is an attribute and it is true.
   checkFlag = attrSet: name:
-        if (name == "true") then true else
-        if (name == "false") then false else
+        if name == "true" then true else
+        if name == "false" then false else
         if (elem name (attrByPath ["flags"] [] attrSet)) then true else
         attrByPath [name] false attrSet ;
 
@@ -170,7 +170,7 @@ rec {
 
   uniqListExt = {inputList, outputList ? [],
     getter ? (x : x), compare ? (x: y: x==y)}:
-        if (inputList == []) then outputList else
+        if inputList == [] then outputList else
         let x=head inputList; 
         isX = y: (compare (getter y) (getter x));
         newOutputList = outputList ++
@@ -226,7 +226,7 @@ rec {
                  in innerClosePropagation
                       acc'
                       (uniqList { inputList = (maybeAttrNullable "propagatedBuildInputs" [] y)
-                                           ++ (maybeAttrNullable "propagatedBuildNativeInputs" [] y)
+                                           ++ (maybeAttrNullable "propagatedNativeBuildInputs" [] y)
                                            ++ ys;
                                   acc = acc';
                                 }
@@ -317,7 +317,7 @@ rec {
   mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
   # sane defaults (same name as attr name so that inherit can be used)
   mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
-    listToAttrs (map (n : nameValuePair n lib.concat) [ "buildNativeInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" ])
+    listToAttrs (map (n : nameValuePair n lib.concat) [ "nativeBuildInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" ])
     // listToAttrs (map (n : nameValuePair n lib.mergeAttrs) [ "passthru" "meta" "cfg" "flags" ])
     // listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
   ;
@@ -362,7 +362,7 @@ rec {
         cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
                           // args2.cfg;
         opts = attrValues (mapAttrs (a : v :
-                let v2 = if (v ? set || v ? unset) then v else { set = v; };
+                let v2 = if v ? set || v ? unset then v else { set = v; };
                     n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
                     attr = maybeAttr n {} v2; in
                 if (maybeAttr "assertion" true attr)
diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix
index 19c105bf4f0..85499e893f8 100644
--- a/pkgs/misc/my-env/default.nix
+++ b/pkgs/misc/my-env/default.nix
@@ -63,8 +63,8 @@
 
 mkDerivation {
   # The setup.sh script from stdenv will expect the native build inputs in
-  # the buildNativeInputs environment variable.
-  buildNativeInputs = [ ] ++ buildInputs;
+  # the nativeBuildInputs environment variable.
+  nativeBuildInputs = [ ] ++ buildInputs;
   # Trick to bypass the stdenv usual change of propagatedBuildInputs => propagatedNativeBuildInputs
   propagatedBuildInputs2 = propagatedBuildInputs;
 
@@ -87,7 +87,7 @@ mkDerivation {
         -e 's@trap.*@@' \
         -i "$s"
     cat >> "$out/dev-envs/''${name/env-/}" << EOF
-      buildNativeInputs="$buildNativeInputs"
+      nativeBuildInputs="$nativeBuildInputs"
       propagatedBuildInputs="$propagatedBuildInputs2"
       # the setup-new script wants to write some data to a temp file.. so just let it do that and tidy up afterwards
       tmp="\$("${pkgs.coreutils}/bin/mktemp" -d)"
diff --git a/pkgs/misc/source-and-tags/default.nix b/pkgs/misc/source-and-tags/default.nix
index e3993d0daea..ece31bbaa74 100644
--- a/pkgs/misc/source-and-tags/default.nix
+++ b/pkgs/misc/source-and-tags/default.nix
@@ -4,8 +4,8 @@ args: with args; {
                                       || x ? meta && x.meta ? sourceWithTags );
   # hack because passthru doesn't work the way I'd expect. Don't have time to spend on this right now
   # that's why I'm abusing meta for the same purpose in ghcsAndLibs
-  sourceWithTagsFromDerivation = x : if (x ? passthru && x.passthru ? sourceWithTags ) then x.passthru.sourceWithTags
-                                     else if (x ? meta && x.meta ? sourceWithTags ) then x.meta.sourceWithTags
+  sourceWithTagsFromDerivation = x : if x ? passthru && x.passthru ? sourceWithTags  then x.passthru.sourceWithTags
+                                     else if x ? meta && x.meta ? sourceWithTags  then x.meta.sourceWithTags
                                        else null;
 
   # createTagFiles =  [ { name  = "my_tag_name_without_suffix", tagCmd = "ctags -R . -o \$TAG_FILE"; } ]
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 7525c28e740..74379880706 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
   };
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
diff --git a/pkgs/misc/uboot/guruplug.nix b/pkgs/misc/uboot/guruplug.nix
index 0e63a56073b..b1f4cab7b73 100644
--- a/pkgs/misc/uboot/guruplug.nix
+++ b/pkgs/misc/uboot/guruplug.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
     fi
   '';
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
diff --git a/pkgs/misc/uboot/sheevaplug.nix b/pkgs/misc/uboot/sheevaplug.nix
index ad8029d9020..4d4f61c40a7 100644
--- a/pkgs/misc/uboot/sheevaplug.nix
+++ b/pkgs/misc/uboot/sheevaplug.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
     fi
   '';
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix
index 0a42b83a46f..27b1cdd3e8a 100644
--- a/pkgs/os-specific/gnu/default.nix
+++ b/pkgs/os-specific/gnu/default.nix
@@ -3,7 +3,7 @@
 args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
 , texinfo, glibcCross, hurdPartedCross, libuuid, samba_light
 , gccCrossStageStatic, gccCrossStageFinal
-, forceBuildDrv, forceSystem, newScope, platform, config, crossSystem
+, forceNativeDrv, forceSystem, newScope, platform, config, crossSystem
 , overrides ? {} }:
 
 with args;
@@ -12,18 +12,18 @@ let
   callPackage = newScope gnu;
 
   gnu = {
-    hurdCross = forceBuildDrv(callPackage ./hurd {
+    hurdCross = forceNativeDrv (callPackage ./hurd {
       inherit fetchgit stdenv autoconf libtool texinfo
         glibcCross hurdPartedCross;
       inherit (gnu) machHeaders mig;
-      libuuid = libuuid.hostDrv;
+      libuuid = libuuid.crossDrv;
       automake = automake111x;
       headersOnly = false;
       cross = assert crossSystem != null; crossSystem;
       gccCross = gccCrossStageFinal;
     });
 
-    hurdCrossIntermediate = forceBuildDrv(callPackage ./hurd {
+    hurdCrossIntermediate = forceNativeDrv (callPackage ./hurd {
       inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
       inherit (gnu) machHeaders mig;
       hurdPartedCross = null;
@@ -58,7 +58,7 @@ let
       hurd = null;
     };
 
-    libpthreadCross = forceBuildDrv(callPackage ./libpthread {
+    libpthreadCross = forceNativeDrv (callPackage ./libpthread {
       inherit fetchgit stdenv autoconf automake libtool glibcCross;
       inherit (gnu) machHeaders hurdHeaders;
       hurd = gnu.hurdCrossIntermediate;
@@ -85,7 +85,7 @@ let
       stdenv = (forceSystem "i686-linux").stdenv;
     };
 
-    # XXX: Use this one for its `.hostDrv'.  Using the one above from
+    # XXX: Use this one for its `.crossDrv'.  Using the one above from
     # `x86_64-linux' leads to building a different cross-toolchain because of
     # the `forceSystem'.
     mig_raw = callPackage ./mig {};
diff --git a/pkgs/os-specific/gnu/libpthread/default.nix b/pkgs/os-specific/gnu/libpthread/default.nix
index 08838f17aff..3eaa6336ec2 100644
--- a/pkgs/os-specific/gnu/libpthread/default.nix
+++ b/pkgs/os-specific/gnu/libpthread/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation ({
     inherit rev;
   };
 
-  buildNativeInputs = [ autoconf automake libtool ];
+  nativeBuildInputs = [ autoconf automake libtool ];
   buildInputs = [ machHeaders hurdHeaders ]
    ++ stdenv.lib.optional (!headersOnly) hurd
    ++ stdenv.lib.optional (gccCross != null) gccCross;
diff --git a/pkgs/os-specific/gnu/mach/default.nix b/pkgs/os-specific/gnu/mach/default.nix
index f5120fca478..54c6429955b 100644
--- a/pkgs/os-specific/gnu/mach/default.nix
+++ b/pkgs/os-specific/gnu/mach/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation ({
     # <http://lists.gnu.org/archive/html/bug-hurd/2010-05/msg00137.html>.
     ++ [ "--enable-dependency-tracking" ];
 
-  buildNativeInputs = [ autoconf automake texinfo ]
+  nativeBuildInputs = [ autoconf automake texinfo ]
     ++ stdenv.lib.optional (mig != null) mig;
 
   preConfigure = "autoreconf -vfi";
diff --git a/pkgs/os-specific/gnu/mig/default.nix b/pkgs/os-specific/gnu/mig/default.nix
index f7b798a7624..9ee188b0c8c 100644
--- a/pkgs/os-specific/gnu/mig/default.nix
+++ b/pkgs/os-specific/gnu/mig/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
 
   patches = [ ./noyywrap.patch ];
 
-  buildNativeInputs = [ autoconf automake flex bison machHeaders ];
+  nativeBuildInputs = [ autoconf automake flex bison machHeaders ];
 
   preConfigure = "autoreconf -vfi";
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     postInstall =
       # Fix the shebang to point to the cross-built shell.
       '' sed -i "$out/bin/mig" \
-             -e 's|^#!/.*|#!${bash.hostDrv}/bin/sh|g'
+             -e 's|^#!/.*|#!${bash.crossDrv}/bin/sh|g'
       '';
   };
 
diff --git a/pkgs/os-specific/gnu/unionfs/default.nix b/pkgs/os-specific/gnu/unionfs/default.nix
index f35fed282b6..946e4c0c109 100644
--- a/pkgs/os-specific/gnu/unionfs/default.nix
+++ b/pkgs/os-specific/gnu/unionfs/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "CC=i586-pc-gnu-gcc" ];
   buildInputs = [ hurd machHeaders ];
-  buildNativeInputs = [ mig ];
+  nativeBuildInputs = [ mig ];
 
   installPhase =
     '' mkdir -p "$out/hurd"
diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix
index ebaef323491..08df6fe64c2 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ alsaLib ncurses ];
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   configureFlags = "--disable-xmlto --with-udev-rules-dir=$(out)/lib/udev/rules.d";
 
diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix
index 0848cb33253..a24e0fd2307 100644
--- a/pkgs/os-specific/linux/busybox/default.nix
+++ b/pkgs/os-specific/linux/busybox/default.nix
@@ -44,6 +44,9 @@ stdenv.mkDerivation rec {
     sha256 = "10k8kgrprll9hxfm9gc3jl7kkq79g6l2pygn5snqwqg5v80zy4zb";
   };
 
+  # Remove this patch after the next busybox update.
+  patches = [ ./include-missing-sys-resource-header.patch ];
+
   configurePhase = ''
     make defconfig
     ${configParser}
@@ -60,7 +63,7 @@ stdenv.mkDerivation rec {
     extraCrossConfig = ''
       CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-"
     '' +
-      (if (stdenv.cross.platform.kernelMajor == "2.4") then ''
+      (if stdenv.cross.platform.kernelMajor == "2.4" then ''
         CONFIG_IONICE n
       '' else "");
   };
diff --git a/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch b/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch
new file mode 100644
index 00000000000..8163a86e3cd
--- /dev/null
+++ b/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch
@@ -0,0 +1,12 @@
+diff --git a/include/libbb.h b/include/libbb.h
+index f12800f..e7806c2 100644
+--- a/include/libbb.h
++++ b/include/libbb.h
+@@ -40,6 +40,7 @@
+ #include <sys/poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
++#include <sys/resource.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
diff --git a/pkgs/os-specific/linux/cryptodev/default.nix b/pkgs/os-specific/linux/cryptodev/default.nix
index cb797f07aa3..b9e5690e80e 100644
--- a/pkgs/os-specific/linux/cryptodev/default.nix
+++ b/pkgs/os-specific/linux/cryptodev/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "13hybl5p0ck0vgi2gxmiwa2810gcfk78kdy17ai8nczj8il15mn0";
   };
 
-  buildPhase = if (!onlyHeaders) then ''
+  buildPhase = if !onlyHeaders then ''
     make -C ${kernel}/lib/modules/${kernel.modDirVersion}/build \
       SUBDIRS=`pwd` INSTALL_PATH=$out
   '' else ":";
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index c97c7416de1..2b22f4a2881 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     + " MANDIR=$(out)/share/man";
 
   buildInputs = [ db4 iptables ];
-  buildNativeInputs = [ bison flex pkgconfig ];
+  nativeBuildInputs = [ bison flex pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/os-specific/linux/jujuutils/default.nix b/pkgs/os-specific/linux/jujuutils/default.nix
index c52aae291eb..7c688943ea8 100644
--- a/pkgs/os-specific/linux/jujuutils/default.nix
+++ b/pkgs/os-specific/linux/jujuutils/default.nix
@@ -1,18 +1,18 @@
-{stdenv, fetchurl, linuxHeaders}:
+{ stdenv, fetchurl, linuxHeaders }:
 
 stdenv.mkDerivation {
   name = "jujuutils-0.2";
 
   src = fetchurl {
-    url = http://jujuutils.googlecode.com/files/jujuutils-0.2.tar.gz;
+    url = "http://jujuutils.googlecode.com/files/jujuutils-0.2.tar.gz";
     sha256 = "1r74m7s7rs9d6y7cffi7mdap3jf96qwm1v6jcw53x5cikgmfxn4x";
   };
 
   buildInputs = [ linuxHeaders ];
 
   meta = {
+    homepage = "http://code.google.com/p/jujuutils/";
     description = "Utilities around FireWire devices connected to a Linux computer";
     license = "GPLv2";
-    homepage = http://code.google.com/p/jujuutils/;
   };
 }
diff --git a/pkgs/os-specific/linux/kernel-headers/2.4.nix b/pkgs/os-specific/linux/kernel-headers/2.4.nix
index c5926ff2e47..9457769f5ef 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.4.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.4.nix
@@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
 
 let
   version = "2.4.37.9";
-  kernelHeadersBaseConfig = if (cross == null) then
+  kernelHeadersBaseConfig = if cross == null then
       stdenv.platform.kernelHeadersBaseConfig
     else
       cross.platform.kernelHeadersBaseConfig;
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     sha256 = "08rca9lcb5l5w483hgaqk8pi2njd7cmwpkifjqxwlb3g8liz4r5g";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
index b576b68773c..1ba03010f8a 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     sha256 = "0hifjh75sinifr5138v22zwbpqln6lhn65k8b57a1dyzlqca7cl9";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.arch else
diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
index a2fc597eaac..100dd0c611b 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
@@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
 
 let
   version = "2.6.32.16";
-  kernelHeadersBaseConfig = if (cross == null) then
+  kernelHeadersBaseConfig = if cross == null then
       stdenv.platform.kernelHeadersBaseConfig
     else
       cross.platform.kernelHeadersBaseConfig;
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     sha256 = "1ndvqvfaxachsklzzr5db1bzvfhnzz8diddrm1zlv7171fzmn13j";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
diff --git a/pkgs/os-specific/linux/kernel-headers/3.3.5.nix b/pkgs/os-specific/linux/kernel-headers/3.7.nix
index f4dd28dab03..4371bf7df9c 100644
--- a/pkgs/os-specific/linux/kernel-headers/3.3.5.nix
+++ b/pkgs/os-specific/linux/kernel-headers/3.7.nix
@@ -3,22 +3,25 @@
 assert cross == null -> stdenv.isLinux;
 
 let
-  version = "3.3.5";
-  kernelHeadersBaseConfig = if cross == null then
-      stdenv.platform.kernelHeadersBaseConfig
-    else
-      cross.platform.kernelHeadersBaseConfig;
+
+  version = "3.7.1";
+
+  kernelHeadersBaseConfig =
+    if cross == null
+    then stdenv.platform.kernelHeadersBaseConfig
+    else cross.platform.kernelHeadersBaseConfig;
+
 in
 
 stdenv.mkDerivation {
   name = "linux-headers-${version}";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0i74jn47f6vs5kcvk8abvz3k08z32c9bbqw0sdjkdxwvr4jbczpv";
+    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2";
+    sha256 = "1bb1dxj1i6j7pj926kfy6pz58kw03swyyikl9f3fq3jnswispaj2";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
@@ -33,15 +36,15 @@ stdenv.mkDerivation {
 
   extraIncludeDirs =
     if cross != null then
-	(if cross.arch == "powerpc" then ["ppc"] else [])
+        (if cross.arch == "powerpc" then ["ppc"] else [])
     else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
 
   buildPhase = ''
     if test -n "$targetConfig"; then
        export ARCH=$platform
     fi
-    make ${kernelHeadersBaseConfig}
-    make mrproper headers_check
+    make ${kernelHeadersBaseConfig} SHELL=bash
+    make mrproper headers_check SHELL=bash
   '';
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
deleted file mode 100644
index 3fb5ef8ef2d..00000000000
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{ stdenv, fetchurl, perl, cross ? null }:
-
-assert cross == null -> stdenv.isLinux;
-
-let
-  version = "2.6.35.14";
-  kernelHeadersBaseConfig = if cross == null then
-      stdenv.platform.kernelHeadersBaseConfig
-    else
-      cross.platform.kernelHeadersBaseConfig;
-in
-
-stdenv.mkDerivation {
-  name = "linux-headers-${version}";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v2.6/longterm/v2.6.35/linux-${version}.tar.bz2";
-    sha256 = "1wzml7s9karfbk2yi36g1r8fyaq4d4f16yizc68zgchv0xzj39zl";
-  };
-
-  targetConfig = if (cross != null) then cross.config else null;
-
-  platform =
-    if cross != null then cross.platform.kernelArch else
-    if stdenv.system == "i686-linux" then "i386" else
-    if stdenv.system == "x86_64-linux" then "x86_64" else
-    if stdenv.system == "powerpc-linux" then "powerpc" else
-    if stdenv.isArm then "arm" else
-    if stdenv.platform ? kernelArch then stdenv.platform.kernelArch else
-    abort "don't know what the kernel include directory is called for this platform";
-
-  buildInputs = [perl];
-
-  extraIncludeDirs =
-    if cross != null then
-	(if cross.arch == "powerpc" then ["ppc"] else [])
-    else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
-
-  buildPhase = ''
-    if test -n "$targetConfig"; then
-       export ARCH=$platform
-    fi
-    make ${kernelHeadersBaseConfig}
-    make mrproper headers_check
-  '';
-
-  installPhase = ''
-    make INSTALL_HDR_PATH=$out headers_install
-
-    # Some builds (e.g. KVM) want a kernel.release.
-    mkdir -p $out/include/config
-    echo "${version}-default" > $out/include/config/kernel.release
-  '';
-
-  # !!! hacky
-  fixupPhase = ''
-    ln -s asm $out/include/asm-$platform
-    if test "$platform" = "i386" -o "$platform" = "x86_64"; then
-      ln -s asm $out/include/asm-x86
-    fi
-  '';
-}
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index a58430401c5..eecf52b1ddf 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -83,7 +83,7 @@ stdenv.mkDerivation {
   # For UML and non-PC, just ignore all options that don't apply (We are lazy).
   ignoreConfigErrors = stdenv.platform.name != "pc";
 
-  buildNativeInputs = [ perl mktemp ];
+  nativeBuildInputs = [ perl mktemp ];
   buildInputs = lib.optional (stdenv.platform.uboot != null)
     (ubootChooser stdenv.platform.uboot);
 
@@ -119,8 +119,8 @@ stdenv.mkDerivation {
 
       # The substitution of crossAttrs happens *after* the stdenv cross adapter sets
       # the parameters for the usual stdenv. Thus, we need to specify
-      # the ".hostDrv" in the buildInputs here.
-      buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).hostDrv;
+      # the ".crossDrv" in the buildInputs here.
+      buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).crossDrv;
     };
 
   meta = {
diff --git a/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix b/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix
new file mode 100644
index 00000000000..0dc6378fff3
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix
@@ -0,0 +1,42 @@
+args @ {
+  stdenv, fetchgit, extraConfig ? "" , perl, mktemp, module_init_tools, ...
+}:
+
+let
+  configWithPlatform = kernelPlatform :
+    ''
+      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
+      ${extraConfig}
+    '';
+in
+
+import ./generic.nix (
+
+  rec {
+    version = "3.6.y";
+    testing = false;
+
+    preConfigure = ''
+      substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
+    '';
+
+    src = fetchgit {
+      url = https://github.com/raspberrypi/linux;
+      rev = "6e1f8bce970043a658d15f9350eb85152fd5fc4e";
+      sha256 = "";
+    };
+
+    config = configWithPlatform stdenv.platform;
+    configCross = configWithPlatform stdenv.cross.platform;
+
+    features.iwlwifi = true;
+    #features.efiBootStub = true;
+    #features.needsCifsUtils = true;
+    #features.canDisableNetfilterConntrackHelpers = true;
+    #features.netfilterRPFilter = true;
+
+    fetchurl = null;
+  }
+
+  // removeAttrs args ["extraConfig"]
+)
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 44c31d824ae..5d84dee0a28 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -122,7 +122,7 @@ stdenv.mkDerivation {
     runHook postConfigure
   '';
 
-  buildNativeInputs = [ perl nettools ];
+  nativeBuildInputs = [ perl nettools ];
 
   makeFlags = commonMakeFlags ++ [
    "INSTALLKERNEL=${installkernel stdenv.platform.kernelTarget}"
diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix
index 01d989e75b1..8f2db1b15bd 100644
--- a/pkgs/os-specific/linux/kernel/perf.nix
+++ b/pkgs/os-specific/linux/kernel/perf.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   '';
 
   # perf refers both to newt and slang
-  buildNativeInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt flex bison ];
+  nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt flex bison ];
   buildInputs = [ elfutils python perl newt slang pkgconfig] ++
     stdenv.lib.optional withGtk gtk;
 
@@ -27,9 +27,9 @@ stdenv.mkDerivation {
   crossAttrs = {
     /* I don't want cross-python or cross-perl -
        I don't know if cross-python even works */
-    propagatedBuildInputs = [ elfutils.hostDrv newt.hostDrv ];
+    propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ];
     makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-";
-    elfutils = elfutils.hostDrv;
+    elfutils = elfutils.crossDrv;
   };
 
   meta = {
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix
index 781bb67edca..42fd6097da0 100644
--- a/pkgs/os-specific/linux/klibc/default.nix
+++ b/pkgs/os-specific/linux/klibc/default.nix
@@ -70,5 +70,5 @@ stdenv.mkDerivation {
     cp usr/dash/sh $dir/
   '';
   
-  buildNativeInputs = [ perl bison mktemp ];
+  nativeBuildInputs = [ perl bison mktemp ];
 }
diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix
index 667fe63bba7..92f15c1ade3 100644
--- a/pkgs/os-specific/linux/libcap/default.nix
+++ b/pkgs/os-specific/linux/libcap/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "03q50j6bg65cc501q87qh328ncav1i8qw2bjig99vxmmfx4bvsvk";
   };
   
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   propagatedBuildInputs = [ attr ];
 
   preConfigure = "cd libcap";
diff --git a/pkgs/os-specific/linux/libcgroup/default.nix b/pkgs/os-specific/linux/libcgroup/default.nix
index 0246f6729b1..6323d8c4f23 100644
--- a/pkgs/os-specific/linux/libcgroup/default.nix
+++ b/pkgs/os-specific/linux/libcgroup/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pam ];
 
-  buildNativeInputs = [ yacc flex ];
+  nativeBuildInputs = [ yacc flex ];
 
   meta = {
     description = "Library and tools to manage Linux's cgroup resource management system";
diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix
index a88107ae73d..1653c018ce1 100644
--- a/pkgs/os-specific/linux/mdadm/default.nix
+++ b/pkgs/os-specific/linux/mdadm/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   # Enable incremental activation of swraid arrays from udev.
   patches = [ ./udev.patch ];
 
-  buildNativeInputs = [ groff ];
+  nativeBuildInputs = [ groff ];
 
   preConfigure = "sed -e 's@/lib/udev@\${out}/lib/udev@' -e 's@ -Werror @ @' -i Makefile";
 
diff --git a/pkgs/os-specific/linux/net-tools/config.h b/pkgs/os-specific/linux/net-tools/config.h
index b060bea12c2..dedaac6247d 100644
--- a/pkgs/os-specific/linux/net-tools/config.h
+++ b/pkgs/os-specific/linux/net-tools/config.h
@@ -38,6 +38,7 @@
 #define HAVE_AFECONET 0
 #define HAVE_AFDECnet 0
 #define HAVE_AFASH 0
+#define HAVE_AFBLUETOOTH 0
 
 /* 
  * 
@@ -49,20 +50,23 @@
 #define HAVE_HWSLIP 1
 #define HAVE_HWPPP 1
 #define HAVE_HWTUNNEL 1
-#define HAVE_HWSTRIP 1
-#define HAVE_HWTR 1
+#define HAVE_HWSTRIP 0
+#define HAVE_HWTR 0
 #define HAVE_HWAX25 0
 #define HAVE_HWROSE 0
 #define HAVE_HWNETROM 1
 #define HAVE_HWX25 0
 #define HAVE_HWFR 1
-#define HAVE_HWSIT 0
+#define HAVE_HWSIT 1
 #define HAVE_HWFDDI 0
 #define HAVE_HWHIPPI 0
 #define HAVE_HWASH 0
 #define HAVE_HWHDLCLAPB 0
 #define HAVE_HWIRDA 1
 #define HAVE_HWEC 0
+#define HAVE_HWEC 0
+#define HAVE_HWEUI64 1
+#define HAVE_HWIB 1
 
 /* 
  * 
@@ -72,3 +76,4 @@
 #define HAVE_FW_MASQUERADE 0
 #define HAVE_IP_TOOLS 0
 #define HAVE_MII 0
+#define HAVE_SELINUX 0
diff --git a/pkgs/os-specific/linux/net-tools/default.nix b/pkgs/os-specific/linux/net-tools/default.nix
index 59af976a71b..9386b50969f 100644
--- a/pkgs/os-specific/linux/net-tools/default.nix
+++ b/pkgs/os-specific/linux/net-tools/default.nix
@@ -1,15 +1,13 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "net-tools-1.60";
-  
+stdenv.mkDerivation rec {
+  name = "net-tools-1.60_p20120127084908";
+
   src = fetchurl {
-    url = http://www.tazenda.demon.co.uk/phil/net-tools/net-tools-1.60.tar.bz2;
-    md5 = "888774accab40217dde927e21979c165";
+    url = "mirror://gentoo/distfiles/${name}.tar.xz";
+    sha256 = "408a51964aa142a4f45c4cffede2478abbd5630a7c7346ba0d3611059a2a3c94";
   };
 
-  patches = [ ./net-tools-labels.patch ];
-  
   preBuild =
     ''
       cp ${./config.h} config.h
diff --git a/pkgs/os-specific/linux/net-tools/net-tools-labels.patch b/pkgs/os-specific/linux/net-tools/net-tools-labels.patch
deleted file mode 100644
index 82c3a27d9c6..00000000000
--- a/pkgs/os-specific/linux/net-tools/net-tools-labels.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff -ruN net-tools-1.60/hostname.c net-tools-1.60-new/hostname.c
---- net-tools-1.60/hostname.c	2001-04-08 19:04:23.000000000 +0200
-+++ net-tools-1.60-new/hostname.c	2004-12-17 14:48:15.624174382 +0100
-@@ -98,6 +98,7 @@
- 	    fprintf(stderr, _("%s: name too long\n"), program_name);
- 	    break;
- 	default:
-+	    break;
- 	}
- 	exit(1);
-     };
-@@ -117,6 +118,7 @@
- 	    fprintf(stderr, _("%s: name too long\n"), program_name);
- 	    break;
- 	default:
-+	    break;
- 	}
- 	exit(1);
-     };
-@@ -174,6 +176,7 @@
- 	printf("%s\n", hp->h_name);
- 	break;
-     default:
-+	break;
-     }
- }
- 
-diff -ruN net-tools-1.60/lib/inet_sr.c net-tools-1.60-new/lib/inet_sr.c
---- net-tools-1.60/lib/inet_sr.c	2000-02-20 22:46:45.000000000 +0100
-+++ net-tools-1.60-new/lib/inet_sr.c	2004-12-17 14:37:15.416349441 +0100
-@@ -105,6 +105,7 @@
-     case 2:
-        isnet = 0; break;
-     default:
-+	break;
-     }
- 
-     /* Fill in the other fields. */
diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix
index 7da03cf9cad..112c82d1ea0 100644
--- a/pkgs/os-specific/linux/pam/default.nix
+++ b/pkgs/os-specific/linux/pam/default.nix
@@ -1,14 +1,15 @@
 { stdenv, fetchurl, flex, cracklib, libxcrypt }:
 
 stdenv.mkDerivation rec {
-  name = "linux-pam-1.1.1";
+  name = "linux-pam-1.1.6";
 
   src = fetchurl {
-    url = http://www.linux-pam.org/library/Linux-PAM-1.1.1.tar.bz2;
-    sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
+    url = https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-1.1.6.tar.bz2;
+    sha256 = "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s";
   };
 
-  buildNativeInputs = [ flex ];
+  nativeBuildInputs = [ flex ];
+
   buildInputs = [ cracklib ]
     ++ stdenv.lib.optional
       (!stdenv.isArm && stdenv.system != "mips64el-linux")
@@ -16,9 +17,9 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     # Skip libxcrypt cross-building, as it fails for mips and arm
-    propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
+    propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
     preConfigure = preConfigure + ''
-      ar x ${flex.hostDrv}/lib/libfl.a
+      ar x ${flex.crossDrv}/lib/libfl.a
       mv libyywrap.o libyywrap-target.o
       ar x ${flex}/lib/libfl.a
       mv libyywrap.o libyywrap-host.o
@@ -27,13 +28,13 @@ stdenv.mkDerivation rec {
     '';
     postConfigure = ''
       sed -e "s@ $PWD/libyywrap-target.o@ $PWD/libyywrap-host.o@" -i doc/specs/Makefile
-    ''; 
+    '';
   };
 
   postInstall = ''
     mv -v $out/sbin/unix_chkpwd{,.orig}
     ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
-    '';
+  '';
 
   preConfigure = ''
     configureFlags="$configureFlags --includedir=$out/include/security"
diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix
index 1ad392ad6fa..e7cce315e8c 100644
--- a/pkgs/os-specific/linux/uclibc/default.nix
+++ b/pkgs/os-specific/linux/uclibc/default.nix
@@ -33,8 +33,8 @@ let
     }
   '';
 
-  archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else "";
-  crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else "";
+  archMakeFlag = if cross != null then "ARCH=${cross.arch}" else "";
+  crossMakeFlag = if cross != null then "CROSS=${cross.config}-" else "";
 
   # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds.
   nixConfig = ''
@@ -74,7 +74,7 @@ stdenv.mkDerivation {
   '';
 
   # Cross stripping hurts.
-  dontStrip = if (cross != null) then true else false;
+  dontStrip = cross != null;
 
   makeFlags = [ crossMakeFlag "VERBOSE=1" ];
 
diff --git a/pkgs/os-specific/linux/udisks/default.nix b/pkgs/os-specific/linux/udisks/default.nix
index b46efd46874..b53af52755f 100644
--- a/pkgs/os-specific/linux/udisks/default.nix
+++ b/pkgs/os-specific/linux/udisks/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
       lvm2 libatasmart intltool libuuid libxslt docbook_xsl
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--localstatedir=/var --enable-lvm2";
 
diff --git a/pkgs/os-specific/linux/upower/default.nix b/pkgs/os-specific/linux/upower/default.nix
index 6ae4c22f48a..cce12f7954a 100644
--- a/pkgs/os-specific/linux/upower/default.nix
+++ b/pkgs/os-specific/linux/upower/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     [ dbus_glib polkit intltool libxslt docbook_xsl udev libusb1 ]
     ++ stdenv.lib.optional useSystemd systemd;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags =
     [ "--with-backend=linux" "--localstatedir=/var" ]
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 35d01739a2a..08f3f53e58e 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,13 +1,11 @@
 { stdenv, fetchurl, zlib, ncurses ? null, perl ? null }:
 
 stdenv.mkDerivation rec {
-  name = "util-linux-2.20.1";
+  name = "util-linux-2.21.2";
 
   src = fetchurl {
-    # This used to be mirror://kernel/linux/utils/util-linux, but it
-    # disappeared in the kernel.org meltdown.
-    url = "mirror://gentoo/distfiles/${name}.tar.bz2";
-    sha256 = "1q5vjcvw4f067c63vj2n3xggvk5prm11571x6vnqiav47vdbqvni";
+    url = "http://www.kernel.org/pub/linux/utils/util-linux/v2.21/${name}.tar.bz2";
+    sha256 = "0c1xp9pzwizxfk09anvjaz5cv8gvxracvvb6s84xiaxza679svq6";
   };
 
   patches = [ ./linux-specific-header.patch ];
diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index b1bc15ff083..a69c5646d74 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ openssl dbus_libs libnl ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   patches =
     [ (fetchurl {
diff --git a/pkgs/os-specific/linux/wpa_supplicant/gui.nix b/pkgs/os-specific/linux/wpa_supplicant/gui.nix
index 12ec08361a6..29591bf0335 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/gui.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/gui.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ qt4 ];
 
-  buildNativeInputs = [ inkscape ];
+  nativeBuildInputs = [ inkscape ];
 
   prePatch = "cd wpa_supplicant/wpa_gui-qt4";
 
diff --git a/pkgs/os-specific/windows/jom/default.nix b/pkgs/os-specific/windows/jom/default.nix
index 2cdd63cc0eb..8f8477d1864 100644
--- a/pkgs/os-specific/windows/jom/default.nix
+++ b/pkgs/os-specific/windows/jom/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ qt48 ];
-  buildNativeInputs = [ flex /*cmake*/ ];
+  nativeBuildInputs = [ flex /*cmake*/ ];
 
   QTDIR = qt48;
   configurePhase = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   
   crossAttrs = {
     # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cross.config}-windres";
-    QTDIR = qt48.hostDrv;
+    QTDIR = qt48.crossDrv;
     preBuild = ''
       export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
     '';
diff --git a/pkgs/os-specific/windows/w32api/default.nix b/pkgs/os-specific/windows/w32api/default.nix
index a4f4245125d..2a5af71b5ec 100644
--- a/pkgs/os-specific/windows/w32api/default.nix
+++ b/pkgs/os-specific/windows/w32api/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation ({
     sha256 = "09rhnl6zikmdyb960im55jck0rdy5z9nlg3akx68ixn7khf3j8wb";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
 } //
 (if onlyHeaders then {
diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix
index cb664eac253..7c16153e9b5 100644
--- a/pkgs/servers/gpm/default.nix
+++ b/pkgs/servers/gpm/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1990i19ddzn8gg5xwm53yn7d0mya885f48sd2hyvr7dvzyaw7ch8";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   buildInputs = [ ncurses ];
 
   preConfigure =
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 31c9deaf3af..25051167ca5 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1bjhyjg561kwp6zc2wg58njdvpnsj5yaa2slz8g3ga1176jl68w3";
   };
 
-  buildNativeInputs = [ makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl
+  nativeBuildInputs = [ makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl
     xmlto bc pythonPackages.wrapPython ];
 
   pythonPath = [ pythonPackages.curses ];
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
index ce664972037..345234ba25e 100644
--- a/pkgs/servers/nosql/mongodb/default.nix
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     sha256 = "12v0cpq9j2gmagr9pbw08karqwqgl4j9r223w7x7sx5cfvj2cih8";
   };
 
-  buildNativeInputs = [ scons which ];
+  nativeBuildInputs = [ scons which ];
 
   patches = [ installerPatch ];
 
diff --git a/pkgs/servers/prayer/default.nix b/pkgs/servers/prayer/default.nix
index c67d2c8a010..f105920ab81 100644
--- a/pkgs/servers/prayer/default.nix
+++ b/pkgs/servers/prayer/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ openssl db4 zlib uwimap htmlTidy pam ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   NIX_LDFLAGS = "-lpam";
 
diff --git a/pkgs/servers/unfs3/default.nix b/pkgs/servers/unfs3/default.nix
index e59023c905e..96073645cc1 100644
--- a/pkgs/servers/unfs3/default.nix
+++ b/pkgs/servers/unfs3/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "076zkyqkn56q0a8n3h65n1a68fknk4hrrp6mbhajq5s1wp5248j8";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
 
   configureFlags = [ "--disable-shared" ];
 
diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh
index bb776a5051b..6ba50d24507 100644
--- a/pkgs/servers/x11/xorg/builder.sh
+++ b/pkgs/servers/x11/xorg/builder.sh
@@ -26,7 +26,7 @@ postInstall() {
             for p in $nativePkgs; do
                 if test -e $p/lib/pkgconfig/$r.pc; then
                     echo "  found requisite $r in $p"
-                    propagatedBuildNativeInputs="$propagatedBuildNativeInputs $p"
+                    propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p"
                 fi
             done
         fi
@@ -34,7 +34,7 @@ postInstall() {
 
     mkdir -p "$out/nix-support"
     echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
-    echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs"
+    echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
 }
 
 
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 6d231e2083e..cf8c4737471 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -37,18 +37,18 @@ in
     # I should use: builtins.unsafeDiscardStringContext
     buildInputs = [args.pkgconfig args.libxslt xorg.libpthreadstubs /*xorg.python*/
         xorg.libXau xorg.xcbproto xorg.libXdmcp ] ++ [ xorg.xproto ];
-    buildNativeInputs = [ args.python ];
+    nativeBuildInputs = [ args.python ];
   };
 
   xcbproto = attrs : attrs // {
     # I only remove python from the original.
     buildInputs = [args.pkgconfig  /*xorg.python*/ ];
-    buildNativeInputs = [ args.python ];
+    nativeBuildInputs = [ args.python ];
   };
 
   pixman = attrs : attrs // {
     buildInputs = [ args.pkgconfig ];
-    buildNativeInputs = [ args.perl ];
+    nativeBuildInputs = [ args.perl ];
   };
 
   libpciaccess = attrs : attrs // {
@@ -261,7 +261,7 @@ in
   };
 
   twm = attrs: attrs // {
-    buildNativeInputs = [args.bison args.flex];
+    nativeBuildInputs = [args.bison args.flex];
   };
 
   xbacklight = attrs: attrs // {
diff --git a/pkgs/shells/bash/bash-4.2-patches.nix b/pkgs/shells/bash/bash-4.2-patches.nix
index 8d2a74e95b0..52392f4b32c 100644
--- a/pkgs/shells/bash/bash-4.2-patches.nix
+++ b/pkgs/shells/bash/bash-4.2-patches.nix
@@ -25,4 +25,22 @@ patch: [
 (patch "022" "0sswp2c63pclvdwi2hbkwbqf9ysmiw6mmi0qinl2pkgqyyfzdkcx")
 (patch "023" "1gzhcmwj0741libjqwln4r4h9k7lskprc4q87hvqgj56y6a17hax")
 (patch "024" "1rlrdfk67g8as6pr076ldhjhnkd2c86mb4ci18fjivivsfyjdj4r")
+(patch "025" "05am4w789v630x0a6a9wrxhvrjvs73fjn68i55qdand5sxpn9c0d")
+(patch "026" "1li3sd3hpdxhh257hdwzzn2g18m4ksflx6crqswv9qxwmgx0rsg7")
+(patch "027" "0hpdywvny6vihls2qqlwwxkvps7q710vp6szq117zhgwarr6n7qc")
+(patch "028" "0ypdn590h5f8y7kvk2sk93vcjbh5vrcwsaasvprsm0ds77g2chi0")
+(patch "029" "10gm73rvfhr42v7i70qqc56wl8l459i2frs6ifrcsnmw2w48rc6h")
+(patch "030" "1bmg8iz95jijxp89czwaw9msppgj220233nbrn66s4qsb5k46n8j")
+(patch "031" "1yfrz093hghhlrj8na48dzc8v6ax34mj5i0h6l3bnpvp6i6qrwsm")
+(patch "032" "1vci8xh1r8f59j6d95iljw9i555jm1fm2lssm1ycprdivdivba73")
+(patch "033" "0js38r5gmlyz70zjfw0m2j08h26c3vma2vy8gbsb5pwzss82glgm")
+(patch "034" "1f213qpvqnv2bm79a01r44xjlwk65483cxvw6kgwx28k20rg7h81")
+(patch "035" "1pvqxpm7m1y7ab5srq3s7r095z34nbcr62gz6nb89d1qn1iy9kff")
+(patch "036" "1yma0m9wrk6a15x36libb8a0cz7gmzihv6lvmrrd5i1ar4dklagy")
+(patch "037" "0x0niqv7zwqvz4l8n9nivhk0g0036jh5h3vlkil3095vsgfqqmy7")
+(patch "038" "0mvdpsxxs4bn5zvsm04yfsplhcrv6y0avpwilj5yasr0vwdsijdq")
+(patch "039" "148pkj5s73ym0jhpr8d3z5vfily4chm0am4yms4506ijc0531ygl")
+(patch "040" "0v5a98ybibwsd4iyh18gy0kc51mx8qn9w2wfpjaiycn7yg5gjrdj")
+(patch "041" "1szmm8xv41hvbzgxfwrj6dg85wa7zy3781nnil428rlzpm8ikk05")
+(patch "042" "017kpdqy6v9sgi2a931wyzpix86n9mkalpm6n9cb45v58lgmraps")
 ]
diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix
index 98fe43b0122..c83cb96148b 100644
--- a/pkgs/shells/bash/default.nix
+++ b/pkgs/shells/bash/default.nix
@@ -44,10 +44,12 @@ stdenv.mkDerivation rec {
   configureFlags = baseConfigureFlags;
 
   # Note: Bison is needed because the patches above modify parse.y.
-  buildNativeInputs = [bison]
+  nativeBuildInputs = [bison]
     ++ stdenv.lib.optional (texinfo != null) texinfo
     ++ stdenv.lib.optional interactive readline;
 
+  enableParallelBuilding = true;
+
   postInstall = ''
     # Add an `sh' -> `bash' symlink.
     ln -s bash "$out/bin/sh"
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index fb0eed51d56..662f3307b46 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -20,7 +20,7 @@ rec {
   # for other dependencies.
   overrideInStdenv = stdenv: pkgs: stdenv //
     { mkDerivation = args: stdenv.mkDerivation (args //
-        { buildInputs = (if args ? buildInputs then args.buildInputs else []) ++ pkgs; }
+        { buildInputs = args.buildInputs or [] ++ pkgs; }
       );
     };
 
@@ -48,11 +48,11 @@ rec {
         # These are added *after* the command-line flags, so we'll
         # always optimise for size.
         NIX_CFLAGS_COMPILE =
-          (if args ? NIX_CFLAGS_COMPILE then args.NIX_CFLAGS_COMPILE else "")
+          args.NIX_CFLAGS_COMPILE or ""
           + " -Os -s -D_BSD_SOURCE=1";
 
         configureFlags =
-          (if args ? configureFlags then args.configureFlags else "")
+          args.configureFlags or ""
           + " --disable-shared"; # brrr...
 
         NIX_GCC = import ../build-support/gcc-wrapper {
@@ -75,12 +75,10 @@ rec {
         # These are added *after* the command-line flags, so we'll
         # always optimise for size.
         NIX_CFLAGS_COMPILE =
-          (if args ? NIX_CFLAGS_COMPILE then args.NIX_CFLAGS_COMPILE else "")
-          + " -Os -s";
+          args.NIX_CFLAGS_COMPILE or "" + " -Os -s";
 
         configureFlags =
-          (if args ? configureFlags then args.configureFlags else "")
-          + " --disable-shared"; # brrr...
+          args.configureFlags or "" + " --disable-shared"; # brrr...
 
         NIX_GCC = runCommand "klibc-wrapper" {} ''
           mkdir -p $out/bin
@@ -100,9 +98,8 @@ rec {
   makeStaticBinaries = stdenv: stdenv //
     { mkDerivation = args: stdenv.mkDerivation (args // {
         NIX_CFLAGS_LINK = "-static";
-
         configureFlags =
-          (if args ? configureFlags then toString args.configureFlags else "")
+          toString args.configureFlags or ""
           + " --disable-shared"; # brrr...
       });
       isStatic = true;
@@ -115,7 +112,7 @@ rec {
     { mkDerivation = args: stdenv.mkDerivation (args // {
         dontDisableStatic = true;
         configureFlags =
-          (if args ? configureFlags then toString args.configureFlags else "")
+          toString args.configureFlags or ""
           + " --enable-static --disable-shared";
       });
     } // {inherit fetchurl;};
@@ -124,62 +121,60 @@ rec {
   # Return a modified stdenv that adds a cross compiler to the
   # builds.
   makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv //
-    { mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [],
-            propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [],
-            selfBuildNativeInput ? false, ...}@args: let
+    { mkDerivation = {name ? "", buildInputs ? [], nativeBuildInputs ? [],
+            propagatedBuildInputs ? [], propagatedNativeBuildInputs ? [],
+            selfNativeBuildInput ? false, ...}@args: let
 
             # *BuildInputs exists temporarily as another name for
             # *HostInputs.
 
             # In nixpkgs, sometimes 'null' gets in as a buildInputs element,
             # and we handle that through isAttrs.
-            getBuildDrv = drv : if (builtins.isAttrs drv && drv ? buildDrv) then drv.buildDrv else drv;
-            getHostDrv = drv : if (builtins.isAttrs drv && drv ? hostDrv) then drv.hostDrv else drv;
-            buildNativeInputsDrvs = map (getBuildDrv) buildNativeInputs;
-            buildInputsDrvs = map (getHostDrv) buildInputs;
-            buildInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
-            propagatedBuildInputsDrvs = map (getHostDrv) (propagatedBuildInputs);
-            propagatedBuildNativeInputsDrvs = map (getBuildDrv)
-                (propagatedBuildNativeInputs);
-
-            # The base stdenv already knows that buildNativeInputs and
+            getNativeDrv = drv: drv.nativeDrv or drv;
+            getCrossDrv = drv: drv.crossDrv or drv;
+            nativeBuildInputsDrvs = map getNativeDrv nativeBuildInputs;
+            buildInputsDrvs = map getCrossDrv buildInputs;
+            buildInputsDrvsAsBuildInputs = map getNativeDrv buildInputs;
+            propagatedBuildInputsDrvs = map getCrossDrv propagatedBuildInputs;
+            propagatedNativeBuildInputsDrvs = map getNativeDrv propagatedNativeBuildInputs;
+
+            # The base stdenv already knows that nativeBuildInputs and
             # buildInputs should be built with the usual gcc-wrapper
             # And the same for propagatedBuildInputs.
-            buildDrv = stdenv.mkDerivation args;
+            nativeDrv = stdenv.mkDerivation args;
 
             # Temporary expression until the cross_renaming, to handle the
             # case of pkgconfig given as buildInput, but to be used as
-            # buildNativeInput.
-            hostAsBuildDrv = drv: builtins.unsafeDiscardStringContext
-                drv.buildDrv.drvPath == builtins.unsafeDiscardStringContext
-                drv.hostDrv.drvPath;
+            # nativeBuildInput.
+            hostAsNativeDrv = drv:
+                builtins.unsafeDiscardStringContext drv.nativeDrv.drvPath
+                == builtins.unsafeDiscardStringContext drv.crossDrv.drvPath;
             buildInputsNotNull = stdenv.lib.filter
-                (drv: builtins.isAttrs drv && drv ? buildDrv) buildInputs;
-            nativeInputsFromBuildInputs = stdenv.lib.filter (hostAsBuildDrv) buildInputsNotNull;
+                (drv: builtins.isAttrs drv && drv ? nativeDrv) buildInputs;
+            nativeInputsFromBuildInputs = stdenv.lib.filter hostAsNativeDrv buildInputsNotNull;
 
-            # We should overwrite the input attributes in hostDrv, to overwrite
+            # We should overwrite the input attributes in crossDrv, to overwrite
             # the defaults for only-native builds in the base stdenv
-            hostDrv = if (cross == null) then buildDrv else
+            crossDrv = if cross == null then nativeDrv else
                 stdenv.mkDerivation (args // {
                     name = name + "-" + cross.config;
-                    buildNativeInputs = buildNativeInputsDrvs
+                    nativeBuildInputs = nativeBuildInputsDrvs
                       ++ nativeInputsFromBuildInputs
                       ++ [ gccCross binutilsCross ] ++
-                      stdenv.lib.optional selfBuildNativeInput buildDrv;
+                      stdenv.lib.optional selfNativeBuildInput nativeDrv;
 
                     # Cross-linking dynamic libraries, every buildInput should
                     # be propagated because ld needs the -rpath-link to find
                     # any library needed to link the program dynamically at
                     # loader time. ld(1) explains it.
                     buildInputs = [];
-                    propagatedBuildInputs = propagatedBuildInputsDrvs ++
-                      buildInputsDrvs;
-                    propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;
+                    propagatedBuildInputs = propagatedBuildInputsDrvs ++ buildInputsDrvs;
+                    propagatedNativeBuildInputs = propagatedNativeBuildInputsDrvs;
 
                     crossConfig = cross.config;
-                } // (if args ? crossAttrs then args.crossAttrs else {}));
-        in buildDrv // {
-            inherit hostDrv buildDrv;
+                } // args.crossAttrs or {});
+        in nativeDrv // {
+          inherit crossDrv nativeDrv;
         };
     } // {
       inherit cross gccCross binutilsCross;
@@ -297,14 +292,9 @@ rec {
           pkg = stdenv.mkDerivation args;
           printDrvPath = val: let
             drvPath = builtins.unsafeDiscardStringContext pkg.drvPath;
-            license =
-              if pkg ? meta && pkg.meta ? license then
-                pkg.meta.license
-              else
-                null;
+            license = pkg.meta.license or null;
           in
-            builtins.trace "@:drv:${toString drvPath}:${builtins.toString license}:@"
-              val;
+            builtins.trace "@:drv:${toString drvPath}:${builtins.toString license}:@" val;
         in pkg // {
           outPath = printDrvPath pkg.outPath;
           drvPath = printDrvPath pkg.drvPath;
@@ -333,15 +323,12 @@ rec {
           pkg = stdenv.mkDerivation args;
           drv = builtins.unsafeDiscardStringContext pkg.drvPath;
           license =
-            if pkg ? meta && pkg.meta ? license then
-              pkg.meta.license
-            else if pkg ? outputHash then
+            pkg.meta.license or
               # Fixed-output derivations such as source tarballs usually
               # don't have licensing information, but that's OK.
-              null
-            else
-              builtins.trace
-                "warning: ${drv} lacks licensing information" null;
+              (pkg.outputHash or
+                (builtins.trace
+                  "warning: ${drv} lacks licensing information" null));
 
           validate = arg:
             if licensePred license then arg
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index 67000670cd1..ca90b46192e 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -56,6 +56,7 @@ rec {
     if stdenvType == "i686-linux" then stdenvLinux else
     if stdenvType == "x86_64-linux" then stdenvLinux else
     if stdenvType == "armv5tel-linux" then stdenvLinux else
+    if stdenvType == "armv6l-linux" then stdenvLinux else
     if stdenvType == "armv7l-linux" then stdenvLinux else
     if stdenvType == "mips64el-linux" then stdenvLinux else
     if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index b6836ca8d79..e7e1f6441d8 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -48,9 +48,9 @@ let
             (removeAttrs attrs ["meta" "passthru" "crossAttrs"])
             // (let
               buildInputs = attrs.buildInputs or [];
-              buildNativeInputs = attrs.buildNativeInputs or [];
+              nativeBuildInputs = attrs.nativeBuildInputs or [];
               propagatedBuildInputs = attrs.propagatedBuildInputs or [];
-              propagatedBuildNativeInputs = attrs.propagatedBuildNativeInputs or [];
+              propagatedNativeBuildInputs = attrs.propagatedNativeBuildInputs or [];
               crossConfig = attrs.crossConfig or null;
             in
             {
@@ -58,15 +58,16 @@ let
               args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
               stdenv = result;
               system = result.system;
+              userHook = config.stdenv.userHook or null;
 
               # Inputs built by the cross compiler.
               buildInputs = lib.optionals (crossConfig != null) buildInputs;
               propagatedBuildInputs = lib.optionals (crossConfig != null)
                   propagatedBuildInputs;
               # Inputs built by the usual native compiler.
-              buildNativeInputs = buildNativeInputs ++ lib.optionals
+              nativeBuildInputs = nativeBuildInputs ++ lib.optionals
                 (crossConfig == null) buildInputs;
-              propagatedBuildNativeInputs = propagatedBuildNativeInputs ++
+              propagatedNativeBuildInputs = propagatedNativeBuildInputs ++
                 lib.optionals (crossConfig == null) propagatedBuildInputs;
             }))
           )
@@ -87,6 +88,7 @@ let
                || result.system == "x86_64-linux"
                || result.system == "powerpc-linux"
                || result.system == "armv5tel-linux"
+               || result.system == "armv6l-linux"
                || result.system == "armv7l-linux"
                || result.system == "mips64el-linux";
         isGNU = result.system == "i686-gnu";      # GNU/Hurd
@@ -114,10 +116,13 @@ let
                || result.system == "x86_64-freebsd"
                || result.system == "x86_64-openbsd";
         is64bit = result.system == "x86_64-linux"
-                || result.system == "x86_64-darwin";
+                || result.system == "x86_64-darwin"
+                || result.system == "x86_64-freebsd"
+                || result.system == "x86_64-openbsd";
         isMips = result.system == "mips-linux"
                 || result.system == "mips64el-linux";
         isArm = result.system == "armv5tel-linux"
+             || result.system == "armv6l-linux"
              || result.system == "armv7l-linux";
 
         # Utility function: allow stdenv to be easily regenerated with
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 703ea53db8e..c5722c3e874 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -1,7 +1,7 @@
 # Run the named hook, either by calling the function with that name or
 # by evaluating the variable with that name.  This allows convenient
 # setting of hooks both from Nix expressions (as attributes /
-# environment variables) and from shell scripts (as functions). 
+# environment variables) and from shell scripts (as functions).
 runHook() {
     local hookName="$1"
     case "$(type -t $hookName)" in
@@ -29,10 +29,10 @@ exitHandler() {
         # - system time for all child processes
         echo "build time elapsed: " ${times[*]}
     fi
-    
+
     if [ $exitCode != 0 ]; then
         runHook failureHook
-    
+
         # If the builder had a non-zero exit code and
         # $succeedOnFailure is set, create the file
         # `$out/nix-support/failed' to signal failure, and exit
@@ -43,11 +43,11 @@ exitHandler() {
             echo -n $exitCode > "$out/nix-support/failed"
             exit 0
         fi
-        
+
     else
         runHook exitHook
     fi
-    
+
     exit $exitCode
 }
 
@@ -169,8 +169,8 @@ for i in $buildInputs $propagatedBuildInputs; do
 done
 
 nativePkgs=""
-for i in $buildNativeInputs $propagatedBuildNativeInputs; do
-    findInputs $i nativePkgs propagated-build-native-inputs
+for i in $nativeBuildInputs $propagatedNativeBuildInputs; do
+    findInputs $i nativePkgs propagated-native-build-inputs
 done
 
 
@@ -197,7 +197,7 @@ addToCrossEnv() {
     local pkg=$1
 
     # Some programs put important build scripts (freetype-config and similar)
-    # into their hostDrv bin path. Intentionally these should go after
+    # into their crossDrv bin path. Intentionally these should go after
     # the nativePkgs in PATH.
     if [ -d $1/bin ]; then
         addToSearchPath _PATH $1/bin
@@ -445,7 +445,7 @@ unpackFile() {
         *)
             if [ -d "$curSrc" ]; then
                 stripHash $curSrc
-                cp -prvd $curSrc $strippedName
+                cp -prd --no-preserve=timestamps $curSrc $strippedName
             else
                 if [ -z "$unpackCmd" ]; then
                     echo "source archive $curSrc has unknown type"
@@ -462,7 +462,7 @@ unpackFile() {
 
 unpackPhase() {
     runHook preUnpack
-    
+
     if [ -z "$srcs" ]; then
         if [ -z "$src" ]; then
             echo 'variable $src or $srcs should point to the source'
@@ -529,9 +529,9 @@ unpackPhase() {
 
 patchPhase() {
     runHook prePatch
-    
+
     if [ -z "$patchPhase" -a -z "$patches" ]; then return; fi
-    
+
     for i in $patches; do
         header "applying patch $i" 3
         local uncompress=cat
@@ -627,7 +627,7 @@ checkPhase() {
     make ${makefile:+-f $makefile} \
         ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
         $makeFlags "${makeFlagsArray[@]}" \
-        $checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
+        ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check}
 
     runHook postCheck
 }
@@ -724,11 +724,11 @@ fixupPhase() {
 
     # TODO: strip _only_ ELF executables, and return || fail here...
     if [ -z "$dontStrip" ]; then
-        stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
+        stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin}
         if [ -n "$stripDebugList" ]; then
             stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
         fi
-        
+
         stripAllList=${stripAllList:-}
         if [ -n "$stripAllList" ]; then
             stripDirs "$stripAllList" "${stripAllFlags:--s}"
@@ -748,9 +748,9 @@ fixupPhase() {
         echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
     fi
 
-    if [ -n "$propagatedBuildNativeInputs" ]; then
+    if [ -n "$propagatedNativeBuildInputs" ]; then
         mkdir -p "$out/nix-support"
-        echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs"
+        echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
     fi
 
     if [ -n "$propagatedUserEnvPkgs" ]; then
@@ -844,7 +844,7 @@ genericBuild() {
 
         showPhaseHeader "$curPhase"
         dumpVars
-        
+
         # Evaluate the variable named $curPhase if it exists, otherwise the
         # function named $curPhase.
         eval "${!curPhase:-$curPhase}"
@@ -852,7 +852,7 @@ genericBuild() {
         if [ "$curPhase" = unpackPhase ]; then
             cd "${sourceRoot:-.}"
         fi
-        
+
         if [ -n "$tracePhases" ]; then
             echo
             echo "@ phase-succeeded $out $curPhase"
@@ -869,4 +869,10 @@ genericBuild() {
 runHook postHook
 
 
+# Execute the global user hook (defined through the Nixpkgs
+# configuration option ‘stdenv.userHook’).  This can be used to set
+# global compiler optimisation flags, for instance.
+runHook userHook
+
+
 dumpVars
diff --git a/pkgs/stdenv/linux/bootstrap/armv6l/default.nix b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
new file mode 100644
index 00000000000..ecda6be8bd3
--- /dev/null
+++ b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
@@ -0,0 +1,15 @@
+{
+  sh = ../armv5tel/sh;
+  bzip2 = ../armv5tel/bzip2;
+  mkdir = ../armv5tel/mkdir;
+  cpio = ../armv5tel/cpio;
+  ln = ../armv5tel/ln;
+  curl = ../armv5tel/curl.bz2;
+
+  bootstrapTools = {
+    # Built from make-bootstrap-tools-crosspi.nix
+    # nixpkgs rev eb0422e4c1263a65a9b2b954fe10a1e03d67db3e
+    url = http://viric.name/tmp/nix/pi/bootstrap-tools.cpio.bz2;
+    sha256 = "1zb27x5h54k51yrvn3sy4wb1qprx8iv2kfbgklxwc0mcxp9b7ccd";
+  };
+}
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 777b2cf6a32..21a916231e0 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -16,6 +16,7 @@ rec {
     else if system == "x86_64-linux" then import ./bootstrap/x86_64
     else if system == "powerpc-linux" then import ./bootstrap/powerpc
     else if system == "armv5tel-linux" then import ./bootstrap/armv5tel
+    else if system == "armv6l-linux" then import ./bootstrap/armv6l
     else if system == "armv7l-linux" then import ./bootstrap/armv5tel
     else if system == "mips64el-linux" then import ./bootstrap/loongson2f
     else abort "unsupported platform for the pure Linux stdenv";
@@ -32,11 +33,11 @@ rec {
 
   # The bootstrap process proceeds in several steps.
 
-  
+
   # 1) Create a standard environment by downloading pre-built binaries
   # of coreutils, GCC, etc.
 
-  
+
   # This function downloads a file.
   download = {url, sha256}: derivation {
     name = baseNameOf (toString url);
@@ -49,31 +50,31 @@ rec {
     impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
   };
 
-  
+
   # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
   bootstrapTools = derivation {
     name = "bootstrap-tools";
-    
+
     builder = bootstrapFiles.sh;
-    
+
     args =
-      if system == "armv5tel-linux"
+      if (system == "armv5tel-linux" || system == "armv6l-linux")
       then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
       else [ ./scripts/unpack-bootstrap-tools.sh ];
-    
+
     inherit (bootstrapFiles) bzip2 mkdir curl cpio;
-    
+
     tarball = download {
       inherit (bootstrapFiles.bootstrapTools) url sha256;
     };
-    
+
     inherit system;
-    
+
     # Needed by the GCC wrapper.
     langC = true;
     langCC = true;
   };
-  
+
 
   # This function builds the various standard environments used during
   # the bootstrap.
@@ -109,7 +110,7 @@ rec {
     fetchurl = null;
   };
 
-  
+
   fetchurl = import ../../build-support/fetchurl {
     stdenv = stdenvLinuxBoot0;
     curl = bootstrapTools;
@@ -133,7 +134,7 @@ rec {
   # A helper function to call gcc-wrapper.
   wrapGCC =
     {gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper"}:
-    
+
     import ../../build-support/gcc-wrapper {
       nativeTools = false;
       nativeLibc = false;
@@ -153,7 +154,7 @@ rec {
     };
     inherit fetchurl;
   };
-  
+
 
   # 2) These are the packages that we can build with the first
   #    stdenv.  We only need binutils, because recent Glibcs
@@ -164,7 +165,7 @@ rec {
     bootStdenv = stdenvLinuxBoot1;
   };
 
-  
+
   # 3) 2nd stdenv that we will use to build only the glibc.
   stdenvLinuxBoot2 = stdenvBootFun {
     gcc = wrapGCC {
@@ -186,12 +187,12 @@ rec {
     bootStdenv = stdenvLinuxBoot2;
   };
 
-  
+
   # 5) Build Glibc with the bootstrap tools.  The result is the full,
   #    dynamically linked, final Glibc.
   stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc;
 
-  
+
   # 6) Construct a third stdenv identical to the 2nd, except that
   #    this one uses the Glibc built in step 3.  It still uses
   #    the recent binutils and rest of the bootstrap tools, including GCC.
@@ -217,14 +218,14 @@ rec {
     inherit fetchurl;
   };
 
-  
+
   # 7) The packages that can be built using the third stdenv.
   stdenvLinuxBoot3Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot3;
   };
 
-  
+
   # 8) Construct a fourth stdenv identical to the second, except that
   #    this one uses the dynamically linked GCC and Binutils from step
   #    5.  The other tools (e.g. coreutils) are still from the
@@ -245,14 +246,14 @@ rec {
     inherit fetchurl;
   };
 
-  
+
   # 9) The packages that can be built using the fourth stdenv.
   stdenvLinuxBoot4Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot4;
   };
 
-  
+
   # 10) Construct the final stdenv.  It uses the Glibc, GCC and
   #     Binutils built above, and adds in dynamically linked versions
   #     of all other tools.
@@ -262,10 +263,10 @@ rec {
   #     first binutils built.
   stdenvLinux = import ../generic rec {
     inherit system config;
-    
+
     preHook = commonPreHook;
-    
-    initialPath = 
+
+    initialPath =
       ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
       ++ [stdenvLinuxBoot4Pkgs.patchelf];
 
@@ -273,18 +274,19 @@ rec {
       inherit (stdenvLinuxBoot3Pkgs) binutils;
       inherit (stdenvLinuxBoot4Pkgs) coreutils;
       libc = stdenvLinuxGlibc;
-      gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
+      gcc = stdenvLinuxBoot4.gcc.gcc;
       shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
       name = "";
     };
 
     shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
-    
+
     fetchurlBoot = fetchurl;
-    
+
     extraAttrs = {
       inherit (stdenvLinuxBoot3Pkgs) glibc;
-      inherit platform;
+      inherit platform bootstrapTools;
+      shellPackage = stdenvLinuxBoot4Pkgs.bash; 
     };
 
     overrides = pkgs: {
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
new file mode 100644
index 00000000000..9b2949e3e36
--- /dev/null
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
@@ -0,0 +1,269 @@
+{system ? builtins.currentSystem}:
+
+let
+  pkgsFun = import ../../top-level/all-packages.nix;
+  pkgsNoParams = pkgsFun {};
+  raspberrypiCrossSystem = {
+    crossSystem = {
+      config = "armv6l-unknown-linux-gnueabi";  
+      bigEndian = false;
+      arch = "arm";
+      float = "hard";
+      fpu = "vfp";
+      withTLS = true;
+      libc = "glibc";
+      platform = pkgsNoParams.platforms.raspberrypi;
+      openssl.system = "linux-generic32";
+      gcc = {
+        arch = "armv6";
+        fpu = "vfp";
+        float = "hard";
+      };
+    };
+  };
+
+  raspberrypiCrossSystemUclibc = {
+    crossSystem = {
+      config = "armv6l-unknown-linux-gnueabi";  
+      bigEndian = false;
+      arch = "arm";
+      float = "hard";
+      fpu = "vfp";
+      withTLS = true;
+      libc = "uclibc";
+      platform = pkgsNoParams.platforms.raspberrypi;
+      openssl.system = "linux-generic32";
+      gcc = {
+        arch = "armv6";
+        fpu = "vfp";
+        float = "hard";
+      };
+      uclibc.extraConfig = ''
+        ARCH_WANTS_BIG_ENDIAN n
+        ARCH_BIG_ENDIAN n
+        ARCH_WANTS_LITTLE_ENDIAN y
+        ARCH_LITTLE_ENDIAN y
+      '';
+    };
+  };
+
+  pkgsuclibc = pkgsFun ({inherit system;} // raspberrypiCrossSystemUclibc);
+  pkgs = pkgsFun ({inherit system;} // raspberrypiCrossSystem);
+
+  inherit (pkgs) stdenv nukeReferences cpio binutilsCross;
+
+  # We want coreutils without ACL support.
+  coreutils_base = pkgs.coreutils.override (args: {
+    aclSupport = false;
+  });
+
+  coreutils_ = coreutils_base.crossDrv;
+
+  glibc = pkgs.libcCross;
+  bash = pkgs.bash.crossDrv;
+  findutils = pkgs.findutils.crossDrv;
+  diffutils = pkgs.diffutils.crossDrv;
+  gnused = pkgs.gnused.crossDrv;
+  gnugrep = pkgs.gnugrep.crossDrv;
+  gawk = pkgs.gawk.crossDrv;
+  gnutar = pkgs.gnutar.crossDrv;
+  gzip = pkgs.gzip.crossDrv;
+  bzip2 = pkgs.bzip2.crossDrv;
+  gnumake = pkgs.gnumake.crossDrv;
+  patch = pkgs.patch.crossDrv;
+  patchelf = pkgs.patchelf.crossDrv;
+  replace = pkgs.replace.crossDrv;
+  gcc = pkgs.gcc47;
+  gmp = pkgs.gmp.crossDrv;
+  mpfr = pkgs.mpfr.crossDrv;
+  ppl = pkgs.ppl.crossDrv;
+  cloogppl = pkgs.cloogppl.crossDrv;
+  cloog = pkgs.cloog.crossDrv;
+  zlib = pkgs.zlib.crossDrv;
+  isl = pkgs.isl.crossDrv;
+  mpc = pkgs.mpc.crossDrv;
+  binutils = pkgs.binutils.crossDrv;
+  klibc = pkgs.klibc.crossDrv;
+
+in
+
+rec {
+
+  curlStatic = import <nixpkgs/pkgs/tools/networking/curl> {
+    stdenv = pkgsuclibc.stdenv;
+    inherit (pkgsuclibc) fetchurl;
+    zlibSupport = false;
+    sslSupport = false;
+    linkStatic = true;
+  };
+
+  bzip2Static = import <nixpkgs/pkgs/tools/compression/bzip2> {
+    stdenv = pkgsuclibc.stdenv;
+    inherit (pkgsuclibc) fetchurl;
+    linkStatic = true;
+  };
+
+  inherit pkgs;
+
+  build = 
+
+    stdenv.mkDerivation {
+      name = "build";
+
+      buildInputs = [nukeReferences cpio binutilsCross];
+
+      crossConfig = stdenv.cross.config;
+
+      buildCommand = ''
+	set -x
+        ensureDir $out/bin $out/lib $out/libexec
+
+        # Copy what we need of Glibc.
+        cp -d ${glibc}/lib/ld-*.so* $out/lib
+        cp -d ${glibc}/lib/libc*.so* $out/lib
+        cp -d ${glibc}/lib/libc_nonshared.a $out/lib
+        cp -d ${glibc}/lib/libm*.so* $out/lib
+        cp -d ${glibc}/lib/libdl*.so* $out/lib
+        cp -d ${glibc}/lib/librt*.so*  $out/lib
+        cp -d ${glibc}/lib/libpthread*.so* $out/lib
+        cp -d ${glibc}/lib/libnsl*.so* $out/lib
+        cp -d ${glibc}/lib/libutil*.so* $out/lib
+        cp -d ${glibc}/lib/crt?.o $out/lib
+        
+        cp -rL ${glibc}/include $out
+        chmod -R u+w $out/include
+        
+        # Hopefully we won't need these.
+        rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
+        find $out/include -name .install -exec rm {} \;
+        find $out/include -name ..install.cmd -exec rm {} \;
+        mv $out/include $out/include-glibc
+        
+        # Copy coreutils, bash, etc.
+        cp ${coreutils_}/bin/* $out/bin
+        (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
+        
+        cp ${bash}/bin/bash $out/bin
+        cp ${findutils}/bin/find $out/bin
+        cp ${findutils}/bin/xargs $out/bin
+        cp -d ${diffutils}/bin/* $out/bin
+        cp -d ${gnused}/bin/* $out/bin
+        cp -d ${gnugrep}/bin/* $out/bin
+        cp ${gawk}/bin/gawk $out/bin
+        cp -d ${gawk}/bin/awk $out/bin
+        cp ${gnutar}/bin/tar $out/bin
+        cp ${gzip}/bin/gzip $out/bin
+        cp ${bzip2}/bin/bzip2 $out/bin
+        cp -d ${gnumake}/bin/* $out/bin
+        cp -d ${patch}/bin/* $out/bin
+        cp ${patchelf}/bin/* $out/bin
+        cp ${replace}/bin/* $out/bin
+
+        cp -d ${gnugrep.pcre.crossDrv}/lib/libpcre*.so* $out/lib # needed by grep
+        
+        # Copy what we need of GCC.
+        cp -d ${gcc.gcc.crossDrv}/bin/gcc $out/bin
+        cp -d ${gcc.gcc.crossDrv}/bin/cpp $out/bin
+        cp -d ${gcc.gcc.crossDrv}/bin/g++ $out/bin
+        cp -d ${gcc.gcc.crossDrv}/lib*/libgcc_s.so* $out/lib
+        cp -d ${gcc.gcc.crossDrv}/lib*/libstdc++.so* $out/lib
+        cp -rd ${gcc.gcc.crossDrv}/lib/gcc $out/lib
+        chmod -R u+w $out/lib
+        rm -f $out/lib/gcc/*/*/include*/linux
+        rm -f $out/lib/gcc/*/*/include*/sound
+        rm -rf $out/lib/gcc/*/*/include*/root
+        rm -f $out/lib/gcc/*/*/include-fixed/asm
+        rm -rf $out/lib/gcc/*/*/plugin
+        #rm -f $out/lib/gcc/*/*/*.a
+        cp -rd ${gcc.gcc.crossDrv}/libexec/* $out/libexec
+        mkdir $out/include
+        cp -rd ${gcc.gcc.crossDrv}/include/c++ $out/include
+        chmod -R u+w $out/include
+        rm -rf $out/include/c++/*/ext/pb_ds
+        rm -rf $out/include/c++/*/ext/parallel
+
+        cp -d ${gmp}/lib/libgmp*.so* $out/lib
+        cp -d ${mpfr}/lib/libmpfr*.so* $out/lib
+        cp -d ${cloogppl}/lib/libcloog*.so* $out/lib
+        cp -d ${cloog}/lib/libcloog*.so* $out/lib
+        cp -d ${ppl}/lib/libppl*.so* $out/lib
+        cp -d ${isl}/lib/libisl*.so* $out/lib
+        cp -d ${mpc}/lib/libmpc*.so* $out/lib
+        cp -d ${zlib}/lib/libz.so* $out/lib
+        
+        # Copy binutils.
+        for i in as ld ar ranlib nm strip readelf objdump; do
+          cp ${binutils}/bin/$i $out/bin
+        done
+
+        chmod -R u+w $out
+        
+        # Strip executables even further.
+        for i in $out/bin/* $out/libexec/gcc/*/*/*; do
+            if test -x $i -a ! -L $i; then
+                chmod +w $i
+                $crossConfig-strip -s $i || true
+            fi
+        done
+
+        nuke-refs $out/bin/*
+        nuke-refs $out/lib/*
+        nuke-refs $out/libexec/gcc/*/*/*
+        nuke-refs $out/libexec/gcc/*/*/*/*
+
+        mkdir $out/.pack
+        mv $out/* $out/.pack
+        mv $out/.pack $out/pack
+
+        mkdir $out/on-server
+        (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
+
+        mkdir $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/sh $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/cpio $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/mkdir $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/ln $out/in-nixpkgs
+        cp ${curlStatic.crossDrv}/bin/curl $out/in-nixpkgs
+        cp ${bzip2Static.crossDrv}/bin/bzip2 $out/in-nixpkgs
+        chmod u+w $out/in-nixpkgs/*
+        $crossConfig-strip $out/in-nixpkgs/*
+        nuke-refs $out/in-nixpkgs/*
+        bzip2 $out/in-nixpkgs/curl
+      ''; # */
+
+      # The result should not contain any references (store paths) so
+      # that we can safely copy them out of the store and to other
+      # locations in the store.
+      allowedReferences = [];
+    };
+
+  
+  unpack =
+    
+    stdenv.mkDerivation {
+      name = "unpack";
+
+      buildCommand = ''
+        ${build}/in-nixpkgs/mkdir $out
+        ${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -V -i)
+
+        for i in $out/bin/* $out/libexec/gcc/*/*/*; do
+            echo patching $i
+            if ! test -L $i; then
+                LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
+                    $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i
+            fi
+        done
+
+        # Fix the libc linker script.
+        for i in $out/lib/libc.so; do
+            cat $i | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $i.tmp
+            mv $i.tmp $i
+        done
+      ''; # " */
+
+      allowedReferences = ["out"];
+    };
+
+    
+}
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
index 3709ac05041..dcf819ad6f7 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
+++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
@@ -13,22 +13,24 @@ echo Patching the bootstrap tools...
 LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf .
 
 for i in $out/bin/* $out/libexec/gcc/*/*/* $out/lib/librt*; do
+    if test ${i%.la} != $i; then continue; fi
+    if test ${i%*.so*} != $i; then continue; fi
+    if ! test -f $i; then continue; fi
+    if test -L $i; then continue; fi
     echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
-    fi
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
 done
-for i in $out/lib/libppl* $out/lib/libgmp*; do
+for i in $out/lib/librt* $out/lib/libcloog* $out/lib/libppl* $out/lib/libgmp*; do
+    if ! test -f $i; then continue; fi
+    if test -L $i; then continue; fi
     echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-    fi
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
 done
 
 # Fix the libc linker script.
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index 668bac5f0ae..d0f7d60f101 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -12,7 +12,7 @@ import ../generic rec {
         export NIX_DONT_SET_RPATH=1
         export NIX_NO_SELF_RPATH=1
         dontFixLibtool=1
-        stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 
+        stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
         xargsFlags=" "
       fi
     '';
@@ -25,7 +25,7 @@ import ../generic rec {
     nativeTools = false;
     nativeLibc = true;
     inherit stdenv;
-    binutils = 
+    binutils =
       if stdenv.isDarwin then
         import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
       else
@@ -42,7 +42,7 @@ import ../generic rec {
   overrides = pkgs_: {
     inherit gcc;
     inherit (gcc) binutils;
-    inherit (pkgs) 
+    inherit (pkgs)
       gzip bzip2 xz bash coreutils diffutils findutils gawk
       gnumake gnused gnutar gnugrep gnupatch perl;
   };
diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix
index 3fbb350e0ab..929332275fc 100644
--- a/pkgs/tools/X11/xpra/default.nix
+++ b/pkgs/tools/X11/xpra/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1s1z6r0r78qvf59ci3vxammjz7lj5m64jyk0bfn7yxd5jl3sy41y";
   };
 
-  buildNativeInputs = [ cython ];
+  nativeBuildInputs = [ cython ];
 
   buildInputs = [
     pkgconfig python pygtk gtk ffmpeg x264 libvpx makeWrapper
diff --git a/pkgs/tools/admin/tigervnc/default.nix b/pkgs/tools/admin/tigervnc/default.nix
index f74463b1063..c6fbff30afa 100644
--- a/pkgs/tools/admin/tigervnc/default.nix
+++ b/pkgs/tools/admin/tigervnc/default.nix
@@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
   inherit fontDirectories;
 
   patchPhase = ''
-    sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.hostDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
-    sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.hostDrv else xkbcomp}/bin";' unix/vncserver 
-    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.hostDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver 
+    sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.crossDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
+    sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.crossDrv else xkbcomp}/bin";' unix/vncserver 
+    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.crossDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver 
 
     fontPath=
     for i in $fontDirectories; do
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
   '';
 
   crossAttrs = {
-    buildInputs = (map (x : x.hostDrv) (buildInputs ++ [
+    buildInputs = (map (x : x.crossDrv) (buildInputs ++ [
       fixesproto damageproto xcmiscproto bigreqsproto randrproto renderproto
       fontsproto videoproto compositeproto scrnsaverproto resourceproto
       libxkbfile libXfont libpciaccess xineramaproto
@@ -82,13 +82,13 @@ stdenv.mkDerivation rec {
       libXinerama libXcursor libxcrypt
     ];
   
-  buildNativeInputs = 
+  nativeBuildInputs = 
     [ autoconf automake cvs utilmacros fontutil libtool flex bison 
       cmake
     ] 
-      ++ xorgserver.buildNativeInputs;
+      ++ xorgserver.nativeBuildInputs;
 
-  propagatedBuildNativeInputs = xorgserver.propagatedBuildNativeInputs;
+  propagatedNativeBuildInputs = xorgserver.propagatedNativeBuildInputs;
 
   meta = {
     homepage = http://www.tigervnc.org/;
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index 4ef973bd56a..51d5d35fe80 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "gnutar-1.26";
 
   src = fetchurl {
@@ -8,6 +8,12 @@ stdenv.mkDerivation (rec {
     sha256 = "0hbdkzmchq9ycr2x1pxqdcgdbaxksh8c6ac0jf75jajhcks6jlss";
   };
 
+  patches = [ ./gets-undeclared.patch ];
+
+  # May have some issues with root compilation because the bootstrap tool
+  # cannot be used as a login shell for now.
+  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux") "1";
+
   meta = {
     homepage = http://www.gnu.org/software/tar/;
     description = "GNU implementation of the `tar' archiver";
@@ -33,18 +39,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-  # May have some issues with root compilation because the bootstrap tool
-  # cannot be used as a login shell for now.
-// stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux") {
-  FORCE_UNSAFE_CONFIGURE = 1;
-}
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ./gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix
index 2773e112a49..7346b8e4e05 100644
--- a/pkgs/tools/archivers/sharutils/default.nix
+++ b/pkgs/tools/archivers/sharutils/default.nix
@@ -8,6 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "1mallg1gprimlggdisfzdmh1xi676jsfdlfyvanlcw72ny8fsj3g";
   };
 
+  preConfigure =
+    ''
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in sharutils is updated.
+       sed -i '/gets is a security hole/d' lib/stdio.in.h
+    '';
+
   # GNU Gettext is needed on non-GNU platforms.
   buildInputs = [ gettext ];
 
diff --git a/pkgs/tools/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix
index 7ba5175d550..7062053703e 100644
--- a/pkgs/tools/backup/bup/default.nix
+++ b/pkgs/tools/backup/bup/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     rev = "458e92da32ddd3c18fc1c3e52a76e9f0b48b832f";
   };
 
-  buildNativeInputs = [ pandoc perl makeWrapper ];
+  nativeBuildInputs = [ pandoc perl makeWrapper ];
 
   buildInputs = [ python git ];
 
diff --git a/pkgs/tools/bluetooth/obexd/default.nix b/pkgs/tools/bluetooth/obexd/default.nix
index 1cf3918c21f..47db0877dd2 100644
--- a/pkgs/tools/bluetooth/obexd/default.nix
+++ b/pkgs/tools/bluetooth/obexd/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib dbus.libs openobex bluez libical ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.bluez.org/;
diff --git a/pkgs/tools/compression/bzip2/builder.sh b/pkgs/tools/compression/bzip2/builder.sh
index 4610bdd4085..a598dfcf808 100644
--- a/pkgs/tools/compression/bzip2/builder.sh
+++ b/pkgs/tools/compression/bzip2/builder.sh
@@ -10,7 +10,7 @@ if test -n "$sharedLibrary"; then
     preInstall() {
         mkdir -p $out/lib
         mv libbz2.so* $out/lib
-        ln -s libbz2.so.1.0 $out/lib/libbz2.so
+        (cd $out/lib && ln -s libbz2.so.1.0.? libbz2.so && ln -s libbz2.so.1.0.? libbz2.so.1);
     }
     
 fi
diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix
index e1d6d75da51..d15b26f48b6 100644
--- a/pkgs/tools/compression/gzip/default.nix
+++ b/pkgs/tools/compression/gzip/default.nix
@@ -1,15 +1,13 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation (rec {
-  name = "gzip-1.4";
+stdenv.mkDerivation rec {
+  name = "gzip-1.5";
 
   src = fetchurl {
-    url = "mirror://gnu/gzip/${name}.tar.gz";
-    sha256 = "1vhiyzls60fws48scw48wvwn8mpv1f4yhcsnafys239qvb9wyrni";
+    url = "mirror://gnu/gzip/${name}.tar.xz";
+    sha256 = "0wx1nqk709kx75cwp2axachnbxryp4gyl06qxn5nl95184w0mhls";
   };
 
-  doCheck = true;
-
   meta = {
     homepage = http://www.gnu.org/software/gzip/;
     description = "Gzip, the GNU zip compression program";
@@ -31,13 +29,3 @@ stdenv.mkDerivation (rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ./gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/compression/gzip/gets-undeclared.patch b/pkgs/tools/compression/gzip/gets-undeclared.patch
deleted file mode 100644
index a09f59b122a..00000000000
--- a/pkgs/tools/compression/gzip/gets-undeclared.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-This is a backport of this patch:
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
---- gzip/lib/stdio.in.h	2012-07-02 14:28:45.000000000 +0200
-+++ gzip/lib/stdio.in.h	2012-07-02 14:28:50.000000000 +0200
-@@ -160,12 +160,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not
-                  "use gnulib module fflush for portable POSIX compliance");
- #endif
- 
--/* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
--#undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
--
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix
index 78a8ed95a4e..6b74ba41eca 100644
--- a/pkgs/tools/compression/xz/default.nix
+++ b/pkgs/tools/compression/xz/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "xz-5.0.3";
+  name = "xz-5.0.4";
 
   src = fetchurl {
     url = "http://tukaani.org/xz/${name}.tar.bz2";
-    sha256 = "1sgaq4gdh8llz3gnlgvd65x610fwc8h4m32skhqn5npwgghvj4as";
+    sha256 = "14nf55b47335aakswqk0kqv1qsh4269rnb757dmkkbd1sdhb1naw";
   };
 
   doCheck = true;
diff --git a/pkgs/tools/filesystems/ntfs-3g/default.nix b/pkgs/tools/filesystems/ntfs-3g/default.nix
index cedb8df39d1..a306a424ee1 100644
--- a/pkgs/tools/filesystems/ntfs-3g/default.nix
+++ b/pkgs/tools/filesystems/ntfs-3g/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   buildInputs = [libuuid] ++ stdenv.lib.optionals crypto [gnutls libgcrypt];
-  buildNativeInputs = stdenv.lib.optional crypto pkgconfig;
+  nativeBuildInputs = stdenv.lib.optional crypto pkgconfig;
 
   src = fetchurl {
     url = "http://tuxera.com/opensource/${name}.tgz";
diff --git a/pkgs/tools/graphics/argyllcms/default.nix b/pkgs/tools/graphics/argyllcms/default.nix
index 08cd012e079..934a27ef25b 100644
--- a/pkgs/tools/graphics/argyllcms/default.nix
+++ b/pkgs/tools/graphics/argyllcms/default.nix
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
       -ljpeg -ltiff ;
   '';
 
-  buildNativeInputs = [ jam unzip ];
+  nativeBuildInputs = [ jam unzip ];
 
   preConfigure = ''
     cp ${jamTop} Jamtop
diff --git a/pkgs/tools/graphics/enblend-enfuse/default.nix b/pkgs/tools/graphics/enblend-enfuse/default.nix
index f1759d7a782..b77d63d510d 100644
--- a/pkgs/tools/graphics/enblend-enfuse/default.nix
+++ b/pkgs/tools/graphics/enblend-enfuse/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libtiff libpng lcms libxmi boost mesa freeglut glew ];
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   patches =
     let
diff --git a/pkgs/tools/graphics/pfstools/default.nix b/pkgs/tools/graphics/pfstools/default.nix
index 0c829eab130..9b0a83725ea 100644
--- a/pkgs/tools/graphics/pfstools/default.nix
+++ b/pkgs/tools/graphics/pfstools/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libtiff openexr imagemagick libjpeg qt4 mesa freeglut
     bzip2 libX11 libpng expat ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://pfstools.sourceforge.net/;
diff --git a/pkgs/tools/graphics/qrencode/default.nix b/pkgs/tools/graphics/qrencode/default.nix
index 866b121f76b..3b83a18fd36 100644
--- a/pkgs/tools/graphics/qrencode/default.nix
+++ b/pkgs/tools/graphics/qrencode/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libpng ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://fukuchi.org/works/qrencode/;
diff --git a/pkgs/tools/misc/coreutils/8.19.nix b/pkgs/tools/misc/coreutils/8.19.nix
new file mode 100644
index 00000000000..f3bee551960
--- /dev/null
+++ b/pkgs/tools/misc/coreutils/8.19.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, perl, gmp ? null
+, aclSupport ? false, acl ? null
+, selinuxSupport? false, libselinux ? null, libsepol ? null
+}:
+
+assert aclSupport -> acl != null;
+assert selinuxSupport -> libselinux != null && libsepol != null;
+
+stdenv.mkDerivation rec {
+  name = "coreutils-8.19";
+
+  src = fetchurl {
+    url = "mirror://gnu/coreutils/${name}.tar.xz";
+    sha256 = "1rx9x3fp848w4nny7irdkcpkan9fcx24d99v5dkwgkyq7wc76f5d";
+  };
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ gmp ]
+    ++ stdenv.lib.optional aclSupport acl
+    ++ stdenv.lib.optional selinuxSupport libselinux
+    ++ stdenv.lib.optional selinuxSupport libsepol;
+
+  crossAttrs = ({
+    buildInputs = [ gmp ]
+      ++ stdenv.lib.optional aclSupport acl.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libselinux.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libsepol.crossDrv
+      ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
+        stdenv.gccCross.libc.libiconv.crossDrv;
+
+    # Needed for fstatfs()
+    # I don't know why it is not properly detected cross building with glibc.
+    configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
+    doCheck = false;
+  }
+
+  //
+
+  # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
+  (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
+    patches = [ ./gets-undeclared.patch ];
+  }));
+
+  # The tests are known broken on Cygwin
+  # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
+  # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
+  # and {Open,Free}BSD.
+  doCheck = stdenv ? glibc;
+
+  enableParallelBuilding = true;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol";
+
+  meta = {
+    homepage = http://www.gnu.org/software/coreutils/;
+    description = "The basic file, shell and text manipulation utilities of the GNU operating system";
+
+    longDescription = ''
+      The GNU Core Utilities are the basic file, shell and text
+      manipulation utilities of the GNU operating system.  These are
+      the core utilities which are expected to exist on every
+      operating system.
+    '';
+
+    license = "GPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
+
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 9d9ea52f3f5..9fd1d86ff82 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -4,17 +4,17 @@
 }:
 
 assert aclSupport -> acl != null;
-assert selinuxSupport -> ( (libselinux != null) && (libsepol != null) );
+assert selinuxSupport -> libselinux != null && libsepol != null;
 
 stdenv.mkDerivation rec {
-  name = "coreutils-8.15";
+  name = "coreutils-8.20";
 
   src = fetchurl {
     url = "mirror://gnu/coreutils/${name}.tar.xz";
-    sha256 = "176lgw810xw84c6fz5xwhydxggkndmzggl0pxqzldbjf85vv6zl3";
+    sha256 = "1cly97xdy3v4nbbx631k43smqw0nnpn651kkprs0yyl2cj3pkjyv";
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   buildInputs = [ gmp ]
     ++ stdenv.lib.optional aclSupport acl
     ++ stdenv.lib.optional selinuxSupport libselinux
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
 
   crossAttrs = ({
     buildInputs = [ gmp ]
-      ++ stdenv.lib.optional aclSupport acl.hostDrv
-      ++ stdenv.lib.optional selinuxSupport libselinux.hostDrv
-      ++ stdenv.lib.optional selinuxSupport libsepol.hostDrv
+      ++ stdenv.lib.optional aclSupport acl.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libselinux.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libsepol.crossDrv
       ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
-        stdenv.gccCross.libc.libiconv.hostDrv;
+        stdenv.gccCross.libc.libiconv.crossDrv;
 
     # Needed for fstatfs()
     # I don't know why it is not properly detected cross building with glibc.
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
   # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
   # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
   # and {Open,Free}BSD.
-  doCheck = (stdenv ? glibc);
+  doCheck = stdenv ? glibc;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/tools/misc/file/511.nix b/pkgs/tools/misc/file/511.nix
deleted file mode 100644
index 4e62462b8b3..00000000000
--- a/pkgs/tools/misc/file/511.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl, zlib}:
- 
-stdenv.mkDerivation rec {
-  name = "file-5.11";
-
-  buildInputs = [ zlib ];
-
-  src = fetchurl {
-    url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
-    sha256 = "c70ae29a28c0585f541d5916fc3248c3e91baa481f63d7ccec53d1534cbcc9b7";
-  };
-
-  meta = {
-    description = "A program that shows the type of files";
-    homepage = "http://darwinsys.com/file";
-  };
-}
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index 38fb0b78cb1..d7e88ec1a8c 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -1,18 +1,17 @@
-{stdenv, fetchurl}:
- 
-stdenv.mkDerivation {
-  name = "file-5.04";
+{stdenv, fetchurl, zlib}:
+
+stdenv.mkDerivation rec {
+  name = "file-5.11";
+
+  buildInputs = [ zlib ];
 
   src = fetchurl {
-    urls = [
-      ftp://ftp.astron.com/pub/file/file-5.04.tar.gz
-      http://pkgs.fedoraproject.org/repo/pkgs/file/file-5.04.tar.gz/accade81ff1cc774904b47c72c8aeea0/file-5.04.tar.gz
-    ];
-    sha256 = "0316lj3jxmp2g8azv0iykmmwjsnjanq93bklccwb6k77jiwnx7jc";
+    url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
+    sha256 = "c70ae29a28c0585f541d5916fc3248c3e91baa481f63d7ccec53d1534cbcc9b7";
   };
 
   meta = {
     description = "A program that shows the type of files";
-    homepage = ftp://ftp.astron.com/pub/file;
+    homepage = "http://darwinsys.com/file";
   };
 }
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index eeb6b852e61..88cb2c313c0 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3";
   };
 
-  buildNativeInputs = [coreutils];
+  nativeBuildInputs = [coreutils];
 
   patches = [ ./findutils-path.patch ./change_echo_path.patch ];
 
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index d37ce9f5aac..d824d76a864 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   buildInputs = [ ncurses libusb freetype gettext devicemapper ]
     ++ stdenv.lib.optional doCheck qemu;
 
@@ -43,6 +43,10 @@ stdenv.mkDerivation rec {
        # See <http://www.mail-archive.com/qemu-devel@nongnu.org/msg22775.html>.
        sed -i "tests/util/grub-shell.in" \
            -e's/qemu-system-i386/qemu-system-x86_64 -nodefaults/g'
+
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in grub is updated.
+       sed -i '/gets is a security hole/d' grub-core/gnulib/stdio.in.h
     '';
 
   prePatch =
diff --git a/pkgs/tools/misc/idutils/default.nix b/pkgs/tools/misc/idutils/default.nix
index 4b81d48b027..b76b9a18715 100644
--- a/pkgs/tools/misc/idutils/default.nix
+++ b/pkgs/tools/misc/idutils/default.nix
@@ -8,6 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1";
   };
 
+  preConfigure =
+    ''
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in idutils is updated.
+       sed -i '/gets is a security hole/d' lib/stdio.in.h
+    '';
+
   buildInputs = stdenv.lib.optional stdenv.isLinux emacs;
 
   doCheck = true;
diff --git a/pkgs/tools/misc/ttf2pt1/default.nix b/pkgs/tools/misc/ttf2pt1/default.nix
index 379db7d533f..659b04a6238 100644
--- a/pkgs/tools/misc/ttf2pt1/default.nix
+++ b/pkgs/tools/misc/ttf2pt1/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   '';
 
   buildInputs = [ freetype ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   
   patches = ./gentoo-makefile.patch; # also contains the freetype patch
 
diff --git a/pkgs/tools/misc/usbmuxd/default.nix b/pkgs/tools/misc/usbmuxd/default.nix
index c4b41249355..b95dfde9850 100644
--- a/pkgs/tools/misc/usbmuxd/default.nix
+++ b/pkgs/tools/misc/usbmuxd/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "09swwr6x46qxmwylrylnyqh4pznr0swla9gijggwxxw8dw82r840";
   };
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
   propagatedBuildInputs = [ libusb1 libplist ];
 
   patchPhase =
diff --git a/pkgs/tools/misc/xburst-tools/default.nix b/pkgs/tools/misc/xburst-tools/default.nix
index 563406e430b..cc9f98a94f6 100644
--- a/pkgs/tools/misc/xburst-tools/default.nix
+++ b/pkgs/tools/misc/xburst-tools/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   # Not to strip cross build binaries (this is for the gcc-cross-wrapper)
   dontCrossStrip = true;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb libusb1 autoconf automake confuse ] ++
     stdenv.lib.optional (gccCross != null) gccCross;
 
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index 52c8e493fdc..40f19dc89e0 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ python ];
-  buildNativeInputs = [ pandoc zip ];
+  nativeBuildInputs = [ pandoc zip ];
 
   patchPhase = ''
     rm youtube-dl
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 028b672380c..c6e7ccd1fa2 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     ${if linkStatic then "--enable-static --disable-shared" else ""}
   '';
 
-  dontDisableStatic = if linkStatic then true else false;
+  dontDisableStatic = linkStatic;
 
   CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else "";
   LDFLAGS = if linkStatic then "-static" else "";
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     # We should refer to the cross built openssl
     # For the 'urandom', maybe it should be a cross-system option
     configureFlags = ''
-      ${if sslSupport then "--with-ssl=${openssl.hostDrv}" else "--without-ssl"}
+      ${if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl"}
       ${if linkStatic then "--enable-static --disable-shared" else ""}
       --with-random /dev/urandom
     '';
diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix
index 6734465dbba..24d73ff4d6f 100644
--- a/pkgs/tools/networking/inetutils/default.nix
+++ b/pkgs/tools/networking/inetutils/default.nix
@@ -1,18 +1,26 @@
 { stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
-  name = "inetutils-1.8";
+  name = "inetutils-1.9.1";
 
   src = fetchurl {
     url = "mirror://gnu/inetutils/${name}.tar.gz";
-    sha256 = "1iqihfv54nzjmclivys2dpcyfhavgynj8pp6r44a97jbw2p0nl68";
+    sha256 = "0azzg6njgq79byl6960kb0wihfhhzf49snslhxgvi30ribgfpa82";
   };
 
   buildInputs = [ ncurses /* for `talk' */ ];
 
   configureFlags = "--with-ncurses-include-dir=${ncurses}/include";
 
-  doCheck = true;
+  preConfigure = ''
+     # Fix for building on Glibc 2.16.  Won't be needed once the
+     # gnulib in inetutils is updated.
+     sed -i '/gets is a security hole/d' lib/stdio.in.h
+  '';
+
+  # Test fails with "UNIX socket name too long", probably because our
+  # $TMPDIR is too long.
+  #doCheck = true;
 
   postInstall = ''
     # XXX: These programs are normally installed setuid but since it
diff --git a/pkgs/tools/networking/modemmanager/default.nix b/pkgs/tools/networking/modemmanager/default.nix
index d3198cee32c..bfa673eff09 100644
--- a/pkgs/tools/networking/modemmanager/default.nix
+++ b/pkgs/tools/networking/modemmanager/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1fdf5d5cc494825afe9f551248e00a2d91e220e88435b47f109ca2a707a40f1f";
   };
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   buildInputs = [ udev polkit dbus_glib ppp ];
 
diff --git a/pkgs/tools/networking/network-manager-applet/default.nix b/pkgs/tools/networking/network-manager-applet/default.nix
index 1a9b9485749..e6ef3093054 100644
--- a/pkgs/tools/networking/network-manager-applet/default.nix
+++ b/pkgs/tools/networking/network-manager-applet/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     polkit isocodes 
   ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   makeFlags = [
     ''CFLAGS=-DMOBILE_BROADBAND_PROVIDER_INFO=\"${mobile_broadband_provider_info}/share/mobile-broadband-provider-info/serviceproviders.xml\"''
diff --git a/pkgs/tools/networking/network-manager/default.nix b/pkgs/tools/networking/network-manager/default.nix
index 0e3eaecf4cb..d9e73a706db 100644
--- a/pkgs/tools/networking/network-manager/default.nix
+++ b/pkgs/tools/networking/network-manager/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ dbus_glib gnutls libgcrypt ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   patches =
     [ ( substituteAll {
diff --git a/pkgs/tools/networking/network-manager/pptp.nix b/pkgs/tools/networking/network-manager/pptp.nix
index 8d2acfe9b31..b71e41c8b56 100644
--- a/pkgs/tools/networking/network-manager/pptp.nix
+++ b/pkgs/tools/networking/network-manager/pptp.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ networkmanager pptp ppp ]
     ++ stdenv.lib.optionals withGnome [ gtk libgnome_keyring ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   configureFlags =
     if withGnome then "--with-gnome --with-gtkver=2" else "--without-gnome";
diff --git a/pkgs/tools/networking/networkmanagement/default.nix b/pkgs/tools/networking/networkmanagement/default.nix
index 1919186586a..474a4638758 100644
--- a/pkgs/tools/networking/networkmanagement/default.nix
+++ b/pkgs/tools/networking/networkmanagement/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ kdelibs kde_workspace networkmanager ];
-  buildNativeInputs = [ gettext pkgconfig ];
+  nativeBuildInputs = [ gettext pkgconfig ];
 
   NIX_CFLAGS_COMPILE="-I${kde_workspace}/include/solid/control";
 
diff --git a/pkgs/tools/networking/ntop/default.nix b/pkgs/tools/networking/ntop/default.nix
index 945effabcfb..48f2c9f0893 100644
--- a/pkgs/tools/networking/ntop/default.nix
+++ b/pkgs/tools/networking/ntop/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     cp ${libtool}/share/aclocal/libtool.m4 libtool.m4.in
   '';
 
-  buildNativeInputs = [ autoconf automake libtool wget libpcap gdbm zlib openssl rrdtool
+  nativeBuildInputs = [ autoconf automake libtool wget libpcap gdbm zlib openssl rrdtool
     python geoip ];
 
   meta = {
diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix
index c1504697a18..d50811febbb 100644
--- a/pkgs/tools/networking/openssh/default.nix
+++ b/pkgs/tools/networking/openssh/default.nix
@@ -28,7 +28,6 @@ stdenv.mkDerivation rec {
     
   patches = [ ./locale_archive.patch ];
 
-  buildNativeInptus = [ perl ];
   buildInputs = [ zlib openssl libedit pkgconfig pam ];
 
   # I set --disable-strip because later we strip anyway. And it fails to strip
diff --git a/pkgs/tools/networking/pptp/default.nix b/pkgs/tools/networking/pptp/default.nix
index 88f1a86a2ed..5bfb6f58bea 100644
--- a/pkgs/tools/networking/pptp/default.nix
+++ b/pkgs/tools/networking/pptp/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
           MANDIR=$out/share/man/man8 PPPDIR=$out/etc/ppp )
     '';
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     description = "PPTP client for Linux";
diff --git a/pkgs/tools/networking/surfraw/default.nix b/pkgs/tools/networking/surfraw/default.nix
index 6fcc031aab4..bd3a1135a84 100644
--- a/pkgs/tools/networking/surfraw/default.nix
+++ b/pkgs/tools/networking/surfraw/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     "--disable-opensearch"
   ];
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     description = "Provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power";
diff --git a/pkgs/tools/networking/wget/default.nix b/pkgs/tools/networking/wget/default.nix
index 799c5e9dd85..f52b344aeac 100644
--- a/pkgs/tools/networking/wget/default.nix
+++ b/pkgs/tools/networking/wget/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gettext, perl, LWP, gnutls ? null }:
 
 stdenv.mkDerivation rec {
-  name = "wget-1.13.4";
+  name = "wget-1.14";
 
   src = fetchurl {
     url = "mirror://gnu/wget/${name}.tar.gz";
-    sha256 = "1kadjg63x1mm741dxdidwsn1rz0f7dkzbq59v0iww87jr45p3ir4";
+    sha256 = "0sf26vlklxx20fjnj30fx6rijpcyvdl6cjmh6m2bjnvn7a78k9pk";
   };
 
   preConfigure = stdenv.lib.optionalString doCheck
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
        done
     '';
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
   buildInputs =
     stdenv.lib.optionals doCheck [ perl LWP ]
     ++ stdenv.lib.optional (gnutls != null) gnutls;
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 5448c9f5ba3..97ef421c341 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "32cba96df0e02d6627f5625a441fdd4ea0db718dd5bfd50044cdfd3c606d4852";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ curl openssl boehmgc sqlite ];
 
@@ -43,8 +43,8 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     postUnpack =
-      '' export CPATH="${bzip2.hostDrv}/include"
-         export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
+      '' export CPATH="${bzip2.crossDrv}/include"
+         export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
       '';
 
     configureFlags =
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index 4c053c9e820..4473bbab9c1 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "d0f952ff3b4c0cf7f9682b45844ffb3686ff333d02be83341380186a97834f95";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ curl openssl boehmgc sqlite ];
 
@@ -43,8 +43,8 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     postUnpack =
-      '' export CPATH="${bzip2.hostDrv}/include"
-         export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
+      '' export CPATH="${bzip2.crossDrv}/include"
+         export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
       '';
 
     configureFlags =
diff --git a/pkgs/tools/security/ccrypt/default.nix b/pkgs/tools/security/ccrypt/default.nix
index a134f45c988..5653af424d1 100644
--- a/pkgs/tools/security/ccrypt/default.nix
+++ b/pkgs/tools/security/ccrypt/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1bzbfq19jnnlp221kilzxpy0l6w3hk9b1iqjz4haypzlyxswnf35";
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     homepage = http://ccrypt.sourceforge.net/;
diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix
index 28a673d03ef..a6f8b2dc064 100644
--- a/pkgs/tools/security/pcsclite/default.nix
+++ b/pkgs/tools/security/pcsclite/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ udev dbus_libs ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Middleware to access a smart card using SCard API (PC/SC)";
diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix
index ba4ce8a3e22..543c5d81ba1 100644
--- a/pkgs/tools/security/pinentry/default.nix
+++ b/pkgs/tools/security/pinentry/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     ++ (if useGtk then ["--enable-pinentry-gtk2"] else ["--disable-pinentry-gtk"])
     ++ (if useQt4 then ["--enable-pinentry-qt4"] else ["--disable-pinentry-qt4"]);
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = "http://gnupg.org/aegypten2/";
diff --git a/pkgs/tools/security/polkit-gnome/default.nix b/pkgs/tools/security/polkit-gnome/default.nix
index b70aa427031..c06aac204a1 100644
--- a/pkgs/tools/security/polkit-gnome/default.nix
+++ b/pkgs/tools/security/polkit-gnome/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ polkit gtk3 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--disable-introspection";
 
diff --git a/pkgs/tools/security/polkit-kde-agent/default.nix b/pkgs/tools/security/polkit-kde-agent/default.nix
index 10836366b18..7696ee93bce 100644
--- a/pkgs/tools/security/polkit-kde-agent/default.nix
+++ b/pkgs/tools/security/polkit-kde-agent/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs polkit_qt_1 ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   patchPhase = "sed -e s/KDE4_AUTOSTART/AUTOSTART/ -i CMakeLists.txt";
 
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index 086a44675a9..fc4293ad7cf 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -1,28 +1,20 @@
-{stdenv, fetchurl, coreutils ? null}:
+{ stdenv, fetchurl, coreutils ? null }:
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name = "diffutils-3.2";
-  
+
   src = fetchurl {
     url = mirror://gnu/diffutils/diffutils-3.2.tar.gz;
     sha256 = "1lsf0ln0h3mnm2y0mwgrfk0lyfi7bnm4r886acvdrrsvc7pypaia";
   };
-  
+
+  patches = [ ./gets-undeclared.patch ];
+
   /* If no explicit coreutils is given, use the one from stdenv. */
-  buildNativeInputs = [coreutils];
+  nativeBuildInputs = [ coreutils ];
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;
     description = "Commands for showing the differences between files (diff, cmp, etc.)";
   };
 }
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ../../misc/coreutils/gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/text/diffutils/gets-undeclared.patch b/pkgs/tools/text/diffutils/gets-undeclared.patch
new file mode 100644
index 00000000000..b6cdc77caa8
--- /dev/null
+++ b/pkgs/tools/text/diffutils/gets-undeclared.patch
@@ -0,0 +1,71 @@
+This patch is needed to allow builds with newer versions of
+the GNU libc (2.16+).
+
+
+commit 66712c23388e93e5c518ebc8515140fa0c807348
+Author: Eric Blake <eblake@redhat.com>
+Date:   Thu Mar 29 13:30:41 2012 -0600
+
+    stdio: don't assume gets any more
+    
+    Gnulib intentionally does not have a gets module, and now that C11
+    and glibc have dropped it, we should be more proactive about warning
+    any user on a platform that still has a declaration of this dangerous
+    interface.
+    
+    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
+    support.
+    * modules/stdio (Makefile.am): Likewise.
+    * lib/stdio-read.c (gets): Likewise.
+    * tests/test-stdio-c++.cc: Likewise.
+    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
+    * lib/stdio.in.h (gets): Make warning occur in more places.
+    * doc/posix-functions/gets.texi (gets): Update documentation.
+    Reported by Christer Solskogen.
+    
+    Signed-off-by: Eric Blake <eblake@redhat.com>
+
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index aa7b599..c377b6e 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
+@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ # endif
+ #endif
+ 
+-/* Some people would argue that sprintf should be handled like gets
+-   (for example, OpenBSD issues a link warning for both functions),
+-   since both can cause security holes due to buffer overruns.
++/* Some people would argue that all sprintf uses should be warned about
++   (for example, OpenBSD issues a link warning for it),
++   since it can cause security holes due to buffer overruns.
+    However, we believe that sprintf can be used safely, and is more
+    efficient than snprintf in those safe cases; and as proof of our
+    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index bb6e4e20d24..29b3936a0ba 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,14 +1,16 @@
 { stdenv, fetchurl, libsigsegv }:
 
-stdenv.mkDerivation (rec {
-  name = "gawk-4.0.0";
+stdenv.mkDerivation rec {
+  name = "gawk-4.0.2";
 
   src = fetchurl {
-    url = "mirror://gnu/gawk/${name}.tar.bz2";
-    sha256 = "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0";
+    url = "mirror://gnu/gawk/${name}.tar.xz";
+    sha256 = "04vd0axif762mf781pj3days6ilv2333b9zi9c50y5mma66g5q91";
   };
 
-  doCheck = !stdenv.isCygwin;      # XXX: `test-dup2' segfaults on Cygwin 6.1
+  patches = stdenv.lib.optional stdenv.isCygwin [ ./cygwin-identifiers.patch ];
+
+  doCheck = !stdenv.isCygwin; # XXX: `test-dup2' segfaults on Cygwin 6.1
 
   buildInputs = [ libsigsegv ];
 
@@ -37,9 +39,3 @@ stdenv.mkDerivation (rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
-
-//
-
-stdenv.lib.optionalAttrs stdenv.isCygwin {
-  patches = [ ./cygwin-identifiers.patch ];
-})
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index 8368edef656..98a737339d2 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -1,19 +1,21 @@
 { stdenv, fetchurl, pcre, libiconv ? null }:
 
-let version = "2.10"; in
+let version = "2.14"; in
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name = "gnugrep-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/grep/grep-${version}.tar.xz";
-    sha256 = "1cvsqyfzk1p38fcaav22dn76fkd02g7bjnqna6vrpk9vy9rnfybc";
+    sha256 = "1qbjb1l7f9blckc5pqy8jlf6482hpx4awn2acmhyf5mv9wfq03p7";
   };
 
   buildInputs = [ pcre ]
-    ++ (stdenv.lib.optional (libiconv != null) libiconv);
+    ++ stdenv.lib.optional (libiconv != null) libiconv;
 
-  doCheck = if stdenv.isDarwin then false else true;
+  NIX_LDFLAGS = stdenv.lib.optionalString (libiconv != null) "-L${libiconv}/lib -liconv";
+
+  doCheck = !stdenv.isDarwin;
 
   # On Mac OS X, force use of mkdir -p, since Grep's fallback
   # (./install-sh) is broken.
@@ -38,4 +40,4 @@ stdenv.mkDerivation ({
   };
 
   passthru = {inherit pcre;};
-} // (if libiconv != null then { NIX_LDFLAGS="-L${libiconv}/lib -liconv"; } else {}) )
+}
diff --git a/pkgs/tools/text/gnupatch/darwin-fix.patch b/pkgs/tools/text/gnupatch/darwin-fix.patch
deleted file mode 100644
index 50d08534814..00000000000
--- a/pkgs/tools/text/gnupatch/darwin-fix.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Fix builds on Darwin:
-http://lists.gnu.org/archive/html/bug-patch/2010-01/msg00004.html .
-
-
-commit 2c4e3ecddec8a686bd50d238f4cefebb950298b7
-Author: Andreas Gruenbacher <agruen@suse.de>
-Date:   Fri Jan 1 15:58:15 2010 +0100
-
-    * Makefile.in (LIBSRCS, LIBM4FILES): Add the missing files strnlen.c,
-    strnlen.m4, and safe-read.m4.
-
-diff --git a/Makefile.in b/Makefile.in
-index 3b3d78a..26dc281 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -91,6 +91,7 @@ LIBSRCS = \
- 	gl/lib/stripslash.c \
- 	gl/lib/strncasecmp.c \
- 	gl/lib/strndup.c \
-+	gl/lib/strnlen.c \
- 	gl/lib/xmalloc.c \
- 	gl/lib/xstrndup.c
-
-
-Add the missing bits from Gnulib.
-
---- /dev/null	2012-04-23 08:54:35.747205543 +0200
-+++ b/gl/lib/strnlen.c	2012-01-16 22:35:02.000000000 +0100
-@@ -0,0 +1,31 @@
-+/* Find the length of STRING, but scan at most MAXLEN characters.
-+   Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
-+   Written by Simon Josefsson.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-+
-+#include <config.h>
-+
-+#include <string.h>
-+
-+/* Find the length of STRING, but scan at most MAXLEN characters.
-+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
-+
-+size_t
-+strnlen (const char *string, size_t maxlen)
-+{
-+  const char *end = memchr (string, '\0', maxlen);
-+  return end ? (size_t) (end - string) : maxlen;
-+}
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index a7a166c95c3..c8c336ad202 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -1,20 +1,21 @@
 { stdenv, fetchurl, ed }:
 
-stdenv.mkDerivation (rec {
-  name = "patch-2.6.1";
+stdenv.mkDerivation rec {
+  name = "patch-2.7.1";
 
   src = fetchurl {
     url = "mirror://gnu/patch/${name}.tar.gz";
-    sha256 = "1fc1jyq80nswkf492fiqdbl2bhvlw2wb44ghqlfd3zngx4qkfmni";
+    sha256 = "1m9r83b5c154xnxbvgjg4lfff58xjapanj6dmmivqx1liik2hpy0";
   };
 
-  buildInputs = (stdenv.lib.optional doCheck ed);
+  buildInputs = stdenv.lib.optional doCheck ed;
 
   crossAttrs = {
     configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
   };
 
-  doCheck = true;
+  # Tests fail on FreeBSD due to a Bashism in the tests.
+  doCheck = !stdenv.isFreeBSD;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";
@@ -33,9 +34,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-
-//
-
-(stdenv.lib.optionalAttrs stdenv.isDarwin {
-  patches = [ ./darwin-fix.patch ];
-}))
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix
index 243fe8dcab8..3cf5dcfca7b 100644
--- a/pkgs/tools/text/groff/default.nix
+++ b/pkgs/tools/text/groff/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ghostscript ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   doCheck = true;
 
diff --git a/pkgs/tools/text/kdiff3/default.nix b/pkgs/tools/text/kdiff3/default.nix
index d8807bda08b..fc8813e7cec 100644
--- a/pkgs/tools/text/kdiff3/default.nix
+++ b/pkgs/tools/text/kdiff3/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ kdelibs ];
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
 
   meta = {
     homepage = http://kdiff3.sourceforge.net/;
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d9475cb86e8..5632176a629 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -222,8 +222,8 @@ let
       else
         defaultStdenv;
 
-  forceBuildDrv = drv : if (crossSystem == null) then drv else
-    (drv // { hostDrv = drv.buildDrv; });
+  forceNativeDrv = drv : if crossSystem == null then drv else
+    (drv // { crossDrv = drv.nativeDrv; });
 
   # A stdenv capable of building 32-bit binaries.  On x86_64-linux,
   # it uses GCC compiled with multilib support; on i686-linux, it's
@@ -582,10 +582,15 @@ let
 
   convmv = callPackage ../tools/misc/convmv { };
 
-  coreutils = callPackage ../tools/misc/coreutils {
-    # TODO: Add ACL support for cross-Linux.
-    aclSupport = crossSystem == null && stdenv.isLinux;
-  };
+  coreutils = (if stdenv.isDarwin then
+      # 8.20 doesn't build on Darwin
+      callPackage ../tools/misc/coreutils/8.19.nix
+    else
+      callPackage ../tools/misc/coreutils)
+    {
+      # TODO: Add ACL support for cross-Linux.
+      aclSupport = crossSystem == null && stdenv.isLinux;
+    };
 
   cpio = callPackage ../tools/archivers/cpio { };
 
@@ -733,7 +738,6 @@ let
   figlet = callPackage ../tools/misc/figlet { };
 
   file = callPackage ../tools/misc/file { };
-  file511 = callPackage ../tools/misc/file/511.nix { };
 
   fileschanged = callPackage ../tools/misc/fileschanged { };
 
@@ -1300,7 +1304,7 @@ let
                 gettext = null;
                 readline = null;
                 devicemapper = null;
-              }).hostDrv)
+              }).crossDrv)
            { hurd = gnu.hurdCrossIntermediate; })
     else null;
 
@@ -2026,7 +2030,7 @@ let
                    if isMingw then windows.mingw_headers1 else null;
     in
       wrapGCCCross {
-      gcc = forceBuildDrv (lib.addMetaAttrs { platforms = []; } (
+      gcc = forceNativeDrv (lib.addMetaAttrs { platforms = []; } (
         gcc_realCross.override {
           crossStageStatic = true;
           langCC = false;
@@ -2047,7 +2051,7 @@ let
   };
 
   gccCrossStageFinal = wrapGCCCross {
-    gcc = forceBuildDrv (gcc_realCross.override {
+    gcc = forceNativeDrv (gcc_realCross.override {
       libpthreadCross =
         # FIXME: Don't explicitly refer to `i586-pc-gnu'.
         if crossSystem != null && crossSystem.config == "i586-pc-gnu"
@@ -2077,9 +2081,9 @@ let
       gettext which noSysDirs;
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.isArm then false else true;
+    profiledCompiler = !stdenv.isArm;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2098,7 +2102,7 @@ let
 
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true;
+    profiledCompiler = !stdenv.system == "armv5tel-linux";
   }));
 
   gcc46_real = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
@@ -2106,9 +2110,9 @@ let
 
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.isArm then false else true;
+    profiledCompiler = !stdenv.isArm;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2135,7 +2139,7 @@ let
     # We can enable it back some day. This makes the *gcc* builds faster now.
     profiledCompiler = false;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2456,10 +2460,10 @@ let
     jreOnly = true;
   };
 
-  jdk = if (stdenv.isDarwin || stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+  jdk = if stdenv.isDarwin || stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
     then pkgs.openjdk
     else pkgs.oraclejdk;
-  jre = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+  jre = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
     then pkgs.openjre
     else pkgs.oraclejre;
 
@@ -2481,7 +2485,6 @@ let
   jikes = callPackage ../development/compilers/jikes { };
 
   julia = callPackage ../development/compilers/julia {
-    pcre = pcre_8_30;
     liblapack = liblapack.override {shared = true;};
     fftw = fftw.override {pthreads = true;};
     fftwSinglePrec = fftwSinglePrec.override {pthreads = true;};
@@ -2722,7 +2725,7 @@ let
   wrapGCCCross =
     {gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}:
 
-    forceBuildDrv (import ../build-support/gcc-cross-wrapper {
+    forceNativeDrv (import ../build-support/gcc-cross-wrapper {
       nativeTools = false;
       nativeLibc = false;
       noLibc = (libc == null);
@@ -2818,11 +2821,13 @@ let
 
   perl510 = callPackage ../development/interpreters/perl/5.10 { };
 
-  perl514 = callPackage ../development/interpreters/perl/5.14 {
+  perl514 = callPackage ../development/interpreters/perl/5.14 { };
+
+  perl516 = callPackage ../development/interpreters/perl/5.16 {
     fetchurl = fetchurlBoot;
   };
 
-  perl = if system != "i686-cygwin" then perl514 else sysPerl;
+  perl = if system != "i686-cygwin" then perl516 else sysPerl;
 
   php = callPackage ../development/interpreters/php/5.3.nix { };
 
@@ -2983,20 +2988,9 @@ let
 
   automake110x = callPackage ../development/tools/misc/automake/automake-1.10.x.nix { };
 
-  automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix {
-    doCheck = !stdenv.isArm && !stdenv.isCygwin && !stdenv.isMips
-      # Some of the parallel tests seem to hang on `i386-pc-solaris2.11'.
-      && stdenv.system != "i686-solaris"
-
-      # One test fails to terminate on FreeBSD: <http://bugs.gnu.org/8788>.
-      && !stdenv.isFreeBSD;
-  };
+  automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix { };
 
-  automake112x = callPackage ../development/tools/misc/automake/automake-1.12.x.nix {
-    doCheck = !stdenv.isArm && !stdenv.isCygwin && !stdenv.isMips
-      # Some of the parallel tests seem to hang on `i386-pc-solaris2.11'.
-      && stdenv.system != "i686-solaris";
-  };
+  automake112x = callPackage ../development/tools/misc/automake/automake-1.12.x.nix { };
 
   automake113x = callPackage ../development/tools/misc/automake/automake-1.13.x.nix { };
 
@@ -3015,23 +3009,13 @@ let
     gold = true;
   });
 
-  binutilsCross = lowPrio (forceBuildDrv (import ../development/tools/misc/binutils {
+  binutilsCross = lowPrio (forceNativeDrv (import ../development/tools/misc/binutils {
     inherit stdenv fetchurl zlib;
     noSysDirs = true;
     cross = assert crossSystem != null; crossSystem;
   }));
 
-  bison = bison25;
-
-  bison1875 = callPackage ../development/tools/parsing/bison/bison-1.875.nix { };
-
-  bison23 = callPackage ../development/tools/parsing/bison/bison-2.3.nix { };
-
-  bison24 = callPackage ../development/tools/parsing/bison/bison-2.4.nix { };
-
-  bison25 = callPackage ../development/tools/parsing/bison/bison-2.5.nix { };
-
-  bison26 = callPackage ../development/tools/parsing/bison/bison-2.6.nix { };
+  bison = callPackage ../development/tools/parsing/bison { };
 
   buildbot = callPackage ../development/tools/build-managers/buildbot {
     inherit (pythonPackages) twisted;
@@ -3262,13 +3246,13 @@ let
 
   pmccabe = callPackage ../development/tools/misc/pmccabe { };
 
-  /* Make pkgconfig always return a buildDrv, never a proper hostDrv,
+  /* Make pkgconfig always return a nativeDrv, never a proper crossDrv,
      because most usage of pkgconfig as buildInput (inheritance of
-     pre-cross nixpkgs) means using it using as buildNativeInput
+     pre-cross nixpkgs) means using it using as nativeBuildInput
      cross_renaming: we should make all programs use pkgconfig as
-     buildNativeInput after the renaming.
+     nativeBuildInput after the renaming.
      */
-  pkgconfig = forceBuildDrv (callPackage ../development/tools/misc/pkgconfig { });
+  pkgconfig = forceNativeDrv (callPackage ../development/tools/misc/pkgconfig { });
   pkgconfigUpstream = lowPrio (pkgconfig.override { vanilla = true; });
 
   premake = callPackage ../development/tools/misc/premake { };
@@ -3686,6 +3670,7 @@ let
   gegl_0_0_22 = callPackage ../development/libraries/gegl/0_0_22.nix {
     #  avocodec avformat librsvg
   };
+
   geoclue = callPackage ../development/libraries/geoclue {};
 
   geoip = builderDefsPackage ../development/libraries/geoip {
@@ -3713,31 +3698,9 @@ let
 
   glfw = callPackage ../development/libraries/glfw { };
 
-  glibc = glibc213;
+  glibc = glibc217;
 
-  glibcCross = glibc213Cross;
-
-  glibc25 = callPackage ../development/libraries/glibc/2.5 {
-    kernelHeaders = linuxHeaders_2_6_28;
-    installLocales = false;
-  };
-
-  glibc27 = callPackage ../development/libraries/glibc/2.7 {
-    kernelHeaders = linuxHeaders;
-    #installLocales = false;
-  };
-
-  glibc29 = callPackage ../development/libraries/glibc/2.9 {
-    kernelHeaders = linuxHeaders;
-    installLocales = config.glibc.locales or false;
-  };
-
-  glibc29Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.9) {
-    inherit stdenv fetchurl;
-    gccCross = gccCrossStageStatic;
-    kernelHeaders = linuxHeadersCross;
-    installLocales = config.glibc.locales or false;
-  });
+  glibcCross = glibc217Cross;
 
   glibc213 = (callPackage ../development/libraries/glibc/2.13 {
     kernelHeaders = linuxHeaders;
@@ -3745,31 +3708,18 @@ let
     machHeaders = null;
     hurdHeaders = null;
     gccCross = null;
-  }) // (if crossSystem != null then { hostDrv = glibc213Cross; } else {});
+  }) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {});
 
-  glibc213Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.13)
-    (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
-     in {
-       inherit stdenv fetchurl;
-       gccCross = gccCrossStageStatic;
-       kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross;
-       installLocales = config.glibc.locales or false;
-     }
-     // lib.optionalAttrs crossGNU {
-        inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig;
-        inherit fetchgit;
-      }));
-
-  glibc214 = (callPackage ../development/libraries/glibc/2.14 {
+  glibc217 = callPackage ../development/libraries/glibc/2.17 {
     kernelHeaders = linuxHeaders;
     installLocales = config.glibc.locales or false;
     machHeaders = null;
     hurdHeaders = null;
     gccCross = null;
-  }) // (lib.optionalAttrs (crossSystem != null) { hostDrv = glibc214Cross; });
+  };
 
-  glibc214Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.14)
-    (let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu");
+  glibc217Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.17)
+    (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
      in {
        inherit stdenv fetchurl;
        gccCross = gccCrossStageStatic;
@@ -3781,12 +3731,13 @@ let
         inherit fetchgit;
       }));
 
+
   # We can choose:
-  libcCrossChooser = name : if (name == "glibc") then glibcCross
-    else if (name == "uclibc") then uclibcCross
-    else if (name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32") then
+  libcCrossChooser = name : if name == "glibc" then glibcCross
+    else if name == "uclibc" then uclibcCross
+    else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
       windows.mingw_w64
-    else if (name == "msvcrt") then windows.mingw_headers3
+    else if name == "msvcrt" then windows.mingw_headers3
     else throw "Unknown libc";
 
   libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
@@ -3837,6 +3788,8 @@ let
 
   gmp5 = callPackage ../development/libraries/gmp/5.0.5.nix { };
 
+  gmp51 = callPackage ../development/libraries/gmp/5.1.0.nix { };
+
   gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { };
 
   goffice = callPackage ../development/libraries/goffice {
@@ -4308,14 +4261,14 @@ let
 
   libiconv = callPackage ../development/libraries/libiconv { };
 
-  libiconvOrEmpty = if (libiconvOrNull == null) then [] else [libiconv];
+  libiconvOrEmpty = if libiconvOrNull == null then [] else [libiconv];
 
   libiconvOrNull =
-    if ((gcc ? libc && (gcc.libc != null)) || stdenv.isGlibc)
+    if gcc.libc or null != null || stdenv.isGlibc
     then null
     else libiconv;
 
-  libiconvOrLibc = if (libiconvOrNull == null) then gcc.libc else libiconv;
+  libiconvOrLibc = if libiconvOrNull == null then gcc.libc else libiconv;
 
   libid3tag = callPackage ../development/libraries/libid3tag { };
 
@@ -4763,10 +4716,6 @@ let
     unicodeSupport = config.pcre.unicode or true;
   };
 
-  pcre_8_30 = callPackage ../development/libraries/pcre/8.30.nix {
-    unicodeSupport = config.pcre.unicode or true;
-  };
-
   pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
 
   phonon = callPackage ../development/libraries/phonon { };
@@ -5725,7 +5674,7 @@ let
   libuuid =
     if crossSystem != null && crossSystem.config == "i586-pc-gnu"
     then (utillinux // {
-      hostDrv = lib.overrideDerivation utillinux.hostDrv (args: {
+      crossDrv = lib.overrideDerivation utillinux.crossDrv (args: {
         # `libblkid' fails to build on GNU/Hurd.
         configureFlags = args.configureFlags
           + " --disable-libblkid --disable-mount --disable-libmount"
@@ -5810,9 +5759,7 @@ let
 
   iwlwifi6000g2bucode = callPackage ../os-specific/linux/firmware/iwlwifi-6000g2b-ucode { };
 
-  jujuutils = callPackage ../os-specific/linux/jujuutils {
-    linuxHeaders = linuxHeaders33;
-  };
+  jujuutils = callPackage ../os-specific/linux/jujuutils { };
 
   kbd = callPackage ../os-specific/linux/kbd { };
 
@@ -5826,25 +5773,25 @@ let
 
   libnl = callPackage ../os-specific/linux/libnl { };
 
-  linuxConsoleTools = callPackage ../os-specific/linux/consoletools { };
+  linuxHeaders = linuxHeaders37;
 
-  linuxHeaders = callPackage ../os-specific/linux/kernel-headers { };
+  linuxConsoleTools = callPackage ../os-specific/linux/consoletools { };
 
-  linuxHeaders33 = callPackage ../os-specific/linux/kernel-headers/3.3.5.nix { };
+  linuxHeaders37 = callPackage ../os-specific/linux/kernel-headers/3.7.nix { };
 
-  linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix {
+  linuxHeaders26Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix {
     inherit stdenv fetchurl perl;
     cross = assert crossSystem != null; crossSystem;
   });
 
-  linuxHeaders24Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
+  linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
     inherit stdenv fetchurl perl;
     cross = assert crossSystem != null; crossSystem;
   });
 
   # We can choose:
-  linuxHeadersCrossChooser = ver : if (ver == "2.4") then linuxHeaders24Cross
-    else if (ver == "2.6") then linuxHeaders26Cross
+  linuxHeadersCrossChooser = ver : if ver == "2.4" then linuxHeaders24Cross
+    else if ver == "2.6" then linuxHeaders26Cross
     else throw "Unknown linux kernel version";
 
   linuxHeadersCross = assert crossSystem != null;
@@ -6004,6 +5951,10 @@ let
       ];
   };
 
+  linux_3_6_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi-3.6.nix) {
+    inherit fetchgit stdenv perl mktemp module_init_tools ubootChooser;
+  };
+
   /* Linux kernel modules are inherently tied to a specific kernel.  So
      rather than provide specific instances of those packages for a
      specific kernel, we have a function that builds those packages
@@ -6049,16 +6000,16 @@ let
     iwlwifi = callPackage ../os-specific/linux/iwlwifi { };
 
     iwlwifi4965ucode =
-      (if (builtins.compareVersions kernel.version "2.6.27" == 0)
-          || (builtins.compareVersions kernel.version "2.6.27" == 1)
-       then iwlwifi4965ucodeV2
-       else iwlwifi4965ucodeV1);
+      if (builtins.compareVersions kernel.version "2.6.27" == 0)
+         || (builtins.compareVersions kernel.version "2.6.27" == 1)
+      then iwlwifi4965ucodeV2
+      else iwlwifi4965ucodeV1;
 
     atheros = callPackage ../os-specific/linux/atheros/0.9.4.nix { };
 
     broadcom_sta = callPackage ../os-specific/linux/broadcom-sta/default.nix { };
 
-    kernelHeaders = callPackage ../os-specific/linux/kernel-headers { };
+    kernelHeaders = linuxHeaders;
 
     nvidia_x11 = callPackage ../os-specific/linux/nvidia-x11 { };
 
@@ -6131,6 +6082,7 @@ let
   linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4 pkgs.linuxPackages_3_4);
   linuxPackages_3_5 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_5 pkgs.linuxPackages_3_5);
   linuxPackages_3_6 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_6 pkgs.linuxPackages_3_6);
+  linuxPackages_3_6_rpi = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_6_rpi pkgs.linuxPackages_3_6_rpi);
   linuxPackages_3_7 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_7 pkgs.linuxPackages_3_7);
 
   # The current default kernel / kernel modules.
@@ -6217,7 +6169,9 @@ let
 
   nss_ldap = callPackage ../os-specific/linux/nss_ldap { };
 
-  pam = callPackage ../os-specific/linux/pam { };
+  pam = callPackage ../os-specific/linux/pam {
+    libxcrypt = null;
+  };
 
   # pam_bioapi ( see http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader )
 
@@ -6330,10 +6284,10 @@ let
 
   tunctl = callPackage ../os-specific/linux/tunctl { };
 
-  ubootChooser = name : if (name == "upstream") then ubootUpstream
-    else if (name == "sheevaplug") then ubootSheevaplug
-    else if (name == "guruplug") then ubootGuruplug
-    else if (name == "nanonote") then ubootNanonote
+  ubootChooser = name : if name == "upstream" then ubootUpstream
+    else if name == "sheevaplug" then ubootSheevaplug
+    else if name == "guruplug" then ubootGuruplug
+    else if name == "nanonote" then ubootNanonote
     else throw "Unknown uboot";
 
   ubootUpstream = callPackage ../misc/uboot { };
@@ -7667,9 +7621,9 @@ let
   picocom = callPackage ../tools/misc/picocom { };
 
   pidgin = callPackage ../applications/networking/instant-messengers/pidgin {
-    openssl = if (config.pidgin.openssl or true) then openssl else null;
-    gnutls = if (config.pidgin.gnutls or false) then gnutls else null;
-    libgcrypt = if (config.pidgin.gnutls or false) then libgcrypt else null;
+    openssl = if config.pidgin.openssl or true then openssl else null;
+    gnutls = if config.pidgin.gnutls or false then gnutls else null;
+    libgcrypt = if config.pidgin.gnutls or false then libgcrypt else null;
     inherit (gnome) startupnotification;
   };
 
@@ -8099,6 +8053,8 @@ let
 
   xbindkeys = callPackage ../tools/X11/xbindkeys { };
 
+  xbmc = callPackage ../applications/video/xbmc { };
+
   xcalib = callPackage ../tools/X11/xcalib { };
 
   xchat = callPackage ../applications/networking/irc/xchat { };
@@ -8407,14 +8363,14 @@ let
   speed_dreams = callPackage ../games/speed-dreams {
     # Torcs wants to make shared libraries linked with plib libraries (it provides static).
     # i686 is the only platform I know than can do that linking without plib built with -fPIC
-    plib = plib.override { enablePIC = if stdenv.isi686 then false else true; };
+    plib = plib.override { enablePIC = !stdenv.isi686; };
     libpng = libpng12;
   };
 
   torcs = callPackage ../games/torcs {
     # Torcs wants to make shared libraries linked with plib libraries (it provides static).
     # i686 is the only platform I know than can do that linking without plib built with -fPIC
-    plib = plib.override { enablePIC = if stdenv.isi686 then false else true; };
+    plib = plib.override { enablePIC = !stdenv.isi686; };
   };
 
   trigger = callPackage ../games/trigger { };
diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix
index 4ff31414722..01f498d2def 100644
--- a/pkgs/top-level/platforms.nix
+++ b/pkgs/top-level/platforms.nix
@@ -131,6 +131,109 @@ rec {
     ubootConfig = "sheevaplug_config";
   };
 
+  raspberrypi = {
+    name = "raspberrypi";
+    kernelMajor = "2.6";
+    kernelHeadersBaseConfig = "kirkwood_defconfig";
+    kernelBaseConfig = "bcmrpi_defconfig";
+    kernelArch = "arm";
+    kernelAutoModules = false;
+    kernelExtraConfig =
+      ''
+        BLK_DEV_RAM y
+        BLK_DEV_INITRD y
+        BLK_DEV_CRYPTOLOOP m
+        BLK_DEV_DM m
+        DM_CRYPT m
+        MD y
+        REISERFS_FS m
+        BTRFS_FS m
+        XFS_FS m
+        JFS_FS m
+        EXT4_FS m
+        USB_STORAGE_CYPRESS_ATACB m
+
+        # mv cesa requires this sw fallback, for mv-sha1
+        CRYPTO_SHA1 y
+
+        IP_PNP y
+        IP_PNP_DHCP y
+        NFS_FS y
+        ROOT_NFS y
+        TUN m
+        NFS_V4 y
+        NFS_V4_1 y
+        NFS_FSCACHE y
+        NFSD m
+        NFSD_V2_ACL y
+        NFSD_V3 y
+        NFSD_V3_ACL y
+        NFSD_V4 y
+        NETFILTER y
+        IP_NF_IPTABLES y
+        IP_NF_FILTER y
+        IP_NF_MATCH_ADDRTYPE y
+        IP_NF_TARGET_LOG y
+        IP_NF_MANGLE y
+        IPV6 m
+        VLAN_8021Q m
+
+        CIFS y
+        CIFS_XATTR y
+        CIFS_POSIX y
+        CIFS_FSCACHE y
+        CIFS_ACL y
+
+        WATCHDOG y
+        WATCHDOG_CORE y
+        ORION_WATCHDOG m
+
+        ZRAM m
+        NETCONSOLE m
+
+        # Fail to build
+        DRM n
+        SCSI_ADVANSYS n
+        USB_ISP1362_HCD n
+        SND_SOC n
+        SND_ALI5451 n
+        FB_SAVAGE n
+        SCSI_NSP32 n
+        ATA_SFF n
+        SUNGEM n
+        IRDA n
+        ATM_HE n
+        SCSI_ACARD n
+        BLK_DEV_CMD640_ENHANCED n
+
+        FUSE_FS m
+
+        # nixos mounts some cgroup
+        CGROUPS y
+
+        # Latencytop 
+        LATENCYTOP y
+
+        # Ubi for the mtd
+        MTD_UBI y
+        UBIFS_FS y
+        UBIFS_FS_XATTR y
+        UBIFS_FS_ADVANCED_COMPR y
+        UBIFS_FS_LZO y
+        UBIFS_FS_ZLIB y
+        UBIFS_FS_DEBUG n
+      '';
+    kernelTarget = "uImage";
+    uboot = "sheevaplug";
+    # Only for uboot = uboot :
+    ubootConfig = "sheevaplug_config";
+    gcc = {
+      arch = "armv6";
+      fpu = "vfp";
+      float = "hard";
+    };
+  };
+
   guruplug = sheevaplug // {
     # Define `CONFIG_MACH_GURUPLUG' (see
     # <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
@@ -280,5 +383,6 @@ rec {
       '';
     kernelTarget = "vmlinux";
     uboot = null;
+    gcc.arch = "loongson2f";
   };
 }
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 00f7ae7bd5d..7b301618215 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -135,7 +135,7 @@ pythonPackages = python.modules // rec {
 
     postInstall = ''
       wrapProgram $out/bin/alot \
-        --prefix LD_LIBRARY_PATH : ${pkgs.notmuch}/lib:${pkgs.file511}/lib:${pkgs.gpgme}/lib
+        --prefix LD_LIBRARY_PATH : ${pkgs.notmuch}/lib:${pkgs.file}/lib:${pkgs.gpgme}/lib
     '';
 
     meta = {
@@ -1285,12 +1285,12 @@ pythonPackages = python.modules // rec {
 
 
   magic = pkgs.stdenv.mkDerivation rec {
-    name = "python-${pkgs.file511.name}";
+    name = "python-${pkgs.file.name}";
 
-    src = pkgs.file511.src;
+    src = pkgs.file.src;
 
     patches = [ ../tools/misc/file/python.patch ];
-    buildInputs = [ python pkgs.file511 ];
+    buildInputs = [ python pkgs.file ];
 
     configurePhase = "cd python";
 
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index 63fffd7d316..5b1294b0157 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -3,32 +3,32 @@ let
   nativePlatforms = linux;
 
   /* Basic list of packages to cross-build */
-  basicHostDrv = {
+  basicCrossDrv = {
     gccCrossStageFinal = nativePlatforms;
-    bison.hostDrv = nativePlatforms;
-    busybox.hostDrv = nativePlatforms;
-    coreutils.hostDrv = nativePlatforms;
-    dropbear.hostDrv = nativePlatforms;
-    tigervnc.hostDrv = nativePlatforms;
-    #openoffice.hostDrv = nativePlatforms;
-    wxGTK.hostDrv = nativePlatforms;
+    bison.crossDrv = nativePlatforms;
+    busybox.crossDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    dropbear.crossDrv = nativePlatforms;
+    tigervnc.crossDrv = nativePlatforms;
+    #openoffice.crossDrv = nativePlatforms;
+    wxGTK.crossDrv = nativePlatforms;
     #firefox = nativePlatforms;
     xorg = {
-      #xorgserver.hostDrv = nativePlatforms;
+      #xorgserver.crossDrv = nativePlatforms;
     };
-    nixUnstable.hostDrv = nativePlatforms;
-    linuxPackages_3_3.kernel.hostDrv = linux;
-    linuxPackages_3_4.kernel.hostDrv = linux;
-    linuxPackages_3_6.kernel.hostDrv = linux;
+    nixUnstable.crossDrv = nativePlatforms;
+    linuxPackages_3_3.kernel.crossDrv = linux;
+    linuxPackages_3_4.kernel.crossDrv = linux;
+    linuxPackages_3_6.kernel.crossDrv = linux;
   };
 
   /* Basic list of packages to be natively built,
      but need a crossSystem defined to get meaning */
-  basicBuildDrv = {
+  basicNativeDrv = {
     gdbCross = nativePlatforms;
   };
 
-  basic = basicHostDrv // basicBuildDrv;
+  basic = basicCrossDrv // basicNativeDrv;
 
 in
 (
@@ -50,7 +50,7 @@ in {
   crossSheevaplugLinux = mapTestOnCross crossSystem (
     basic //
     {
-      ubootSheevaplug.hostDrv = nativePlatforms;
+      ubootSheevaplug.crossDrv = nativePlatforms;
     });
 }) // (
 
@@ -79,7 +79,7 @@ in {
   crossSheevaplugLinuxUclibc = mapTestOnCross crossSystem (
     basic //
     {
-      ubootSheevaplug.hostDrv = nativePlatforms;
+      ubootSheevaplug.crossDrv = nativePlatforms;
     });
 }) // (
 
@@ -153,14 +153,14 @@ let
   };
 in {
   crossMingw32 = mapTestOnCross crossSystem {
-    coreutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    windows.wxMSW.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    windows.wxMSW.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -176,14 +176,14 @@ let
   };
 in {
   crossMingwW64 = mapTestOnCross crossSystem {
-    coreutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    windows.wxMSW.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    windows.wxMSW.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -202,34 +202,34 @@ let
 in {
   crossGNU = mapTestOnCross crossSystem {
     gnu.hurdCross = nativePlatforms;
-    gnu.mach.hostDrv = nativePlatforms;
+    gnu.mach.crossDrv = nativePlatforms;
     gnu.mig = nativePlatforms;
-    gnu.smbfs.hostDrv = nativePlatforms;
+    gnu.smbfs.crossDrv = nativePlatforms;
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    grub2.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    findutils.hostDrv = nativePlatforms;
-    gcc.hostDrv = nativePlatforms;
-    gcc46.hostDrv = nativePlatforms;
-    gdb.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    gnugrep.hostDrv = nativePlatforms;
-    gnumake.hostDrv = nativePlatforms;
-    gnused.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    guile.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    lsh.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    openssl.hostDrv = nativePlatforms;            # dependency of Nix
-    patch.hostDrv = nativePlatforms;
-    samba_light.hostDrv = nativePlatforms;      # needed for `runInGenericVM'
-    zile.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    grub2.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    findutils.crossDrv = nativePlatforms;
+    gcc.crossDrv = nativePlatforms;
+    gcc46.crossDrv = nativePlatforms;
+    gdb.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    gnugrep.crossDrv = nativePlatforms;
+    gnumake.crossDrv = nativePlatforms;
+    gnused.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    guile.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    lsh.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    openssl.crossDrv = nativePlatforms;            # dependency of Nix
+    patch.crossDrv = nativePlatforms;
+    samba_light.crossDrv = nativePlatforms;      # needed for `runInGenericVM'
+    zile.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -261,13 +261,13 @@ let
 in {
   fuloongminipc = mapTestOnCross crossSystem {
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    grub2.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    patch.hostDrv = nativePlatforms;
-    zile.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    grub2.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    patch.crossDrv = nativePlatforms;
+    zile.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -321,20 +321,20 @@ let
 in {
   nanonote = mapTestOnCross crossSystem {
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    patch.hostDrv = nativePlatforms;
-    zile.hostDrv = nativePlatforms;
-    prboom.hostDrv = nativePlatforms;
-    vim.hostDrv = nativePlatforms;
-    lynx.hostDrv = nativePlatforms;
-    patchelf.hostDrv = nativePlatforms;
-    nix.hostDrv = nativePlatforms;
-    fossil.hostDrv = nativePlatforms;
-    binutils.hostDrv = nativePlatforms;
-    mpg123.hostDrv = nativePlatforms;
-    yacas.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    patch.crossDrv = nativePlatforms;
+    zile.crossDrv = nativePlatforms;
+    prboom.crossDrv = nativePlatforms;
+    vim.crossDrv = nativePlatforms;
+    lynx.crossDrv = nativePlatforms;
+    patchelf.crossDrv = nativePlatforms;
+    nix.crossDrv = nativePlatforms;
+    fossil.crossDrv = nativePlatforms;
+    binutils.crossDrv = nativePlatforms;
+    mpg123.crossDrv = nativePlatforms;
+    yacas.crossDrv = nativePlatforms;
   };
 })
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index d03f2724e1f..fed9a1d673b 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -69,7 +69,7 @@ rec {
 
   /* Similar to the testOn function, but with an additional 'crossSystem'
    * parameter for allPackages, defining the target platform for cross builds,
-   * and triggering the build of the host derivation (cross built - hostDrv). */
+   * and triggering the build of the host derivation (cross built - crossDrv). */
   mapTestOnCross = crossSystem: pkgs.lib.mapAttrsRecursiveCond
     (as: !(as ? type && as.type == "job"))
     (path: value:
diff --git a/pkgs/top-level/release-small.nix b/pkgs/top-level/release-small.nix
index 4098086c2f7..d15c2744ee0 100644
--- a/pkgs/top-level/release-small.nix
+++ b/pkgs/top-level/release-small.nix
@@ -30,8 +30,6 @@ with (import ./release-lib.nix);
   bc = all;
   binutils = linux;
   bind = linux;
-  bison24 = all;
-  boostFull = all;
   bsdiff = all;
   bzip2 = all;
   classpath = linux;
@@ -76,8 +74,6 @@ with (import ./release-lib.nix);
   gsl = linux;
   guile = linux;  # tests fail on Cygwin
   gzip = all;
-  hal = linux;
-  hal_info = linux;
   hddtemp = linux;
   hdparm = linux;
   hello = all;
@@ -186,7 +182,6 @@ with (import ./release-lib.nix);
   time = linux;
   tinycc = ["i686-linux"];
   udev = linux;
-  uml = ["i686-linux"];
   unrar = linux;
   unzip = all;
   upstart = linux;
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 833210e8de9..7a4a770ff2d 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -33,9 +33,7 @@ with (import ./release-lib.nix);
   bc = all;
   binutils = linux;
   bind = linux;
-  bison23 = all;
-  bison24 = all;
-  bison25 = all;
+  bison26 = all;
   bitlbee = linux;
   bittorrent = linux;
   blender = linux;