summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
authorCarles Pagès <page@cubata.homelinux.net>2013-03-10 18:19:49 +0100
committerCarles Pagès <page@cubata.homelinux.net>2013-03-10 18:19:49 +0100
commit6c949148b6966d53f6a9e0389932221f860caae3 (patch)
treed87e4921fb1faadfdf56441a697244aabf99ad7c /pkgs/development/libraries
parent728116ec3eb04fe7c9465a240eab75e745e78d74 (diff)
parent2c13f0fd2043b8b19834eba544987b0f5c1eb68d (diff)
downloadnixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar.gz
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar.bz2
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar.lz
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar.xz
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.tar.zst
nixlib-6c949148b6966d53f6a9e0389932221f860caae3.zip
Merge remote-tracking branch 'upstream/x-updates' into wayland
Conflicts:
	pkgs/development/libraries/mesa/default.nix
	pkgs/top-level/all-packages.nix
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/GConf/3.x.nix23
-rw-r--r--pkgs/development/libraries/SDL/default.nix2
-rw-r--r--pkgs/development/libraries/acl/default.nix2
-rw-r--r--pkgs/development/libraries/agg/default.nix7
-rw-r--r--pkgs/development/libraries/aqbanking/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/default.nix2
-rw-r--r--pkgs/development/libraries/atkmm/default.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.47.nix90
-rw-r--r--pkgs/development/libraries/boost/1.49.nix12
-rw-r--r--pkgs/development/libraries/boost/1.53.nix10
-rw-r--r--pkgs/development/libraries/boost/boost_filesystem_1_47_0.patch24
-rw-r--r--pkgs/development/libraries/boost/time_utc.patch320
-rw-r--r--pkgs/development/libraries/bullet/default.nix19
-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/crypto++/default.nix18
-rw-r--r--pkgs/development/libraries/crypto++/pic.patch22
-rw-r--r--pkgs/development/libraries/crypto++/salsa-gcc4.6.patch62
-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.nix6
-rw-r--r--pkgs/development/libraries/ffmpeg/1.0.nix85
-rw-r--r--pkgs/development/libraries/ffmpeg/1.1.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/default.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/default.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.nix181
-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-crypt-blowfish.patch795
-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/glibc-rh739743.patch55
-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/default.nix2
-rw-r--r--pkgs/development/libraries/gmp/4.3.2.nix2
-rw-r--r--pkgs/development/libraries/gmp/5.0.5.nix9
-rw-r--r--pkgs/development/libraries/gmp/5.1.1.nix54
-rw-r--r--pkgs/development/libraries/gnutls/2.12.nix8
-rw-r--r--pkgs/development/libraries/gnutls/default.nix2
-rw-r--r--pkgs/development/libraries/goffice/default.nix3
-rw-r--r--pkgs/development/libraries/goffice/pcre_info.patch13
-rw-r--r--pkgs/development/libraries/google-perftools/default.nix14
-rw-r--r--pkgs/development/libraries/gperftools/default.nix22
-rw-r--r--pkgs/development/libraries/gperftools/glibc-2.16.patch13
-rw-r--r--pkgs/development/libraries/gpgme/default.nix2
-rw-r--r--pkgs/development/libraries/gsasl/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch11
-rw-r--r--pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix2
-rw-r--r--pkgs/development/libraries/gtk+/2.x.nix6
-rw-r--r--pkgs/development/libraries/gtk+/3-default.nix (renamed from pkgs/development/libraries/gtk+/3.2.x.nix)18
-rw-r--r--pkgs/development/libraries/gtk-sharp-2/default.nix7
-rw-r--r--pkgs/development/libraries/gtkmm/2.x.nix2
-rw-r--r--pkgs/development/libraries/gtkmm/3.x.nix10
-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/OpenAL/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/QuickCheck/2.6.nix15
-rw-r--r--pkgs/development/libraries/haskell/basic-prelude/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/bifunctors/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/binary/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/blaze-html/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cuda/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/data-default/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/diagrams/core.nix5
-rw-r--r--pkgs/development/libraries/haskell/doctest/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/flexible-defaults/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ghc-mod/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/ghc-vis/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hakyll/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/happstack/happstack-server.nix4
-rw-r--r--pkgs/development/libraries/haskell/highlighting-kate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hledger-web/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hp2any-core/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hp2any-graph/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/http-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/monad-control/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/multiarg/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-sqlite/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/resourcet/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/shake/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-js/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/shelly/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/syb/0.4.0.nix15
-rw-r--r--pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/th-extras/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/uu-parsinglib/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/uulib/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/xdot/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/xml-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yaml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-test/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zip-archive/default.nix4
-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/jbig2dec/default.nix12
-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/libalkimia/default.nix4
-rw-r--r--pkgs/development/libraries/libbluray/default.nix2
-rw-r--r--pkgs/development/libraries/libcanberra/default.nix16
-rw-r--r--pkgs/development/libraries/libcdr/default.nix2
-rw-r--r--pkgs/development/libraries/libchop/default.nix3
-rw-r--r--pkgs/development/libraries/libcroco/default.nix11
-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.nix8
-rw-r--r--pkgs/development/libraries/libgnome-keyring/3.x.nix18
-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.nix21
-rw-r--r--pkgs/development/libraries/libgtop/default.nix2
-rw-r--r--pkgs/development/libraries/libgweather/default.nix13
-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/libnice/default.nix6
-rw-r--r--pkgs/development/libraries/libnotify/default.nix31
-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/default.nix28
-rw-r--r--pkgs/development/libraries/librdf/raptor2.nix6
-rw-r--r--pkgs/development/libraries/librdf/rasqal.nix10
-rw-r--r--pkgs/development/libraries/librdf/redland.nix6
-rw-r--r--pkgs/development/libraries/librsvg/default.nix14
-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/libvirt/default.nix4
-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/libxcrypt/default.nix17
-rw-r--r--pkgs/development/libraries/libxcrypt/gcc46.patch18
-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.nix15
-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/openscenegraph/default.nix16
-rw-r--r--pkgs/development/libraries/openscenegraph/xine.patch18
-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/default.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/8.31.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/0.18.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/qjson/default.nix4
-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/simgear/default.nix22
-rw-r--r--pkgs/development/libraries/sodium/default.nix28
-rw-r--r--pkgs/development/libraries/sodium/default.upstream1
-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.nix10
-rw-r--r--pkgs/development/libraries/telepathy/farstream/default.nix8
-rw-r--r--pkgs/development/libraries/telepathy/glib/default.nix6
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix10
-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/ustr/default.nix5
-rw-r--r--pkgs/development/libraries/ustr/va_args.patch23
-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/webkit/bison26.patch515
-rw-r--r--pkgs/development/libraries/webkit/default.nix48
-rw-r--r--pkgs/development/libraries/webkit/gtk2.nix53
-rw-r--r--pkgs/development/libraries/webkit/src-for-gtk2.nix11
-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
293 files changed, 2881 insertions, 4287 deletions
diff --git a/pkgs/development/libraries/GConf/3.x.nix b/pkgs/development/libraries/GConf/3.x.nix
deleted file mode 100644
index 4f6d5a9a04ac..000000000000
--- a/pkgs/development/libraries/GConf/3.x.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl, glib, dbus_glib, pkgconfig, libxml2, gtk3, intltool, polkit }:
-
-stdenv.mkDerivation {
-  name = "GConf-3.2.3";
-
-  src = fetchurl {
-    url = mirror://gnome/sources/GConf/3.2/GConf-3.2.3.tar.xz;
-    sha256 = "0jd1z9gb1b7mv4g07qm554va6idasf3swgrfqflypdh9s38mvdcy";
-  };
-
-  propagatedBuildInputs = [ glib dbus_glib ];
-  buildInputs = [ polkit gtk3 libxml2 ];
-  buildNativeInputs = [ pkgconfig intltool ];
-
-  configureFlags = "--disable-orbit";
-
-  meta = {
-    homepage = http://projects.gnome.org/gconf/;
-    description = "A system for storing application preferences";
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-    inherit (gtk3.meta) platforms;
-  };
-}
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index a2847bac884a..899c3bb5c8d8 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -44,7 +44,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 3ccb56919800..bc0821f39fdd 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/agg/default.nix b/pkgs/development/libraries/agg/default.nix
index 9ef13735b084..8c24ae6fdbee 100644
--- a/pkgs/development/libraries/agg/default.nix
+++ b/pkgs/development/libraries/agg/default.nix
@@ -8,7 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb";
   };
   buildInputs = [ autoconf automake libtool pkgconfig freetype SDL libX11 ];
-  preConfigure = "sh autogen.sh";
+
+  # fix build with new automake, from Gentoo ebuild
+  preConfigure = ''
+    sed -i '/^AM_C_PROTOTYPES/d' configure.in
+    sh autogen.sh
+  '';
 
   configureFlags = "--x-includes=${libX11}/include --x-libraries=${libX11}/lib";
 
diff --git a/pkgs/development/libraries/aqbanking/default.nix b/pkgs/development/libraries/aqbanking/default.nix
index 6c6e30137179..0ddb1aaa7492 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/asc-support/default.nix b/pkgs/development/libraries/asc-support/default.nix
index a078faaceb12..a2b2588d9cc3 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 e2b7a14e8191..9a712a869af7 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/default.nix b/pkgs/development/libraries/atk/default.nix
index eba56776bd2b..4dd0ae1eeafb 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.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/default.nix b/pkgs/development/libraries/atkmm/default.nix
index 66237c4c7b99..b25432491fbc 100644
--- a/pkgs/development/libraries/atkmm/default.nix
+++ b/pkgs/development/libraries/atkmm/default.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 a719537dd2fb..9a5002551cb8 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 adc530863068..3c5855ea284f 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 0789ef0ea7ca..39a03e0b0029 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 c05fddc18cf0..9b5c25d4ca4e 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 ad09adc8606c..e0235cd8b39f 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.47.nix b/pkgs/development/libraries/boost/1.47.nix
deleted file mode 100644
index b8774b70265c..000000000000
--- a/pkgs/development/libraries/boost/1.47.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
-, enableRelease ? true
-, enableDebug ? false
-, enableSingleThreaded ? false
-, enableMultiThreaded ? true
-, enableShared ? true
-, enableStatic ? false
-, enablePIC ? false
-, enableExceptions ? false
-}:
-
-let
-
-  variant = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableRelease "release" ++
-     stdenv.lib.optional enableDebug "debug");
-
-  threading = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableSingleThreaded "single" ++
-     stdenv.lib.optional enableMultiThreaded "multi");
-
-  link = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableShared "shared" ++
-     stdenv.lib.optional enableStatic "static");
-
-  # To avoid library name collisions
-  finalLayout = if ((enableRelease && enableDebug) ||
-    (enableSingleThreaded && enableMultiThreaded) ||
-    (enableShared && enableStatic)) then
-    "tagged" else "system";
-
-  cflags = if (enablePIC && enableExceptions) then
-             "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
-             "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
-             "cflags=-fexceptions"
-           else
-             "";
-in
-
-stdenv.mkDerivation {
-  name = "boost-1.47.0";
-
-  meta = {
-    homepage = "http://boost.org/";
-    description = "Boost C++ Library Collection";
-    license = "boost-license";
-
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-
-  src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_47_0.tar.bz2";
-    sha256 = "815a5d9faac4dbd523fbcf3fe1065e443c0bbf43427c44aa423422c6ec4c2e31";
-  };
-
-  # See <http://svn.boost.org/trac/boost/ticket/4688>.
-  patches = [ ./boost_filesystem_1_47_0.patch ];
-
-  enableParallelBuilding = true;
-
-  buildInputs = [icu expat zlib bzip2 python];
-
-  configureScript = "./bootstrap.sh";
-  configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
-
-  buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
-
-  installPhase = ":";
-
-  crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
-    # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
-    # override them.
-    propagatedBuildInputs = buildInputs;
-    # We want to substitute the contents of configureFlags, removing thus the
-    # usual --build and --host added on cross building.
-    preConfigure = ''
-      export configureFlags="--prefix=$out --without-icu"
-    '';
-    buildPhase = ''
-      set -x
-      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
-    '';
-  };
-}
diff --git a/pkgs/development/libraries/boost/1.49.nix b/pkgs/development/libraries/boost/1.49.nix
index a86670927aad..e0ba0630cd06 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
              "";
@@ -57,7 +57,7 @@ stdenv.mkDerivation {
   };
 
   # See <http://svn.boost.org/trac/boost/ticket/4688>.
-  patches = [ ./boost_filesystem_post_1_49_0.patch ];
+  patches = [ ./boost_filesystem_post_1_49_0.patch ./time_utc.patch ];
 
   enableParallelBuilding = true;
 
@@ -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.53.nix b/pkgs/development/libraries/boost/1.53.nix
index 7de750efd916..c3272e98a144 100644
--- a/pkgs/development/libraries/boost/1.53.nix
+++ b/pkgs/development/libraries/boost/1.53.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/boost/boost_filesystem_1_47_0.patch b/pkgs/development/libraries/boost/boost_filesystem_1_47_0.patch
deleted file mode 100644
index f32e9ed572d3..000000000000
--- a/pkgs/development/libraries/boost/boost_filesystem_1_47_0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ubr boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp
---- boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp	2011-01-11 22:39:33.000000000 +0100
-+++ boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp	2011-07-21 01:06:26.000000000 +0200
-@@ -45,7 +45,7 @@
-   {
- #if !defined(macintosh) && !defined(__APPLE__) && !defined(__APPLE_CC__) 
-     // ISO C calls this "the locale-specific native environment":
--    static std::locale lc("");
-+    static std::locale lc;
- #else  // Mac OS
-     // "All BSD system functions expect their string parameters to be in UTF-8 encoding
-     // and nothing else."
-diff -ubr boost_1_47_0/libs/filesystem/v3/src/path.cpp boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp
---- boost_1_47_0/libs/filesystem/v3/src/path.cpp	2011-07-05 16:49:42.000000000 +0200
-+++ boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp	2011-07-21 01:06:26.000000000 +0200
-@@ -767,7 +767,7 @@
-     // or LANG are wrong, for example), so dynamic initialization is used to ensure
-     // that exceptions can be caught.
- 
--    return std::locale("");
-+    return std::locale();
- 
- #   endif
-   }
diff --git a/pkgs/development/libraries/boost/time_utc.patch b/pkgs/development/libraries/boost/time_utc.patch
new file mode 100644
index 000000000000..3585d0bfc6dd
--- /dev/null
+++ b/pkgs/development/libraries/boost/time_utc.patch
@@ -0,0 +1,320 @@
+From: https://build.opensuse.org/package/view_file?file=boost-time_utc.patch&package=boost&project=Application%3AGeo
+
+From: https://svn.boost.org/trac/boost/changeset/78802
+
+Message:
+    Thread: fix TIME_UTC, WINVER, constexpr for tags, and don't use local files
+
+Only the TIME_UTC_ change is taken
+ 
+Index: boost_1_49_0/boost/thread/xtime.hpp
+===================================================================
+--- boost_1_49_0.orig/boost/thread/xtime.hpp
++++ boost_1_49_0/boost/thread/xtime.hpp
+@@ -2,7 +2,7 @@
+ // William E. Kempf
+ // Copyright (C) 2007-8 Anthony Williams
+ //
+-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
++//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ 
+ #ifndef BOOST_XTIME_WEK070601_HPP
+@@ -20,7 +20,7 @@ namespace boost {
+ 
+ enum xtime_clock_types
+ {
+-    TIME_UTC=1
++    TIME_UTC_=1
+ //    TIME_TAI,
+ //    TIME_MONOTONIC,
+ //    TIME_PROCESS,
+@@ -53,14 +53,14 @@ struct xtime
+         boost::posix_time::microseconds((nsec+500)/1000);
+ #endif
+     }
+-    
++
+ };
+ 
+ inline xtime get_xtime(boost::system_time const& abs_time)
+ {
+     xtime res;
+     boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0);
+-            
++
+     res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds());
+     res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second()));
+     return res;
+@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_tim
+ 
+ inline int xtime_get(struct xtime* xtp, int clock_type)
+ {
+-    if (clock_type == TIME_UTC)
++    if (clock_type == TIME_UTC_)
+     {
+         *xtp=get_xtime(get_system_time());
+         return clock_type;
+@@ -81,7 +81,7 @@ inline int xtime_cmp(const xtime& xt1, c
+ {
+     if (xt1.sec == xt2.sec)
+         return (int)(xt1.nsec - xt2.nsec);
+-    else 
++    else
+         return (xt1.sec > xt2.sec) ? 1 : -1;
+ }
+ 
+Index: boost_1_49_0/libs/thread/example/starvephil.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/starvephil.cpp
++++ boost_1_49_0/libs/thread/example/starvephil.cpp
+@@ -50,7 +50,7 @@ public:
+                       << "very hot ..." << std::endl;
+         }
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += 3;
+         boost::thread::sleep(xt);
+         m_chickens += value;
+@@ -85,7 +85,7 @@ void chef()
+             std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
+         }
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += 2;
+         boost::thread::sleep(xt);
+         {
+@@ -111,7 +111,7 @@ struct phil
+             if (m_id > 0)
+             {
+                 boost::xtime xt;
+-                boost::xtime_get(&xt, boost::TIME_UTC);
++                boost::xtime_get(&xt, boost::TIME_UTC_);
+                 xt.sec += 3;
+                 boost::thread::sleep(xt);
+             }
+Index: boost_1_49_0/libs/thread/example/tennis.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/tennis.cpp
++++ boost_1_49_0/libs/thread/example/tennis.cpp
+@@ -1,7 +1,7 @@
+ // Copyright (C) 2001-2003
+ // William E. Kempf
+ //
+-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
++//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ 
+ #include <boost/thread/mutex.hpp>
+@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
+     boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
+ 
+     boost::xtime xt;
+-    boost::xtime_get(&xt, boost::TIME_UTC);
++    boost::xtime_get(&xt, boost::TIME_UTC_);
+     xt.sec += 1;
+     boost::thread::sleep(xt);
+     {
+Index: boost_1_49_0/libs/thread/example/thread.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/thread.cpp
++++ boost_1_49_0/libs/thread/example/thread.cpp
+@@ -14,7 +14,7 @@ struct thread_alarm
+     void operator()()
+     {
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += m_secs;
+ 
+         boost::thread::sleep(xt);
+Index: boost_1_49_0/libs/thread/example/xtime.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/xtime.cpp
++++ boost_1_49_0/libs/thread/example/xtime.cpp
+@@ -10,7 +10,7 @@
+ int main(int argc, char* argv[])
+ {
+     boost::xtime xt;
+-    boost::xtime_get(&xt, boost::TIME_UTC);
++    boost::xtime_get(&xt, boost::TIME_UTC_);
+     xt.sec += 1;
+     boost::thread::sleep(xt); // Sleep for 1 second
+ }
+Index: boost_1_49_0/libs/thread/src/pthread/thread.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/pthread/thread.cpp
++++ boost_1_49_0/libs/thread/src/pthread/thread.cpp
+@@ -23,7 +23,7 @@
+ #include <unistd.h>
+ #endif
+ 
+-#include "timeconv.inl"
++#include <libs/thread/src/pthread/timeconv.inl>
+ 
+ namespace boost
+ {
+@@ -354,7 +354,7 @@ namespace boost
+                     cond.timed_wait(lock, xt);
+ #   endif
+                     xtime cur;
+-                    xtime_get(&cur, TIME_UTC);
++                    xtime_get(&cur, TIME_UTC_);
+                     if (xtime_cmp(xt, cur) <= 0)
+                         return;
+                 }
+@@ -369,7 +369,7 @@ namespace boost
+             BOOST_VERIFY(!pthread_yield());
+ #   else
+             xtime xt;
+-            xtime_get(&xt, TIME_UTC);
++            xtime_get(&xt, TIME_UTC_);
+             sleep(xt);
+ #   endif
+         }
+Index: boost_1_49_0/libs/thread/src/pthread/timeconv.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/pthread/timeconv.inl
++++ boost_1_49_0/libs/thread/src/pthread/timeconv.inl
+@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND =
+ inline void to_time(int milliseconds, boost::xtime& xt)
+ {
+     int res = 0;
+-    res = boost::xtime_get(&xt, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&xt, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+@@ -56,8 +56,8 @@ inline void to_timespec_duration(const b
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+     {
+@@ -87,8 +87,8 @@ inline void to_duration(boost::xtime xt,
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         milliseconds = 0;
+@@ -109,8 +109,8 @@ inline void to_microduration(boost::xtim
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         microseconds = 0;
+Index: boost_1_49_0/libs/thread/src/win32/timeconv.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/win32/timeconv.inl
++++ boost_1_49_0/libs/thread/src/win32/timeconv.inl
+@@ -17,8 +17,8 @@ const int NANOSECONDS_PER_MICROSECOND =
+ inline void to_time(int milliseconds, boost::xtime& xt)
+ {
+     int res = 0;
+-    res = boost::xtime_get(&xt, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&xt, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+@@ -54,8 +54,8 @@ inline void to_timespec_duration(const b
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+     {
+@@ -85,8 +85,8 @@ inline void to_duration(boost::xtime xt,
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         milliseconds = 0;
+@@ -107,8 +107,8 @@ inline void to_microduration(boost::xtim
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         microseconds = 0;
+Index: boost_1_49_0/libs/thread/test/test_xtime.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/test/test_xtime.cpp
++++ boost_1_49_0/libs/thread/test/test_xtime.cpp
+@@ -17,8 +17,8 @@ void test_xtime_cmp()
+ {
+     boost::xtime xt1, xt2, cur;
+     BOOST_CHECK_EQUAL(
+-        boost::xtime_get(&cur, boost::TIME_UTC),
+-        static_cast<int>(boost::TIME_UTC));
++        boost::xtime_get(&cur, boost::TIME_UTC_),
++        static_cast<int>(boost::TIME_UTC_));
+ 
+     xt1 = xt2 = cur;
+     xt1.nsec -= 1;
+@@ -42,14 +42,14 @@ void test_xtime_get()
+     boost::xtime orig, cur, old;
+     BOOST_CHECK_EQUAL(
+         boost::xtime_get(&orig,
+-            boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
++            boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC_));
+     old = orig;
+ 
+     for (int x=0; x < 100; ++x)
+     {
+         BOOST_CHECK_EQUAL(
+-            boost::xtime_get(&cur, boost::TIME_UTC),
+-            static_cast<int>(boost::TIME_UTC));
++            boost::xtime_get(&cur, boost::TIME_UTC_),
++            static_cast<int>(boost::TIME_UTC_));
+         BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
+         BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
+         old = cur;
+Index: boost_1_49_0/libs/thread/test/util.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/test/util.inl
++++ boost_1_49_0/libs/thread/test/util.inl
+@@ -28,8 +28,8 @@ inline boost::xtime delay(int secs, int
+     const int NANOSECONDS_PER_MILLISECOND = 1000000;
+ 
+     boost::xtime xt;
+-    if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))
+-        BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC");
++    if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC_))
++        BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_");
+ 
+     nsecs += xt.nsec;
+     msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index b725f6bbf9fe..6320dd58e4c6 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -1,14 +1,17 @@
-{stdenv, fetchurl, unzip, cmake}:
+{ stdenv, fetchurl, cmake, mesa, freeglut }:
 
-stdenv.mkDerivation {
-  name = "bullet-2.78";
+stdenv.mkDerivation rec {
+  name = "bullet-2.80"; # vdrift 2012-07-22 doesn't build with 2.81
+  rev = "2531";
   src = fetchurl {
-    url = "http://bullet.googlecode.com/files/bullet-2.78.zip";
-    sha256 = "10l2dclvv0di9mi9qp6xfy9vybx182xp2dyygabacrpr3p75s77k";
+    url = "http://bullet.googlecode.com/files/${name}-rev${rev}.tgz";
+    sha256 = "0dig6k88jz5y0cz6dn186vc4l96l4v56zvwpsp5bv9f5wdwjskj6";
   };
-  buildInputs = [ unzip cmake ];
+
+  buildInputs = [ cmake mesa freeglut ];
   configurePhase = ''
-    cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXTRAS=OFF -DBUILD_DEMOS=OFF .
+    cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXTRAS=OFF -DBUILD_DEMOS=OFF \
+      -DCMAKE_INSTALL_PREFIX=$out .
   '';
 
   meta = {
@@ -19,6 +22,6 @@ stdenv.mkDerivation {
     '';
     homepage = http://code.google.com/p/bullet/;
     license = stdenv.lib.licenses.zlib;
-    maintainers = [ "Alexander Foremny <alexanderforemny@googlemail.com>" ];
+    maintainers = with stdenv.lib.maintainers; [ aforemny ];
   };
 }
diff --git a/pkgs/development/libraries/c-library/default.nix b/pkgs/development/libraries/c-library/default.nix
index 96bb82f54be8..714e8b66089c 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 75eb5109b453..e48ed5a76928 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 d9dae7bfd41f..aa594a8e2bc1 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 72460184df21..97c7a4c9f53a 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 b44801928e90..182040f5c414 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 a48ff93ce228..3e13ff2da7e3 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 52a9eaa98fa1..6c6891fb279c 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 11a6e374e2e4..b697ed87edc4 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 72b1bea7b203..d25accd4664e 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/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index 43d1011ec0a1..e9efcfaf7f00 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -1,20 +1,16 @@
 { fetchurl, stdenv, unzip, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "crypto++-5.6.1";
+  name = "crypto++-5.6.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/cryptopp/cryptopp561.zip";
-    sha256 = "0s7jhvnfihikqp1iwpdz03fad62xkjxci6jiahrh6f3sn664vrwq";
+    url = "mirror://sourceforge/cryptopp/cryptopp562.zip";
+    sha256 = "0x1mqpz1v071cfrw4grbw7z734cxnpry1qh2b6rsmcx6nkyd5gsw";
   };
 
-  patches = [
-    ./pic.patch
-    ./salsa-gcc4.6.patch
-  ] ++ stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
+  patches = stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
 
-
-  buildInputs = [ unzip ];
+  buildInputs = [ unzip libtool ];
 
   # Unpack the thing in a subdirectory.
   unpackPhase = ''
@@ -37,7 +33,7 @@ stdenv.mkDerivation rec {
   # I add what 'enableParallelBuilding' would add to the make call,
   # if we were using the generic build phase.
   buildPhase = ''
-    make PREFIX="$out" all libcryptopp.so -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
+    make PREFIX="$out" all -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES
   '';
 
   # TODO: Installing cryptotest.exe doesn't seem to be necessary. We run
@@ -53,7 +49,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Crypto++, a free C++ class library of cryptographic schemes";
     homepage = http://cryptopp.com/;
-    license = "Public Domain";
+    license = "Boost 1.0";
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
diff --git a/pkgs/development/libraries/crypto++/pic.patch b/pkgs/development/libraries/crypto++/pic.patch
deleted file mode 100644
index c01550b132ac..000000000000
--- a/pkgs/development/libraries/crypto++/pic.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Build position-independent code, for shared libraries.  Fix $(DLLSRCS)
-while we're at it (it lacks `pssr.cpp', for instance).
-
---- a/GNUmakefile	2009-03-15 02:48:02.000000000 +0100
-+++ b/GNUmakefile	2009-08-11 00:13:43.000000000 +0200
-@@ -104,6 +104,7 @@ TESTOBJS = bench.o bench2.o test.o valid
- LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
- 
- DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
-+DLLSRCS = $(SRCS)
- DLLOBJS = $(DLLSRCS:.cpp=.export.o)
- LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
- TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
-@@ -162,7 +162,7 @@ endif
- 	$(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@
- 
- %.export.o : %.cpp
--	$(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@
-+	$(CXX) $(CXXFLAGS) -fPIC -DCRYPTOPP_EXPORTS -c $< -o $@
- 
- %.o : %.cpp
- 	$(CXX) $(CXXFLAGS) -c $<
diff --git a/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch b/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch
deleted file mode 100644
index 609d2f55d223..000000000000
--- a/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From fbccde3578feddb16f07be981da1d0f26209fd04 Mon Sep 17 00:00:00 2001
-From: weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>
-Date: Sun, 5 Jun 2011 21:07:11 +0000
-Subject: [PATCH 1/4] fix Salsa validation failure when compiling with GCC 4.6
- (https://sourceforge.net/apps/trac/cryptopp/ticket/12)
-
-git-svn-id: https://cryptopp.svn.sourceforge.net/svnroot/cryptopp/trunk@529 57ff6487-cd31-0410-9ec3-f628ee90f5f0
----
- c5/salsa.cpp |   21 +++++++++++----------
- 1 file changed, 11 insertions(+), 10 deletions(-)
-
-# NOTE: remove the c5 path component
-
-diff --git a/salsa.cpp b/salsa.cpp
-index bd216ee..bdc5d75 100755
---- a/salsa.cpp
-+++ b/salsa.cpp
-@@ -122,17 +122,17 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output
- 	if (HasSSE2())
- 	{
- 	#if CRYPTOPP_BOOL_X64
--		#define REG_output			%4
--		#define REG_input			%1
-+		#define REG_output			%1
-+		#define REG_input			%0
- 		#define REG_iterationCount	%2
--		#define REG_state			%3
--		#define REG_rounds			%0
-+		#define REG_state			%4		/* constant */
-+		#define REG_rounds			%3		/* constant */
- 		#define REG_roundsLeft		eax
- 		#define REG_temp32			edx
- 		#define REG_temp			rdx
--		#define SSE2_WORKSPACE		%5
-+		#define SSE2_WORKSPACE		%5		/* constant */
- 
--		FixedSizeAlignedSecBlock<byte, 32*16> workspace;
-+		CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32];
- 	#else
- 		#define REG_output			edi
- 		#define REG_input			eax
-@@ -457,12 +457,13 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output
- #ifdef __GNUC__
- 		AS_POP_IF86(	bx)
- 		".att_syntax prefix;"
--			: 
- 	#if CRYPTOPP_BOOL_X64
--			: "r" (m_rounds), "r" (input), "r" (iterationCount), "r" (m_state.data()), "r" (output), "r" (workspace.m_ptr)
--			: "%eax", "%edx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
-+			: "+r" (input), "+r" (output), "+r" (iterationCount)
-+			: "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace)
-+			: "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
- 	#else
--			: "d" (m_rounds), "a" (input), "c" (iterationCount), "S" (m_state.data()), "D" (output)
-+			: "+a" (input), "+D" (output), "+c" (iterationCount)
-+			: "d" (m_rounds), "S" (m_state.m_ptr)
- 			: "memory", "cc"
- 	#endif
- 		);
--- 
-1.7.9.2
-
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 5fccc7ad66b7..47e83e7780cc 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 0b8029c94dbf..5716ac6648a0 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 5c6c080a9251..cdc54ef66916 100644
--- a/pkgs/development/libraries/directfb/default.nix
+++ b/pkgs/development/libraries/directfb/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = s.hash;
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   buildInputs = [ pkgconfig 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 6884aca16fcb..9cf0a3c350cc 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 56f66aba8f8d..5653eec6d41f 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 da59c3bb9b46..766a0dbef1d8 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 cbb21073685c..3467ac2cc3bc 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 3babcb828337..7d84cf889932 100644
--- a/pkgs/development/libraries/farstream/default.nix
+++ b/pkgs/development/libraries/farstream/default.nix
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
     sha256 = "1nbkbvq959f70zhr03fwdibhs0sbf1k7zmbz9w99vda7gdcl0nps";
   };
 
-  buildInputs = [ libnice python pygobject gupnp_igd ];
+  buildInputs = [ libnice python pygobject gupnp_igd libnice ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
-  propagatedBuildInputs = [ gstreamer gst_plugins_base gst_python 
+  propagatedBuildInputs = [ gstreamer gst_plugins_base gst_python
     gst_plugins_good gst_plugins_bad gst_ffmpeg
     ];
 
diff --git a/pkgs/development/libraries/ffmpeg/1.0.nix b/pkgs/development/libraries/ffmpeg/1.0.nix
deleted file mode 100644
index d703fd8e3697..000000000000
--- a/pkgs/development/libraries/ffmpeg/1.0.nix
+++ /dev/null
@@ -1,85 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2, alsaLib
-, mp3Support ? true, lame ? null
-, speexSupport ? true, speex ? null
-, theoraSupport ? true, libtheora ? null
-, vorbisSupport ? true, libvorbis ? null
-, vpxSupport ? false, libvpx ? null
-, x264Support ? true, x264 ? null
-, xvidSupport ? true, xvidcore ? null
-, vdpauSupport ? true, libvdpau ? null
-, faacSupport ? false, faac ? null
-, dc1394Support ? false, libdc1394 ? null
-, x11grabSupport ? false, libXext ? null, libXfixes ? null
-}:
-
-assert speexSupport -> speex != null;
-assert theoraSupport -> libtheora != null;
-assert vorbisSupport -> libvorbis != null;
-assert vpxSupport -> libvpx != null;
-assert x264Support -> x264 != null;
-assert xvidSupport -> xvidcore != null;
-assert vdpauSupport -> libvdpau != null;
-assert faacSupport -> faac != null;
-assert x11grabSupport -> libXext != null && libXfixes != null;
-
-stdenv.mkDerivation rec {
-  name = "ffmpeg-1.0";
-  
-  src = fetchurl {
-    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
-    sha256 = "1jbi85z2zkk3fh09l9f1s70kpvsz8706ay4lsw75395q8vic70hd";
-  };
-  
-  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
-  # the resulting library is GPL'ed, so it can only be used in GPL'ed
-  # applications.
-  configureFlags = [
-    "--enable-gpl"
-    "--enable-postproc"
-    "--enable-swscale"
-    "--disable-ffplay"
-    "--enable-shared"
-    "--enable-runtime-cpudetect"
-  ]
-    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
-    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
-    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
-    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
-    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
-    ++ stdenv.lib.optional x264Support "--enable-libx264"
-    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
-    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
-    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
-    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
-    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab";
-
-  buildInputs = [ pkgconfig lame yasm zlib bzip2 alsaLib ]
-    ++ stdenv.lib.optional mp3Support lame
-    ++ stdenv.lib.optional speexSupport speex
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional vorbisSupport libvorbis
-    ++ stdenv.lib.optional vpxSupport libvpx
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional faacSupport faac
-    ++ stdenv.lib.optional dc1394Support libdc1394
-    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ];
-
-  enableParallelBuilding = true;
-    
-  crossAttrs = {
-    dontSetConfigureCross = true;
-    configureFlags = configureFlags ++ [
-      "--cross-prefix=${stdenv.cross.config}-"
-      "--enable-cross-compile"
-      "--target_os=linux"
-      "--arch=${stdenv.cross.arch}"
-      ];
-  };
-
-  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/ffmpeg/1.1.nix b/pkgs/development/libraries/ffmpeg/1.1.nix
index 7cb83db5e8d3..100e3456ca43 100644
--- a/pkgs/development/libraries/ffmpeg/1.1.nix
+++ b/pkgs/development/libraries/ffmpeg/1.1.nix
@@ -25,7 +25,7 @@ assert faacSupport -> faac != null;
 assert x11grabSupport -> libXext != null && libXfixes != null;
 
 stdenv.mkDerivation rec {
-  name = "ffmpeg-1.1";
+  name = "ffmpeg-1.1.3";
   
   src = fetchurl {
     url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix
index 3b5e28a2ee7f..b37fcdf4436c 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 d3d89e6a9074..3ab267ad6b4a 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 f73480b3ce46..d85a24fa63ad 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 589ffaba3f96..98049e0ca35a 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 a212946c67f3..6d94eee865f3 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/default.nix b/pkgs/development/libraries/gdk-pixbuf/default.nix
index 56ef0f708748..532318b334b8 100644
--- a/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -12,7 +12,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 5da6e3e40f4c..a30d5c78e7f2 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 73366b2bdc95..5468c9f2336d 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 000000000000..9daa48eae649
--- /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 107a583d1020..2c651980eda8 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/default.nix b/pkgs/development/libraries/glib/default.nix
index 2c5028427f87..3ea277181148 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.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 cc8c5373ff55..8be076f335c0 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 ab3ef7c42f49..000000000000
--- 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 444eb8251e49..000000000000
--- 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 75bd996d9bc5..000000000000
--- 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 e48dc2bc0a6e..000000000000
--- 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 fbb03dd5fade..000000000000
--- 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 e68e13f9beca..e68e13f9beca 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 000000000000..ea2f3b6d1400
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/common.nix
@@ -0,0 +1,181 @@
+/* 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
+
+      /* Add blowfish password hashing support.  This is needed for
+         compatibility with old NixOS installations (since NixOS used
+         to default to blowfish). */
+      ./glibc-crypt-blowfish.patch
+
+      /* Fix for random "./sysdeps/posix/getaddrinfo.c:1467:
+         rfc3484_sort: Assertion `src->results[i].native == -1 ||
+         src->results[i].native == a2_native' failed." crashes. */
+      ./glibc-rh739743.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 1b4e43b1013a..0a0752570f32 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 000000000000..95f537733204
--- /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.17/glibc-crypt-blowfish.patch b/pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch
new file mode 100644
index 000000000000..a0a8acdab63d
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch
@@ -0,0 +1,795 @@
+From http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/glibc/glibc-crypt-blowfish.patch?revision=1.7&view=markup
+
+diff -ru -N glibc-2.17-orig/crypt/crypt_blowfish.c glibc-2.17/crypt/crypt_blowfish.c
+--- glibc-2.17-orig/crypt/crypt_blowfish.c	1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.17/crypt/crypt_blowfish.c	2013-01-22 23:30:12.340353965 +0100
+@@ -0,0 +1,743 @@
++/*
++ * This code comes from John the Ripper password cracker, with reentrant
++ * and crypt(3) interfaces added, but optimizations specific to password
++ * cracking removed.
++ *
++ * Written by Solar Designer <solar at openwall.com> in 1998-2002 and
++ * placed in the public domain.
++ *
++ * There's absolutely no warranty.
++ *
++ * It is my intent that you should be able to use this on your system,
++ * as a part of a software package, or anywhere else to improve security,
++ * ensure compatibility, or for any other purpose. I would appreciate
++ * it if you give credit where it is due and keep your modifications in
++ * the public domain as well, but I don't require that in order to let
++ * you place this code and any modifications you make under a license
++ * of your choice.
++ *
++ * This implementation is compatible with OpenBSD bcrypt.c (version 2a)
++ * by Niels Provos <provos at citi.umich.edu>, and uses some of his
++ * ideas. The password hashing algorithm was designed by David Mazieres
++ * <dm at lcs.mit.edu>.
++ *
++ * There's a paper on the algorithm that explains its design decisions:
++ *
++ *	http://www.usenix.org/events/usenix99/provos.html
++ *
++ * Some of the tricks in BF_ROUND might be inspired by Eric Young's
++ * Blowfish library (I can't be sure if I would think of something if I
++ * hadn't seen his code).
++ */
++
++#include <string.h>
++
++#include <errno.h>
++#ifndef __set_errno
++#define __set_errno(val) errno = (val)
++#endif
++
++#undef __CONST
++#ifdef __GNUC__
++#define __CONST __const
++#else
++#define __CONST
++#endif
++
++#ifdef __i386__
++#define BF_ASM				0 /* original OW patch has 1 */
++#define BF_SCALE			1
++#elif defined(__alpha__) || defined(__hppa__) || defined(__x86_64__)
++#define BF_ASM				0
++#define BF_SCALE			1
++#else
++#define BF_ASM				0
++#define BF_SCALE			0
++#endif
++
++typedef unsigned int BF_word;
++
++/* Number of Blowfish rounds, this is also hardcoded into a few places */
++#define BF_N				16
++
++typedef BF_word BF_key[BF_N + 2];
++
++typedef struct {
++	BF_word S[4][0x100];
++	BF_key P;
++} BF_ctx;
++
++/*
++ * Magic IV for 64 Blowfish encryptions that we do at the end.
++ * The string is "OrpheanBeholderScryDoubt" on big-endian.
++ */
++static BF_word BF_magic_w[6] = {
++	0x4F727068, 0x65616E42, 0x65686F6C,
++	0x64657253, 0x63727944, 0x6F756274
++};
++
++/*
++ * P-box and S-box tables initialized with digits of Pi.
++ */
++static BF_ctx BF_init_state = {
++	{
++		{
++			0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
++			0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
++			0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
++			0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
++			0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
++			0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
++			0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
++			0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
++			0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
++			0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
++			0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
++			0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
++			0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
++			0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
++			0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
++			0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
++			0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
++			0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
++			0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
++			0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
++			0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
++			0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
++			0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
++			0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
++			0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
++			0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
++			0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
++			0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
++			0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
++			0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
++			0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
++			0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
++			0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
++			0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
++			0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
++			0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
++			0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
++			0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
++			0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
++			0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
++			0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
++			0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
++			0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
++			0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
++			0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
++			0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
++			0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
++			0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
++			0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
++			0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
++			0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
++			0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
++			0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
++			0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
++			0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
++			0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
++			0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
++			0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
++			0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
++			0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
++			0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
++			0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
++			0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
++			0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
++		}, {
++			0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
++			0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
++			0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
++			0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
++			0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
++			0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
++			0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
++			0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
++			0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
++			0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
++			0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
++			0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
++			0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
++			0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
++			0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
++			0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
++			0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
++			0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
++			0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
++			0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
++			0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
++			0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
++			0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
++			0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
++			0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
++			0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
++			0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
++			0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
++			0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
++			0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
++			0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
++			0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
++			0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
++			0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
++			0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
++			0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
++			0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
++			0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
++			0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
++			0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
++			0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
++			0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
++			0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
++			0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
++			0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
++			0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
++			0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
++			0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
++			0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
++			0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
++			0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
++			0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
++			0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
++			0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
++			0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
++			0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
++			0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
++			0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
++			0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
++			0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
++			0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
++			0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
++			0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
++			0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
++		}, {
++			0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
++			0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
++			0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
++			0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
++			0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
++			0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
++			0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
++			0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
++			0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
++			0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
++			0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
++			0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
++			0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
++			0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
++			0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
++			0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
++			0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
++			0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
++			0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
++			0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
++			0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
++			0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
++			0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
++			0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
++			0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
++			0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
++			0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
++			0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
++			0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
++			0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
++			0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
++			0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
++			0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
++			0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
++			0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
++			0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
++			0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
++			0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
++			0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
++			0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
++			0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
++			0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
++			0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
++			0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
++			0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
++			0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
++			0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
++			0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
++			0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
++			0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
++			0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
++			0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
++			0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
++			0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
++			0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
++			0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
++			0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
++			0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
++			0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
++			0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
++			0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
++			0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
++			0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
++			0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
++		}, {
++			0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
++			0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
++			0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
++			0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
++			0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
++			0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
++			0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
++			0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
++			0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
++			0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
++			0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
++			0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
++			0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
++			0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
++			0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
++			0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
++			0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
++			0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
++			0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
++			0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
++			0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
++			0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
++			0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
++			0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
++			0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
++			0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
++			0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
++			0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
++			0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
++			0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
++			0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
++			0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
++			0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
++			0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
++			0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
++			0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
++			0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
++			0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
++			0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
++			0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
++			0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
++			0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
++			0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
++			0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
++			0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
++			0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
++			0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
++			0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
++			0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
++			0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
++			0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
++			0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
++			0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
++			0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
++			0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
++			0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
++			0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
++			0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
++			0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
++			0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
++			0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
++			0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
++			0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
++			0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
++		}
++	}, {
++		0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
++		0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
++		0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
++		0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
++		0x9216d5d9, 0x8979fb1b
++	}
++};
++
++static unsigned char BF_itoa64[64 + 1] =
++	"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
++
++static unsigned char BF_atoi64[0x60] = {
++	64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1,
++	54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64,
++	64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
++	17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64,
++	64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
++	43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64
++};
++
++/*
++ * This may be optimized out if built with function inlining and no BF_ASM.
++ */
++static void clean(void *data, int size)
++{
++#if BF_ASM
++	extern void _BF_clean(void *data);
++#endif
++	memset(data, 0, size);
++#if BF_ASM
++	_BF_clean(data);
++#endif
++}
++
++#define BF_safe_atoi64(dst, src) \
++{ \
++	tmp = (unsigned char)(src); \
++	if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \
++	tmp = BF_atoi64[tmp]; \
++	if (tmp > 63) return -1; \
++	(dst) = tmp; \
++}
++
++static int BF_decode(BF_word *dst, __CONST char *src, int size)
++{
++	unsigned char *dptr = (unsigned char *)dst;
++	unsigned char *end = dptr + size;
++	unsigned char *sptr = (unsigned char *)src;
++	unsigned int tmp, c1, c2, c3, c4;
++
++	do {
++		BF_safe_atoi64(c1, *sptr++);
++		BF_safe_atoi64(c2, *sptr++);
++		*dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4);
++		if (dptr >= end) break;
++
++		BF_safe_atoi64(c3, *sptr++);
++		*dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2);
++		if (dptr >= end) break;
++
++		BF_safe_atoi64(c4, *sptr++);
++		*dptr++ = ((c3 & 0x03) << 6) | c4;
++	} while (dptr < end);
++
++	return 0;
++}
++
++static void BF_encode(char *dst, __CONST BF_word *src, int size)
++{
++	unsigned char *sptr = (unsigned char *)src;
++	unsigned char *end = sptr + size;
++	unsigned char *dptr = (unsigned char *)dst;
++	unsigned int c1, c2;
++
++	do {
++		c1 = *sptr++;
++		*dptr++ = BF_itoa64[c1 >> 2];
++		c1 = (c1 & 0x03) << 4;
++		if (sptr >= end) {
++			*dptr++ = BF_itoa64[c1];
++			break;
++		}
++
++		c2 = *sptr++;
++		c1 |= c2 >> 4;
++		*dptr++ = BF_itoa64[c1];
++		c1 = (c2 & 0x0f) << 2;
++		if (sptr >= end) {
++			*dptr++ = BF_itoa64[c1];
++			break;
++		}
++
++		c2 = *sptr++;
++		c1 |= c2 >> 6;
++		*dptr++ = BF_itoa64[c1];
++		*dptr++ = BF_itoa64[c2 & 0x3f];
++	} while (sptr < end);
++}
++
++static void BF_swap(BF_word *x, int count)
++{
++	static int endianness_check = 1;
++	char *is_little_endian = (char *)&endianness_check;
++	BF_word tmp;
++
++	if (*is_little_endian)
++	do {
++		tmp = *x;
++		tmp = (tmp << 16) | (tmp >> 16);
++		*x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF);
++	} while (--count);
++}
++
++#if BF_SCALE
++/* Architectures which can shift addresses left by 2 bits with no extra cost */
++#define BF_ROUND(L, R, N) \
++	tmp1 = L & 0xFF; \
++	tmp2 = L >> 8; \
++	tmp2 &= 0xFF; \
++	tmp3 = L >> 16; \
++	tmp3 &= 0xFF; \
++	tmp4 = L >> 24; \
++	tmp1 = data.ctx.S[3][tmp1]; \
++	tmp2 = data.ctx.S[2][tmp2]; \
++	tmp3 = data.ctx.S[1][tmp3]; \
++	tmp3 += data.ctx.S[0][tmp4]; \
++	tmp3 ^= tmp2; \
++	R ^= data.ctx.P[N + 1]; \
++	tmp3 += tmp1; \
++	R ^= tmp3;
++#else
++/* Architectures with no complicated addressing modes supported */
++#define BF_INDEX(S, i) \
++	(*((BF_word *)(((unsigned char *)S) + (i))))
++#define BF_ROUND(L, R, N) \
++	tmp1 = L & 0xFF; \
++	tmp1 <<= 2; \
++	tmp2 = L >> 6; \
++	tmp2 &= 0x3FC; \
++	tmp3 = L >> 14; \
++	tmp3 &= 0x3FC; \
++	tmp4 = L >> 22; \
++	tmp4 &= 0x3FC; \
++	tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \
++	tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \
++	tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \
++	tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \
++	tmp3 ^= tmp2; \
++	R ^= data.ctx.P[N + 1]; \
++	tmp3 += tmp1; \
++	R ^= tmp3;
++#endif
++
++/*
++ * Encrypt one block, BF_N is hardcoded here.
++ */
++#define BF_ENCRYPT \
++	L ^= data.ctx.P[0]; \
++	BF_ROUND(L, R, 0); \
++	BF_ROUND(R, L, 1); \
++	BF_ROUND(L, R, 2); \
++	BF_ROUND(R, L, 3); \
++	BF_ROUND(L, R, 4); \
++	BF_ROUND(R, L, 5); \
++	BF_ROUND(L, R, 6); \
++	BF_ROUND(R, L, 7); \
++	BF_ROUND(L, R, 8); \
++	BF_ROUND(R, L, 9); \
++	BF_ROUND(L, R, 10); \
++	BF_ROUND(R, L, 11); \
++	BF_ROUND(L, R, 12); \
++	BF_ROUND(R, L, 13); \
++	BF_ROUND(L, R, 14); \
++	BF_ROUND(R, L, 15); \
++	tmp4 = R; \
++	R = L; \
++	L = tmp4 ^ data.ctx.P[BF_N + 1];
++
++#if BF_ASM
++#define BF_body() \
++	_BF_body_r(&data.ctx);
++#else
++#define BF_body() \
++	L = R = 0; \
++	ptr = data.ctx.P; \
++	do { \
++		ptr += 2; \
++		BF_ENCRYPT; \
++		*(ptr - 2) = L; \
++		*(ptr - 1) = R; \
++	} while (ptr < &data.ctx.P[BF_N + 2]); \
++\
++	ptr = data.ctx.S[0]; \
++	do { \
++		ptr += 2; \
++		BF_ENCRYPT; \
++		*(ptr - 2) = L; \
++		*(ptr - 1) = R; \
++	} while (ptr < &data.ctx.S[3][0xFF]);
++#endif
++
++static void BF_set_key(__CONST char *key, BF_key expanded, BF_key initial)
++{
++	__CONST char *ptr = key;
++	int i, j;
++	BF_word tmp;
++
++	for (i = 0; i < BF_N + 2; i++) {
++		tmp = 0;
++		for (j = 0; j < 4; j++) {
++			tmp <<= 8;
++			tmp |= (unsigned char)*ptr;
++
++			if (!*ptr) ptr = key; else ptr++;
++		}
++
++		expanded[i] = tmp;
++		initial[i] = BF_init_state.P[i] ^ tmp;
++	}
++}
++
++char *_crypt_blowfish_rn(__CONST char *key, __CONST char *setting,
++	char *output, int size)
++{
++#if BF_ASM
++	extern void _BF_body_r(BF_ctx *ctx);
++#endif
++	struct {
++		BF_ctx ctx;
++		BF_key expanded_key;
++		union {
++			BF_word salt[4];
++			BF_word output[6];
++		} binary;
++	} data;
++	BF_word L, R;
++	BF_word tmp1, tmp2, tmp3, tmp4;
++	BF_word *ptr;
++	BF_word count;
++	int i;
++
++	if (size < 7 + 22 + 31 + 1) {
++		__set_errno(ERANGE);
++		return NULL;
++	}
++
++	if (setting[0] != '$' ||
++	    setting[1] != '2' ||
++	    setting[2] != 'a' ||
++	    setting[3] != '$' ||
++	    setting[4] < '0' || setting[4] > '3' ||
++	    setting[5] < '0' || setting[5] > '9' ||
++	    setting[6] != '$') {
++		__set_errno(EINVAL);
++		return NULL;
++	}
++
++	count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0'));
++	if (count < 16 || BF_decode(data.binary.salt, &setting[7], 16)) {
++		clean(data.binary.salt, sizeof(data.binary.salt));
++		__set_errno(EINVAL);
++		return NULL;
++	}
++	BF_swap(data.binary.salt, 4);
++
++	BF_set_key(key, data.expanded_key, data.ctx.P);
++
++	memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S));
++
++	L = R = 0;
++	for (i = 0; i < BF_N + 2; i += 2) {
++		L ^= data.binary.salt[i & 2];
++		R ^= data.binary.salt[(i & 2) + 1];
++		BF_ENCRYPT;
++		data.ctx.P[i] = L;
++		data.ctx.P[i + 1] = R;
++	}
++
++	ptr = data.ctx.S[0];
++	do {
++		ptr += 4;
++		L ^= data.binary.salt[(BF_N + 2) & 3];
++		R ^= data.binary.salt[(BF_N + 3) & 3];
++		BF_ENCRYPT;
++		*(ptr - 4) = L;
++		*(ptr - 3) = R;
++
++		L ^= data.binary.salt[(BF_N + 4) & 3];
++		R ^= data.binary.salt[(BF_N + 5) & 3];
++		BF_ENCRYPT;
++		*(ptr - 2) = L;
++		*(ptr - 1) = R;
++	} while (ptr < &data.ctx.S[3][0xFF]);
++
++	do {
++		data.ctx.P[0] ^= data.expanded_key[0];
++		data.ctx.P[1] ^= data.expanded_key[1];
++		data.ctx.P[2] ^= data.expanded_key[2];
++		data.ctx.P[3] ^= data.expanded_key[3];
++		data.ctx.P[4] ^= data.expanded_key[4];
++		data.ctx.P[5] ^= data.expanded_key[5];
++		data.ctx.P[6] ^= data.expanded_key[6];
++		data.ctx.P[7] ^= data.expanded_key[7];
++		data.ctx.P[8] ^= data.expanded_key[8];
++		data.ctx.P[9] ^= data.expanded_key[9];
++		data.ctx.P[10] ^= data.expanded_key[10];
++		data.ctx.P[11] ^= data.expanded_key[11];
++		data.ctx.P[12] ^= data.expanded_key[12];
++		data.ctx.P[13] ^= data.expanded_key[13];
++		data.ctx.P[14] ^= data.expanded_key[14];
++		data.ctx.P[15] ^= data.expanded_key[15];
++		data.ctx.P[16] ^= data.expanded_key[16];
++		data.ctx.P[17] ^= data.expanded_key[17];
++
++		BF_body();
++
++		tmp1 = data.binary.salt[0];
++		tmp2 = data.binary.salt[1];
++		tmp3 = data.binary.salt[2];
++		tmp4 = data.binary.salt[3];
++		data.ctx.P[0] ^= tmp1;
++		data.ctx.P[1] ^= tmp2;
++		data.ctx.P[2] ^= tmp3;
++		data.ctx.P[3] ^= tmp4;
++		data.ctx.P[4] ^= tmp1;
++		data.ctx.P[5] ^= tmp2;
++		data.ctx.P[6] ^= tmp3;
++		data.ctx.P[7] ^= tmp4;
++		data.ctx.P[8] ^= tmp1;
++		data.ctx.P[9] ^= tmp2;
++		data.ctx.P[10] ^= tmp3;
++		data.ctx.P[11] ^= tmp4;
++		data.ctx.P[12] ^= tmp1;
++		data.ctx.P[13] ^= tmp2;
++		data.ctx.P[14] ^= tmp3;
++		data.ctx.P[15] ^= tmp4;
++		data.ctx.P[16] ^= tmp1;
++		data.ctx.P[17] ^= tmp2;
++
++		BF_body();
++	} while (--count);
++
++	for (i = 0; i < 6; i += 2) {
++		L = BF_magic_w[i];
++		R = BF_magic_w[i + 1];
++
++		count = 64;
++		do {
++			BF_ENCRYPT;
++		} while (--count);
++
++		data.binary.output[i] = L;
++		data.binary.output[i + 1] = R;
++	}
++
++	memcpy(output, setting, 7 + 22 - 1);
++	output[7 + 22 - 1] = BF_itoa64[(int)
++		BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30];
++
++/* This has to be bug-compatible with the original implementation, so
++ * only encode 23 of the 24 bytes. :-) */
++	BF_swap(data.binary.output, 6);
++	BF_encode(&output[7 + 22], data.binary.output, 23);
++	output[7 + 22 + 31] = '\0';
++
++/* Overwrite the most obvious sensitive data we have on the stack. Note
++ * that this does not guarantee there's no sensitive data left on the
++ * stack and/or in registers; I'm not aware of portable code that does. */
++	clean(&data, sizeof(data));
++
++	return output;
++}
++
++char *_crypt_gensalt_blowfish_rn(unsigned long count,
++	__CONST char *input, int size, char *output, int output_size)
++{
++	if (size < 16 || output_size < 7 + 22 + 1 ||
++	    (count && (count < 4 || count > 31))) {
++		if (output_size > 0) output[0] = '\0';
++		__set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
++		return NULL;
++	}
++
++	if (!count) count = 5;
++
++	output[0] = '$';
++	output[1] = '2';
++	output[2] = 'a';
++	output[3] = '$';
++	output[4] = '0' + count / 10;
++	output[5] = '0' + count % 10;
++	output[6] = '$';
++
++	BF_encode(&output[7], (BF_word *)input, 16);
++	output[7 + 22] = '\0';
++
++	return output;
++}
+diff -ru -N glibc-2.17-orig/crypt/crypt-entry.c glibc-2.17/crypt/crypt-entry.c
+--- glibc-2.17-orig/crypt/crypt-entry.c	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/crypt/crypt-entry.c	2013-01-22 23:30:12.342353955 +0100
+@@ -61,6 +61,8 @@
+ extern char *__sha512_crypt_r (const char *key, const char *salt,
+ 			       char *buffer, int buflen);
+ extern char *__sha512_crypt (const char *key, const char *salt);
++extern char *_crypt_blowfish_rn (const char *key, const char *setting,
++				char *output, int size);
+ 
+ /* Define our magic string to mark salt for MD5 encryption
+    replacement.  This is meant to be the same as for other MD5 based
+@@ -73,6 +75,9 @@
+ /* Magic string for SHA512 encryption.  */
+ static const char sha512_salt_prefix[] = "$6$";
+ 
++/* Magic string for Blowfish encryption.  */
++static const char blowfish_salt_prefix[] = "$2a$";
++
+ /* For use by the old, non-reentrant routines (crypt/encrypt/setkey)  */
+ extern struct crypt_data _ufc_foobar;
+ 
+@@ -113,6 +118,11 @@
+   if (strncmp (sha512_salt_prefix, salt, sizeof (sha512_salt_prefix) - 1) == 0)
+     return __sha512_crypt_r (key, salt, (char *) data,
+ 			     sizeof (struct crypt_data));
++
++  /* Try to find out whether we have to use Blowfish encryption replacement.  */
++  if (strncmp (blowfish_salt_prefix, salt, sizeof (blowfish_salt_prefix) - 1) == 0)
++    return _crypt_blowfish_rn (key, salt, (char *) data,
++			     sizeof (struct crypt_data));
+ #endif
+ 
+   /*
+diff -ru -N glibc-2.17-orig/crypt/Makefile glibc-2.17/crypt/Makefile
+--- glibc-2.17-orig/crypt/Makefile	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/crypt/Makefile	2013-01-22 23:30:12.341353960 +0100
+@@ -26,7 +26,7 @@
+ extra-libs-others := $(extra-libs)
+ 
+ libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
+-		     crypt_util
++		     crypt_util crypt_blowfish
+ 
+ tests := cert md5c-test sha256c-test sha512c-test badsalttest
+ 
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 98f7f81087bb..98f7f81087bb 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/glibc-rh739743.patch b/pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch
new file mode 100644
index 000000000000..c390b772b16d
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch
@@ -0,0 +1,55 @@
+2009-04-26  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assign native
+	result if the result has no associated interface.
+
+---
+ sysdeps/posix/getaddrinfo.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1456,13 +1456,13 @@
+ 
+ 	      /* Fill in the results in all the records.  */
+ 	      for (int i = 0; i < src->nresults; ++i)
+-		if (src->results[i].index == a1_index)
++		if (a1_index != -1 && src->results[i].index == a1_index)
+ 		  {
+ 		    assert (src->results[i].native == -1
+ 			    || src->results[i].native == a1_native);
+ 		    src->results[i].native = a1_native;
+ 		  }
+-		else if (src->results[i].index == a2_index)
++		else if (a2_index != -1 && src->results[i].index == a2_index)
+ 		  {
+ 		    assert (src->results[i].native == -1
+ 			    || src->results[i].native == a2_native);
+
+2009-03-15  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect 
+	interface for all 127.X.Y.Z addresses.
+
+---
+ sysdeps/posix/getaddrinfo.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -2265,7 +2265,14 @@
+ 			  tmp.addr[0] = 0;
+ 			  tmp.addr[1] = 0;
+ 			  tmp.addr[2] = htonl (0xffff);
+-			  tmp.addr[3] = sinp->sin_addr.s_addr;
++			  /* Special case for lo interface, the source address
++			     being possibly different than the interface 
++			     address. */
++			  if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000)
++			      == 0x7f000000)
++			    tmp.addr[3] = htonl(0x7f000001);
++			  else
++			    tmp.addr[3] = sinp->sin_addr.s_addr;
+ 			}
+ 		      else
+ 			{
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 000000000000..322f07f02363
--- /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 d732e208fa22..d732e208fa22 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 b7eae50ca385..b7eae50ca385 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 aca904f7ff44..88c8adef9226 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 000000000000..fd81ab5324e3
--- /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 4cd7ab3cec34..000000000000
--- 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 bc80af83b926..000000000000
--- 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 8b8c204a4803..000000000000
--- 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 8543dbbf1d76..000000000000
--- 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 19e400e0d50f..000000000000
--- 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 07039718477f..000000000000
--- 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 816e0aa528be..000000000000
--- 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 45deb1d2d719..000000000000
--- 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 d5a43229bfaf..000000000000
--- 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 7eb34e88899a..000000000000
--- 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 4d29082f9419..000000000000
--- 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 ab3d6144d6ee..000000000000
--- 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 ae70f145ce0d..000000000000
--- 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 c81a3ac2a9e9..000000000000
--- 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 7d42825206e2..000000000000
--- 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 7adeb11c8bc1..000000000000
--- 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 23f4bd4cc619..000000000000
--- 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 cc79bbece3d2..000000000000
--- 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 108d0e35dacf..000000000000
--- 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 a1fe9f82f143..000000000000
--- 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 a28f6bcbaeb3..000000000000
--- 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 dc09b5098707..000000000000
--- 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 fbb03dd5fade..000000000000
--- 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/default.nix b/pkgs/development/libraries/glibmm/default.nix
index 05efa2757568..962b14bc7888 100644
--- a/pkgs/development/libraries/glibmm/default.nix
+++ b/pkgs/development/libraries/glibmm/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1i4jsvahva2q0mig7kjnpsw0r3fnpybm8b6hzymfm2hpgqnaa9dl";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib gdk_pixbuf libsigcxx ];
 
   meta = {
diff --git a/pkgs/development/libraries/gmp/4.3.2.nix b/pkgs/development/libraries/gmp/4.3.2.nix
index d25b69411538..df7bd0ea3b96 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 98ebe5fcc256..461187a509cd 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
@@ -23,6 +23,13 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  crossAttrs = {
+    # Disable stripping to avoid "libgmp.a: Archive has no index"
+    # (see <http://hydra.nixos.org/build/4268666>.)
+    dontStrip = true;
+    dontCrossStrip = true;
+  };
+
   meta = {
     description = "GMP, the GNU multiple precision arithmetic library";
 
diff --git a/pkgs/development/libraries/gmp/5.1.1.nix b/pkgs/development/libraries/gmp/5.1.1.nix
new file mode 100644
index 000000000000..0261f833962e
--- /dev/null
+++ b/pkgs/development/libraries/gmp/5.1.1.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, m4, cxx ? true }:
+
+stdenv.mkDerivation rec {
+  name = "gmp-5.1.1";
+
+  src = fetchurl {
+    urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
+    sha256 = "1bdgf04k2i12pfivxgjq68iarz3ngix9hpzbmkgijrdk92gpgm50";
+  };
+
+  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 = {
+    homepage = "http://gmplib.org/";
+    description = "GMP, the GNU multiple precision arithmetic library";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    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.
+      '';
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/libraries/gnutls/2.12.nix b/pkgs/development/libraries/gnutls/2.12.nix
index cbb72754b1bf..85a676a05b1f 100644
--- a/pkgs/development/libraries/gnutls/2.12.nix
+++ b/pkgs/development/libraries/gnutls/2.12.nix
@@ -5,11 +5,11 @@ assert guileBindings -> guile != null;
 
 stdenv.mkDerivation rec {
 
-  name = "gnutls-2.12.11";
+  name = "gnutls-2.12.23";
 
-  src = fetchurl {
-    url = "mirror://gnu/gnutls/${name}.tar.bz2";
-    sha256 = "0q0kk69y1vpdxdz0mxqw603zi2y5kkgz3rvinc6bv6z9mwd8xd80";
+  src = fetchurl { # missing on standard mirrors
+    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v2.12/${name}.tar.bz2";
+    sha256 = "1lkys703z4yxfgzarmgas5ccvn6m254w9wvm7s8v0zkj81z7m9nz";
   };
 
   configurePhase = ''
diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix
index a1c1f3f357f4..c1dab82e37a2 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/goffice/default.nix b/pkgs/development/libraries/goffice/default.nix
index 1eaa1baf86d6..14da5f3468b4 100644
--- a/pkgs/development/libraries/goffice/default.nix
+++ b/pkgs/development/libraries/goffice/default.nix
@@ -10,6 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "165070beb67b84580afe80a8a100b674a81d553ab791acd72ac0c655f4fadb15";
   };
 
+  # fix linking error: undefined reference to pcre_info
+  patches = [ ./pcre_info.patch ]; # inspired by https://bugs.php.net/bug.php?id=60986
+
   buildInputs = [
     pkgconfig libglade bzip2 libart intltool gettext
     gconf libgnomeui pcre
diff --git a/pkgs/development/libraries/goffice/pcre_info.patch b/pkgs/development/libraries/goffice/pcre_info.patch
new file mode 100644
index 000000000000..cd4ef3c9fed7
--- /dev/null
+++ b/pkgs/development/libraries/goffice/pcre_info.patch
@@ -0,0 +1,13 @@
+diff --git a/goffice/utils/regutf8.c b/goffice/utils/regutf8.c
+index bc4aae4..3adb696 100644
+--- a/goffice/utils/regutf8.c
++++ b/goffice/utils/regutf8.c
+@@ -155,7 +155,7 @@ go_regcomp (GORegexp *gor, const char *pat, int cflags)
+ 		default: return GO_REG_BADPAT;
+ 		}
+ 	} else {
+-		gor->re_nsub = pcre_info (r, NULL, NULL);
++		gor->re_nsub = pcre_fullinfo (r, NULL, NULL, NULL);
+ 		gor->nosub = (cflags & GO_REG_NOSUB) != 0;
+ 		return 0;
+ 	}
diff --git a/pkgs/development/libraries/google-perftools/default.nix b/pkgs/development/libraries/google-perftools/default.nix
deleted file mode 100644
index 7935a794a2ff..000000000000
--- a/pkgs/development/libraries/google-perftools/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{stdenv, fetchurl, libunwind}:
-
-stdenv.mkDerivation rec {
-  name = "google-perftools-1.8.3";
-  src = fetchurl {
-    url = "http://google-perftools.googlecode.com/files/${name}.tar.gz";
-    sha256 = "0ncx3a8jl6n38q9bjnaz5sq96yb6yh99j3bl64k3295v9arl9mva";
-  };
-  buildInputs = [libunwind];
-  meta = {
-    description = "Fast, multi-threaded malloc() and nifty performance analysis tools.";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix
new file mode 100644
index 000000000000..76d1d8c41f75
--- /dev/null
+++ b/pkgs/development/libraries/gperftools/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libunwind }:
+
+stdenv.mkDerivation rec {
+  name = "gperftools-2.0";
+
+  src = fetchurl {
+    url = "https://gperftools.googlecode.com/files/${name}.tar.gz";
+    sha1 = "da7181a7ba9b5ee7302daf6c16e886c179fe8d1b";
+  };
+
+  patches = [ ./glibc-2.16.patch ];
+
+  buildInputs = [ libunwind ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://code.google.com/p/gperftools/;
+    description = "Fast, multi-threaded malloc() and nifty performance analysis tools";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gperftools/glibc-2.16.patch b/pkgs/development/libraries/gperftools/glibc-2.16.patch
new file mode 100644
index 000000000000..b17e0d57f5fb
--- /dev/null
+++ b/pkgs/development/libraries/gperftools/glibc-2.16.patch
@@ -0,0 +1,13 @@
+Index: gperftools-2.0/src/base/linuxthreads.cc
+===================================================================
+--- gperftools-2.0.orig/src/base/linuxthreads.cc
++++ gperftools-2.0/src/base/linuxthreads.cc
+@@ -193,7 +193,7 @@ static volatile int *sig_pids, sig_num_t
+ /* Signal handler to help us recover from dying while we are attached to
+  * other threads.
+  */
+-static void SignalHandler(int signum, siginfo_t *si, void *data) {
++static void SignalHandler(int signum, struct siginfo *si, void *data) {
+   if (sig_pids != NULL) {
+     if (signum == SIGABRT) {
+       while (sig_num_threads-- > 0) {
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 2f1411a0bdaa..4ba4cbb33474 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/gsasl/default.nix b/pkgs/development/libraries/gsasl/default.nix
index 9f71bc5e202a..3b52133058f1 100644
--- a/pkgs/development/libraries/gsasl/default.nix
+++ b/pkgs/development/libraries/gsasl/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gss, libidn }:
 
 stdenv.mkDerivation rec {
-  name = "gsasl-1.6.1";
+  name = "gsasl-1.8.0";
 
   src = fetchurl {
     url = "mirror://gnu/gsasl/${name}.tar.gz";
-    sha256 = "02dmras3kqik08p14mpq0lj678w7wmmaxpcvdrx116wkcgspv2z6";
+    sha256 = "1rci64cxvcfr8xcjpqc4inpfq7aw4snnsbf5xz7d30nhvv8n40ii";
   };
 
   buildInputs = [ gss libidn ];
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
index 4298a88f65e8..85468b309c55 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
@@ -5,16 +5,18 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-plugins-good-0.10.30";
+  name = "gst-plugins-good-0.10.31";
 
   src = fetchurl {
     urls = [
       "${meta.homepage}/src/gst-plugins-good/${name}.tar.bz2"
       "mirror://gentoo/distfiles/${name}.tar.bz2"
       ];
-    sha256 = "1xlmw211fcn60y2m5gxrryb3knqril4kk2c01b6j713xna8blb5i";
+    sha256 = "1ijswgcrdp243mfsyza31fpzq6plz40p4b83vkr2x4x7807889vy";
   };
 
+  patches = [ ./v4l.patch ];
+
   configureFlags = "--disable-oss";
 
   buildInputs =
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch b/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch
new file mode 100644
index 000000000000..22cff574134f
--- /dev/null
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch
@@ -0,0 +1,11 @@
+diff -ru -x '*~' gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c
+--- gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c	2011-12-30 14:59:13.000000000 +0100
++++ gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c	2013-01-28 17:41:25.549523708 +0100
+@@ -181,7 +181,6 @@
+     GST_LOG_OBJECT (pool->v4l2elem, "  MMAP offset:  %u",
+         ret->vbuffer.m.offset);
+   GST_LOG_OBJECT (pool->v4l2elem, "  length:    %u", ret->vbuffer.length);
+-  GST_LOG_OBJECT (pool->v4l2elem, "  input:     %u", ret->vbuffer.input);
+ 
+   data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
+       PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
diff --git a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
index 8bfeb8a4beac..c3510a69a123 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.x.nix b/pkgs/development/libraries/gtk+/2.x.nix
index f35031fa071d..f899db0e18f5 100644
--- a/pkgs/development/libraries/gtk+/2.x.nix
+++ b/pkgs/development/libraries/gtk+/2.x.nix
@@ -8,16 +8,16 @@ assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
 stdenv.mkDerivation rec {
-  name = "gtk+-2.24.15";
+  name = "gtk+-2.24.16";
 
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/2.24/${name}.tar.xz";
-    sha256 = "06vpryqaz6q4kganfj34cf3h1dhg7fvm5zj1hk44iakbmvbcdqfp";
+    sha256 = "1lq2jdpxy2diczlplllclhl6jakm4i5ay35566ma7ygc5k66kkck";
   };
 
   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-default.nix
index 9f333c03fabf..3b7361835e23 100644
--- a/pkgs/development/libraries/gtk+/3.2.x.nix
+++ b/pkgs/development/libraries/gtk+/3-default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, glib, atk, pango, cairo, perl, xlibs
-, gdk_pixbuf, xz
+, gdk_pixbuf, xz, at_spi2_atk
 , xineramaSupport ? true
 , cupsSupport ? true, cups ? null
 }:
@@ -8,21 +8,19 @@ assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
 stdenv.mkDerivation rec {
-  name = "gtk+-3.2.4";
+  name = "gtk+-3.6.4";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtk+/3.2/${name}.tar.xz";
-    sha256 = "f981bf514858c00d7084bd6f6c34b3c60b8aebdb959e7aca6faa59ed67c136bd";
+    url = "mirror://gnome/sources/gtk+/3.6/${name}.tar.xz";
+    sha256 = "18gijn9ghzv7d6np10q9bhp7lwgjb462n3xj1dn9hkwkdyc3gnnv";
   };
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ perl pkgconfig ];
-
-  propagatedBuildInputs =
-    [ xlibs.xlibs glib atk pango gdk_pixbuf cairo
-      xlibs.libXrandr xlibs.libXrender xlibs.libXcomposite xlibs.libXi
-    ]
+  buildInputs = with xlibs; [
+    pkgconfig glib atk pango gdk_pixbuf at_spi2_atk
+    libXrandr libXrender libXcomposite libXi
+  ]
     ++ stdenv.lib.optional xineramaSupport xlibs.libXinerama
     ++ stdenv.lib.optionals cupsSupport [ cups ];
 
diff --git a/pkgs/development/libraries/gtk-sharp-2/default.nix b/pkgs/development/libraries/gtk-sharp-2/default.nix
index 7ffc918f678d..9baac518ff76 100644
--- a/pkgs/development/libraries/gtk-sharp-2/default.nix
+++ b/pkgs/development/libraries/gtk-sharp-2/default.nix
@@ -26,6 +26,13 @@ stdenv.mkDerivation {
 
   # patches = [ ./dllmap-glue.patch ];
 
+  # patch bad usage of glib, which wasn't tolerated anymore
+  prePatch = ''
+    for f in glib/glue/{thread,list,slist}.c; do
+      sed -i 's,#include <glib/.*\.h>,#include <glib.h>,g' "$f"
+    done
+  '';
+
   buildInputs = [
     pkgconfig mono glib pango gtk GConf libglade libgnomecanvas
     libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
diff --git a/pkgs/development/libraries/gtkmm/2.x.nix b/pkgs/development/libraries/gtkmm/2.x.nix
index 56d151101c5d..ec7f01a8be5e 100644
--- a/pkgs/development/libraries/gtkmm/2.x.nix
+++ b/pkgs/development/libraries/gtkmm/2.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.x.nix b/pkgs/development/libraries/gtkmm/3.x.nix
index 890d4a34519d..37c885bf630c 100644
--- a/pkgs/development/libraries/gtkmm/3.x.nix
+++ b/pkgs/development/libraries/gtkmm/3.x.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, gtk3, glibmm, cairomm, pangomm, atkmm }:
 
-stdenv.mkDerivation {
-  name = "gtkmm-3.2.0";
+stdenv.mkDerivation rec {
+  name = "gtkmm-3.6.0";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gtkmm/3.2/gtkmm-3.2.0.tar.xz;
-    sha256 = "1wkljr2vjvjg5mggi4rvk9k4j2kzh8lc106k2yp8gqjlhk2xm5b1";
+    url = "mirror://gnome/sources/gtkmm/3.6/${name}.tar.xz";
+    sha256 = "0n93z8is5afgpqq0czr5wynr78vpv5lap3ayl4x0iv5cr3am90c8";
   };
 
-  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 a8bb065d7eb8..20a5f2d9c946 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 5679591878a5..c70d8fcb0c26 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 207b81997af5..724524e2b263 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/OpenAL/default.nix b/pkgs/development/libraries/haskell/OpenAL/default.nix
index 206e78eb728b..a04aea993fa2 100644
--- a/pkgs/development/libraries/haskell/OpenAL/default.nix
+++ b/pkgs/development/libraries/haskell/OpenAL/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "OpenAL";
-  version = "1.4.0.1";
-  sha256 = "180f84sjakhd1b8h5n3l92by2wmic20n6ax0z5fi3fvk9w73khyv";
+  version = "1.4.0.2";
+  sha256 = "19q4pd5i2w330qh895z0cgim4m4f4gxqf4ya1192fchqmgcz1svz";
   buildDepends = [ ObjectName StateVar Tensor ];
   extraLibraries = [ openal ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/QuickCheck/2.6.nix b/pkgs/development/libraries/haskell/QuickCheck/2.6.nix
new file mode 100644
index 000000000000..39c97859e657
--- /dev/null
+++ b/pkgs/development/libraries/haskell/QuickCheck/2.6.nix
@@ -0,0 +1,15 @@
+{ cabal, random }:
+
+cabal.mkDerivation (self: {
+  pname = "QuickCheck";
+  version = "2.6";
+  sha256 = "03cp7mshjy2yrg31i13b9kmc2a6lrmrbl1sh9s8lswcj305c00c0";
+  buildDepends = [ random ];
+  meta = {
+    homepage = "http://code.haskell.org/QuickCheck";
+    description = "Automatic testing of Haskell programs";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/basic-prelude/default.nix b/pkgs/development/libraries/haskell/basic-prelude/default.nix
index 77f37cfe5af1..04f3842be41b 100644
--- a/pkgs/development/libraries/haskell/basic-prelude/default.nix
+++ b/pkgs/development/libraries/haskell/basic-prelude/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "basic-prelude";
-  version = "0.3.3.0";
-  sha256 = "1b3fydswi7sj2j5d3jfynd9r5qg8pzlv1qdb9xp56ig01ig18cyv";
+  version = "0.3.4.0";
+  sha256 = "0layc06df7df4mf4zafj87c4klsvkxbhi69dkv4ag9fkzvs62sz6";
   buildDepends = [
     hashable liftedBase ReadArgs systemFilepath text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/bifunctors/default.nix b/pkgs/development/libraries/haskell/bifunctors/default.nix
index 09287600323d..c659c3bc3bea 100644
--- a/pkgs/development/libraries/haskell/bifunctors/default.nix
+++ b/pkgs/development/libraries/haskell/bifunctors/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "bifunctors";
-  version = "3.2";
-  sha256 = "03bszf1127iw5kimjbag5gmgzz7h2qzcd9f7jb53jpiadfhjfx0a";
+  version = "3.2.0.1";
+  sha256 = "1biicx0zi48wzzi7vkhzvrdyk59hmmm1bqbsga6x5nbrbf3qrkm6";
   buildDepends = [ semigroupoids semigroups tagged ];
   meta = {
     homepage = "http://github.com/ekmett/bifunctors/";
diff --git a/pkgs/development/libraries/haskell/binary/default.nix b/pkgs/development/libraries/haskell/binary/default.nix
index b4f205e41b21..6273a099f739 100644
--- a/pkgs/development/libraries/haskell/binary/default.nix
+++ b/pkgs/development/libraries/haskell/binary/default.nix
@@ -1,13 +1,14 @@
-{ cabal, QuickCheck, random, testFramework
+{ cabal, Cabal, filepath, HUnit, QuickCheck, random, testFramework
 , testFrameworkQuickcheck2
 }:
 
 cabal.mkDerivation (self: {
   pname = "binary";
-  version = "0.6.4.0";
-  sha256 = "0vq80fzhwil5bx4a2vbd3jvfh1awhg1pwxgvq3lvbi37yzl0ydgh";
+  version = "0.7.0.1";
+  sha256 = "16srrp0qx9hsr7820b2q3sp9wp8y8sxxi8rvsh63n48w4l3canxq";
   testDepends = [
-    QuickCheck random testFramework testFrameworkQuickcheck2
+    Cabal filepath HUnit QuickCheck random testFramework
+    testFrameworkQuickcheck2
   ];
   meta = {
     homepage = "https://github.com/kolmodin/binary";
diff --git a/pkgs/development/libraries/haskell/blaze-html/default.nix b/pkgs/development/libraries/haskell/blaze-html/default.nix
index 59e0f7187515..2063e3a862d7 100644
--- a/pkgs/development/libraries/haskell/blaze-html/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-html/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "blaze-html";
-  version = "0.6.0.0";
-  sha256 = "0n8jpmslcs29pfyb8jhp43dg4058ahd9y3kf2p2wr3r6b9yr5dll";
+  version = "0.6.1.0";
+  sha256 = "1y2z2md62kpl57qcvwvswmrjq7zhkqwfv8zr2acdvcxcxnyc47fm";
   buildDepends = [ blazeBuilder blazeMarkup text ];
   testDepends = [
     blazeBuilder blazeMarkup HUnit QuickCheck testFramework
diff --git a/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
index 44e27aa1bc33..c04b4dfc25e1 100644
--- a/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "classy-prelude-conduit";
-  version = "0.5.2";
-  sha256 = "11krzhy78z0srjy5g6h8ssv5n3ml8ryx92x0zdjigqxw4zq9ic72";
+  version = "0.5.3";
+  sha256 = "1rmx439kdjipyz2s3v2s1xv1mb55kb4njl9k6f8mfhykgac39rhz";
   buildDepends = [
     classyPrelude conduit monadControl resourcet transformers void
     xmlConduit
diff --git a/pkgs/development/libraries/haskell/classy-prelude/default.nix b/pkgs/development/libraries/haskell/classy-prelude/default.nix
index 48b6bc583695..4d0f5441e414 100644
--- a/pkgs/development/libraries/haskell/classy-prelude/default.nix
+++ b/pkgs/development/libraries/haskell/classy-prelude/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "classy-prelude";
-  version = "0.5.2";
-  sha256 = "1nmhx6fs783v67b5ygdlmpxbsj41brj32i1sx9gyjyhfvr40wiw5";
+  version = "0.5.3";
+  sha256 = "0xlhdxkxvrzj9y8wdl2f1pz94zz2gfa9vfbia9prhr7skirxvsad";
   buildDepends = [
     basicPrelude hashable liftedBase systemFilepath text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/conduit/default.nix b/pkgs/development/libraries/haskell/conduit/default.nix
index 75260bcb1b39..21f81ee038ce 100644
--- a/pkgs/development/libraries/haskell/conduit/default.nix
+++ b/pkgs/development/libraries/haskell/conduit/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "conduit";
-  version = "1.0.1";
-  sha256 = "1r3d30cap4f7qxi9v2ab5w31w9ay19z848d4l8klf1np9xs27hki";
+  version = "1.0.2";
+  sha256 = "03hyryljvkbgyvwx63qrkvf2wm1qm8640rsm8yb4mahgzp4r130f";
   buildDepends = [
     liftedBase monadControl resourcet text transformers
     transformersBase void
diff --git a/pkgs/development/libraries/haskell/cuda/default.nix b/pkgs/development/libraries/haskell/cuda/default.nix
index 3baa02d26747..f03e1907ec08 100644
--- a/pkgs/development/libraries/haskell/cuda/default.nix
+++ b/pkgs/development/libraries/haskell/cuda/default.nix
@@ -7,21 +7,19 @@ cabal.mkDerivation (self: {
   buildDepends = [ extensibleExceptions ];
   buildTools = [ c2hs ];
   extraLibraries = [ cudatoolkit nvidia_x11 self.stdenv.gcc ];
+  doCheck = false;
   # Perhaps this should be the default in cabal.nix ...
   #
   # The cudatoolkit provides both 64 and 32-bit versions of the
   # library. GHC's linker fails if the wrong version is found first.
   # We solve this by eliminating lib64 from the path on 32-bit
   # platforms and putting lib64 first on 64-bit platforms.
-  
   libPaths = if self.stdenv.is64bit then "lib64 lib" else "lib";
-  
   configurePhase = ''
     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
@@ -31,7 +29,6 @@ cabal.mkDerivation (self: {
         fi
       done
     done
-  
     ./Setup configure --verbose --prefix="$out" $libraryProfiling $extraLibDirs $configureFlags
   '';
   meta = {
diff --git a/pkgs/development/libraries/haskell/data-default/default.nix b/pkgs/development/libraries/haskell/data-default/default.nix
index 893f2121f0ab..4fb21ed5f551 100644
--- a/pkgs/development/libraries/haskell/data-default/default.nix
+++ b/pkgs/development/libraries/haskell/data-default/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "data-default";
-  version = "0.5.0";
-  sha256 = "1wv8wjd9j40s7h19aph5pqph7rby5ma1nlagqywn9q0634iq9n2a";
+  version = "0.5.1";
+  sha256 = "05zp9bcxm4lcdqniwckq0zi014iqcnqbrk5wh54dyy83h97z6mpv";
   buildDepends = [ dlist ];
   meta = {
     description = "A class for types with a default value";
diff --git a/pkgs/development/libraries/haskell/diagrams/core.nix b/pkgs/development/libraries/haskell/diagrams/core.nix
index c087e27d025d..ebea3fd60908 100644
--- a/pkgs/development/libraries/haskell/diagrams/core.nix
+++ b/pkgs/development/libraries/haskell/diagrams/core.nix
@@ -4,13 +4,12 @@
 
 cabal.mkDerivation (self: {
   pname = "diagrams-core";
-  version = "0.6.0.1";
-  sha256 = "0kw0rxk9a2zkpnbx4bfd0japm75y29ldvdn7i3c93kvz0p6jc2wa";
+  version = "0.6.0.2";
+  sha256 = "1g4b1zabgfdpaf7y3804r3w04ll4sqqrf71rm9389dg17ghc1q85";
   buildDepends = [
     dualTree MemoTrie monoidExtras newtype semigroups vectorSpace
     vectorSpacePoints
   ];
-  jailbreak = true;
   meta = {
     homepage = "http://projects.haskell.org/diagrams";
     description = "Core libraries for diagrams EDSL";
diff --git a/pkgs/development/libraries/haskell/doctest/default.nix b/pkgs/development/libraries/haskell/doctest/default.nix
index 3c8988400bcb..fd9728f4fb84 100644
--- a/pkgs/development/libraries/haskell/doctest/default.nix
+++ b/pkgs/development/libraries/haskell/doctest/default.nix
@@ -14,6 +14,7 @@ cabal.mkDerivation (self: {
     silently stringbuilder syb transformers
   ];
   doCheck = false;
+  jailbreak = true;
   meta = {
     homepage = "https://github.com/sol/doctest-haskell#readme";
     description = "Test interactive Haskell examples";
diff --git a/pkgs/development/libraries/haskell/flexible-defaults/default.nix b/pkgs/development/libraries/haskell/flexible-defaults/default.nix
index 9cba8f2c13f1..7be21dbbf347 100644
--- a/pkgs/development/libraries/haskell/flexible-defaults/default.nix
+++ b/pkgs/development/libraries/haskell/flexible-defaults/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "flexible-defaults";
-  version = "0.0.1.0";
-  sha256 = "0vq8ci3zbzmw8abjd12dhjiqzz4ckr99c1fqk32qsp5bvm81bdma";
+  version = "0.0.1.1";
+  sha256 = "0cbp8hb7y29xz3hl780173cs6ca4df0r98fz7v3drqr46aq55ipl";
   buildDepends = [ thExtras transformers ];
   meta = {
     homepage = "https://github.com/mokus0/flexible-defaults";
diff --git a/pkgs/development/libraries/haskell/ghc-mod/default.nix b/pkgs/development/libraries/haskell/ghc-mod/default.nix
index 3481d37356dc..1109a512a8da 100644
--- a/pkgs/development/libraries/haskell/ghc-mod/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mod/default.nix
@@ -1,20 +1,20 @@
 { cabal, Cabal, convertible, emacs, filepath, ghcPaths, ghcSybUtils
-, hlint, hspec, ioChoice, regexPosix, syb, time, transformers
+, hlint, hspec, ioChoice, syb, time, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "ghc-mod";
-  version = "1.11.5";
-  sha256 = "0lcq4ffmv017pdy58p91qn5d4hmcxcqzk8dvnmh7m4m7saslqivp";
+  version = "1.12.1";
+  sha256 = "0m876lfxi0k7v27rg4ipq3rpk7qvsrzfdflp5fayxvmi9wgdvm3r";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    Cabal convertible filepath ghcPaths ghcSybUtils hlint ioChoice
-    regexPosix syb time transformers
+    Cabal convertible filepath ghcPaths ghcSybUtils hlint ioChoice syb
+    time transformers
   ];
   testDepends = [
     Cabal convertible filepath ghcPaths ghcSybUtils hlint hspec
-    ioChoice regexPosix syb time transformers
+    ioChoice syb time transformers
   ];
   buildTools = [ emacs ];
   postInstall = ''
diff --git a/pkgs/development/libraries/haskell/ghc-vis/default.nix b/pkgs/development/libraries/haskell/ghc-vis/default.nix
index 4b606e8b73b9..3fd1230073e7 100644
--- a/pkgs/development/libraries/haskell/ghc-vis/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-vis/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-vis";
-  version = "0.6";
-  sha256 = "0gvfs0f6fjg4bzq9q6rrhin6gk1pbyw9qbigi90cz1fg10nq7nzi";
+  version = "0.6.1";
+  sha256 = "0q0v1l44vagcg0nl4iv8m872g4qblj9syjlcgbf6fpgx1fqnyp24";
   buildDepends = [
     cairo deepseq fgl ghcHeapView graphviz gtk mtl svgcairo text
     transformers xdot
diff --git a/pkgs/development/libraries/haskell/hakyll/default.nix b/pkgs/development/libraries/haskell/hakyll/default.nix
index 59a32b0d290b..eb27fde823fe 100644
--- a/pkgs/development/libraries/haskell/hakyll/default.nix
+++ b/pkgs/development/libraries/haskell/hakyll/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hakyll";
-  version = "4.1.4.0";
-  sha256 = "0nhr7ai03hx2qjxlqml0js43iwxhcbpdqkwdvw8pqs396yrjwxdj";
+  version = "4.2.1.0";
+  sha256 = "05w5j8wc47j8g4x2lsm0zs3aspb4rjvgnrxbjlxps0mfz3csqfhh";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -22,7 +22,7 @@ cabal.mkDerivation (self: {
     QuickCheck random regexBase regexTdfa tagsoup testFramework
     testFrameworkHunit testFrameworkQuickcheck2 text time
   ];
-  jailbreak = true;
+  doCheck = false;
   meta = {
     homepage = "http://jaspervdj.be/hakyll";
     description = "A static website compiler library";
diff --git a/pkgs/development/libraries/haskell/happstack/happstack-server.nix b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
index 8d8261df97e3..0185e4e6ce92 100644
--- a/pkgs/development/libraries/haskell/happstack/happstack-server.nix
+++ b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "happstack-server";
-  version = "7.1.6";
-  sha256 = "0gifq625kclam6sgblwa8a1vhxmx8saanzlrikch0l9q0l95nfwd";
+  version = "7.1.7";
+  sha256 = "1gd7qa224z04aya44fdrbhpiy5iw88wjcvqihz6l95ks9ilbzmg7";
   buildDepends = [
     base64Bytestring blazeHtml extensibleExceptions filepath hslogger
     html monadControl mtl network parsec sendfile syb systemFilepath
diff --git a/pkgs/development/libraries/haskell/highlighting-kate/default.nix b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
index 805519d3d30c..9d6185dc5266 100644
--- a/pkgs/development/libraries/haskell/highlighting-kate/default.nix
+++ b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "highlighting-kate";
-  version = "0.5.3.7";
-  sha256 = "04wa1al83v5ak6gvrwqy2b63mda0qfi2ircxfs9ddk1gkdscrlrl";
+  version = "0.5.3.8";
+  sha256 = "1fdgmwhiw05mgbgsrgyzvdqzklw9r10nswxfpnxkh5ivfxrhz82w";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ blazeHtml filepath mtl parsec regexPcre ];
diff --git a/pkgs/development/libraries/haskell/hledger-web/default.nix b/pkgs/development/libraries/haskell/hledger-web/default.nix
index 67adcb0fbdd6..c33026f5fd60 100644
--- a/pkgs/development/libraries/haskell/hledger-web/default.nix
+++ b/pkgs/development/libraries/haskell/hledger-web/default.nix
@@ -4,6 +4,7 @@
 , parsec, regexpr, safe, shakespeareCss, shakespeareJs
 , shakespeareText, text, time, transformers, wai, waiExtra, warp
 , yaml, yesod, yesodCore, yesodDefault, yesodForm, yesodStatic
+, yesodTest
 }:
 
 cabal.mkDerivation (self: {
@@ -19,15 +20,16 @@ cabal.mkDerivation (self: {
     shakespeareJs shakespeareText text time transformers wai waiExtra
     warp yaml yesod yesodCore yesodDefault yesodForm yesodStatic
   ];
+  testDepends = [ yesodCore yesodDefault yesodTest ];
   patchPhase = ''
     sed -r -i -e 's|blaze-html * >= 0.5 *&& < 0.6|blaze-html >= 0.5|' hledger-web.cabal
   '';
   jailbreak = true;
+  doCheck = false;
   meta = {
     homepage = "http://hledger.org";
     description = "A web interface for the hledger accounting tool";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hp2any-core/default.nix b/pkgs/development/libraries/haskell/hp2any-core/default.nix
index 37e6000a3c01..96ac397da79c 100644
--- a/pkgs/development/libraries/haskell/hp2any-core/default.nix
+++ b/pkgs/development/libraries/haskell/hp2any-core/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hp2any-core";
-  version = "0.11.1";
-  sha256 = "146bigmch7dawyyakj0w55p0jdpnxkj8q5izjsswqqk0pdxia546";
+  version = "0.11.2";
+  sha256 = "1gmw9bggw8hsp6pi0xgrryf0sqjb1aaxbwh85q5h72h4ixskwn1y";
   buildDepends = [ attoparsec filepath network time ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Hp2any";
diff --git a/pkgs/development/libraries/haskell/hp2any-graph/default.nix b/pkgs/development/libraries/haskell/hp2any-graph/default.nix
index 98b9518c7dea..83369ac008b7 100644
--- a/pkgs/development/libraries/haskell/hp2any-graph/default.nix
+++ b/pkgs/development/libraries/haskell/hp2any-graph/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hp2any-graph";
-  version = "0.5.3";
-  sha256 = "1al20pxfgkgwynrx7vr0i57342s91lcm3cnd9qjx8b6vkqmzykkq";
+  version = "0.5.4";
+  sha256 = "1lhp9saw51w09fhk94hz31rjawnnxavd7x3lxjc8xn1778wp3v9h";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/http-conduit/default.nix b/pkgs/development/libraries/haskell/http-conduit/default.nix
index dc5e248f4454..683396eea818 100644
--- a/pkgs/development/libraries/haskell/http-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/http-conduit/default.nix
@@ -9,8 +9,8 @@
 
 cabal.mkDerivation (self: {
   pname = "http-conduit";
-  version = "1.9.0";
-  sha256 = "1b6f2sg96fddk5ywbfvbvj9z81695d35qymf31idpkyshcp9argk";
+  version = "1.9.1";
+  sha256 = "1ypwqd5f6m459kjw2x3knig924s93b6yiviy7jlaxllpaw2lrial";
   buildDepends = [
     asn1Data base64Bytestring blazeBuilder blazeBuilderConduit
     caseInsensitive certificate conduit cookie cprngAes dataDefault
diff --git a/pkgs/development/libraries/haskell/monad-control/default.nix b/pkgs/development/libraries/haskell/monad-control/default.nix
index bf27ac461c3d..1cdf917cf8fb 100644
--- a/pkgs/development/libraries/haskell/monad-control/default.nix
+++ b/pkgs/development/libraries/haskell/monad-control/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "monad-control";
-  version = "0.3.1.4";
-  sha256 = "0mvcj6rljh2drkpf29zavwsqpzd9lw7s0n4inxm82i2017xdazy1";
+  version = "0.3.2";
+  sha256 = "1gw1g89cjr993kcxjd1lvj94klrb8hsxn0yzyl1gmfk4273z39pa";
   buildDepends = [
     baseUnicodeSymbols transformers transformersBase
   ];
diff --git a/pkgs/development/libraries/haskell/multiarg/default.nix b/pkgs/development/libraries/haskell/multiarg/default.nix
index 74254a4c591e..0a2495a07e9d 100644
--- a/pkgs/development/libraries/haskell/multiarg/default.nix
+++ b/pkgs/development/libraries/haskell/multiarg/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "multiarg";
-  version = "0.8.0.0";
-  sha256 = "17zfrm9zjf7c8g7q9vqj1srk0g766ifhwqp7gm4ql890541q5lv5";
+  version = "0.10.0.0";
+  sha256 = "09clgin66i2m0b3ws7di9p15cy9bd144as832xpx4li6cfbg16ip";
   buildDepends = [ explicitException utf8String ];
   meta = {
     homepage = "https://github.com/massysett/multiarg";
diff --git a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
index 066d1dd2ebe8..947f75342d45 100644
--- a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-sqlite";
-  version = "1.1.4.1";
-  sha256 = "0rhvbbzlzgzx4na7ffa2jx2zinzbb6b1jxf8964hcxx7iyzcycjj";
+  version = "1.1.5";
+  sha256 = "1kqxp0qsvxfz352yg9k1wgb2nfm7kcz8xdj9q537ilh99wxkp6cl";
   buildDepends = [
     aeson conduit monadControl monadLogger persistent text transformers
   ];
diff --git a/pkgs/development/libraries/haskell/resourcet/default.nix b/pkgs/development/libraries/haskell/resourcet/default.nix
index 35b7fec32765..f0dde62ef979 100644
--- a/pkgs/development/libraries/haskell/resourcet/default.nix
+++ b/pkgs/development/libraries/haskell/resourcet/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "resourcet";
-  version = "0.4.4";
-  sha256 = "0ad1hl7bl9qid4brchb95gvnylfchmxncgdvgljb5lci7gy9r31z";
+  version = "0.4.5";
+  sha256 = "1i2n0y4ridlzi2fn319f8jg1whb10gajgyvbz0rx2mwxj15bbgni";
   buildDepends = [
     liftedBase monadControl mtl transformers transformersBase
   ];
diff --git a/pkgs/development/libraries/haskell/shake/default.nix b/pkgs/development/libraries/haskell/shake/default.nix
new file mode 100644
index 000000000000..dd4f985e6183
--- /dev/null
+++ b/pkgs/development/libraries/haskell/shake/default.nix
@@ -0,0 +1,21 @@
+{ cabal, binary, deepseq, filepath, hashable, random, time
+, transformers, unorderedContainers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "shake";
+  version = "0.9.1";
+  sha256 = "19jpnf7794ii1v0rfafmcrs71flwz6hmz72ng529ll12iy64xwkv";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary deepseq filepath hashable random time transformers
+    unorderedContainers
+  ];
+  meta = {
+    homepage = "http://community.haskell.org/~ndm/shake/";
+    description = "Build system library, like Make, but more accurate dependencies";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/shakespeare-js/default.nix b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
index 55bf276d1f82..7f00530a7f94 100644
--- a/pkgs/development/libraries/haskell/shakespeare-js/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-js";
-  version = "1.1.2";
-  sha256 = "0iwajn0d0yngzp10j9qbb2gpq1g7r390yqd7pj5dri35rjc6mr8n";
+  version = "1.1.2.1";
+  sha256 = "049nn0p236wbm2majkih87n2c7h65xrnf6gydsi7najxccjl7y8z";
   buildDepends = [ aeson shakespeare text ];
   testDepends = [ aeson hspec HUnit shakespeare text ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/shelly/default.nix b/pkgs/development/libraries/haskell/shelly/default.nix
index 325021c1cca3..1e9e1f8c6ccb 100644
--- a/pkgs/development/libraries/haskell/shelly/default.nix
+++ b/pkgs/development/libraries/haskell/shelly/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "shelly";
-  version = "0.15.4";
-  sha256 = "1b8fn5fa350hhlswn97g6zn9454nzn9sz60x55j959phwys0fcdk";
+  version = "0.15.4.1";
+  sha256 = "12m11s22izz0ny1syb1ykp2hi9n240myf0nhapvn8jx1fgf5iyck";
   buildDepends = [
     mtl systemFileio systemFilepath text time unixCompat
   ];
diff --git a/pkgs/development/libraries/haskell/syb/0.4.0.nix b/pkgs/development/libraries/haskell/syb/0.4.0.nix
new file mode 100644
index 000000000000..7408d0ac5375
--- /dev/null
+++ b/pkgs/development/libraries/haskell/syb/0.4.0.nix
@@ -0,0 +1,15 @@
+{ cabal, HUnit, mtl }:
+
+cabal.mkDerivation (self: {
+  pname = "syb";
+  version = "0.4.0";
+  sha256 = "1wxz8y2dcjl407l596qswcl9cakbb5cs4wzwlyy6qjz7lyd0h0gj";
+  testDepends = [ HUnit mtl ];
+  meta = {
+    homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/SYB";
+    description = "Scrap Your Boilerplate";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix b/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
index 77e201ca63d4..b944c1e104cc 100644
--- a/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   buildDepends = [
     extensibleExceptions QuickCheck random testFramework
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://batterseapower.github.com/test-framework/";
     description = "QuickCheck2 support for the test-framework package";
diff --git a/pkgs/development/libraries/haskell/th-extras/default.nix b/pkgs/development/libraries/haskell/th-extras/default.nix
index be78bbaef31d..3475ccb804a0 100644
--- a/pkgs/development/libraries/haskell/th-extras/default.nix
+++ b/pkgs/development/libraries/haskell/th-extras/default.nix
@@ -2,12 +2,12 @@
 
 cabal.mkDerivation (self: {
   pname = "th-extras";
-  version = "0.0.0.1";
-  sha256 = "13d9fs48z87inma3kg9b7lfjp3h8j85fav6awd1zj3i2nl214hff";
+  version = "0.0.0.2";
+  sha256 = "15sqf2jjnqcssq8hp80fk0ysgwqykjjc31gvvmzg4sypskpjs8cl";
   buildDepends = [ syb ];
   meta = {
     homepage = "https://github.com/mokus0/th-extras";
-    description = "A grab bag of useful functions for use with Template Haskell";
+    description = "A grab bag of functions for use with Template Haskell";
     license = self.stdenv.lib.licenses.publicDomain;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
index d28eb827dabf..d9477f4233da 100644
--- a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
+++ b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uu-parsinglib";
-  version = "2.7.4.1";
-  sha256 = "1aya95j7dd0yal0ygy6d4w4wmlhgn5ddy3c5f6ncl4k3kg7hjxd1";
+  version = "2.7.4.2";
+  sha256 = "10ddm6x9km3lzs9ahqpsl9krvslsn9glimwzq4hspgsp6izd1dmq";
   buildDepends = [ ListLike time ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators";
diff --git a/pkgs/development/libraries/haskell/uulib/default.nix b/pkgs/development/libraries/haskell/uulib/default.nix
index 991f38080984..2521c44bec6e 100644
--- a/pkgs/development/libraries/haskell/uulib/default.nix
+++ b/pkgs/development/libraries/haskell/uulib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uulib";
-  version = "0.9.14";
-  sha256 = "0bi62l9fp1ghqq4dagdy4nsxmm08gpsrnfgy6d6k8f4239s3yr0z";
+  version = "0.9.15";
+  sha256 = "0433shh493c04qmi0sd9mfzpy198zi11gxdmcs6nz2gcnxm812zm";
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/HUT/WebHome";
     description = "Haskell Utrecht Tools Library";
diff --git a/pkgs/development/libraries/haskell/xdot/default.nix b/pkgs/development/libraries/haskell/xdot/default.nix
index 73cc5c6e7640..d1702862f422 100644
--- a/pkgs/development/libraries/haskell/xdot/default.nix
+++ b/pkgs/development/libraries/haskell/xdot/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xdot";
-  version = "0.2.2";
-  sha256 = "1n7lwshfn5rzbk4fxlkn02fxki2xh5m0304hnb1d5mchxyzhfdan";
+  version = "0.2.3";
+  sha256 = "0xb8igsqydiw1w00frn4mxkflhxkayif2vivxmq5fk53am2f43wy";
   buildDepends = [ cairo graphviz gtk mtl polyparse text ];
   meta = {
     description = "Parse Graphviz xdot files and interactively view them using GTK and Cairo";
diff --git a/pkgs/development/libraries/haskell/xml-conduit/default.nix b/pkgs/development/libraries/haskell/xml-conduit/default.nix
index 7ebc0b003e55..b586a6336bca 100644
--- a/pkgs/development/libraries/haskell/xml-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/xml-conduit/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xml-conduit";
-  version = "1.1.0.2";
-  sha256 = "17wv4rngmn8jvg6c3ia48w5q9s9dww9aisrmans9llqs7ks3ndqc";
+  version = "1.1.0.3";
+  sha256 = "04mnn6j9bbkhvav04gl9cbd4rldl7bwgcapvykwvf2p3nb3d7bi4";
   buildDepends = [
     attoparsec attoparsecConduit blazeBuilder blazeBuilderConduit
     blazeHtml blazeMarkup conduit dataDefault failure monadControl
diff --git a/pkgs/development/libraries/haskell/yaml/default.nix b/pkgs/development/libraries/haskell/yaml/default.nix
index f1cbb7ee7b8b..2c2f39451e6b 100644
--- a/pkgs/development/libraries/haskell/yaml/default.nix
+++ b/pkgs/development/libraries/haskell/yaml/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yaml";
-  version = "0.8.2.1";
-  sha256 = "1p0hi9psm42bsmm14gfdkj4wrbcgzkishcih6rwc2bcvn2i0hyyw";
+  version = "0.8.2.3";
+  sha256 = "1ds6969gbkxgkm2fha0ifmssjl7by9glgix165v0h8i7fx9wx3wa";
   buildDepends = [
     aeson attoparsec conduit resourcet text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/yesod-test/default.nix b/pkgs/development/libraries/haskell/yesod-test/default.nix
index a47d109ace5a..8b32b48af873 100644
--- a/pkgs/development/libraries/haskell/yesod-test/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-test/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-test";
-  version = "0.3.4";
-  sha256 = "18sz1blnrgijcq6psqk2b5zxbizpgam1cy1vcxc4nrfryfscr42b";
+  version = "0.3.5";
+  sha256 = "095hwl1dm4mk467la68x3lilj0c056603kl0nn8ra4glcr86273j";
   buildDepends = [
     attoparsec blazeBuilder blazeHtml blazeMarkup caseInsensitive
     cookie hspec htmlConduit httpTypes HUnit monadControl network
diff --git a/pkgs/development/libraries/haskell/yesod/default.nix b/pkgs/development/libraries/haskell/yesod/default.nix
index e51ca16aa4fb..9998790ea739 100644
--- a/pkgs/development/libraries/haskell/yesod/default.nix
+++ b/pkgs/development/libraries/haskell/yesod/default.nix
@@ -12,8 +12,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod";
-  version = "1.1.9.1";
-  sha256 = "0kysj3akf2pvhsiy6f8yfs41mrya86b8ddskqzzibjmdyipiqksj";
+  version = "1.1.9.2";
+  sha256 = "1rv9mk842b9qwdzal9y5cn2z5z2rl6490600jg1xbsg0x0nl7hdj";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/zip-archive/default.nix b/pkgs/development/libraries/haskell/zip-archive/default.nix
index 45f2ac96319d..38290c8cd544 100644
--- a/pkgs/development/libraries/haskell/zip-archive/default.nix
+++ b/pkgs/development/libraries/haskell/zip-archive/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zip-archive";
-  version = "0.1.3.3";
-  sha256 = "0zzps6s6lsv35qv1xx1fwipk2nwv255wpa956mvzbwdr47pgqjwi";
+  version = "0.1.3.4";
+  sha256 = "0hvndr3gb7fiv4qjwjvic5mg7wq7h7nw3c3v5xq8fnlr1l943vyb";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ binary digest filepath mtl time utf8String zlib ];
diff --git a/pkgs/development/libraries/hspell/dicts.nix b/pkgs/development/libraries/hspell/dicts.nix
index a7f0d19865cf..fd456ca6209b 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 de4270008f37..3c5f198cea60 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 3ab4e7e738c9..d77b5d46a79e 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 83adb16bbc8d..d77e2052f811 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 6be998b691a5..bfe10490fc7f 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 8cf4cc7991f0..4046c05f79e5 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/jbig2dec/default.nix b/pkgs/development/libraries/jbig2dec/default.nix
index 60c6e9922a4a..e15c5c8d179f 100644
--- a/pkgs/development/libraries/jbig2dec/default.nix
+++ b/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchurl }: 
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "jbig2dec-0.11";
-  
+
   src = fetchurl {
-    url = http://ghostscript.com/~giles/jbig2/jbig2dec/jbig2dec-0.11.tar.gz;
-    sha256 = "1ffhgmf2fqzk0h4k736pp06z7q5y4x41fg844bd6a9vgncq86bby";
+    url = "mirror://sourceforge/jbig2dec/${name}.tar.xz";
+    sha256 = "1xddc30garsg5j8p348cz5l8vn8j7723c0sykv0kc1w5ihaghsq1";
   };
-  
+
   meta = {
     homepage = http://jbig2dec.sourceforge.net/;
     description = "Decoder implementation of the JBIG2 image compression format";
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index ad3af7778ff3..8ca1445b1f6d 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 367987d5dee4..2ff2fac296d8 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/libalkimia/default.nix b/pkgs/development/libraries/libalkimia/default.nix
index 7a37c61c4955..d372c5cf8fc9 100644
--- a/pkgs/development/libraries/libalkimia/default.nix
+++ b/pkgs/development/libraries/libalkimia/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kdelibs, gmpxx }:
+{ stdenv, fetchurl, pkgconfig, kdelibs, gmpxx }:
 
 stdenv.mkDerivation rec {
   name = "libalkimia-4.3.2";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   patchPhase = "sed -e 's/KDE4_DATA_DIR/DATA_INSTALL_DIR/' -i CMakeLists.txt";
-  buildInputs = [ kdelibs gmpxx ];
+  buildInputs = [ pkgconfig kdelibs gmpxx ];
 
   meta = {
     maintainers = [ stdenv.lib.maintainers.urkud ];
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index b0252617d7d7..6c139242f3e7 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/libcanberra/default.nix b/pkgs/development/libraries/libcanberra/default.nix
index 691294d4a85d..b57ea63fde75 100644
--- a/pkgs/development/libraries/libcanberra/default.nix
+++ b/pkgs/development/libraries/libcanberra/default.nix
@@ -1,21 +1,21 @@
 { stdenv, fetchurl, pkgconfig, libtool, gtk ? null
-, alsaLib, pulseaudio, gstreamer ? null, libvorbis, libcap }:
+, alsaLib, pulseaudio, gstreamer, gst_plugins_base, libvorbis }:
 
 stdenv.mkDerivation rec {
-  name = "libcanberra-0.28";
+  name = "libcanberra-0.30";
 
   src = fetchurl {
-    url = "http://0pointer.de/lennart/projects/libcanberra/${name}.tar.gz";
-    sha256 = "1346d2y24wiyanyr5bvdnjjgq7iysy8nlq2dwjv0fzxdmcn8n7zb";
+    url = "http://0pointer.de/lennart/projects/libcanberra/${name}.tar.xz";
+    sha256 = "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2";
   };
 
-  buildInputs =
-    [ pkgconfig libtool alsaLib pulseaudio gstreamer libvorbis libcap gtk ];
+  buildInputs = # ToDo: gstreamer not found (why?), add (g)udev?
+    [ pkgconfig libtool alsaLib pulseaudio /*gstreamer gst_plugins_base*/ libvorbis gtk ];
 
-  configureFlags = "--disable-oss --disable-schemas-install";
+  configureFlags = "--disable-oss";
 
   meta = {
-    description = "libcanberra, an implementation of the XDG Sound Theme and Name Specifications";
+    description = "An implementation of the XDG Sound Theme and Name Specifications";
 
     longDescription = ''
       libcanberra is an implementation of the XDG Sound Theme and Name
diff --git a/pkgs/development/libraries/libcdr/default.nix b/pkgs/development/libraries/libcdr/default.nix
index 823a4839e80d..d2d686405604 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 56aac34a3441..9a1b4122365a 100644
--- a/pkgs/development/libraries/libchop/default.nix
+++ b/pkgs/development/libraries/libchop/default.nix
@@ -11,7 +11,8 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gets-undeclared.patch ];
 
-  buildNativeInputs = [ pkgconfig gperf ];
+  nativeBuildInputs = [ pkgconfig gperf ];
+  
   buildInputs =
     [ zlib bzip2 lzo
       libgcrypt
diff --git a/pkgs/development/libraries/libcroco/default.nix b/pkgs/development/libraries/libcroco/default.nix
deleted file mode 100644
index 99604475e625..000000000000
--- a/pkgs/development/libraries/libcroco/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl, pkgconfig, libxml2, glib}:
-
-stdenv.mkDerivation {
-  name = "libcroco-0.6.4";
-
-  src = fetchurl {
-    url = mirror://gnome/sources/libcroco/0.6/libcroco-0.6.4.tar.xz;
-    sha256 = "1sij88na1skd4d5dx75l803fww3v9872q8m2hj6sjlkc839vl5n8";
-  };
-  buildInputs = [ pkgconfig libxml2 glib ];
-}
diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix
index aeb9331c8ada..6fa6ca4b6f81 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 12008bcbccb0..6efb785b6577 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 3ee43ba3bee0..b8f79f2ae695 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 97622bb7b24b..970a1cf05e92 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 b36fcd602028..4e0038d4c34c 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, udev }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.40";
-  
+  name = "libdrm-2.4.42";
+
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "07xazz6flzc2khvks2cxls36sbsx0ns3x2cj499dw3za0134xha8";
+    sha256 = "1qbnpi64hyqzd650hj6jki1d50pzypdhj3rw9m3whwbqly110rz0";
   };
 
-  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
deleted file mode 100644
index a8b8e98ced99..000000000000
--- a/pkgs/development/libraries/libgnome-keyring/3.x.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, glib, dbus_libs, libgcrypt, pkgconfig,
-intltool }:
-
-stdenv.mkDerivation {
-  name = "libgnome-keyring-3.2.2";
-
-  src = fetchurl {
-    url = mirror://gnome/sources/libgnome-keyring/3.2/libgnome-keyring-3.2.2.tar.xz;
-    sha256 = "1cxd2vb1lzm8smq1q45dsn13s6kdqdb60lashdk7hwv035xy9jrb";
-  };
-
-  propagatedBuildInputs = [ glib dbus_libs libgcrypt ];
-  buildNativeInputs = [ 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 05a21f3c82e2..4aadafff8441 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 b55da62c9fb2..3edc8d0ac6ca 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 e271e9661809..0ad46e2ed5f4 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 4264890fd956..c6d46643ba97 100644
--- a/pkgs/development/libraries/libgsf/default.nix
+++ b/pkgs/development/libraries/libgsf/default.nix
@@ -1,26 +1,21 @@
-{ fetchurl, stdenv, perl, perlXMLParser, pkgconfig, libxml2
-, gettext, intltool, bzip2, glib, python
-, gnomeSupport ? true,  gdk_pixbuf ? null
-, gnome_vfs ? null, libbonobo ? null }:
+{ fetchurl, stdenv, pkgconfig, intltool, gettext, glib, libxml2, zlib, bzip2
+, python
+}:
 
-assert gnomeSupport -> gdk_pixbuf != null && gnome_vfs != null && libbonobo != null
-  && glib != null;
+with { inherit (stdenv.lib) optionals; };
 
 stdenv.mkDerivation rec {
   name = "libgsf-1.14.25";
 
   src = fetchurl {
     url = "mirror://gnome/sources/libgsf/1.14/${name}.tar.xz";
-    sha256 = "127548f07e07951984fb139c3f89d65b9e471aefe6555387de03e1113944d1a2";
+    sha256 = "18ni8hwi3q83vs3m6mg6xwd4g7jvss4kz70kzf21k587gvq4hx8j";
   };
 
-  buildNativeInputs = [ intltool pkgconfig ];
-  buildInputs =
-    [ perl perlXMLParser gettext bzip2 python ]
-    ++ stdenv.lib.optionals gnomeSupport [ gnome_vfs gdk_pixbuf ];
+  nativeBuildInputs = [ pkgconfig intltool ];
+  buildInputs = [ gettext bzip2 zlib python ];
 
-  propagatedBuildInputs = [ libxml2 glib ]
-    ++ stdenv.lib.optionals gnomeSupport [ libbonobo ];
+  propagatedBuildInputs = [ libxml2 glib ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/libgtop/default.nix b/pkgs/development/libraries/libgtop/default.nix
index f214c7acf73d..b592f458c6ce 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
deleted file mode 100644
index 4a4da810ae67..000000000000
--- a/pkgs/development/libraries/libgweather/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, gtk3, intltool, libsoup, GConf3 }:
-
-stdenv.mkDerivation {
-  name = "libgweather-3.4.1";
-
-  src = fetchurl {
-    url = mirror://gnome/sources/libgweather/3.4/libgweather-3.4.1.tar.xz;
-    sha256 = "0q0vkggrbvy2ihwcsfynlv5qk9l3wjinls8yvmkb1qisyc4lv77f";
-  };
-  configureFlags = if stdenv ? glibc then "--with-zoneinfo-dir=${stdenv.glibc}/share/zoneinfo" else "";
-  propagatedBuildInputs = [ libxml2 gtk3 libsoup GConf3 ];
-  buildNativeInputs = [ pkgconfig intltool ];
-}
diff --git a/pkgs/development/libraries/libharu/default.nix b/pkgs/development/libraries/libharu/default.nix
index 3b8c4be54e05..db1aa4a7473c 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 80f3a1b8e71f..59d352cf730e 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 6da91d98d13a..94e785ee53b9 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 b4bb3b47a35e..a21d9bf7b5de 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 083fbf13c817..a452cb7609e1 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 24b93221d11e..b1e8342ca91b 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 178e65d2506f..6e2e2c949cca 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 8d24ddbb6300..0f6d220861c5 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 5a73fd417f90..fcaf95672e18 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/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix
index 5a3cb9d041b5..4ccb7d4df8ba 100644
--- a/pkgs/development/libraries/libnice/default.nix
+++ b/pkgs/development/libraries/libnice/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, glib, gupnp_igd, gstreamer, gst_plugins_base }:
 
 stdenv.mkDerivation rec {
-  name = "libnice-0.1.1";
-  
+  name = "libnice-0.1.4";
+
   src = fetchurl {
     url = "http://nice.freedesktop.org/releases/${name}.tar.gz";
-    sha256 = "0jcpb953jn7c3ng2vbkljybzh63x6mg4m6rjxj1s1iccm3fi6qki";
+    sha256 = "0mxzr3y91hkjxdz1mzhxwi59la86hw2rzmd3y9c32801kkg1gra4";
   };
 
   buildInputs = [ pkgconfig glib gupnp_igd gstreamer gst_plugins_base ];
diff --git a/pkgs/development/libraries/libnotify/default.nix b/pkgs/development/libraries/libnotify/default.nix
index 7bfd8c05104b..ab8034c781e5 100644
--- a/pkgs/development/libraries/libnotify/default.nix
+++ b/pkgs/development/libraries/libnotify/default.nix
@@ -1,17 +1,34 @@
-{ stdenv, fetchurl, pkgconfig, dbus, dbus_glib, gtk, glib }:
- 
+{ stdenv, fetchurl, pkgconfig, automake, autoconf, libtool, glib, gdk_pixbuf }:
+
 stdenv.mkDerivation rec {
-  name = "libnotify-0.4.5";
+  ver_maj = "0.7";
+  ver_min = "5";
+  name = "libnotify-${ver_maj}.${ver_min}";
 
   src = fetchurl {
-    url = "http://www.galago-project.org/files/releases/source/libnotify/${name}.tar.gz";
-    sha256 = "1ndh7wpm9qh12vm5avjrq2xv1j681j9qq6j2fyj6a2shl67dp687";
+    url = "mirror://gnome/sources/libnotify/${ver_maj}/${name}.tar.xz";
+    sha256 = "0lmnzy16vdjs9vlgdm0b7wfyi1nh526hv2dpb7vxb92bhx3wny23";
+  };
+  src_m4 = fetchurl {
+    url = "mirror://gentoo/distfiles/introspection-20110205.m4.tar.bz2";
+    sha256 = "1cnqh7aaji648nfd5537v7xaak8hgww3bpifhwam7bl0sc3ad523";
   };
 
-  buildInputs = [ pkgconfig dbus.libs dbus_glib gtk glib ];
+  # see Gentoo ebuild - we don't need to depend on gtk+(2/3)
+  preConfigure = ''
+    cd m4
+    tar xvf ${src_m4}
+    cd ..
+
+    sed -i -e 's:noinst_PROG:check_PROG:' tests/Makefile.am || die
+    sed -i -e '/PKG_CHECK_MODULES(TESTS/d' configure.ac || die
+    AT_M4DIR=. autoreconf
+  '';
+
+  buildInputs = [ pkgconfig automake autoconf glib gdk_pixbuf ];
 
   meta = {
-    homepage = http://galago-project.org/;
+    homepage = http://galago-project.org/; # very obsolete but found no better
     description = "A library that sends desktop notifications to a notification daemon";
   };
 }
diff --git a/pkgs/development/libraries/libogg/default.nix b/pkgs/development/libraries/libogg/default.nix
index e407b75c8bbe..f3c2d3b766df 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 ad524c21ff10..d229933111e8 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 8f786469a555..73a7cd2e4bb5 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 816269599387..95da6dfb7499 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 ebdb9e756aaa..031e2aa1a914 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/default.nix b/pkgs/development/libraries/librdf/default.nix
index 1f3e5b409378..21c952b7fb89 100644
--- a/pkgs/development/libraries/librdf/default.nix
+++ b/pkgs/development/libraries/librdf/default.nix
@@ -1,18 +1,30 @@
-{ stdenv, fetchurl, pkgconfig, librdf_raptor, ladspaH, openssl, zlib }:
+{ stdenv, fetchurl, pkgconfig, libtool, automake, autoconf
+, librdf_raptor, librdf_raptor2, ladspaH, openssl, zlib #, swh_lv2
+}:
 
-stdenv.mkDerivation {
-  name = "liblrdf-0.4.0";
+stdenv.mkDerivation rec {
+  version = "0.5.0";
+  name = "liblrdf-${version}";
 
   src = fetchurl {
-    url = mirror://sourceforge/lrdf/liblrdf/0.4.0/liblrdf-0.4.0.tar.gz;
-    sha256 = "015jv7pp0a0qxgljgdvf7d01nj4fx0zgzg0wayjp7v86pa38xscm";
+    url = "http://github.com/swh/LRDF/archive/${version}.tar.gz";
+    sha256 = "18p2flb2sv2hq6w2qkd29z9c7knnwqr3f12i2srshlzx6vwkm05s";
   };
 
-  buildInputs = [ pkgconfig ladspaH openssl zlib ];
+  postPatch = "sed -i -e 's:usr/local:usr:' examples/{instances,remove}_test.c";
 
-  propagatedBuildInputs = [ librdf_raptor ];
+  preConfigure = "rm m4/* && autoreconf -if";
 
-  meta = { 
+  buildInputs = [
+    pkgconfig libtool automake autoconf ladspaH openssl zlib /*swh_lv2*/
+    #librdf_raptor 
+  ];
+
+  propagatedBuildInputs = [ librdf_raptor2 ];
+
+  #doCheck = true; # would need swh_lv2 and some path patching
+
+  meta = {
     description = "A lightweight RDF library with special support for LADSPA plugins.";
     homepage = http://sourceforge.net/projects/lrdf/;
     license = "GPLv2";
diff --git a/pkgs/development/libraries/librdf/raptor2.nix b/pkgs/development/libraries/librdf/raptor2.nix
index 2f956630fa12..4658cf283353 100644
--- a/pkgs/development/libraries/librdf/raptor2.nix
+++ b/pkgs/development/libraries/librdf/raptor2.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, libxml2, libxslt, curl }:
 
 stdenv.mkDerivation rec {
-  name = "raptor2-2.0.4";
+  name = "raptor2-2.0.8"; # 2.0.9 misses a header and so fails liblrdf
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "0viaam60adhsxim2vaq5xs1pfmm6wiidxpkrhwyl7x9mz8x9vx1l";
+    sha256 = "1mz7cxnfw73saf74c9if06n2mlsvn2rnn67vy7j2mq3wkhy0hcb0";
   };
 
   buildInputs = [ libxml2 libxslt ];
 
   postInstall = "rm -rvf $out/share/gtk-doc";
 
-  meta = { 
+  meta = {
     description = "The RDF Parser Toolkit";
     homepage = "http://librdf.org/raptor";
     license = "LGPL-2.1 Apache-2.0";
diff --git a/pkgs/development/libraries/librdf/rasqal.nix b/pkgs/development/libraries/librdf/rasqal.nix
index bcab7e03917f..6d6f9d058081 100644
--- a/pkgs/development/libraries/librdf/rasqal.nix
+++ b/pkgs/development/libraries/librdf/rasqal.nix
@@ -1,22 +1,22 @@
 { stdenv, fetchurl, librdf_raptor2, gmp, pkgconfig, pcre, libxml2 }:
 
 stdenv.mkDerivation rec {
-  name = "rasqal-0.9.26";
+  name = "rasqal-0.9.30";
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "1drjcy1k9g72iis0ghllzn7n0w03bahhrd2p5hs39anbm6mr0yk9";
+    sha256 = "1z8wifq79kivcwpwzmjnjdrbr65zam190gpxhgrvsyfch0yykw5b";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ gmp pcre libxml2 ];
 
   propagatedBuildInputs = [ librdf_raptor2 ];
 
   postInstall = "rm -rvf $out/share/gtk-doc";
-  
-  meta = { 
+
+  meta = {
     description = "Library that handles Resource Description Framework (RDF)";
     homepage = "http://librdf.org/rasqal";
     license = "LGPL-2.1 Apache-2.0";
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index e825e1d852b2..26b3de70dcdc 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -7,14 +7,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "redland-1.0.14";
+  name = "redland-1.0.16";
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "1i460q9gslb7l75hjwc6w2kp2wk7fgp8lr7phamg33c6j013y30k";
+    sha256 = "1gcx0h5dxa3c4xhhjk3gr0708zjj0n6zpslvbjfi2qbf13y798nr";
   };
 
-  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 772bae24dabe..13385dfb65c0 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -1,5 +1,7 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, libgsf, bzip2, glib, gtk, libcroco
-, gdk_pixbuf, gobjectIntrospection?null, enableIntrospection?false }:
+{ stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, pango, cairo
+, libxml2, libgsf, bzip2, libcroco
+, gtk2 ? null, gtk3 ? null
+, gobjectIntrospection ? null, enableIntrospection ? false }:
 
 # no introspection by default, it's too big
 
@@ -10,10 +12,10 @@ stdenv.mkDerivation rec {
     url = "mirror://gnome/sources/librsvg/2.36/${name}.tar.xz";
     sha256 = "1hp6325gdkzx8yqn2d2r915ak3k6hfshjjh0sc54z3vr0i99688h";
   };
-  buildInputs = [ libxml2 libgsf bzip2 libcroco gdk_pixbuf ]
-    ++ stdenv.lib.optional enableIntrospection [gobjectIntrospection];
-  propagatedBuildInputs = [ glib gtk ];
-  buildNativeInputs = [ pkgconfig ];
+  buildInputs = [ libxml2 libgsf bzip2 libcroco pango cairo ]
+    ++ stdenv.lib.optional enableIntrospection [ gobjectIntrospection ];
+  propagatedBuildInputs = [ glib gdk_pixbuf gtk2 gtk3 ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = ["--enable-introspection=auto"];
 
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 87aaafabcc4b..08784a0f2574 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 f8621f3b78b2..c2b812744c9a 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 f70f7d348016..f5c07f47379f 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 e846b213ee0f..cb9367474173 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/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index de6ef510e16d..ce714fd59ffc 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -3,14 +3,14 @@
 , libtasn1, ebtables, libgcrypt, yajl
 }:
 
-let version = "0.9.11"; in
+let version = "1.0.2"; in
 
 stdenv.mkDerivation {
   name = "libvirt-${version}";
 
   src = fetchurl {
     url = "http://libvirt.org/sources/libvirt-${version}.tar.gz";
-    sha256 = "0qk0fsc5rxwwjp7801vdanmw61p89xqiy6q279i0kqc3bx1zx66f";
+    sha256 = "0yf104r1377pg0kmx6sshmh8v5z0bdvv6266y5gbcn46yx92g34v";
   };
 
   buildInputs =
diff --git a/pkgs/development/libraries/libvisio/default.nix b/pkgs/development/libraries/libvisio/default.nix
index 99146cd02cc4..77e7e0a56f64 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 efb210d65762..b1277b87e6a7 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 ceaa0d36d4b5..536db35fb4e9 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 d857b6e17ea4..1c56022de580 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 d140b8b8a0cd..a97b8fc2fd85 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/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix
deleted file mode 100644
index 536d30992bbd..000000000000
--- a/pkgs/development/libraries/libxcrypt/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl}:
-
-# I could not build it in armv5tel-linux or the fuloon2f
-assert !stdenv.isArm;
-assert stdenv.system != "mips64el-linux";
-   
-stdenv.mkDerivation {
-  name = "libxcrypt-3.0.2";
-   
-  src = fetchurl {
-    url = ftp://ftp.suse.com/pub/people/kukuk/libxcrypt/libxcrypt-3.0.2.tar.bz2;
-    sha256 = "15l2xvhi3r3b40x4665c101ikylh5xsbpw03gnszypfjgn1jkcii";
-  };
-
-  patches = [ ./gcc46.patch ];
-
-}
diff --git a/pkgs/development/libraries/libxcrypt/gcc46.patch b/pkgs/development/libraries/libxcrypt/gcc46.patch
deleted file mode 100644
index 0664f96aa688..000000000000
--- a/pkgs/development/libraries/libxcrypt/gcc46.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-For gcc 4.6 to build this. Otherwise it says 's unused variable', and it's built
-with -Werror.
-
-diff --git a/src/cert.c b/src/cert.c
-index 28c7b11..34570a4 100644
---- a/src/cert.c
-+++ b/src/cert.c
-@@ -87,9 +87,7 @@ char *cp;
- 	int i,j,t;
- 
- 	for(i=0;i<8;i++){
--		int s;
--                  
--                s = scanf("%2x",&t);
-+                scanf("%2x",&t);
- 		if(feof(stdin))
- 		  good_bye();
- 		for(j=0; j<8 ; j++) {
diff --git a/pkgs/development/libraries/libxklavier/default.nix b/pkgs/development/libraries/libxklavier/default.nix
index b50399d4f108..ac5c6146cbae 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 20ef82401e65..75f175a5b2da 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 ebd6826bc9ed..4aa78570b2ff 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 3cf81edb5e97..1a8ca9c94750 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, flex, bison, pkgconfig, libdrm, file, expat, makedepend
+{ stdenv, fetchurl, flex, bison, pkgconfig, intltool, libdrm, file, expat, makedepend
 , libXxf86vm, libXfixes, libXdamage, glproto, dri2proto, libX11, libxcb, libXext
 , libXt, udev, enableTextureFloats ? false, enableR600LlvmCompiler ? false
 , python, libxml2Python, autoconf, automake, libtool, llvm, writeText
@@ -9,14 +9,14 @@ if ! stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms then
 else
 
 let
-  version = "9.0.2";
+  version = "9.1";
 in
 stdenv.mkDerivation {
   name = "mesa-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
-    sha256="0knnb8srr1xbin25js4y5kmpw7xys5gh1h8hwqamayvfdkr33gvm";
+    sha256="0yvhl0vdg32h0xr4xi348gkp0hlcc16j1cfxn4pyc9pywyzlqj5g";
   };
 
   prePatch = "patchShebangs .";
@@ -32,10 +32,13 @@ stdenv.mkDerivation {
     # Texture floats are patented, see docs/patents.txt
     + stdenv.lib.optionalString enableTextureFloats " --enable-texture-float";
 
-  buildInputs = [ expat libdrm libXxf86vm libXfixes libXdamage glproto dri2proto
-    libxml2Python libX11 libXext libxcb libXt udev llvm wayland ];
+  buildInputs = [
+    autoconf automake libtool intltool expat libxml2Python udev llvm
+    libdrm libXxf86vm libXfixes libXdamage glproto dri2proto libX11 libXext libxcb libXt
+    wayland
+  ];
 
-  buildNativeInputs = [ pkgconfig python makedepend file flex bison automake autoconf libtool ];
+  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 ff06f2a00506..8fc160ae11d5 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 a6b9a69e6e1f..569d7fe2a328 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 95bde495c0ef..13ab00e41be6 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 6b2b9c9e4a65..f508637dfefb 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 455dbceff23c..e6df13eed34e 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 207c14bdce05..09a36247348d 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/openscenegraph/default.nix b/pkgs/development/libraries/openscenegraph/default.nix
index 08e08b876b66..01993fa1cd87 100644
--- a/pkgs/development/libraries/openscenegraph/default.nix
+++ b/pkgs/development/libraries/openscenegraph/default.nix
@@ -2,22 +2,22 @@ x@{builderDefsPackage
   , cmake, giflib, libjpeg, libtiff, lib3ds, freetype, libpng
   , coin3d, jasper, gdal, xproto, libX11, libXmu, freeglut, mesa
   , doxygen, ffmpeg, xineLib, unzip, zlib, openal, libxml2
-  , curl
+  , curl, a52dec, faad2, gdk_pixbuf
   , ...}:
 builderDefsPackage
 (a :
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="OpenSceneGraph";
-    version="2.8.3";
+    version="3.0.1";
     name="${baseName}-${version}";
     url="http://www.openscenegraph.org/downloads/stable_releases/${name}/source/${name}.zip";
-    hash="0phihxs7zgir9n1z54xsrsha8wa0xll7xl6lvqvrrczf0bm80yrs";
+    hash="15l23mxv93mw6wkc90x52jhwxh7r3d7lahwdsv3jfnha9dbh648c";
   };
 in
 rec {
@@ -30,7 +30,9 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "addInputs" "doUnpack" "doCmake" "doMakeInstall"];
+  phaseNames = ["setVars" "addInputs" "doUnpack" "doPatch" "doCmake" "doMakeInstall"];
+
+  patches = [ ./xine.patch ]; # http://forum.openscenegraph.org/viewtopic.php?t=9659
 
   cmakeFlags = [
     "-D MATH_LIBRARY="
@@ -39,7 +41,7 @@ rec {
   setVars = a.noDepEntry ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__STDC_CONSTANT_MACROS=1"
   '';
-      
+
   meta = {
     description = "A 3D graphics toolkit";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/openscenegraph/xine.patch b/pkgs/development/libraries/openscenegraph/xine.patch
new file mode 100644
index 000000000000..8fbc8ceec52e
--- /dev/null
+++ b/pkgs/development/libraries/openscenegraph/xine.patch
@@ -0,0 +1,18 @@
+--- OpenSceneGraph-3.0.1.orig/src/osgPlugins/xine/video_out_rgb.c
++++ OpenSceneGraph-3.0.1/src/osgPlugins/xine/video_out_rgb.c
+@@ -2769,8 +2769,14 @@ init_class(xine_t* xine, void* vo_visual
+ 	clear(rgb_class, sizeof(rgbout_class_t));
+ 
+ 	rgb_class->driver_class.open_plugin     = open_plugin;
++#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
+ 	rgb_class->driver_class.get_identifier  = get_identifier;
+ 	rgb_class->driver_class.get_description = get_description;
++#else
++	rgb_class->driver_class.identifier      = get_identifier(NULL);
++	rgb_class->driver_class.description     = get_description(NULL);
++#endif
++
+ 	rgb_class->driver_class.dispose         = dispose_class;
+ 
+ 	return(rgb_class);
+
diff --git a/pkgs/development/libraries/openssl/darwin-arch.patch b/pkgs/development/libraries/openssl/darwin-arch.patch
index 5d5a3afdd1d8..63db3efc0846 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 48574a332c8d..640b99df5473 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.1e";
 
   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 = "1qqskk39jh85fvdn3ycmdqjdf67c0b97dwmmbcysl4gzr3l1akzp";
   };
 
   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/default.nix b/pkgs/development/libraries/pango/default.nix
index 4d429bfd7fb1..80e50cfa8bcf 100644
--- a/pkgs/development/libraries/pango/default.nix
+++ b/pkgs/development/libraries/pango/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optional stdenv.isDarwin gettext;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ x11 glib cairo libpng harfbuzz ];
 
diff --git a/pkgs/development/libraries/pangomm/2.28.x.nix b/pkgs/development/libraries/pangomm/2.28.x.nix
index 5cd4744fed38..7f4d14dfbacf 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 2f636492eb61..000000000000
--- 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/8.31.nix b/pkgs/development/libraries/pcre/8.31.nix
deleted file mode 100644
index 41315d9bb5d8..000000000000
--- a/pkgs/development/libraries/pcre/8.31.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
-
-stdenv.mkDerivation rec {
-  name = "pcre-8.31";
-
-  src = fetchurl {
-    url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "0g4c0z4h30v8g8qg02zcbv7n67j5kz0ri9cfhgkpwg276ljs0y2p";
-  };
-
-  # 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 edfe26740def..e59c249348a8 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 91c9f16f5c87..53dc7a768ee3 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 b2677eb1e7a5..24a261065ebd 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 faa88f8854f9..97e778cc1f58 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 2c70957746d2..bd74b9372764 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 b39d8bc4aff3..16fb46d1698a 100644
--- a/pkgs/development/libraries/physfs/default.nix
+++ b/pkgs/development/libraries/physfs/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na";
   };
 
-  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 679db72802c6..5e15a63735ee 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 44ae11a6317b..6b79482c330e 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 0c1a0a79584b..13bc992d0263 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/0.18.nix b/pkgs/development/libraries/poppler/0.18.nix
index f4b9e4015b11..2f962224187a 100644
--- a/pkgs/development/libraries/poppler/0.18.nix
+++ b/pkgs/development/libraries/poppler/0.18.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals gtkSupport [ glib /*gtk3*/ ]
     ++ 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/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index 7e10ca4b94e6..1558f23219d9 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals gtkSupport [ glib /*gtk3*/ ]
     ++ 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 8cad9022d911..b24b4e06cb94 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 ca8ba46d7dcb..7beb93eb4620 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 c2264eebddc7..063fdd7cc049 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 c95a82d42876..357d288c7320 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 6af622c0a15b..1da9ef193b5f 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 1e0c583b7a5d..153d3ba57467 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 6d15ce576ff8..b81dbda15860 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/qjson/default.nix b/pkgs/development/libraries/qjson/default.nix
index af960c1b9933..e69ae5f98f7b 100644
--- a/pkgs/development/libraries/qjson/default.nix
+++ b/pkgs/development/libraries/qjson/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
-  name = "qjson-0.7.1";
+  name = "qjson-0.8.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/qjson/${name}.tar.bz2";
-    sha256 = "155r7nypgnsvjc6w3q51zmjchpqxi4c3azad9cf1fip8bws993iv";
+    sha256 = "1n8lr2ph08yhcgimf4q1pnkd4z15v895bsf3m68ljz14aswvakfd";
   };
 
   buildInputs = [ cmake qt4 ];
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index ba796259f703..91eec5fcd315 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 55be463473b5..ab9cd43d63bc 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 95c6d0a0b52d..c18f52e84d7c 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 9f25011b76f8..029deecb93a7 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 0604a099d3ce..8095650b12ff 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 449667c6b527..f6c14eae464d 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/simgear/default.nix b/pkgs/development/libraries/simgear/default.nix
index 961d14753335..de8e1d1df1da 100644
--- a/pkgs/development/libraries/simgear/default.nix
+++ b/pkgs/development/libraries/simgear/default.nix
@@ -1,23 +1,23 @@
 x@{builderDefsPackage
   , plib, freeglut, xproto, libX11, libXext, xextproto, libXi , inputproto
   , libICE, libSM, libXt, libXmu, mesa, boost, zlib, libjpeg , freealut
-  , openscenegraph, openal
+  , openscenegraph, openal, expat, cmake
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    baseName="SimGear";
-    version="2.0.0";
+    baseName="simgear";
+    version="2.10.0";
     name="${baseName}-${version}";
-    extension="tar.gz";
-    url="ftp://ftp.goflyflightgear.com/simgear/Source/${name}.${extension}";
-    hash="08fia5rjrlvw45i3v09fn90vhdhb54wjl6kn3d8vpspxmsw4fn55";
+    extension="tar.bz2";
+    url="http://mirrors.ibiblio.org/pub/mirrors/simgear/ftp/Source/${name}.${extension}";
+    hash="0pb148hb35p1c5iz0kpiclmswjl9bax9xfm087ldpxsqg9a0sb2q";
   };
 in
 rec {
@@ -30,8 +30,8 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
+  phaseNames = [ "doCmake" "doMakeInstall" ];
+
   meta = {
     description = "Simulation construction toolkit";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/sodium/default.nix b/pkgs/development/libraries/sodium/default.nix
new file mode 100644
index 000000000000..0d40df405744
--- /dev/null
+++ b/pkgs/development/libraries/sodium/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="sodium";
+    version="0.3";
+    name="${baseName}-${version}";
+    hash="0l1p0d7ag186hhs65kifp8jfgf4mm9rngv41bhq35d7d9gw2d2lh";
+    url="http://download.dnscrypt.org/libsodium/releases/libsodium-0.3.tar.gz";
+    sha256="0l1p0d7ag186hhs65kifp8jfgf4mm9rngv41bhq35d7d9gw2d2lh";
+  };
+  buildInputs = [
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  meta = {
+    inherit (s) version;
+    description = ''A cryptography library with simple API'';
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/sodium/default.upstream b/pkgs/development/libraries/sodium/default.upstream
new file mode 100644
index 000000000000..ccc02cd89785
--- /dev/null
+++ b/pkgs/development/libraries/sodium/default.upstream
@@ -0,0 +1 @@
+url http://download.dnscrypt.org/libsodium/releases/
diff --git a/pkgs/development/libraries/sofia-sip/default.nix b/pkgs/development/libraries/sofia-sip/default.nix
index 3ce49e8ffaff..950d1302dad1 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 7705ee1893d9..7a3d6eacde57 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 60b148f870e5..80fbb53953a1 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 fc2e5bb72c5f..2bcb9e593b86 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 ccb960643bd0..c6ef448ea122 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 6d7212f5c5c6..465a5d80ae04 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 de0c7ba2b754..05fe67eb9d7b 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 8157ca269aa3..cd083f0d80ad 100644
--- a/pkgs/development/libraries/taglib/default.nix
+++ b/pkgs/development/libraries/taglib/default.nix
@@ -1,17 +1,17 @@
 {stdenv, fetchurl, zlib, cmake}:
 
 stdenv.mkDerivation rec {
-  name = "taglib-1.7.1";
-  
+  name = "taglib-1.8";
+
   src = fetchurl {
     url = "https://github.com/downloads/taglib/taglib/${name}.tar.gz";
-    sha256 = "1nc7zd9jxx5gw4n6zqgvjh0wxlm89ihcyyrzk2rbf15njw4lgpjj";
+    sha256 = "16i0zjpxqqslbwi4kl6y15qwm15mh7ykh74x19m2741wf20k9lv6";
   };
-  
+
   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 a183737dc9b2..a6a624c0a878 100644
--- a/pkgs/development/libraries/telepathy/farstream/default.nix
+++ b/pkgs/development/libraries/telepathy/farstream/default.nix
@@ -2,16 +2,16 @@
 , pkgconfig, libxslt, python, gstreamer, gst_python, pygobject }:
 
 stdenv.mkDerivation rec {
-  name = "${pname}-0.2.3";
+  name = "${pname}-0.4.0";
   pname = "telepathy-farstream";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "1a163gk9y3ckabm4a43lxc5a7j2s42hykbwr6r7b5mlfyqq8myx1";
+    sha256 = "13mllgfx4b1hh1vpzq8lk5qfr3ivkkkmwbxgi6d47avgk746kznd";
   };
 
   buildInputs = [ gst_plugins_base gst_python pygobject ];
 
-  propagatedBuildInputs = [ dbus_glib farstream telepathy_glib gstreamer ];
-  buildNativeInputs = [ pkgconfig python libxslt];
+  propagatedBuildInputs = [ dbus_glib telepathy_glib gstreamer farstream ];
+  nativeBuildInputs = [ pkgconfig python libxslt];
 }
diff --git a/pkgs/development/libraries/telepathy/glib/default.nix b/pkgs/development/libraries/telepathy/glib/default.nix
index b31338a65951..46aba67702df 100644
--- a/pkgs/development/libraries/telepathy/glib/default.nix
+++ b/pkgs/development/libraries/telepathy/glib/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, dbus_glib, glib, python, pkgconfig, libxslt }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-glib-0.18.1";
+  name = "telepathy-glib-0.20.1";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/telepathy-glib/${name}.tar.gz";
-    sha256 = "0vac5wk9rpaniqxwa50szcc5ql779ks37sy4z7fj4k73i5k2af1p";
+    sha256 = "1dk1s977zv8c935jsiv7ll51a52rlwd7a6f8v7z8klzvc4zk9801";
   };
 
   propagatedBuildInputs = [dbus_glib glib python];
-  
+
   buildInputs = [pkgconfig libxslt];
 
   meta = {
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 64067a61e3e1..b535961357b0 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, cmake, qt4, pkgconfig, python, libxslt, dbus_glib
-, telepathy_farstream, telepathy_glib }:
+, telepathy_farstream, telepathy_glib, pythonDBus }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-qt-0.9.1";
+  name = "telepathy-qt-0.9.3";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/telepathy-qt/${name}.tar.gz";
-    sha256 = "0rwyxjk6646r43mvsg01q7rfsah0ni05fa8gxzlx1zhj76db95yh";
+    sha256 = "1yabyhsikw828ns7cf6hvzbxdxh53na1ck0q7qsav1lvlyz5gzy0";
   };
 
-  buildNativeInputs = [ cmake pkgconfig python libxslt ];
-  propagatedBuildInputs = [ qt4 dbus_glib telepathy_farstream telepathy_glib ];
+  nativeBuildInputs = [ cmake pkgconfig python libxslt ];
+  propagatedBuildInputs = [ qt4 dbus_glib telepathy_farstream telepathy_glib pythonDBus ];
   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 a778535f362c..d30d316c0dc0 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 633192133122..b623c7731423 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 4d184b11abd4..16680f0134c3 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 2770fadf0044..d55ea6166e8b 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/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix
index ebf9628126e2..b016a6f715c1 100644
--- a/pkgs/development/libraries/ustr/default.nix
+++ b/pkgs/development/libraries/ustr/default.nix
@@ -8,8 +8,11 @@ stdenv.mkDerivation rec {
     url = "http://www.and.org/ustr/${version}/${name}.tar.bz2";
     sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx";
   };
+
   prePatch = "substituteInPlace Makefile --replace /usr/include/ ${glibc}/include/";
 
+  patches = [ ./va_args.patch ]; # fixes bogus warnings that failed libsemanage
+
   makeFlags = "DESTDIR=$(out) prefix= LDCONFIG=echo";
 
   configurePhase = "make ustr-import";
@@ -21,4 +24,4 @@ stdenv.mkDerivation rec {
     license = licenses.bsd2;
     maintainers = [ maintainers.phreedom ];
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/libraries/ustr/va_args.patch b/pkgs/development/libraries/ustr/va_args.patch
new file mode 100644
index 000000000000..f75b537485d8
--- /dev/null
+++ b/pkgs/development/libraries/ustr/va_args.patch
@@ -0,0 +1,23 @@
+diff --git a/ustr-compiler.h b/ustr-compiler.h
+index 9e71276..c5f847a 100644
+--- a/ustr-compiler.h
++++ b/ustr-compiler.h
+@@ -11,17 +11,11 @@
+ #define USTR_CONF_HAVE_ATTR_FMT 1
+ #endif
+ 
++#include <stdarg.h>
+ /* We assume this is enough,
+  * C99 specifies that va_copy() exists and is a macro */
+-#ifdef va_copy
+ # define USTR_CONF_HAVE_VA_COPY 1
+ # define USTR__VA_COPY(x, y)   va_copy(x, y)
+-#elif __va_copy
+-# define USTR_CONF_HAVE_VA_COPY 1
+-# define USTR__VA_COPY(x, y) __va_copy(x, y)
+-#else
+-# define USTR_CONF_HAVE_VA_COPY 0
+-#endif
+ 
+ #ifndef USTR_CONF_HAVE_ATTR_NONNULL
+ #if defined(__GNUC__) && (__GNUC__ > 3) /* not sure */
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index 1fd6179183fd..1634be1363ae 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 6940f88ffbea..58b9d2f25735 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 01ccb23b77cf..2f169f3f25dd 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/webkit/bison26.patch b/pkgs/development/libraries/webkit/bison26.patch
new file mode 100644
index 000000000000..95898adeb8a6
--- /dev/null
+++ b/pkgs/development/libraries/webkit/bison26.patch
@@ -0,0 +1,515 @@
+Index: /trunk/Source/WebCore/ChangeLog

+===================================================================

+--- /trunk/Source/WebCore/ChangeLog	(revision 124098)

++++ /trunk/Source/WebCore/ChangeLog	(revision 124099)

+@@ -1,2 +1,27 @@

++2012-07-30  Alexis Menard  <alexis.menard@openbossa.org>

++

++        Build fix with newer bison 2.6.

++        https://bugs.webkit.org/show_bug.cgi?id=92264

++

++        Reviewed by Adam Barth.

++

++        As stated in http://www.gnu.org/software/bison/manual/html_node/Table-of-Symbols.html

++        YYLEX_PARAM and YYPARSE_PARAM are depecreated since version 1.875. So far all Mac OS

++        version I had access to as well as recent Linux runs at least version 2.3 so it's safe

++        to use the replacement of these deprecated macros in favor of %lex-param and %parse-param.

++        As announced http://lists.gnu.org/archive/html/info-gnu/2012-07/msg00011.html with the release

++        of version 2.6 YYLEX_PARAM and YYPARSE_PARAM are not supported anymore.

++

++        No new tests : build fix and the patch should not trigger any regressions

++

++        * css/CSSGrammar.y:

++        * css/CSSParser.cpp:

++        * xml/XPathGrammar.y: Refactored a bit to not use an intermediate PARSER define.

++        * xml/XPathParser.cpp: bison 2.6 declare xpathyyparse in the .h file now, i.e. XPathGrammar.h

++        therefore including this file within the namespace {} declarations leads to xpathyyparse being

++        defined part of WebCore::XPath namespaces but the actual implementation of xpathyyparse is in XPathGrammar.cpp

++        (generated) and not implemented within the WebCore::XPath so it lead to linking issues. Last, XPathGrammar.h needs 

++        to be included after the other includes as it uses some XPath types. It breaks the style but CSSParser.cpp is doing the same.

++

+ 2012-07-30  Sadrul Habib Chowdhury  <sadrul@chromium.org>

+ 

+Index: /trunk/Source/WebCore/css/CSSParser.cpp

+===================================================================

+--- /trunk/Source/WebCore/css/CSSParser.cpp	(revision 124098)

++++ /trunk/Source/WebCore/css/CSSParser.cpp	(revision 124099)

+@@ -115,5 +115,5 @@

+ #endif

+ 

+-extern int cssyyparse(void* parser);

++extern int cssyyparse(WebCore::CSSParser*);

+ 

+ using namespace std;

+Index: /trunk/Source/WebCore/css/CSSGrammar.y

+===================================================================

+--- /trunk/Source/WebCore/css/CSSGrammar.y	(revision 124098)

++++ /trunk/Source/WebCore/css/CSSGrammar.y	(revision 124099)

+@@ -54,11 +54,10 @@

+ #define YYDEBUG 0

+ 

+-// FIXME: Replace with %parse-param { CSSParser* parser } once we can depend on bison 2.x

+-#define YYPARSE_PARAM parser

+-#define YYLEX_PARAM parser

+-

+ %}

+ 

+ %pure_parser

++

++%parse-param { CSSParser* parser }

++%lex-param { CSSParser* parser }

+ 

+ %union {

+@@ -90,5 +89,5 @@

+ %{

+ 

+-static inline int cssyyerror(const char*)

++static inline int cssyyerror(void*, const char*)

+ {

+     return 1;

+Index: /trunk/Source/WebCore/xml/XPathParser.cpp

+===================================================================

+--- /trunk/Source/WebCore/xml/XPathParser.cpp	(revision 124098)

++++ /trunk/Source/WebCore/xml/XPathParser.cpp	(revision 124099)

+@@ -33,22 +33,19 @@

+ #include "XPathException.h"

+ #include "XPathNSResolver.h"

++#include "XPathPath.h"

+ #include "XPathStep.h"

+ #include <wtf/StdLibExtras.h>

+ #include <wtf/text/StringHash.h>

+ 

+-int xpathyyparse(void*);

+-

++using namespace WebCore;

+ using namespace WTF;

+ using namespace Unicode;

+-

+-namespace WebCore {

+-namespace XPath {

+-

+-class LocationPath;

+-

+-#include "XPathGrammar.h"    

++using namespace XPath;

++

++extern int xpathyyparse(WebCore::XPath::Parser*);

++#include "XPathGrammar.h"

+ 

+ Parser* Parser::currentParser = 0;

+-    

++

+ enum XMLCat { NameStart, NameCont, NotPartOfName };

+ 

+@@ -631,4 +628,2 @@

+ }

+ 

+-}

+-}

+Index: /trunk/Source/WebCore/xml/XPathGrammar.y

+===================================================================

+--- /trunk/Source/WebCore/xml/XPathGrammar.y	(revision 124098)

++++ /trunk/Source/WebCore/xml/XPathGrammar.y	(revision 124099)

+@@ -35,4 +35,5 @@

+ #include "XPathPath.h"

+ #include "XPathPredicate.h"

++#include "XPathStep.h"

+ #include "XPathVariableReference.h"

+ #include <wtf/FastMalloc.h>

+@@ -45,6 +46,4 @@

+ #define YYDEBUG 0

+ #define YYMAXDEPTH 10000

+-#define YYPARSE_PARAM parserParameter

+-#define PARSER static_cast<Parser*>(parserParameter)

+ 

+ using namespace WebCore;

+@@ -54,4 +53,5 @@

+ 

+ %pure_parser

++%parse-param { WebCore::XPath::Parser* parser }

+ 

+ %union

+@@ -72,5 +72,5 @@

+ 

+ static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); }

+-static void xpathyyerror(const char*) { }

++static void xpathyyerror(void*, const char*) { }

+     

+ %}

+@@ -119,5 +119,5 @@

+     OrExpr

+     {

+-        PARSER->m_topExpr = $1;

++        parser->m_topExpr = $1;

+     }

+     ;

+@@ -139,5 +139,5 @@

+     {

+         $$ = new LocationPath;

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -151,5 +151,5 @@

+         $$ = $2;

+         $$->insertFirstStep($1);

+-        PARSER->unregisterParseNode($1);

++        parser->unregisterParseNode($1);

+     }

+     ;

+@@ -160,6 +160,6 @@

+         $$ = new LocationPath;

+         $$->appendStep($1);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -167,5 +167,5 @@

+     {

+         $$->appendStep($3);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($3);

+     }

+     |

+@@ -174,6 +174,6 @@

+         $$->appendStep($2);

+         $$->appendStep($3);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($2);

++        parser->unregisterParseNode($3);

+     }

+     ;

+@@ -184,9 +184,9 @@

+         if ($2) {

+             $$ = new Step(Step::ChildAxis, *$1, *$2);

+-            PARSER->deletePredicateVector($2);

++            parser->deletePredicateVector($2);

+         } else

+             $$ = new Step(Step::ChildAxis, *$1);

+-        PARSER->deleteNodeTest($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteNodeTest($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -195,6 +195,6 @@

+         String localName;

+         String namespaceURI;

+-        if (!PARSER->expandQName(*$1, localName, namespaceURI)) {

+-            PARSER->m_gotNamespaceError = true;

++        if (!parser->expandQName(*$1, localName, namespaceURI)) {

++            parser->m_gotNamespaceError = true;

+             YYABORT;

+         }

+@@ -202,9 +202,9 @@

+         if ($2) {

+             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2);

+-            PARSER->deletePredicateVector($2);

++            parser->deletePredicateVector($2);

+         } else

+             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -213,9 +213,9 @@

+         if ($3) {

+             $$ = new Step($1, *$2, *$3);

+-            PARSER->deletePredicateVector($3);

++            parser->deletePredicateVector($3);

+         } else

+             $$ = new Step($1, *$2);

+-        PARSER->deleteNodeTest($2);

+-        PARSER->registerParseNode($$);

++        parser->deleteNodeTest($2);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -224,6 +224,6 @@

+         String localName;

+         String namespaceURI;

+-        if (!PARSER->expandQName(*$2, localName, namespaceURI)) {

+-            PARSER->m_gotNamespaceError = true;

++        if (!parser->expandQName(*$2, localName, namespaceURI)) {

++            parser->m_gotNamespaceError = true;

+             YYABORT;

+         }

+@@ -231,9 +231,9 @@

+         if ($3) {

+             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3);

+-            PARSER->deletePredicateVector($3);

++            parser->deletePredicateVector($3);

+         } else

+             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));

+-        PARSER->deleteString($2);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($2);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -260,6 +260,6 @@

+             $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest);

+ 

+-        PARSER->deleteString($1);

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->registerNodeTest($$);

+     }

+     |

+@@ -267,6 +267,6 @@

+     {

+         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);

+-        PARSER->deleteString($1);        

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->registerNodeTest($$);

+     }

+     |

+@@ -274,7 +274,7 @@

+     {

+         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace());

+-        PARSER->deleteString($1);        

+-        PARSER->deleteString($3);

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->deleteString($3);

++        parser->registerNodeTest($$);

+     }

+     ;

+@@ -294,6 +294,6 @@

+         $$ = new Vector<Predicate*>;

+         $$->append(new Predicate($1));

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerPredicateVector($$);

++        parser->unregisterParseNode($1);

++        parser->registerPredicateVector($$);

+     }

+     |

+@@ -301,5 +301,5 @@

+     {

+         $$->append(new Predicate($2));

+-        PARSER->unregisterParseNode($2);

++        parser->unregisterParseNode($2);

+     }

+     ;

+@@ -316,5 +316,5 @@

+     {

+         $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -324,5 +324,5 @@

+     {

+         $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -330,5 +330,5 @@

+     {

+         $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -338,6 +338,6 @@

+     {

+         $$ = new VariableReference(*$1);

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -350,6 +350,6 @@

+     {

+         $$ = new StringExpression(*$1);

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -357,6 +357,6 @@

+     {

+         $$ = new Number($1->toDouble());

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -370,6 +370,6 @@

+         if (!$$)

+             YYABORT;

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -379,7 +379,7 @@

+         if (!$$)

+             YYABORT;

+-        PARSER->deleteString($1);

+-        PARSER->deleteExpressionVector($3);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->deleteExpressionVector($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -390,6 +390,6 @@

+         $$ = new Vector<Expression*>;

+         $$->append($1);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerExpressionVector($$);

++        parser->unregisterParseNode($1);

++        parser->registerExpressionVector($$);

+     }

+     |

+@@ -397,5 +397,5 @@

+     {

+         $$->append($3);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($3);

+     }

+     ;

+@@ -413,7 +413,7 @@

+         $$->addSubExpression($1);

+         $$->addSubExpression($3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -431,7 +431,7 @@

+         $3->setAbsolute(true);

+         $$ = new Path(static_cast<Filter*>($1), $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -441,8 +441,8 @@

+         $3->setAbsolute(true);

+         $$ = new Path(static_cast<Filter*>($1), $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($2);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -454,7 +454,7 @@

+     {

+         $$ = new Filter($1, *$2);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->deletePredicateVector($2);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->deletePredicateVector($2);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -466,7 +466,7 @@

+     {

+         $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -478,7 +478,7 @@

+     {

+         $$ = new LogicalOp(LogicalOp::OP_And, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -490,7 +490,7 @@

+     {

+         $$ = new EqTestOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -502,7 +502,7 @@

+     {

+         $$ = new EqTestOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -514,7 +514,7 @@

+     {

+         $$ = new NumericOp(NumericOp::OP_Add, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -522,7 +522,7 @@

+     {

+         $$ = new NumericOp(NumericOp::OP_Sub, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -534,7 +534,7 @@

+     {

+         $$ = new NumericOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -547,6 +547,6 @@

+         $$ = new Negative;

+         $$->addSubExpression($2);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($2);

++        parser->registerParseNode($$);

+     }

+     ;

diff --git a/pkgs/development/libraries/webkit/default.nix b/pkgs/development/libraries/webkit/default.nix
index d229228b94f7..ef4d259cb029 100644
--- a/pkgs/development/libraries/webkit/default.nix
+++ b/pkgs/development/libraries/webkit/default.nix
@@ -1,6 +1,6 @@
 args : with args; 
 let 
-  s = import ./src-for-default.nix;
+  s = import ./src-for-default.nix; # 1.8.3 needs newer gtk3, wait for x-updates
   version = lib.attrByPath ["version"] s.version args;
 in
 rec {
@@ -9,12 +9,13 @@ rec {
     sha256 = s.hash;
   };
 
-  buildInputs = [gtk glib atk cairo curl fontconfig freetype
-    gettext libjpeg libpng libtiff libxml2 libxslt pango
-    sqlite icu gperf bison flex autoconf automake libtool 
-    perl intltool pkgconfig libsoup gtkdoc libXt libproxy
-    enchant python ruby which renderproto libXrender geoclue
-    kbproto mesa
+  buildInputs = with xlibs; [
+    pkgconfig libtool intltool autoconf automake gperf bison flex
+    gtk3 gtk2 glib atk cairo pango fontconfig freetype libsoup gtkdoc
+    libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+    which libproxy geoclue enchant python ruby perl
+    mesa libXt libXrender renderproto libXcomposite compositeproto
+    libXdamage damageproto kbproto
     ];
 
   propagatedBuildInputs = [
@@ -22,19 +23,22 @@ rec {
     ];
 
   configureFlags = [
-    "--enable-3D-transforms"
+    # "--enable-3D-transforms" # no longer recognized
     "--enable-web-sockets"
     "--enable-web-timing"
-    
+
+    # https://bugs.webkit.org/show_bug.cgi?id=55294
+    "--enable-image-resizer"
+
     "--enable-geolocation"
 
     # Not implemented?
-    #"--enable-web-audio"
+    # "--enable-web-audio"
 
     "--enable-mathml"
 
     #"--enable-wml"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=45110
     #"--enable-indexed-database"
 
@@ -43,23 +47,29 @@ rec {
 
     # "--enable-input-speech"
 
-    "--enable-file-writer"
+    #"--enable-file-writer" # no longer recognized
     "--enable-blob"
 
     # https://bugs.webkit.org/show_bug.cgi?id=59430
-    #"--enable-directory-upload"
+    # "--enable-directory-upload"
 
     # https://bugs.webkit.org/show_bug.cgi?id=58443
-    #"--enable-file-system"
+    # "--enable-file-system"
+
+    "--enable-dependency-tracking" # to fix parallel building
     ];
 
+  # instead of enableParallelBuilding = true;
+  makeFlags = "-j$NIX_BUILD_CORES";
+
   /* doConfigure should be specified separately */
-  phaseNames = ["setVars" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
+  phaseNames = ["doPatch" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
     "doReplaceUsrBin" "doMakeInstall" "doAddPrograms"];
 
-  setVars = fullDepEntry (''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lXt"
-  '') ["minInit"];
+  patches = [ ./bison26.patch ]; # http://trac.webkit.org/changeset/124099
+  patchFlags = "-p2";
+
+  #doCheck = true; # tests still have problems
 
   doReplaceUsrBin = fullDepEntry (''
     for i in $(find . -name '*.pl') $(find . -name '*.pm'); do 
@@ -91,6 +101,6 @@ rec {
     maintainers = [stdenv.lib.maintainers.raskin];
   };
   passthru = {
-    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg;
+    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg libsoup;
   };
 }
diff --git a/pkgs/development/libraries/webkit/gtk2.nix b/pkgs/development/libraries/webkit/gtk2.nix
index 0b836cd08f00..c2e3b9b06dd6 100644
--- a/pkgs/development/libraries/webkit/gtk2.nix
+++ b/pkgs/development/libraries/webkit/gtk2.nix
@@ -10,11 +10,13 @@ rec {
     sha256 = s.hash;
   };
 
-  buildInputs = [gtk glib atk cairo curl fontconfig freetype
-    gettext libjpeg libpng libtiff libxml2 libxslt pango
-    sqlite icu gperf bison flex autoconf automake libtool 
-    intltool pkgconfig libsoup gtkdoc libXt libproxy
-    enchant python ruby which renderproto libXrender geoclue perl
+  buildInputs = with xlibs; [
+    pkgconfig libtool intltool autoconf automake gperf bison flex
+    gtk2 glib atk cairo pango fontconfig freetype libsoup gtkdoc
+    libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+    which libproxy geoclue enchant python ruby perl
+    mesa libXt libXrender renderproto libXcomposite compositeproto
+    libXdamage damageproto kbproto
     ];
 
   propagatedBuildInputs = [
@@ -22,12 +24,14 @@ rec {
     ];
 
   configureFlags = [
-    "--enable-3D-transforms"
+    "--with-gtk=2.0"
+
+    # "--enable-3D-transforms" # no longer recognized
     "--enable-web-sockets"
     "--enable-web-timing"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=55294
-    # "--enable-image-resizer"
+    "--enable-image-resizer"
 
     "--enable-geolocation"
 
@@ -37,15 +41,16 @@ rec {
     "--enable-mathml"
 
     #"--enable-wml"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=45110
-    # "--enable-indexed-database"
+    #"--enable-indexed-database"
 
-    "--enable-xhtmlmp"
+    # Doesn't work in release...
+    #"--enable-xhtmlmp"
 
     # "--enable-input-speech"
 
-    "--enable-file-writer"
+    #"--enable-file-writer" # no longer recognized
     "--enable-blob"
 
     # https://bugs.webkit.org/show_bug.cgi?id=59430
@@ -53,16 +58,21 @@ rec {
 
     # https://bugs.webkit.org/show_bug.cgi?id=58443
     # "--enable-file-system"
+
+    "--enable-dependency-tracking" # to fix parallel building
     ];
 
+  # instead of enableParallelBuilding = true;
+  makeFlags = "-j$NIX_BUILD_CORES";
+
   /* doConfigure should be specified separately */
-  phaseNames = ["setVars" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
+  phaseNames = ["doPatch" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
     "doReplaceUsrBin" "doMakeInstall" "doAddPrograms"];
 
-  setVars = fullDepEntry (''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lXt"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fpermissive"
-  '') ["minInit"];
+  patches = [ ./bison26.patch ]; # http://trac.webkit.org/changeset/124099
+  patchFlags = "-p2";
+
+  #doCheck = true; # tests still have problems
 
   doReplaceUsrBin = fullDepEntry (''
     for i in $(find . -name '*.pl') $(find . -name '*.pm'); do 
@@ -81,12 +91,19 @@ rec {
     sed -re 's@( |^)//.*@/* & */@' -i $(find . -name '*.c' -o -name '*.h')
   '') ["minInit" "doUnpack"];
 
+  # See http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2012-April/022893.html
+  fixConfigure = fullDepEntry (''
+    sed   -i -e 's/=GSTREAMER_0_10_REQUIRED_VERSION/=\$GSTREAMER_0_10_REQUIRED_VERSION/' \
+      -e 's/=GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/=\$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/' \
+      configure{,.ac}
+  '') ["minInit" "doUnpack"];
+
   name = s.name;
   meta = {
     description = "WebKit - a fast and correct HTML renderer";
     maintainers = [stdenv.lib.maintainers.raskin];
   };
   passthru = {
-    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg;
+    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg libsoup;
   };
 }
diff --git a/pkgs/development/libraries/webkit/src-for-gtk2.nix b/pkgs/development/libraries/webkit/src-for-gtk2.nix
index 5f5149fedfe6..65bcd4350960 100644
--- a/pkgs/development/libraries/webkit/src-for-gtk2.nix
+++ b/pkgs/development/libraries/webkit/src-for-gtk2.nix
@@ -1,9 +1,10 @@
 rec {
-   version="1.4.0";
-   name="webkit-1.4.0";
-   hash="123zllzlnkjgw4d2ag73dvrjmkikbapxlz5730ps6y4qm43gxc1y";
-   url="http://webkitgtk.org/webkit-1.4.0.tar.gz";
-   advertisedUrl="http://webkitgtk.org/webkit-1.4.0.tar.gz";
+   version="1.8.1";
+   name="webkit-1.8.1";
+   hash="0a1v3v8dp2cl332qr51j4fpl0rwpgxbf29hn3zdim9hcniv6l4ls";
+   url="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
+   advertisedUrl="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
   
   
 }
+
diff --git a/pkgs/development/libraries/wxGTK-2.8/default.nix b/pkgs/development/libraries/wxGTK-2.8/default.nix
index 919a458d248f..a73638dc478a 100644
--- a/pkgs/development/libraries/wxGTK-2.8/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.8/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   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 21a80d8951fb..fca5a4a278e0 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 4ae48a4c04e1..45c60acfa898 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 5e1ddf839516..ec47c35c1530 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"