summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/applications/misc/ikiwiki/default.nix4
-rw-r--r--pkgs/applications/misc/st/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/opera/default.nix10
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix22
-rw-r--r--pkgs/applications/networking/remote/freerdp/unstable.nix36
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix62
-rw-r--r--pkgs/applications/window-managers/i3/default.nix4
-rw-r--r--pkgs/applications/window-managers/ion-3/default.nix6
-rwxr-xr-xpkgs/build-support/upstream-updater/update-walker.sh16
-rw-r--r--pkgs/build-support/vm/default.nix38
-rw-r--r--pkgs/development/androidenv/addon.xml153
-rw-r--r--pkgs/development/androidenv/addons.nix14
-rw-r--r--pkgs/development/androidenv/androidsdk.nix34
-rw-r--r--pkgs/development/androidenv/default.nix2
-rw-r--r--pkgs/development/androidenv/platform-tools.nix10
-rw-r--r--pkgs/development/androidenv/platforms-linux.nix14
-rw-r--r--pkgs/development/androidenv/platforms-macosx.nix14
-rw-r--r--pkgs/development/androidenv/repository-7.xml294
-rw-r--r--pkgs/development/androidenv/support.nix6
-rw-r--r--pkgs/development/androidenv/sysimages.nix10
-rw-r--r--pkgs/development/arduino/arduino-core/default.nix42
-rw-r--r--pkgs/development/arduino/ino/default.nix28
-rw-r--r--pkgs/development/interpreters/lua-5/5.1.nix23
-rw-r--r--pkgs/development/libraries/haskell/Boolean/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/bloomfilter/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/bmp/1.2.3.4.nix (renamed from pkgs/development/libraries/haskell/bmp/1.2.3.2.nix)4
-rw-r--r--pkgs/development/libraries/haskell/configurator/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cryptohash/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/diagrams/contrib.nix4
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.1.2.5.nix (renamed from pkgs/development/libraries/haskell/hashable/default.nix)0
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.2.0.2.nix15
-rw-r--r--pkgs/development/libraries/haskell/heist/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/hsemail/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hslogger-template/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/http-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/lens/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mime-types/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/network-conduit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/optparse-applicative/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/parallel-io/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-postgresql/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-sqlite/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent-template/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/persistent/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pretty-show/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/semigroups/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/shelly/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/snap/snap.nix1
-rw-r--r--pkgs/development/libraries/haskell/strptime/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/tls/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/unix-compat/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vault/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yaml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-auth/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/yesod-form/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/yesod/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zeromq3-haskell/default.nix4
-rw-r--r--pkgs/development/libraries/libxtc_dxtn/default.nix15
-rw-r--r--pkgs/development/misc/avr-gcc-with-avr-libc/default.nix16
-rw-r--r--pkgs/development/tools/haskell/splot/default.nix4
-rw-r--r--pkgs/development/tools/haskell/timeplot/default.nix4
-rw-r--r--pkgs/development/tools/misc/distcc/default.nix103
-rw-r--r--pkgs/development/tools/misc/distcc/masq.nix41
-rw-r--r--pkgs/lib/types.nix14
-rw-r--r--pkgs/misc/emulators/wine/default.nix4
-rw-r--r--pkgs/os-specific/linux/aufs-util/3.nix3
-rw-r--r--pkgs/os-specific/linux/aufs/3.nix3
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.0.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.6.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.7.nix6
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix12
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch338
-rw-r--r--pkgs/os-specific/linux/spl/default.nix6
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix6
-rw-r--r--pkgs/servers/sql/postgresql/9.2.x.nix35
-rw-r--r--pkgs/tools/networking/mu/default.nix25
-rw-r--r--pkgs/tools/networking/mu0/default.nix25
-rw-r--r--pkgs/top-level/all-packages.nix45
-rw-r--r--pkgs/top-level/haskell-packages.nix6
-rw-r--r--pkgs/top-level/python-packages.nix2
81 files changed, 1314 insertions, 390 deletions
diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix
index df59145e51f..bbc8aaac49b 100644
--- a/pkgs/applications/misc/ikiwiki/default.nix
+++ b/pkgs/applications/misc/ikiwiki/default.nix
@@ -23,7 +23,7 @@ assert mercurialSupport -> (mercurial != null);
 
 let
   name = "ikiwiki";
-  version = "3.20121017";
+  version = "3.20121212";
 
   lib = stdenv.lib;
 in
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://ftp.de.debian.org/debian/pool/main/i/ikiwiki/${name}_${version}.tar.gz";
-    sha256 = "c0bb6ef9340ebc7eec40812b091700b2bcfd61e7321a22f41026ce130e877028";
+    sha256 = "1frsr2sqzsnagbxvyjsgk4nrl1p1048vybsd1zw1ln1mqik31ydz";
   };
 
   buildInputs = [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
diff --git a/pkgs/applications/misc/st/default.nix b/pkgs/applications/misc/st/default.nix
index 86b24e7e401..70089759626 100644
--- a/pkgs/applications/misc/st/default.nix
+++ b/pkgs/applications/misc/st/default.nix
@@ -4,8 +4,8 @@ stdenv.mkDerivation rec {
   name = "st-0.3";
   
   src = fetchurl {
-    url = http://hg.suckless.org/st/archive/0.3.tar.gz;
-    sha256 = "12ypldjjpsq3nvhszgjsk4wgqkwcvz06qiqw8k5npv3rd1nbx9cl";
+    url = "http://dl.suckless.org/st/${name}.tar.gz";
+    sha256 = "0d0fjixiis4ixbz4l18rqhnssa7cy2bap3jkjyphqlqhl7lahv3d";
   };
   
   buildInputs = [ libX11 ncurses libXext libXft ];
diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix
index e03f07c1e23..80b09bcd8a8 100644
--- a/pkgs/applications/networking/browsers/opera/default.nix
+++ b/pkgs/applications/networking/browsers/opera/default.nix
@@ -13,18 +13,18 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "opera-12.11-1661";
+  name = "opera-12.12-1707";
 
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "${mirror}/linux/1211/${name}.i386.linux.tar.xz";
-        sha256 = "0ax2kcnl0hb7fz56c9gcjia3dnwabxl2mq2hvszmbky4i399jlkk";
+        url = "${mirror}/linux/1212/${name}.i386.linux.tar.xz";
+        sha256 = "1jkrhxjxa5kz4bhyma0zlnsszdn84sq4pks3x8bfcayn12m6yxkz";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "${mirror}/linux/1211/${name}.x86_64.linux.tar.xz";
-        sha256 = "1pnad4kdasrmm27kg6frldipyzcfy1y610rasbqic9frzb9q8dbp";
+        url = "${mirror}/linux/1212/${name}.x86_64.linux.tar.xz";
+        sha256 = "0acizxgyqblcvl91dwmvi937fi1kw6whz5qgxyl1fkygbayji90v";
       }
     else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
 
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 434d75bce58..d8634e31dad 100644
--- a/pkgs/applications/networking/remote/freerdp/default.nix
+++ b/pkgs/applications/networking/remote/freerdp/default.nix
@@ -10,16 +10,22 @@
 , libXdamage
 , libXext
 , alsaLib
+, ffmpeg
+, libxkbfile
+#, xmlto, docbook_xml_dtd_412, docbook_xml_xslt
+, libXinerama
+, libXv
+, pulseaudioSupport ? true, pulseaudio
 }:
 
 assert printerSupport -> cups != null;
 stdenv.mkDerivation rec {
   name = "freerdp-${version}";
-  version = "1.0.0";
+  version = "1.0.1";
 
   src = fetchurl {
-    url = "https://github.com/downloads/FreeRDP/FreeRDP/FreeRDP-${version}.tar.gz";
-    sha256 = "df9f5f3275436f3e413824ca40f1e41733a95121f45e1ed41ab410701c5764cc";
+    url = "https://github.com/FreeRDP/FreeRDP/archive/${version}.tar.gz";
+    sha256 = "1my8gamvfrn6v9gcqxsa9cgxr42shc0l826zvxj8wpcay6gd321w";
   };
 
   buildInputs = [
@@ -32,11 +38,17 @@ stdenv.mkDerivation rec {
     libXdamage
     libXext
     alsaLib
+    ffmpeg
+    libxkbfile
+#    xmlto docbook_xml_dtd_412 docbook_xml_xslt
+    libXinerama
+    libXv
   ] ++ stdenv.lib.optional printerSupport cups;
 
   configureFlags = [
-    "--with-x"
-  ] ++ stdenv.lib.optional printerSupport "--with-printer=cups";
+    "--with-x" "-DWITH_MANPAGES=OFF"
+  ] ++ stdenv.lib.optional printerSupport "--with-printer=cups"
+    ++ stdenv.lib.optional pulseaudioSupport "-DWITH_PULSEAUDIO=ON";
 
   meta = {
     description = "A Remote Desktop Protocol Client";
diff --git a/pkgs/applications/networking/remote/freerdp/unstable.nix b/pkgs/applications/networking/remote/freerdp/unstable.nix
index 2266f7237f6..ef8ddf8b0e3 100644
--- a/pkgs/applications/networking/remote/freerdp/unstable.nix
+++ b/pkgs/applications/networking/remote/freerdp/unstable.nix
@@ -1,53 +1,63 @@
 { stdenv
 , fetchgit
+, cmake
 , openssl
 , printerSupport ? true, cups
 , pkgconfig
 , zlib
 , libX11
 , libXcursor
+, libXdamage
+, libXext
 , alsaLib
-, cmake
+, ffmpeg
 , libxkbfile
+#, xmlto, docbook_xml_dtd_412, docbook_xml_xslt
 , libXinerama
-, libXext
-, directfb
-, cunit
+#, directfb
+#, cunit
+, libXv
+, pulseaudioSupport ? true, pulseaudio
 }:
 
 assert printerSupport -> cups != null;
 
-let rev = "498b88a1da748a4a2b4dbd12c795ca87fee24bab"; in
+let rev = "ec6effcb1e7759551cf31f5b18d768afc67db97d"; in
 
 stdenv.mkDerivation rec {
-  name = "freerdp-1.0pre${rev}";
+  name = "freerdp-1.1pre${rev}";
 
   src = fetchgit {
     url = git://github.com/FreeRDP/FreeRDP.git;
     inherit rev;
-    sha256 = "91ef562e96db483ada28236e524326a75b6942becce4fd2a65ace386186eccf7";
+    sha256 = "4e5af9a6769c4b34c6b75dffe83a385d1d86068c523ea9f62fabc651a2958455";
   };
 
   buildInputs = [
+    cmake
     openssl
     pkgconfig
     zlib
     libX11
     libXcursor
-    libxkbfile
-    libXinerama
+    libXdamage
     libXext
-    directfb
+#    directfb
+#    cunit
     alsaLib
-    cmake
-    cunit
+    ffmpeg
+    libxkbfile
+#    xmlto docbook_xml_dtd_412 docbook_xml_xslt
+    libXinerama
+    libXv
   ] ++ stdenv.lib.optional printerSupport cups;
 
   doCheck = false;
 
   checkPhase = ''LD_LIBRARY_PATH="libfreerdp-cache:libfreerdp-chanman:libfreerdp-common:libfreerdp-core:libfreerdp-gdi:libfreerdp-kbd:libfreerdp-rail:libfreerdp-rfx:libfreerdp-utils" cunit/test_freerdp'';
 
-  cmakeFlags = [ "-DWITH_DIRECTFB=ON" "-DWITH_CUNIT=ON" ];
+  cmakeFlags = [ "-DWITH_DIRECTFB=OFF" "-DWITH_CUNIT=OFF" "-DWITH_MANPAGES=OFF" 
+  ] ++ stdenv.lib.optional pulseaudioSupport "-DWITH_PULSEAUDIO=ON";
 
   meta = {
     description = "A Remote Desktop Protocol Client";
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
new file mode 100644
index 00000000000..22180e9a3f7
--- /dev/null
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, freeglut, gtk2, gtkglext, libjpeg_turbo, libtheora, libXmu
+, lua, mesa, pkgconfig, perl, automake, autoconf, libtool, gettext
+}:
+
+let
+  name = "celestia-1.6.1";
+
+  gcc46Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-gcc46.patch?h=packages/celestia";
+    sha256 = "1q840ip5h2q93r0d68jwrvf40ns5qzqss9vzd6xnwvs3wa77m5wp";
+    name = "celestia-1.6.1-gcc46.patch";
+  };
+
+  libpng15Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-libpng15.patch?h=packages/celestia";
+    sha256 = "19yqbi5k944d3jm0q2mvcfg52kicy4j347gj62dyaijzj505x4pm";
+    name = "celestia-1.6.1-libpng15.patch";
+  };
+
+  linkingPatch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-linking.patch?h=packages/celestia";
+    sha256 = "1qzv18b2prqbhy21js5bnf7vwkmrq1dmrq8r0wab7v10axjqdv35";
+    name = "celestia-1.6.1-linking.patch";
+  };
+
+  gcc47Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc-4.7-fixes.diff?h=packages/celestia";
+    sha256 = "1jqkafwrg1829cwqvlxxkqbf42zqfsgpqd8a5b2qlzma5napdmg5";
+    name = "gcc-4.7-fixes.diff";
+  };
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/celestia/${name}.tar.gz";
+    sha256 = "1i1lvhbgllsh2z8i6jj4mvrjak4a7r69psvk7syw03s4p7670mfk";
+  };
+
+  buildInputs = [ freeglut gtk2 gtkglext libjpeg_turbo libtheora libXmu mesa pkgconfig lua
+    perl automake autoconf libtool gettext  ];
+
+  patchPhase = ''
+    patch -Np0 -i "${gcc46Patch}"
+    patch -Np0 -i "${libpng15Patch}"
+    patch -Np1 -i "${linkingPatch}"
+    patch -Np1 -i "${gcc47Patch}"
+    autoreconf
+    configureFlagsArray=( --with-gtk --with-lua=${lua} CFLAGS="-O2 -fsigned-char" CXXFLAGS="-O2 -fsigned-char" )
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Free space simulation";
+    homepage = "http://www.shatters.net/celestia/";
+    license = stdenv.lib.licenses.gpl2;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/window-managers/i3/default.nix b/pkgs/applications/window-managers/i3/default.nix
index 042e1a323a6..94ac84f838c 100644
--- a/pkgs/applications/window-managers/i3/default.nix
+++ b/pkgs/applications/window-managers/i3/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "i3-${version}";
-  version = "4.3";
+  version = "4.4";
 
   src = fetchurl {
     url = "http://i3wm.org/downloads/${name}.tar.bz2";
-    sha256 = "895bf586092535efb2bc723ba599c71a027768115e56052f111fc8bb148db925";
+    sha256 = "06s8gzcxxh06zp1586kp4bxaj8yj5i9jacwg0nizbmmnx94mg1wr";
   };
 
   buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil bison xcbutilwm
diff --git a/pkgs/applications/window-managers/ion-3/default.nix b/pkgs/applications/window-managers/ion-3/default.nix
index e6714536cad..b4dabb300c1 100644
--- a/pkgs/applications/window-managers/ion-3/default.nix
+++ b/pkgs/applications/window-managers/ion-3/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, x11, lua, gettext, groff }:
 
 stdenv.mkDerivation {
-  name = "ion-3rc-20070902";
+  name = "ion-3-20090110";
   meta = {
     description = "Ion is a tiling tabbed window manager designed with keyboard users in mind.";
     homepage = http://modeemi.fi/~tuomov/ion;
   };
   src = fetchurl {
-    url = http://iki.fi/tuomov/dl/ion-3rc-20070902.tar.gz;
-    sha256 = "062a0rgxzz4h1hih5lp7l2nfvhz095brag9fmnanzqc4dac228xl";
+    url = http://tuomov.iki.fi/software/dl/ion-3-20090110.tar.gz;
+    sha256 = "1nkks5a95986nyfkxvg2rik6zmwx0lh7szd5fji7yizccwzc9xns";
   };
   buildInputs = [ x11 lua gettext groff ];
   buildFlags = "LUA_DIR=${lua} X11_PREFIX=/no-such-path PREFIX=\${out}";
diff --git a/pkgs/build-support/upstream-updater/update-walker.sh b/pkgs/build-support/upstream-updater/update-walker.sh
index b8621616169..c4dc7713f50 100755
--- a/pkgs/build-support/upstream-updater/update-walker.sh
+++ b/pkgs/build-support/upstream-updater/update-walker.sh
@@ -88,7 +88,7 @@ ensure_version () {
 
 ensure_target () {
   echo "Ensuring target. CURRENT_TARGET: $CURRENT_TARGET" >&2
-  [ -z "$CURRENT_TARGET" ] && target default.nix
+  [ -z "$CURRENT_TARGET" ] && target "$(basename "$CONFIG_NAME" .upstream).nix"
 }
 
 ensure_name () {
@@ -152,8 +152,7 @@ full_path () {
 
 target () {
   CURRENT_TARGET="$1"
-  test -e "$CURRENT_TARGET" || 
-    { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; }
+  { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; }
   echo "Target set to: $CURRENT_TARGET"
 }
 
@@ -190,6 +189,12 @@ replace_once () {
   replacement="$3"
   instance="${4:-1}"
 
+  echo "Replacing once:"
+  echo "file: [[$file]]"
+  echo "regexp: [[$regexp]]"
+  echo "replacement: [[$replacement]]"
+  echo "instance: [[$instance]]"
+
   position="$(line_position "$file" "$regexp" "$instance")"
   sed -re "${position}s	$regexp	$replacement	" -i "$file"
 }
@@ -204,7 +209,7 @@ set_var_value () {
   quote='"'
   let "$no_quotes" && quote=""
 
-  replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};"
+  replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};" "$instance"
 }
 
 do_regenerate () {
@@ -227,8 +232,9 @@ do_overwrite () {
 
 process_config () {
   CONFIG_DIR="$(directory_of "$1")"
+  CONFIG_NAME="$(basename "$1")"
   BEGIN_EXPRESSION='# Generated upstream information';
-  source "$CONFIG_DIR/$(basename "$1")"
+  source "$CONFIG_DIR/$CONFIG_NAME"
   ensure_name
   ensure_attribute_name
   retrieve_version
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 1a456080553..9d9bdb2033e 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -38,35 +38,19 @@ rec {
       # Copy what we need from Glibc.
       cp -p ${pkgs.stdenv.glibc}/lib/ld-linux*.so.? $out/lib
       cp -p ${pkgs.stdenv.glibc}/lib/libc.so.* $out/lib
-      cp -p ${pkgs.stdenv.glibc}/lib/librt.so.* $out/lib
-      cp -p ${pkgs.stdenv.glibc}/lib/libdl.so.* $out/lib
-
-      # Copy some utillinux stuff.
-      cp ${utillinux}/bin/mount ${utillinux}/bin/umount $out/bin
-      cp -pd ${utillinux}/lib/libblkid*.so.* $out/lib
-      cp -pd ${utillinux}/lib/libuuid*.so.* $out/lib
-
-      # Copy some coreutils.
-      cp ${coreutils}/bin/basename $out/bin
-      cp ${coreutils}/bin/mkdir $out/bin
-      cp ${coreutils}/bin/mknod $out/bin
-      cp ${coreutils}/bin/cat $out/bin
-      cp ${coreutils}/bin/chroot $out/bin
-      cp ${coreutils}/bin/sleep $out/bin
-      cp ${coreutils}/bin/ln $out/bin
-
-      # Copy some other tools.
-      cp ${bash}/bin/bash $out/bin
-      cp ${module_init_tools}/sbin/insmod $out/bin/insmod
-      cp ${nettools}/sbin/ifconfig $out/bin
-      cp ${sysvinit}/sbin/halt $out/bin
+      cp -p ${pkgs.stdenv.glibc}/lib/libm.so.* $out/lib
+
+      # Copy BusyBox.
+      cp -pd ${pkgs.busybox}/bin/* ${pkgs.busybox}/sbin/* $out/bin
 
       # Run patchelf to make the programs refer to the copied libraries.
       for i in $out/bin/* $out/lib/*; do if ! test -L $i; then nuke-refs $i; fi; done
 
       for i in $out/bin/*; do
-          echo "patching $i..."
-          patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true
+          if [ -f "$i" -a ! -L "$i" ]; then
+              echo "patching $i..."
+              patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true
+          fi
       done
     ''; # */
 
@@ -84,8 +68,7 @@ rec {
 
 
   stage1Init = writeScript "vm-run-stage1" ''
-    #! ${initrdUtils}/bin/bash -e
-    echo START
+    #! ${initrdUtils}/bin/ash -e
 
     export PATH=${initrdUtils}/bin
 
@@ -167,8 +150,7 @@ rec {
 
     mount -o remount,ro dummy /fs
 
-    echo DONE
-    halt -d -p -f
+    poweroff -f
   '';
 
 
diff --git a/pkgs/development/androidenv/addon.xml b/pkgs/development/androidenv/addon.xml
index 7b0f69128a6..fb5d324d778 100644
--- a/pkgs/development/androidenv/addon.xml
+++ b/pkgs/development/androidenv/addon.xml
@@ -16,69 +16,85 @@
 -->
 <sdk:sdk-addon xmlns:sdk="http://schemas.android.com/sdk/android/addon/5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
-    <sdk:license id="android-sdk-license" type="text">This is the Android Software Development Kit License Agreement.
+    <sdk:license id="android-sdk-license" type="text">Terms and Conditions
+
+This is the Android Software Development Kit License Agreement.
+
 
 1. Introduction
 
-1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
 
-1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+1.1 The Android Software Development Kit (referred to in this License Agreement as the &quot;SDK&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 &quot;Android&quot; means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
 
 2. Accepting this License Agreement
 
-2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
 
-2.2 You can accept this License Agreement by:
+2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
 
-(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
 
-(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
 
-2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
 
-2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity.
 
 3. SDK License from Google
 
-3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
 
-3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
 
-3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
 
-3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement.  Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
 
-3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
 
-3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
 
-3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
 
 4. Use of the SDK by You
 
+
 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
 
 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
 
-4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
 
 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
 
-4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
 
 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
 
+
 5. Your Developer Credentials
 
+
 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
 
+
 6. Privacy and Information
 
+
 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
 
 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
 
-7. Third Party Applications for the Android Platform
+
+7. Third Party Applications
+
 
 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
 
@@ -86,55 +102,65 @@
 
 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
 
+
 8. Using Android APIs
 
+
 8.1 Google Data APIs
 
 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
 
 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
 
+
 9. Terminating this License Agreement
 
+
 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
 
 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
 
 9.3 Google may at any time, terminate this License Agreement with you if:
-
 (A) you have breached any provision of this License Agreement; or
-
 (B) Google is required to do so by law; or
-
 (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
-
-(D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
 
 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
 
+
 10. DISCLAIMER OF WARRANTIES
 
-10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
 
 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
 
 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 
+
 11. LIMITATION OF LIABILITY
 
-11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
 
 12. Indemnification
 
+
 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
 
+
 13. Changes to the License Agreement
 
+
 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
 
+
 14. General Legal Terms
 
-14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK.
+
+14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
 
 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
 
@@ -148,7 +174,7 @@
 
 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
 
-April 10, 2009
+November 13, 2012
     </sdk:license>
 
     <sdk:license id="android-googletv-license" type="text">Terms and Conditions
@@ -157,9 +183,9 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 1. Introduction
 
-1.1 The Google TV Add-on for the Android Software Development Kit (referred to in this License Agreement as the "Google TV Add-on" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the Google TV Add-on.
+1.1 The Google TV Add-on for the Android Software Development Kit (referred to in this License Agreement as the &quot;Google TV Add-on&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the Google TV Add-on.
 
-1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+1.2 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
 
 2. Accepting this License Agreement
 
@@ -179,7 +205,7 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the Google TV Add-on solely to develop applications to run on the Google TV platform.
 
-3.2 You agree that Google or third parties own all legal right, title and interest in and to the Google TV Add-on, including any Intellectual Property Rights that subsist in the Google TV Add-on. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the Google TV Add-on, including any Intellectual Property Rights that subsist in the Google TV Add-on. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
 
 3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Google TV Add-on or any part of the Google TV Add-on. Except to the extent required by applicable third party licenses, you may not load any part of the Google TV Add-on onto a mobile handset, television, or any other hardware device except a personal computer, combine any part of the Google TV Add-on with other software, or distribute any software or device incorporating a part of the Google TV Add-on.
 
@@ -257,7 +283,7 @@ This is the Google TV Add-on for the Android Software Development Kit License Ag
 
 10. DISCLAIMER OF WARRANTIES
 
-10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE GOOGLE TV ADD-ON IS AT YOUR SOLE RISK AND THAT THE GOOGLE TV ADD-ON IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE GOOGLE TV ADD-ON IS AT YOUR SOLE RISK AND THAT THE GOOGLE TV ADD-ON IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
 
 10.2 YOUR USE OF THE GOOGLE TV ADD-ON AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE GOOGLE TV ADD-ON IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
 
@@ -704,11 +730,41 @@ August 15, 2011
         <sdk:libs/>
     </sdk:add-on>
 
+    <sdk:add-on>
+        <!-- Generated at Mon Nov 12 17:15:51 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.android.future.usb.accessory</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.google.android.media.effects</sdk:name>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>132568033</sdk:size>
+                <sdk:checksum type="sha1">62cb086f11e15713878c8834d58ef1a2454c19a4</sdk:checksum>
+                <sdk:url>google_apis-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:add-on>
+
     <!-- EXTRAS VENDOR=ANDROID ........................ -->
 
     <sdk:extra>
-        <!-- Generated at Thu Aug  9 13:20:52 2012 from git_jb-dev @ 416700 -->
-        <sdk:revision>10</sdk:revision>
+        <!-- Generated at Mon Nov 12 17:16:25 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>11</sdk:revision>
         <sdk:vendor-display>Android</sdk:vendor-display>
         <sdk:vendor-id>android</sdk:vendor-id>
         <sdk:name-display>Android Support Library</sdk:name-display>
@@ -716,11 +772,12 @@ August 15, 2011
         <sdk:old-paths>compatibility</sdk:old-paths>
         <sdk:archives>
             <sdk:archive arch="any" os="any">
-                <sdk:size>1161015</sdk:size>
-                <sdk:checksum type="sha1">7c62e542d46ac3bdb89e1b90503d6afae557cf7d</sdk:checksum>
-                <sdk:url>support_r10.zip</sdk:url>
+                <sdk:size>1264808</sdk:size>
+                <sdk:checksum type="sha1">d30d182d8e4c86bb4464c03a83ccffce7bc84ecd</sdk:checksum>
+                <sdk:url>support_r11.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:extra>
 
     <!-- EXTRAS VENDOR=GOOGLE ....................... -->
@@ -768,15 +825,15 @@ August 15, 2011
         <sdk:vendor-display>Google Inc.</sdk:vendor-display>
         <sdk:name-display>Google Play services</sdk:name-display>
         <sdk:path>google_play_services</sdk:path>
-        <sdk:revision>1</sdk:revision>
+        <sdk:revision>4</sdk:revision>
         <sdk:description>Google Play Services client library and sample code</sdk:description>
         <sdk:desc-url>https://developers.google.com/android/google-play-services/index</sdk:desc-url>
         <sdk:uses-license ref="android-sdk-license"/>
         <sdk:archives>
             <sdk:archive os="any">
-                <sdk:size>363692</sdk:size>
-                <sdk:checksum type="sha1">b1808a7d5f91a3ed42839b950fd254c60e9328f1</sdk:checksum>
-                <sdk:url>google_play_services_1013.zip</sdk:url>
+                <sdk:size>3732458</sdk:size>
+                <sdk:checksum type="sha1">bbb3d11225fcf60a0bae75afa2c4737010468bf6</sdk:checksum>
+                <sdk:url>google_play_services_2012110_r04.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
     </sdk:extra>
@@ -806,14 +863,14 @@ August 15, 2011
         <sdk:name-display>Google Play Billing Library</sdk:name-display>
         <sdk:path>play_billing</sdk:path>
         <sdk:old-paths>market_billing</sdk:old-paths>
-        <sdk:revision>2</sdk:revision>
-        <sdk:description>Google Play Billing sample code</sdk:description>
-        <sdk:desc-url>http://developer.android.com/guide/market/billing/index.html</sdk:desc-url>
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Google Play Billing files and sample code</sdk:description>
+        <sdk:desc-url>http://developer.android.com/google/play/billing/index.html</sdk:desc-url>
         <sdk:archives>
             <sdk:archive os="any">
-                <sdk:size>55191</sdk:size>
-                <sdk:checksum type="sha1">3c84c05c60a9cabb578cebce0515860be7ad23d2</sdk:checksum>
-                <sdk:url>market_billing_r02.zip</sdk:url>
+                <sdk:size>435718</sdk:size>
+                <sdk:checksum type="sha1">a133d454c992ef2a18e62fa810e8185f1be4b054</sdk:checksum>
+                <sdk:url>play_billing_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
         <sdk:uses-license ref="android-sdk-license"/>
@@ -890,4 +947,4 @@ August 15, 2011
         </sdk:archives>
         <sdk:uses-license ref="android-sdk-license"/>
     </sdk:extra>
-</sdk:sdk-addon>
\ No newline at end of file
+</sdk:sdk-addon>
diff --git a/pkgs/development/androidenv/addons.nix b/pkgs/development/androidenv/addons.nix
index b995b4301e9..f26db5c2cb7 100644
--- a/pkgs/development/androidenv/addons.nix
+++ b/pkgs/development/androidenv/addons.nix
@@ -182,5 +182,17 @@ in
       };
     };
     
+  google_apis_17 = buildGoogleApis {
+    name = "google_apis-17";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-17_r01.zip;
+        sha1 = "62cb086f11e15713878c8834d58ef1a2454c19a4";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        
+      };
+    };
+    
 }
-  
+  
\ No newline at end of file
diff --git a/pkgs/development/androidenv/androidsdk.nix b/pkgs/development/androidenv/androidsdk.nix
index b175266ebf7..e8e1f919fe4 100644
--- a/pkgs/development/androidenv/androidsdk.nix
+++ b/pkgs/development/androidenv/androidsdk.nix
@@ -2,22 +2,22 @@
 , platformTools, support, platforms, sysimages, addons
 , zlib_32bit
 , libX11_32bit, libxcb_32bit, libXau_32bit, libXdmcp_32bit, libXext_32bit
-, libX11, libXext, libXrender
+, libX11, libXext, libXrender, libxcb, libXau, libXdmcp
 , freetype, fontconfig, gtk, atk
 }:
 {platformVersions, useGoogleAPIs}:
 
 stdenv.mkDerivation {
-  name = "android-sdk-20.0.3";
+  name = "android-sdk-21";
   
   src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
     then fetchurl {
-      url = http://dl.google.com/android/android-sdk_r20.0.3-linux.tgz;
-      sha256 = "0xfb41xsjaf7n6b9gsrxm24jwg2fi1hzn73y69rlqm55bw1vxhc1";
+      url = http://dl.google.com/android/android-sdk_r21-linux.tgz;
+      md5 = "7f8d73b629f808cdcfc9f9900bbd7580";
     }
     else if stdenv.system == "x86_64-darwin" then fetchurl {
-      url = http://dl.google.com/android/android-sdk_r20.0.3-macosx.zip;
-      sha256 = "0eecaa04950d5c540f36ab4183a4cbaef3ae6a7434467bfc32febaeb796a8ff2";
+      url = http://dl.google.com/android/android-sdk_r21-macosx.zip;
+      md5 = "67e46adca90dd18d7291443f6c15d6af";
     }
     else throw "platform not ${stdenv.system} supported!";
   
@@ -32,12 +32,22 @@ stdenv.mkDerivation {
     ''
       # There are a number of native binaries. We must patch them to let them find the interpreter and libstdc++
     
-      for i in dmtracedump emulator emulator-arm emulator-x86 hprof-conv mksdcard sqlite3
+      for i in dmtracedump emulator emulator-arm emulator-mips emulator-x86 hprof-conv mksdcard sqlite3
       do
           patchelf --set-interpreter ${stdenv_32bit.gcc.libc}/lib/ld-linux.so.2 $i
           patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib $i
       done
     
+      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+        # We must also patch the 64-bit emulator instances, if needed
+        
+        for i in emulator64-arm emulator64-mips emulator64-x86
+        do
+            patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 $i
+            patchelf --set-rpath ${stdenv.gcc.gcc}/lib64 $i
+        done
+      ''}
+      
       # These tools also need zlib in addition to libstdc++
     
       for i in etc1tool zipalign
@@ -48,11 +58,19 @@ stdenv.mkDerivation {
     
       # The emulators need additional libraries, which are not in the RPATH => let's wrap them
     
-      for i in emulator emulator-arm emulator-x86
+      for i in emulator emulator-arm emulator-mips emulator-x86
       do
           wrapProgram `pwd`/$i \
             --prefix LD_LIBRARY_PATH : `pwd`/lib:${libX11_32bit}/lib:${libxcb_32bit}/lib:${libXau_32bit}/lib:${libXdmcp_32bit}/lib:${libXext_32bit}/lib
       done
+      
+      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+        for i in emulator64-arm emulator64-mips emulator64-x86
+        do
+            wrapProgram `pwd`/$i \
+            --prefix LD_LIBRARY_PATH : `pwd`/lib:${libX11}/lib:${libxcb}/lib:${libXau}/lib:${libXdmcp}/lib:${libXext}/lib
+        done
+      ''}
     ''}
 
     patchShebangs .
diff --git a/pkgs/development/androidenv/default.nix b/pkgs/development/androidenv/default.nix
index d2769799df1..a76deb98b6e 100644
--- a/pkgs/development/androidenv/default.nix
+++ b/pkgs/development/androidenv/default.nix
@@ -32,7 +32,7 @@ rec {
   androidsdk = import ./androidsdk.nix {
     inherit (pkgs) stdenv fetchurl unzip makeWrapper;
     inherit (pkgs) freetype fontconfig gtk atk;
-    inherit (pkgs.xorg) libX11 libXext libXrender;
+    inherit (pkgs.xorg) libX11 libXext libXrender libxcb libXau libXdmcp;
     
     inherit platformTools support platforms sysimages addons;
     
diff --git a/pkgs/development/androidenv/platform-tools.nix b/pkgs/development/androidenv/platform-tools.nix
index bc4ceb4e39d..55499608290 100644
--- a/pkgs/development/androidenv/platform-tools.nix
+++ b/pkgs/development/androidenv/platform-tools.nix
@@ -1,15 +1,15 @@
 {stdenv, stdenv_32bit, fetchurl, unzip, zlib, ncurses}:
 
 stdenv.mkDerivation {
-  name = "android-platform-tools-r15_rc7";
+  name = "android-platform-tools-r16";
   src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
     then fetchurl {
-      url = https://dl-ssl.google.com/android/repository/platform-tools_r15_rc7-linux.zip;
-      sha1 = "444e12ba413341282cd810d2e4bdb49975c95758";
+      url = https://dl-ssl.google.com/android/repository/platform-tools_r16-linux.zip;
+      sha1 = "84d563ae5e324f223f335f11bf511bf6207c05fb";
     }
     else if stdenv.system == "x86_64-darwin" then fetchurl {
-      url = https://dl-ssl.google.com/android/repository/platform-tools_r15_rc7-macosx.zip;
-      sha1 = "974eac4afbe404278fcda8f8cd39b55c82be012d";
+      url = https://dl-ssl.google.com/android/repository/platform-tools_r16-macosx.zip;
+      sha1 = "fbb0f8d2786a83b8c3eb6df402e706e136db8fed";
     }
     else throw "System ${stdenv.system} not supported!";
   
diff --git a/pkgs/development/androidenv/platforms-linux.nix b/pkgs/development/androidenv/platforms-linux.nix
index c2cff1b62a2..f544fcc08be 100644
--- a/pkgs/development/androidenv/platforms-linux.nix
+++ b/pkgs/development/androidenv/platforms-linux.nix
@@ -194,5 +194,17 @@ in
     };
   };
     
+  platform_17 = buildPlatform {
+    name = "android-platform-4.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-17_r01.zip;
+      sha1 = "c2e7c8c8db40e06b804ddb1725ac2c3555b55025";
+    };
+    meta = {
+      description = "Android SDK Platform 4.2";
+      
+    };
+  };
+    
 }
-  
+  
\ No newline at end of file
diff --git a/pkgs/development/androidenv/platforms-macosx.nix b/pkgs/development/androidenv/platforms-macosx.nix
index 355740c4200..a1434bbe56c 100644
--- a/pkgs/development/androidenv/platforms-macosx.nix
+++ b/pkgs/development/androidenv/platforms-macosx.nix
@@ -194,5 +194,17 @@ in
     };
   };
     
+  platform_17 = buildPlatform {
+    name = "android-platform-4.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-17_r01.zip;
+      sha1 = "c2e7c8c8db40e06b804ddb1725ac2c3555b55025";
+    };
+    meta = {
+      description = "Android SDK Platform 4.2";
+      
+    };
+  };
+    
 }
-  
+  
\ No newline at end of file
diff --git a/pkgs/development/androidenv/repository-7.xml b/pkgs/development/androidenv/repository-7.xml
index 695be1d90a7..7bbbaf1e362 100644
--- a/pkgs/development/androidenv/repository-7.xml
+++ b/pkgs/development/androidenv/repository-7.xml
@@ -16,69 +16,85 @@
 -->
 <sdk:sdk-repository xmlns:sdk="http://schemas.android.com/sdk/android/repository/7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 
-    <sdk:license id="android-sdk-license" type="text">This is the Android Software Development Kit License Agreement.
+    <sdk:license id="android-sdk-license" type="text">Terms and Conditions
+
+This is the Android Software Development Kit License Agreement.
+
 
 1. Introduction
 
-1.1 The Android Software Development Kit (referred to in this License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
 
-1.2 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+1.1 The Android Software Development Kit (referred to in this License Agreement as the &quot;SDK&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 &quot;Android&quot; means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
 
 2. Accepting this License Agreement
 
-2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
 
-2.2 You can accept this License Agreement by:
+2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
 
-(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
 
-(B) by actually using the SDK. In this case, you agree that use of the SDK constitutes acceptance of the Licensing Agreement from that point onwards.
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
 
-2.3 You may not use the SDK and may not accept the Licensing Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
 
-2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the SDK on behalf of your employer or other entity.
 
 3. SDK License from Google
 
-3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
 
-3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
+
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement.  Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
 
-3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK. Except to the extent required by applicable third party licenses, you may not load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
 
-3.4 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
 
-3.5 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
 
-3.6 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
 
-3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
 
 4. Use of the SDK by You
 
+
 4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
 
 4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
 
-4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
 
 4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
 
-4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Android platform and/or applications for the Android platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
 
 4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
 
+
 5. Your Developer Credentials
 
+
 5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
 
+
 6. Privacy and Information
 
+
 6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
 
 6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
 
-7. Third Party Applications for the Android Platform
+
+7. Third Party Applications
+
 
 7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
 
@@ -86,55 +102,65 @@
 
 7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
 
+
 8. Using Android APIs
 
+
 8.1 Google Data APIs
 
 8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
 
 8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
 
+
 9. Terminating this License Agreement
 
+
 9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
 
 9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
 
 9.3 Google may at any time, terminate this License Agreement with you if:
-
 (A) you have breached any provision of this License Agreement; or
-
 (B) Google is required to do so by law; or
-
 (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
-
-(D) Google decides to no longer providing the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
 
 9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
 
+
 10. DISCLAIMER OF WARRANTIES
 
-10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
 
 10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
 
 10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
 
+
 11. LIMITATION OF LIABILITY
 
-11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
 
 12. Indemnification
 
+
 12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
 
+
 13. Changes to the License Agreement
 
+
 13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
 
+
 14. General Legal Terms
 
-14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the SDK.
+
+14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
 
 14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
 
@@ -148,7 +174,7 @@
 
 14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
 
-April 10, 2009
+November 13, 2012
     </sdk:license>
 
     <!-- PLATFORMS ........................ -->
@@ -180,6 +206,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated manually from earlier versions -->
@@ -213,6 +240,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -245,6 +273,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Thu Oct 22 10:16:34 PDT 2009 using eclair-sdk 17704: Platform. Addon. Tools. Doc. -->
@@ -280,6 +309,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Mon Nov 23 14:08:02 PST 2009 using eclair-release 20723: Platform. Addon. -->
@@ -315,6 +345,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Thu May  6 15:57:41 PDT 2010 using eclair 35983: Platform. -->
@@ -339,6 +370,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Wed Jun 30 16:13:06 PDT 2010 using froyo-release 43546: Platform. Addon. -->
@@ -363,6 +395,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Thu Jan 20 09:40:59 PST 2011 using gingerbread-sdk-release 93351: Platform. -->
@@ -388,6 +421,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Fri Feb  4 16:41:27 PST 2011 using gingerbread-release 101070: Platform. -->
@@ -412,6 +446,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Thu Feb 17 08:41:10 PST 2011 using honeycomb 104254: Platform. -->
@@ -436,6 +471,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Wed May  4 19:39:17 PDT 2011 using honeycomb-mr1 123685: Platform.
@@ -462,6 +498,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- Generated on Fri Jul 15 11:50:12 PDT 2011 using honeycomb-mr2-release 140714: Platform. -->
@@ -486,6 +523,7 @@ April 10, 2009
         <sdk:layoutlib>
             <sdk:api>4</sdk:api>
         </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -505,6 +543,7 @@ April 10, 2009
                 <sdk:url>android-14_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -527,6 +566,7 @@ April 10, 2009
                 <sdk:url>android-15_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <sdk:platform>
@@ -549,6 +589,30 @@ April 10, 2009
                 <sdk:url>android-16_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <!-- Generated at Mon Nov 12 17:12:35 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android SDK Platform 4.2</sdk:description>
+        <sdk:version>4.2</sdk:version>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:min-tools-rev>
+            <sdk:major>21</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:layoutlib>
+            <sdk:api>9</sdk:api>
+            <sdk:revision>1</sdk:revision>
+        </sdk:layoutlib>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>47886130</sdk:size>
+                <sdk:checksum type="sha1">c2e7c8c8db40e06b804ddb1725ac2c3555b55025</sdk:checksum>
+                <sdk:url>android-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform>
 
     <!-- SYSTEM IMAGES ........................ -->
@@ -566,6 +630,7 @@ April 10, 2009
                 <sdk:url>sysimg_armv7a-14_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:system-image>
 
     <sdk:system-image>
@@ -581,6 +646,7 @@ April 10, 2009
                 <sdk:url>sysimg_armv7a-15_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:system-image>
 
     <sdk:system-image>
@@ -596,6 +662,23 @@ April 10, 2009
                 <sdk:url>sysimg_armv7a-16_r03.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:system-image>
+
+    <sdk:system-image>
+        <!-- Generated at Mon Nov 12 17:14:39 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android SDK Platform 4.2</sdk:description>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:abi>armeabi-v7a</sdk:abi>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>116831648</sdk:size>
+                <sdk:checksum type="sha1">45b9344473e0a6d063c2b1fe58d8cd47d307905e</sdk:checksum>
+                <sdk:url>sysimg_armv7a-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:system-image>
 
     <!-- SAMPLES ........................ -->
@@ -615,6 +698,7 @@ April 10, 2009
                 <sdk:url>samples-2.1_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Tue May 11 19:15:20 PDT 2010 using froyo 36658: Samples. -->
@@ -632,6 +716,7 @@ April 10, 2009
                 <sdk:url>samples-2.2_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Tue Nov 30 19:39:34 PST 2010 using gingerbread 79962: Samples. -->
@@ -650,6 +735,7 @@ April 10, 2009
                 <sdk:url>samples-2.3_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Tue Feb  8 17:37:15 PST 2011 using gingerbread 102121: Samples. -->
@@ -667,6 +753,7 @@ April 10, 2009
                 <sdk:url>samples-2.3.3_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Thu Feb 17 08:45:49 PST 2011 using honeycomb 104254: Samples. -->
@@ -684,6 +771,7 @@ April 10, 2009
                 <sdk:url>samples-3.0_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Wed May  4 19:49:56 PDT 2011 using honeycomb-mr1 123685: Samples. -->
@@ -701,6 +789,7 @@ April 10, 2009
                 <sdk:url>samples-3.1_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <!-- Generated on Fri Jul 15 11:52:24 PDT 2011 using honeycomb-mr2 142871: Samples. -->
@@ -718,6 +807,7 @@ April 10, 2009
                 <sdk:url>samples-3.2_r01-linux.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <sdk:sample>
@@ -731,6 +821,7 @@ April 10, 2009
                 <sdk:url>samples-14_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <sdk:sample>
@@ -744,6 +835,7 @@ April 10, 2009
                 <sdk:url>samples-15_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
     <sdk:sample>
@@ -757,132 +849,125 @@ April 10, 2009
                 <sdk:url>samples-16_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:sample>
 
-    <!-- PLATFORM-TOOLS ........................ -->
-
-    <sdk:platform-tool>
-        <!-- Generated at Thu Jul 19 18:38:34 2012 from git_jb-dev @ 407773 -->
-        <sdk:revision>
-            <sdk:major>14</sdk:major>
-        </sdk:revision>
+    <sdk:sample>
+        <!-- Generated at Mon Nov 12 17:18:09 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
         <sdk:archives>
-            <sdk:archive arch="any" os="windows">
-                <sdk:size>11159472</sdk:size>
-                <sdk:checksum type="sha1">6028258d8f2fba14d8b40c3cf507afa0289aaa13</sdk:checksum>
-                <sdk:url>platform-tools_r14-windows.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive arch="any" os="linux">
-                <sdk:size>10985068</sdk:size>
-                <sdk:checksum type="sha1">6e2bc329c9485eb383172cbc2cde8b0c0cd1843f</sdk:checksum>
-                <sdk:url>platform-tools_r14-linux.zip</sdk:url>
-            </sdk:archive>
-            <sdk:archive arch="any" os="macosx">
-                <sdk:size>11342461</sdk:size>
-                <sdk:checksum type="sha1">4a015090c6a209fc33972acdbc65745e0b3c08b9</sdk:checksum>
-                <sdk:url>platform-tools_r14-macosx.zip</sdk:url>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>14840030</sdk:size>
+                <sdk:checksum type="sha1">12d58cb26503610fc05bd7618c434cc6f983bc41</sdk:checksum>
+                <sdk:url>samples-17_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
-    </sdk:platform-tool>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- PLATFORM-TOOLS ........................ -->
 
     <sdk:platform-tool>
-        <!-- Generated at Wed Oct 17 15:42:13 2012 from git_jb-dev @ 505673 -->
+        <!-- Generated at Mon Nov 12 17:13:48 2012 from git_jb-mr1-dev @ 527242 -->
         <sdk:revision>
-            <sdk:major>15</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:major>16</sdk:major>
         </sdk:revision>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>11170483</sdk:size>
-                <sdk:checksum type="sha1">853afdf5f63aaac61dcfd016a7acb930b6dac377</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-windows.zip</sdk:url>
+                <sdk:size>11938435</sdk:size>
+                <sdk:checksum type="sha1">0d6245b685c7d303cf4a054a3d373c4427b7ad01</sdk:checksum>
+                <sdk:url>platform-tools_r16-windows.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="linux">
-                <sdk:size>10996592</sdk:size>
-                <sdk:checksum type="sha1">c1aa2bc0d6f7dac7e292151ee77752bbfb10d1c5</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-linux.zip</sdk:url>
+                <sdk:size>12676089</sdk:size>
+                <sdk:checksum type="sha1">84d563ae5e324f223f335f11bf511bf6207c05fb</sdk:checksum>
+                <sdk:url>platform-tools_r16-linux.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="macosx">
-                <sdk:size>11345162</sdk:size>
-                <sdk:checksum type="sha1">22ac626ec3526b606d358193a16df10179f1d4f5</sdk:checksum>
-                <sdk:url>platform-tools_r15_rc9-macosx.zip</sdk:url>
+                <sdk:size>13147351</sdk:size>
+                <sdk:checksum type="sha1">fbb0f8d2786a83b8c3eb6df402e706e136db8fed</sdk:checksum>
+                <sdk:url>platform-tools_r16-macosx.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:platform-tool>
 
     <!-- TOOLS ........................ -->
 
     <sdk:tool>
-        <!-- Generated at Thu Aug  9 13:16:38 2012 from git_tools_r20 @ 427395 -->
+        <!-- Generated at Mon Nov 12 17:07:47 2012 from git_tools_r21 @ 519525 -->
         <sdk:revision>
-            <sdk:major>20</sdk:major>
-            <sdk:minor>0</sdk:minor>
-            <sdk:micro>3</sdk:micro>
+            <sdk:major>21</sdk:major>
         </sdk:revision>
         <sdk:min-platform-tools-rev>
-            <sdk:major>12</sdk:major>
+            <sdk:major>16</sdk:major>
         </sdk:min-platform-tools-rev>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>90272048</sdk:size>
-                <sdk:checksum type="sha1">54fb94168e631e211910f88aa40c532205730dd4</sdk:checksum>
-                <sdk:url>tools_r20.0.3-windows.zip</sdk:url>
+                <sdk:size>98982670</sdk:size>
+                <sdk:checksum type="sha1">57bbfadcedbef44fc322e5e037666393668cf3fe</sdk:checksum>
+                <sdk:url>tools_r21-windows.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="linux">
-                <sdk:size>82723559</sdk:size>
-                <sdk:checksum type="sha1">09bc633b406ae81981e3a0db19426acbb01ef219</sdk:checksum>
-                <sdk:url>tools_r20.0.3-linux.zip</sdk:url>
+                <sdk:size>91495104</sdk:size>
+                <sdk:checksum type="sha1">013b9c04407a9d73b8bf3c574327fbe870acd264</sdk:checksum>
+                <sdk:url>tools_r21-linux.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="macosx">
-                <sdk:size>58197071</sdk:size>
-                <sdk:checksum type="sha1">09cee5ff3226277a6f0c07dcd29cba4ffc2e1da4</sdk:checksum>
-                <sdk:url>tools_r20.0.3-macosx.zip</sdk:url>
+                <sdk:size>65767130</sdk:size>
+                <sdk:checksum type="sha1">fcfa3a6932f2ed0d970a0ca959bb2b4972f7d46d</sdk:checksum>
+                <sdk:url>tools_r21-macosx.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:tool>
 
     <sdk:tool>
-        <!-- Generated at Wed Oct 17 15:40:42 2012 from git_mirror-aosp-master @ 506320 -->
+        <!-- Generated at Fri Nov 30 13:45:55 2012 from git_tools_r21 @ 539280 -->
         <sdk:revision>
             <sdk:major>21</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:minor>0</sdk:minor>
+            <sdk:micro>1</sdk:micro>
+            <sdk:preview>1</sdk:preview>
         </sdk:revision>
         <sdk:min-platform-tools-rev>
-            <sdk:major>15</sdk:major>
-            <sdk:preview>9</sdk:preview>
+            <sdk:major>16</sdk:major>
         </sdk:min-platform-tools-rev>
         <sdk:archives>
             <sdk:archive arch="any" os="windows">
-                <sdk:size>98865433</sdk:size>
-                <sdk:checksum type="sha1">a1379cef10f33e74061f6935fd74922b0351addb</sdk:checksum>
-                <sdk:url>tools_r21_rc9-windows.zip</sdk:url>
+                <sdk:size>98998088</sdk:size>
+                <sdk:checksum type="sha1">1503aaf2c91cb07c0240a2db3af0de027941a4f6</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-windows.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="linux">
-                <sdk:size>91377922</sdk:size>
-                <sdk:checksum type="sha1">dde958cb26276b632a02ca6d530506c09ce4e086</sdk:checksum>
-                <sdk:url>tools_r21_rc9-linux.zip</sdk:url>
+                <sdk:size>91510079</sdk:size>
+                <sdk:checksum type="sha1">183670a7f9878d8d3693d5fcf32e1357b69f0fed</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-linux.zip</sdk:url>
             </sdk:archive>
             <sdk:archive arch="any" os="macosx">
-                <sdk:size>65655657</sdk:size>
-                <sdk:checksum type="sha1">43803f6179707ca6bd4a37e129bcf022ebda0043</sdk:checksum>
-                <sdk:url>tools_r21_rc9-macosx.zip</sdk:url>
+                <sdk:size>65777178</sdk:size>
+                <sdk:checksum type="sha1">109d4f287904875f067e021be3fd1f549e6afb67</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-macosx.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:tool>
 
     <!-- DOCS ........................ -->
 
     <sdk:doc>
-        <!-- Generated at Tue Oct  9 14:08:23 2012 from git_jb-dev @ 495790 -->
-        <sdk:revision>3</sdk:revision>
-        <sdk:api-level>16</sdk:api-level>
+        <!-- Generated at Mon Nov 12 17:17:53 2012 from git_jb-mr1-dev @ 528390 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
         <sdk:archives>
             <sdk:archive arch="any" os="any">
-                <sdk:size>164244602</sdk:size>
-                <sdk:checksum type="sha1">3168152f52f5edc0c85523c875c96e7431ab4545</sdk:checksum>
-                <sdk:url>docs-16_r03.zip</sdk:url>
+                <sdk:size>171564393</sdk:size>
+                <sdk:checksum type="sha1">fb988cdd2beaac0dd47dc630821ccc30557c67e5</sdk:checksum>
+                <sdk:url>docs-17_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:doc>
 
     <!-- SOURCES ........................ -->
@@ -898,6 +983,7 @@ April 10, 2009
                 <sdk:url>sources-14_r01.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:source>
 
     <sdk:source>
@@ -911,6 +997,7 @@ April 10, 2009
                 <sdk:url>sources-15_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:source>
 
     <sdk:source>
@@ -924,5 +1011,20 @@ April 10, 2009
                 <sdk:url>sources-16_r02.zip</sdk:url>
             </sdk:archive>
         </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:source>
+
+    <sdk:source>
+        <!-- Generated at Mon Nov 12 17:16:08 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>18976816</sdk:size>
+                <sdk:checksum type="sha1">6f1f18cd2d2b1852d7f6892df9cee3823349d43a</sdk:checksum>
+                <sdk:url>sources-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
     </sdk:source>
-</sdk:sdk-repository>
\ No newline at end of file
+</sdk:sdk-repository>
diff --git a/pkgs/development/androidenv/support.nix b/pkgs/development/androidenv/support.nix
index 0c69bf37107..2e9690de7a2 100644
--- a/pkgs/development/androidenv/support.nix
+++ b/pkgs/development/androidenv/support.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
-  name = "android-support";
+  name = "android-support-r11";
   src = fetchurl {
-    url = https://dl-ssl.google.com/android/repository/support_r10.zip;
-    sha1 = "7c62e542d46ac3bdb89e1b90503d6afae557cf7d";
+    url = https://dl-ssl.google.com/android/repository/support_r11.zip;
+    sha1 = "d30d182d8e4c86bb4464c03a83ccffce7bc84ecd";
   };
   
   buildCommand = ''
diff --git a/pkgs/development/androidenv/sysimages.nix b/pkgs/development/androidenv/sysimages.nix
index 3add0c41444..b35b4298983 100644
--- a/pkgs/development/androidenv/sysimages.nix
+++ b/pkgs/development/androidenv/sysimages.nix
@@ -38,5 +38,13 @@ in
     };
   };
     
+  sysimg_17 = buildSystemImage {
+    name = "armeabi-v7a-17";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/sysimg_armv7a-17_r01.zip;
+      sha1 = "45b9344473e0a6d063c2b1fe58d8cd47d307905e";
+    };
+  };
+    
 }
-  
+  
\ No newline at end of file
diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix
new file mode 100644
index 00000000000..f1be290b190
--- /dev/null
+++ b/pkgs/development/arduino/arduino-core/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, jdk, jre, ant, coreutils, gnugrep }:
+
+stdenv.mkDerivation rec {
+
+  version = "1.0.2";
+  name = "arduino-core";
+
+  src = fetchurl {
+    url = "http://arduino.googlecode.com/files/arduino-${version}-src.tar.gz";
+    sha256 = "0nszl2hdjjgxk87gyk0xi0ww9grbq83hch3iqmpaf9yp4y9bra0x";
+  };
+
+  buildInputs = [ jdk ant ];
+
+  phases = "unpackPhase patchPhase buildPhase installPhase";
+
+  patchPhase = ''
+  #
+  '';
+
+  buildPhase = ''
+    cd ./core && ant 
+    cd ../build && ant 
+    cd ..
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/arduino
+    cp -r ./build/linux/work/hardware/ $out/share/arduino
+    cp -r ./build/linux/work/libraries/ $out/share/arduino
+    cp -r ./build/linux/work/tools/ $out/share/arduino
+    cp -r ./build/linux/work/lib/ $out/share/arduino
+    echo ${version} > $out/share/arduino/lib/version.txt
+  '';
+
+  meta = {
+    description = "Arduino libraries";
+    homepage = http://arduino.cc/;
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  }; 
+}
diff --git a/pkgs/development/arduino/ino/default.nix b/pkgs/development/arduino/ino/default.nix
new file mode 100644
index 00000000000..6b88a8deaea
--- /dev/null
+++ b/pkgs/development/arduino/ino/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, buildPythonPackage, minicom, avrdude, arduino_core, avrgcclibc }:
+
+buildPythonPackage {
+  name = "ino-0.3.4";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/i/ino/ino-0.3.4.tar.gz";
+    sha256 = "1v7z3da31cv212k28aci269qkg92p377fm7i76rymjjpjra7payv";
+  };
+
+  # TODO: add avrgcclibc, it must be rebuild with C++ support
+  propagatedBuildInputs = [ minicom avrdude arduino_core ];
+
+  patchPhase = ''
+    echo "Patching Arduino distribution path"
+    sed -i 's@/usr/local/share/arduino@${arduino_core}/share/arduino@g' ino/environment.py
+  '';
+ 
+  doCheck = false;
+
+  meta = {
+    description = "Command line toolkit for working with Arduino hardware";
+    homepage = http://inotool.org/;
+    license = "MIT";
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  };
+}
diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix
index e3dfd4711a1..8b1e1529095 100644
--- a/pkgs/development/interpreters/lua-5/5.1.nix
+++ b/pkgs/development/interpreters/lua-5/5.1.nix
@@ -1,5 +1,12 @@
 { stdenv, fetchurl, readline}:
 
+let
+  dsoPatch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51";
+    sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw";
+    name = "lua-arch.patch";
+  };
+in
 stdenv.mkDerivation rec {
   name = "lua-5.1.5";
 
@@ -10,7 +17,19 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ readline ];
 
-  configurePhase = "makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux )";
+  patches = [ dsoPatch ];
+
+  configurePhase = ''
+    makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-O2 -fPIC" LDLAGS="-fPIC" )
+    installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.5.1" INSTALL_DATA='cp -d' )
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/share/doc/lua" "$out/lib/pkgconfig"
+    mv "etc/lua.pc" "$out/lib/pkgconfig/"
+    mv "doc/"*.{gif,png,css,html} "$out/share/doc/lua/"
+    rmdir $out/{share,lib}/lua/5.1 $out/{share,lib}/lua
+  '';
 
   meta = {
     homepage = "http://www.lua.org";
@@ -25,6 +44,6 @@ stdenv.mkDerivation rec {
     '';
     license = "MIT";
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/development/libraries/haskell/Boolean/default.nix b/pkgs/development/libraries/haskell/Boolean/default.nix
index 45661b815b1..4503c0fec54 100644
--- a/pkgs/development/libraries/haskell/Boolean/default.nix
+++ b/pkgs/development/libraries/haskell/Boolean/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Boolean";
-  version = "0.1.1";
-  sha256 = "1id075slxgz67gv382vpr7cr19i59bjajvb60iv2xrhh73gp08yv";
+  version = "0.1.2";
+  sha256 = "07mhg9zf98hlm7qq9gdbrq68a8rpvdby1jwmgrvf3nv2k47dimx6";
   meta = {
     description = "Generalized booleans";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/bloomfilter/default.nix b/pkgs/development/libraries/haskell/bloomfilter/default.nix
index 2545c3f4f40..7c8c2d34849 100644
--- a/pkgs/development/libraries/haskell/bloomfilter/default.nix
+++ b/pkgs/development/libraries/haskell/bloomfilter/default.nix
@@ -3,7 +3,7 @@
 cabal.mkDerivation (self: {
   pname = "bloomfilter";
   version = "1.2.6.10";
-  sha256 = "1z2jc7588fkv42dxf0dxsrgk5pmj3xapshy1vyfwipp1q6y20x4j";
+  sha256 = "162vp9riwf5q2l1hnw3g157fpwnw185fk41hkgyf8qaavcrz6slv";
   buildDepends = [ deepseq ];
   meta = {
     homepage = "https://github.com/bos/bloomfilter";
diff --git a/pkgs/development/libraries/haskell/bmp/1.2.3.2.nix b/pkgs/development/libraries/haskell/bmp/1.2.3.4.nix
index 64c13f15ee1..404229cf763 100644
--- a/pkgs/development/libraries/haskell/bmp/1.2.3.2.nix
+++ b/pkgs/development/libraries/haskell/bmp/1.2.3.4.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "bmp";
-  version = "1.2.3.2";
-  sha256 = "0lr6ys15ap3myzv48xmcy0bv17s4x2drskqz3kmbp06knrx9y1bh";
+  version = "1.2.3.4";
+  sha256 = "134nfchsw4q1k3kr09i5w8jxbr659as4523gs5m2dch15wrmrhf6";
   buildDepends = [ binary ];
   meta = {
     homepage = "http://code.ouroborus.net/bmp";
diff --git a/pkgs/development/libraries/haskell/configurator/default.nix b/pkgs/development/libraries/haskell/configurator/default.nix
index 3618f598055..775c2e5027f 100644
--- a/pkgs/development/libraries/haskell/configurator/default.nix
+++ b/pkgs/development/libraries/haskell/configurator/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "configurator";
-  version = "0.2.0.1";
-  sha256 = "02w6f5q2xkpc3kgqz6a58g7yr0q4xd8ck1b6lr64ahvqwsjbxy6p";
+  version = "0.2.0.2";
+  sha256 = "011rgd48gv4idkh2dwg4mlyx3s6pgm1263xq5ixsa4sg3jqh9d8b";
   buildDepends = [
     attoparsec hashable text unixCompat unorderedContainers
   ];
diff --git a/pkgs/development/libraries/haskell/cryptohash/default.nix b/pkgs/development/libraries/haskell/cryptohash/default.nix
index e0724e49ccb..61f2f2a050d 100644
--- a/pkgs/development/libraries/haskell/cryptohash/default.nix
+++ b/pkgs/development/libraries/haskell/cryptohash/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cryptohash";
-  version = "0.8.1";
-  sha256 = "1xxnmxfpd77ahyjhy2fq3fxhiivhj6k12v1z72ndyhrd3369zqky";
+  version = "0.8.2";
+  sha256 = "0mym1q5sa1pqfffy0p8v12lfim1dlaczppw3c3wjhxgs222303wj";
   buildDepends = [ cereal cryptoApi tagged ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cryptohash";
diff --git a/pkgs/development/libraries/haskell/diagrams/contrib.nix b/pkgs/development/libraries/haskell/diagrams/contrib.nix
index b31af6bd383..c646c5e3943 100644
--- a/pkgs/development/libraries/haskell/diagrams/contrib.nix
+++ b/pkgs/development/libraries/haskell/diagrams/contrib.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "diagrams-contrib";
-  version = "0.6";
-  sha256 = "059ljwsbrkzj2wvx9q4viinz46nw5lf4yjmx2c1dmwaqfz3i7j7i";
+  version = "0.6.0.1";
+  sha256 = "1wrfdsfb2yj93wq2ykxjyg6g0q56bmxd2rc6r3gd0zcs8kiimaar";
   buildDepends = [
     colour dataDefault diagramsLib forceLayout lens mtl vectorSpace
   ];
diff --git a/pkgs/development/libraries/haskell/hashable/default.nix b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
index 96fe7ae0eb1..96fe7ae0eb1 100644
--- a/pkgs/development/libraries/haskell/hashable/default.nix
+++ b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
diff --git a/pkgs/development/libraries/haskell/hashable/1.2.0.2.nix b/pkgs/development/libraries/haskell/hashable/1.2.0.2.nix
new file mode 100644
index 00000000000..10f9c0ec620
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hashable/1.2.0.2.nix
@@ -0,0 +1,15 @@
+{ cabal, text }:
+
+cabal.mkDerivation (self: {
+  pname = "hashable";
+  version = "1.2.0.2";
+  sha256 = "1l827sh7v2jls2gcbxgbvz5hacwi43bcrxwmd3wp92hfwy1yza65";
+  buildDepends = [ text ];
+  meta = {
+    homepage = "http://github.com/tibbe/hashable";
+    description = "A class for types that can be converted to a hash value";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/heist/default.nix b/pkgs/development/libraries/haskell/heist/default.nix
index 6a6d0d7ddf3..4191536407e 100644
--- a/pkgs/development/libraries/haskell/heist/default.nix
+++ b/pkgs/development/libraries/haskell/heist/default.nix
@@ -12,6 +12,7 @@ cabal.mkDerivation (self: {
     filepath hashable MonadCatchIOTransformers mtl random text time
     unorderedContainers vector xmlhtml
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://snapframework.com/";
     description = "An Haskell template system supporting both HTML5 and XML";
diff --git a/pkgs/development/libraries/haskell/hsemail/default.nix b/pkgs/development/libraries/haskell/hsemail/default.nix
index f69789772ac..ac22e94abb8 100644
--- a/pkgs/development/libraries/haskell/hsemail/default.nix
+++ b/pkgs/development/libraries/haskell/hsemail/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hsemail";
-  version = "1.7.2";
-  sha256 = "1bl017gfyvjvxs9z1fns6sknk1l55905r82i31aqbz9qyaj70gzx";
+  version = "1.7.3";
+  sha256 = "0i9qh4rbgcgpjiz7nj8rrmj0ai53s420dskfvwrbwl4j6z67f7la";
   buildDepends = [ mtl parsec ];
   meta = {
     homepage = "http://gitorious.org/hsemail";
diff --git a/pkgs/development/libraries/haskell/hslogger-template/default.nix b/pkgs/development/libraries/haskell/hslogger-template/default.nix
index a7b1a51b705..be78bea938c 100644
--- a/pkgs/development/libraries/haskell/hslogger-template/default.nix
+++ b/pkgs/development/libraries/haskell/hslogger-template/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hslogger-template";
-  version = "2.0.1";
-  sha256 = "1m8h4i8cxxw83vhbw61njvv86qdcff6zi3bf0nyhc4cq7pfrzqvj";
+  version = "2.0.2";
+  sha256 = "0qkyclj9fajvzbfcs0ik8ncy66x916r40jd85r4wi5nh482i7sp3";
   buildDepends = [ hslogger mtl ];
   meta = {
     description = "Automatic generation of hslogger functions";
diff --git a/pkgs/development/libraries/haskell/http-conduit/default.nix b/pkgs/development/libraries/haskell/http-conduit/default.nix
index b0755946eef..e467d572f9d 100644
--- a/pkgs/development/libraries/haskell/http-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/http-conduit/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "http-conduit";
-  version = "1.8.5.1";
-  sha256 = "1v70rslnga063mlpfs1w03y1s4x7kfisjqwbcbczynhz15s9hymx";
+  version = "1.8.5.2";
+  sha256 = "0c1a6iknvi34sh97j7cfzwyikcz0kdz4vgsc47lr7c2a75gl0via";
   buildDepends = [
     asn1Data attoparsec attoparsecConduit base64Bytestring blazeBuilder
     blazeBuilderConduit caseInsensitive certificate conduit cookie
diff --git a/pkgs/development/libraries/haskell/lens/default.nix b/pkgs/development/libraries/haskell/lens/default.nix
index 6a2ca0866b7..dd9966a0d58 100644
--- a/pkgs/development/libraries/haskell/lens/default.nix
+++ b/pkgs/development/libraries/haskell/lens/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "lens";
-  version = "3.7.1";
-  sha256 = "16rgfv21f7sl7n6gqn4750i3yv7w972ybn883yr474y4xwhhyh6w";
+  version = "3.7.1.2";
+  sha256 = "1hapcnmyqyc3645gsy1ikwzm2srbbznps6yrfr02y2lcbnjpn3g6";
   buildDepends = [
     comonad comonadsFd comonadTransformers filepath hashable mtl
     parallel semigroups split text transformers unorderedContainers
diff --git a/pkgs/development/libraries/haskell/mime-types/default.nix b/pkgs/development/libraries/haskell/mime-types/default.nix
index 8359d6dc181..75eb11e6a12 100644
--- a/pkgs/development/libraries/haskell/mime-types/default.nix
+++ b/pkgs/development/libraries/haskell/mime-types/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "mime-types";
-  version = "0.1.0.0";
-  sha256 = "0xc36pr84nszyych3jd8sl6kj1grsyv8ci8v7ilrbpnw7ngbkw1p";
+  version = "0.1.0.1";
+  sha256 = "1a34ckmv8qcyk38jydxwph59zcrhnwaah1h6pzn112kysjqjgcsl";
   buildDepends = [ text ];
   meta = {
     homepage = "https://github.com/yesodweb/wai";
diff --git a/pkgs/development/libraries/haskell/network-conduit/default.nix b/pkgs/development/libraries/haskell/network-conduit/default.nix
index 8eff213c463..1b2187daaaf 100644
--- a/pkgs/development/libraries/haskell/network-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/network-conduit/default.nix
@@ -3,8 +3,8 @@
 
 cabal.mkDerivation (self: {
   pname = "network-conduit";
-  version = "0.6.2";
-  sha256 = "1v9f2x4ryqiwird60n4rkj0jlyn3lqkfs40956xi11r7p656l6q6";
+  version = "0.6.2.1";
+  sha256 = "1pkqkkj18yn31dmxcc8xfq2drg2jm9169my0s3jsxjbyxsyq58l6";
   buildDepends = [
     conduit liftedBase monadControl network transformers
   ];
diff --git a/pkgs/development/libraries/haskell/optparse-applicative/default.nix b/pkgs/development/libraries/haskell/optparse-applicative/default.nix
index 3af9dd248cb..3e04a33990e 100644
--- a/pkgs/development/libraries/haskell/optparse-applicative/default.nix
+++ b/pkgs/development/libraries/haskell/optparse-applicative/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "optparse-applicative";
-  version = "0.4.3";
-  sha256 = "1zsydxgq3lcgzrf9iwas3gkjy0vxn4z2cj6h3m63h0qqa26sfcwz";
+  version = "0.5.2.1";
+  sha256 = "0w4mk851mx8dch8lnck0g82asmzrsc47xrf34jygh0f6v4kbj40i";
   buildDepends = [ transformers ];
   meta = {
     homepage = "https://github.com/pcapriotti/optparse-applicative";
diff --git a/pkgs/development/libraries/haskell/parallel-io/default.nix b/pkgs/development/libraries/haskell/parallel-io/default.nix
index 0672a01f361..56c1a130696 100644
--- a/pkgs/development/libraries/haskell/parallel-io/default.nix
+++ b/pkgs/development/libraries/haskell/parallel-io/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "parallel-io";
-  version = "0.3.2.2";
-  sha256 = "04swl1mp704ijrpmvw800x0fpzmrbd382p45kvqzynmkgqzx33a3";
+  version = "0.3.3";
+  sha256 = "0i86x3bf8pjlg6mdg1zg5lcrjpg75pbqs2mrgrbp4z4bkcmw051s";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ extensibleExceptions random ];
diff --git a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
index 8731a83ac89..e09a9b8d161 100644
--- a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-postgresql";
-  version = "1.1.1";
-  sha256 = "19ywyf0d7n6z8ws7s7jc958g30aiy6il43qwvqh92q1cz8bd1mj9";
+  version = "1.1.2";
+  sha256 = "06ylfijm59akdzb6kd0qs5kw3qyn5ig7q9wbj0a8sgkf8hs2mmad";
   buildDepends = [
     aeson conduit monadControl persistent postgresqlLibpq
     postgresqlSimple text time transformers
diff --git a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
index 1e03cfdb036..2da2c06a243 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.0";
-  sha256 = "0ycs8qb8vksnypzpxi0ypxk7akl68hdwyxzkbchyy6zh3zv2pa4z";
+  version = "1.1.2";
+  sha256 = "0pb52k7a7js71s4d2mynd62i8gk99az7y72rycs0xg9r9cr081p3";
   buildDepends = [
     aeson conduit monadControl persistent text transformers
   ];
diff --git a/pkgs/development/libraries/haskell/persistent-template/default.nix b/pkgs/development/libraries/haskell/persistent-template/default.nix
index 8bdf010215b..f19a38a55f0 100644
--- a/pkgs/development/libraries/haskell/persistent-template/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-template/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent-template";
-  version = "1.1.1";
-  sha256 = "18rxjqgmjzx0j0sbg9ms779pkq264vf8w0qz679xsyn98wc95i36";
+  version = "1.1.2";
+  sha256 = "1hz8cxx2a84c93x364vgahmv4xd3cbpjx4j7si5n0pasyq3clbvr";
   buildDepends = [ aeson monadControl persistent text transformers ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
diff --git a/pkgs/development/libraries/haskell/persistent/default.nix b/pkgs/development/libraries/haskell/persistent/default.nix
index 45b1da1ca79..817047fd5c0 100644
--- a/pkgs/development/libraries/haskell/persistent/default.nix
+++ b/pkgs/development/libraries/haskell/persistent/default.nix
@@ -6,8 +6,8 @@
 
 cabal.mkDerivation (self: {
   pname = "persistent";
-  version = "1.1.0.1";
-  sha256 = "07b9d9fcah3k03r2pm6mfl3qsdp4s9gbb376by3122nvc26w6sjc";
+  version = "1.1.2";
+  sha256 = "1khzbmdw3ham8ig58srvcdsz4j5r9mg2s2ackm1f40851fa0642r";
   buildDepends = [
     aeson attoparsec base64Bytestring blazeHtml blazeMarkup conduit
     liftedBase monadControl monadLogger pathPieces poolConduit
diff --git a/pkgs/development/libraries/haskell/pretty-show/default.nix b/pkgs/development/libraries/haskell/pretty-show/default.nix
index 577848ab459..791d8c59b74 100644
--- a/pkgs/development/libraries/haskell/pretty-show/default.nix
+++ b/pkgs/development/libraries/haskell/pretty-show/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pretty-show";
-  version = "1.2";
-  sha256 = "0lbalmyrqisgd2spbvzifsy25lr6cl9sgz78hav8q8r406k7nf2l";
+  version = "1.3.2";
+  sha256 = "0m3kw4d68gd1mhlgi5vy3k2cqi9f0i4s502m2sgy4pww45fjllxy";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ haskellLexer ];
diff --git a/pkgs/development/libraries/haskell/semigroups/default.nix b/pkgs/development/libraries/haskell/semigroups/default.nix
index 240062493e3..1a412aec908 100644
--- a/pkgs/development/libraries/haskell/semigroups/default.nix
+++ b/pkgs/development/libraries/haskell/semigroups/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "semigroups";
-  version = "0.8.4.1";
-  sha256 = "05wv5amgg3nqr1if936zl330sv1k4i9p8xzdmgxsmchp4lshyr6n";
+  version = "0.8.5";
+  sha256 = "0dnxqqxfyxj0mpy524nvgwagsp6ynadmh2yr4k5159rzbg2xgz90";
   meta = {
     homepage = "http://github.com/ekmett/semigroups/";
     description = "Haskell 98 semigroups";
diff --git a/pkgs/development/libraries/haskell/shelly/default.nix b/pkgs/development/libraries/haskell/shelly/default.nix
index 41953629e0b..a0ae240f671 100644
--- a/pkgs/development/libraries/haskell/shelly/default.nix
+++ b/pkgs/development/libraries/haskell/shelly/default.nix
@@ -3,8 +3,8 @@
 
 cabal.mkDerivation (self: {
   pname = "shelly";
-  version = "0.15.0";
-  sha256 = "138x2c76ynv0kl0kg86pawnnlk6973dqkaapycb30rf44p1m53j2";
+  version = "0.15.3.3";
+  sha256 = "0g062rzpcksnszcjln9z39lw9cd084k0zs9pbr23s1985xkf6cj7";
   buildDepends = [
     mtl systemFileio systemFilepath text time unixCompat
   ];
diff --git a/pkgs/development/libraries/haskell/snap/snap.nix b/pkgs/development/libraries/haskell/snap/snap.nix
index f2a90a5802c..30a2d34a99e 100644
--- a/pkgs/development/libraries/haskell/snap/snap.nix
+++ b/pkgs/development/libraries/haskell/snap/snap.nix
@@ -19,6 +19,7 @@ cabal.mkDerivation (self: {
     snapCore snapServer stm syb text time transformers
     unorderedContainers vector vectorAlgorithms xmlhtml
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://snapframework.com/";
     description = "Top-level package for the Snap Web Framework";
diff --git a/pkgs/development/libraries/haskell/strptime/default.nix b/pkgs/development/libraries/haskell/strptime/default.nix
index bb30fe71cc3..c092f0c0d15 100644
--- a/pkgs/development/libraries/haskell/strptime/default.nix
+++ b/pkgs/development/libraries/haskell/strptime/default.nix
@@ -1,10 +1,10 @@
-{ cabal, time }:
+{ cabal, text, time }:
 
 cabal.mkDerivation (self: {
   pname = "strptime";
-  version = "1.0.8";
-  sha256 = "0cd4wzrg9zpnwrfpp6lxs1ib06h0fcsdqd3idsw663wr5lllfgdq";
-  buildDepends = [ time ];
+  version = "1.0.10";
+  sha256 = "1f42yf49fqr2fyjfakscmmlnmw3w5rg7wyy6gjyrf0gcgsh0h9fd";
+  buildDepends = [ text time ];
   meta = {
     description = "Efficient parsing of LocalTime using a binding to C's strptime, with some extra features (i.e. fractional seconds)";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/tls/default.nix b/pkgs/development/libraries/haskell/tls/default.nix
index 72466f5d8e8..fbd20bebdf1 100644
--- a/pkgs/development/libraries/haskell/tls/default.nix
+++ b/pkgs/development/libraries/haskell/tls/default.nix
@@ -11,6 +11,7 @@ cabal.mkDerivation (self: {
   buildDepends = [
     cereal certificate cryptoApi cryptocipher cryptohash mtl network
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://github.com/vincenthz/hs-tls";
     description = "TLS/SSL protocol native implementation (Server and Client)";
diff --git a/pkgs/development/libraries/haskell/unix-compat/default.nix b/pkgs/development/libraries/haskell/unix-compat/default.nix
index 7c5cb6c63c4..58276420481 100644
--- a/pkgs/development/libraries/haskell/unix-compat/default.nix
+++ b/pkgs/development/libraries/haskell/unix-compat/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "unix-compat";
-  version = "0.4.0.0";
-  sha256 = "0xhhvqdjcmcyavf0g2q2sjghj2h4si1ijg4nc4s8kidbd957z9r8";
+  version = "0.4.1.0";
+  sha256 = "155m3zg692zbfyck4njx1vzvb5vgs0dkzyzlqf2x78ds6j9bzjzi";
   meta = {
     homepage = "http://github.com/jystic/unix-compat";
     description = "Portable POSIX-compatibility layer";
diff --git a/pkgs/development/libraries/haskell/vault/default.nix b/pkgs/development/libraries/haskell/vault/default.nix
index 39802793103..6039e742477 100644
--- a/pkgs/development/libraries/haskell/vault/default.nix
+++ b/pkgs/development/libraries/haskell/vault/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vault";
-  version = "0.2.0.3";
-  sha256 = "1ky7c5hg7spa545xhgs4ahf07w60k3x149087mla1dxl8lpcz70i";
+  version = "0.2.0.4";
+  sha256 = "1a63rarksp4waj64b9kv8q77wbhdnsnxahkixl1klp25hkp8aan3";
   buildDepends = [ hashable unorderedContainers ];
   meta = {
     homepage = "https://github.com/HeinrichApfelmus/vault";
diff --git a/pkgs/development/libraries/haskell/yaml/default.nix b/pkgs/development/libraries/haskell/yaml/default.nix
index 0271f6874f3..6ab227a205d 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.1.1";
-  sha256 = "0n2m205f0jq8v4g84bw642vdqqr68m3jklv98rr21s8r2fyy7937";
+  version = "0.8.1.2";
+  sha256 = "1prk1nxzb84svqr552pgrfxg8kd34zvnh35js8l0q58y9rifxyq0";
   buildDepends = [
     aeson attoparsec conduit resourcet text transformers
     unorderedContainers vector
diff --git a/pkgs/development/libraries/haskell/yesod-auth/default.nix b/pkgs/development/libraries/haskell/yesod-auth/default.nix
index 7d4d208a9f5..dfa96bf2b13 100644
--- a/pkgs/development/libraries/haskell/yesod-auth/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-auth/default.nix
@@ -8,8 +8,8 @@
 
 cabal.mkDerivation (self: {
   pname = "yesod-auth";
-  version = "1.1.2.2";
-  sha256 = "16g2lnnwp5219i77fb4pv2y8ljz4msflj38mvh0zw3x93747baf7";
+  version = "1.1.3";
+  sha256 = "0rlp56jsb0cwm1z303b7l9iy5hbip18vlm7fisna4agbf4rj2k0z";
   buildDepends = [
     aeson authenticate blazeHtml blazeMarkup hamlet httpConduit
     liftedBase mimeMail network persistent persistentTemplate pureMD5
diff --git a/pkgs/development/libraries/haskell/yesod-form/default.nix b/pkgs/development/libraries/haskell/yesod-form/default.nix
index 69ef6b1f492..2d0a099002c 100644
--- a/pkgs/development/libraries/haskell/yesod-form/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-form/default.nix
@@ -14,7 +14,6 @@ cabal.mkDerivation (self: {
     shakespeareJs text time transformers wai xssSanitize yesodCore
     yesodPersistent
   ];
-  noHaddock = true;
   meta = {
     homepage = "http://www.yesodweb.com/";
     description = "Form handling support for Yesod Web Framework";
diff --git a/pkgs/development/libraries/haskell/yesod/default.nix b/pkgs/development/libraries/haskell/yesod/default.nix
index 72f19e5a5c2..717bba2853c 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.7";
-  sha256 = "1qcvmy8ichri9ivfkanj4gp687lwymgi170sbdzwf5phy34bhkc5";
+  version = "1.1.7.1";
+  sha256 = "01sic3s3mwn67das6cffvndpf4c6n612hd183bvw4a80h7mbaqxz";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
index 44b04397c3f..4db350f93b5 100644
--- a/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
+++ b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zeromq3-haskell";
-  version = "0.1.4";
-  sha256 = "026b18ligbrfbg4x7vivk6r2gj9rj3vy6pm3h0s81571h6lk3dhx";
+  version = "0.2";
+  sha256 = "12qljfkcd4l9h3l80jibxgw2an6v782w0sxwvzxqmma29jv6hvky";
   extraLibraries = [ zeromq ];
   meta = {
     homepage = "http://github.com/twittner/zeromq-haskell/";
diff --git a/pkgs/development/libraries/libxtc_dxtn/default.nix b/pkgs/development/libraries/libxtc_dxtn/default.nix
new file mode 100644
index 00000000000..0e7442633d7
--- /dev/null
+++ b/pkgs/development/libraries/libxtc_dxtn/default.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, mesa }:
+
+stdenv.mkDerivation rec {
+  name = "libtxc_dxtn-1.0.1";
+
+  src = fetchurl {
+    url = "people.freedesktop.org/~cbrill/libtxc_dxtn/${name}.tar.bz2";
+    sha256 = "0q5fjaknl7s0z206dd8nzk9bdh8g4p23bz7784zrllnarl90saa5";
+  };
+
+  postUnpack = ''
+    tar xf ${mesa.src} --wildcards '*/include/'
+    export NIX_CFLAGS_COMPILE="-I $NIX_BUILD_TOP/[mM]esa*/include"
+  '';
+}
diff --git a/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix b/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
index 83e800faa2c..3c28ed04dba 100644
--- a/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
+++ b/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
@@ -6,13 +6,18 @@ stdenv.mkDerivation {
   name = "avr-gcc-libc";
 
   srcBinutils = fetchurl {
-    url = "mirror://gnu/binutils/binutils-2.21.tar.bz2";
-    sha256 = "1iyhc42zfa0j2gaxy4zvpk47sdqj4rqvib0mb8597ss8yidyrav0";
+    url = "mirror://gnu/binutils/binutils-2.21.1.tar.bz2";
+    sha256 = "0m7nmd7gc9d9md43wbrv65hz6lbi2crqwryzpigv19ray1lzmv6d";
   };
 
   srcGCC = fetchurl {
-    url = "mirror://gcc/releases/gcc-4.6.1/gcc-core-4.6.1.tar.bz2";
-    sha256 = "0bbb8f754a31f29013f6e9ad4c755d92bb0f154a665c4b623e86ae7174d98e33";
+    url = "mirror://gcc/releases/gcc-4.6.3/gcc-core-4.6.3.tar.bz2";
+    sha256 = "1hai090f0svf886nyhn4glmfw54v9lz88w2izkx5iqhd3j400gi8";
+  };
+
+  srcGCCGPP = fetchurl {
+    url = "mirror://gcc/releases/gcc-4.6.3/gcc-g++-4.6.3.tar.bz2";
+    sha256 = "1s199gb6p65r5k69cdfqqcz5hgifw9bhyj65n2b91s80x4rwgq5k";
   };
 
   srcAVRLibc = fetchurl {
@@ -55,10 +60,11 @@ stdenv.mkDerivation {
 
     cd $TMP
     tar jxf $srcGCC
+    tar jxf $srcGCCGPP
       cd gcc-*
       mkdir obj-avr
       cd obj-avr
-      ../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c --disable-libssp --with-dwarf2
+      ../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c,c++ --disable-libssp --with-dwarf2
       make $MAKE_FLAGS
       make install
 
diff --git a/pkgs/development/tools/haskell/splot/default.nix b/pkgs/development/tools/haskell/splot/default.nix
index 9f35054b4c0..dcab346aab5 100644
--- a/pkgs/development/tools/haskell/splot/default.nix
+++ b/pkgs/development/tools/haskell/splot/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "splot";
-  version = "0.3.6";
-  sha256 = "0fxjji6b0v3hf4pn1cbh88nvp4n4bfgfkiga6l149flk5nmlapqx";
+  version = "0.3.7";
+  sha256 = "0mal7zphwzycxm2i0v87vn6gvdb582zy51prngj4w11xgpxd7dg1";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/timeplot/default.nix b/pkgs/development/tools/haskell/timeplot/default.nix
index ffdfa7869e0..d95c8cea03f 100644
--- a/pkgs/development/tools/haskell/timeplot/default.nix
+++ b/pkgs/development/tools/haskell/timeplot/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "timeplot";
-  version = "1.0.18";
-  sha256 = "1q4kzzqmr7bx97wfaasrkzii6b9zpxcxggshpsjv02bwb1hazxmc";
+  version = "1.0.19";
+  sha256 = "1mwhrcjavx56z3msdf5zqvqlx5m3hbcw85f22h8p9wvfgn79aydx";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix
index a46c7a695f2..565d7835f05 100644
--- a/pkgs/development/tools/misc/distcc/default.nix
+++ b/pkgs/development/tools/misc/distcc/default.nix
@@ -1,46 +1,77 @@
-{ stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk
+{ stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk, runCommand, gcc
 , sysconfDir ? ""   # set this parameter to override the default value $out/etc
 , static ? false
 }:
 
-let name    = "distcc";
-    version = "3.1";
-in
+let
+  name    = "distcc";
+  version = "3.1";
+  distcc = stdenv.mkDerivation {
+    name = "${name}-${version}";
+    src = fetchurl {
+      url = "http://distcc.googlecode.com/files/${name}-${version}.tar.bz2";
+      sha256 = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89";
+    };
 
-stdenv.mkDerivation {
-  name = "${name}-${version}";
-  src = fetchurl {
-    url = "http://distcc.googlecode.com/files/${name}-${version}.tar.bz2";
-    sha256 = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89";
-  };
+    buildInputs = [popt avahi pkgconfig python gtk];
+    preConfigure =
+    ''
+      configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
+                            CXXFLAGS="-O2 -fno-strict-aliasing"
+          --mandir=$out/share/man
+                            ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
+                            ${if static then "LDFLAGS=-static" else ""}
+                            --with${if static == true || popt == null then "" else "out"}-included-popt
+                            --with${if avahi != null then "" else "out"}-avahi
+                            --with${if gtk != null then "" else "out"}-gtk
+                            --without-gnome
+                            --enable-rfc2553
+                            --disable-Werror   # a must on gcc 4.6
+                           )
+      installFlags="sysconfdir=$out/etc";
+    '';
+    patches = [ ./20-minute-io-timeout.patch ];
 
-  buildInputs = [popt avahi pkgconfig python gtk];
-  preConfigure =
-  ''
-    configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
-                          CXXFLAGS="-O2 -fno-strict-aliasing"
-			  --mandir=$out/share/man
-                          ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
-                          ${if static then "LDFLAGS=-static" else ""}
-                          --with${if static == true || popt == null then "" else "out"}-included-popt
-                          --with${if avahi != null then "" else "out"}-avahi
-                          --with${if gtk != null then "" else "out"}-gtk
-                          --without-gnome
-                          --enable-rfc2553
-                         )
-    installFlags="sysconfdir=$out/etc";
-  '';
-  patches = [ ./20-minute-io-timeout.patch ];
+    # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
+    doCheck = false;
 
-  # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
-  doCheck = false;
+    passthru = {
+      # A derivation that provides gcc and g++ commands, but that
+      # will end up calling distcc for the given cacheDir
+      #
+      # extraConfig is meant to be sh lines exporting environment
+      # variables like DISTCC_HOSTS, DISTCC_DIR, ...
+      links = extraConfig : (runCommand "distcc-links"
+          { inherit (gcc) langC langCC; }
+        ''
+          mkdir -p $out/bin
+          if [ $langC -eq 1 ]; then
+            cat > $out/bin/gcc << EOF
+            #!/bin/sh
+            ${extraConfig}
+            exec ${distcc}/bin/distcc gcc "\$@"
+          EOF
+            chmod +x $out/bin/gcc
+          fi
+          if [ $langCC -eq 1 ]; then
+            cat > $out/bin/g++ << EOF
+            #!/bin/sh
+            ${extraConfig}
+            exec ${distcc}/bin/distcc g++ "\$@"
+          EOF
+            chmod +x $out/bin/g++
+          fi
+        '');
+    };
 
-  meta = {
-    description = "a fast, free distributed C/C++ compiler";
-    homepage = "http://distcc.org";
-    license = "GPL";
+    meta = {
+      description = "a fast, free distributed C/C++ compiler";
+      homepage = "http://distcc.org";
+      license = "GPL";
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+      platforms = stdenv.lib.platforms.linux;
+      maintainers = [ stdenv.lib.maintainers.simons ];
+    };
   };
-}
+in
+  distcc
diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix
new file mode 100644
index 00000000000..117480670c3
--- /dev/null
+++ b/pkgs/development/tools/misc/distcc/masq.nix
@@ -0,0 +1,41 @@
+{ stdenv, gccRaw, binutils }:
+
+stdenv.mkDerivation {
+  name = "distcc-masq-${gccRaw.name}";
+
+  phases = [ "installPhase" ];
+  installPhase = ''
+    ensureDir $out/bin
+
+    bin=${gccRaw}/bin
+
+    shopt -s nullglob
+    if [ -f $bin/gcc ]; then
+      ln -s $bin/gcc $out/bin
+    else
+      for a in $bin/*-gcc; do
+        ln -s $bin/*-gcc $out/bin/gcc
+        ln -s $bin/*-gcc $out/bin/cc
+      done
+    fi
+
+    if [ -f $bin/g++ ]; then
+      ln -s $bin/g++ $out/bin
+    else
+      for a in $bin/*-g++; do
+        ln -sf $bin/*-g++ $out/bin/g++
+        ln -sf $bin/*-g++ $out/bin/c++
+      done
+    fi
+
+    bbin=${binutils}/bin
+    if [ -f $bbin/as ]; then
+      ln -s $bbin/as $out/bin
+    else
+      for a in $bbin/*-as; do
+        ln -sf $bbin/*-as $out/bin/as
+      done
+    fi
+    
+  '';
+}
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix
index 38ae7b43630..6bc2e0f1ecb 100644
--- a/pkgs/lib/types.nix
+++ b/pkgs/lib/types.nix
@@ -176,6 +176,20 @@ rec {
       fold = op: nul: v: if v == null then nul else elemType.fold op nul v;
     };
 
+    functionTo = elemType: mkOptionType {
+      name = "function that evaluates to a(n) ${elemType.name}";
+      check = lib.traceValIfNot builtins.isFunction;
+      merge = fns:
+        args: elemType.merge (map (fn: fn args) fns);
+      # These are guesses, I don't fully understand iter, fold, delayOnGlobalEval
+      iter = f: path: v:
+        args: elemType.iter f path (v args);
+      fold = op: nul: v:
+        args: elemType.fold op nul (v args);
+      inherit (elemType) delayOnGlobalEval;
+      hasOptions = false;
+    };
+
     # !!! this should be a type constructor that takes the options as
     # an argument.
     optionSet = mkOptionType {
diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix
index 8e6d22dd76a..401c9da575b 100644
--- a/pkgs/misc/emulators/wine/default.nix
+++ b/pkgs/misc/emulators/wine/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://sourceforge/wine/${name}.tar.bz2";
-    sha256 = "08qhjqia2g6pm5rnawcvfz64pm2pmjaxafmwdyn950rdwrd7kbai";
+    sha256 = "0c14paj2j3sswl6mpjjmy9bxnpijk095ks58x9dsycx9c8x0gqvm";
   };
 
   gecko = fetchurl {
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    version = "1.5.19";
+    version = "1.5.20";
     homepage = "http://www.winehq.org/";
     license = "LGPL";
     description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
diff --git a/pkgs/os-specific/linux/aufs-util/3.nix b/pkgs/os-specific/linux/aufs-util/3.nix
index 8eefc1b0f4a..d75f51d38c9 100644
--- a/pkgs/os-specific/linux/aufs-util/3.nix
+++ b/pkgs/os-specific/linux/aufs-util/3.nix
@@ -34,8 +34,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Utilities for AUFS3";
     homepage = http://aufs.sourceforge.net/;
-    maintainers = [ stdenv.lib.maintainers.eelco 
-                    stdenv.lib.maintainers.shlevy ];
+    maintainers = [ stdenv.lib.maintainers.eelco  ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/aufs/3.nix b/pkgs/os-specific/linux/aufs/3.nix
index 83de1faa8fe..130fd5075cd 100644
--- a/pkgs/os-specific/linux/aufs/3.nix
+++ b/pkgs/os-specific/linux/aufs/3.nix
@@ -37,8 +37,7 @@ stdenv.mkDerivation {
     description = "Another Unionfs implementation for Linux (third generation)";
     homepage = http://aufs.sourceforge.net/;
     maintainers = [ stdenv.lib.maintainers.eelco
-                    stdenv.lib.maintainers.raskin
-                    stdenv.lib.maintainers.shlevy ];
+                    stdenv.lib.maintainers.raskin ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/kernel/linux-3.0.nix b/pkgs/os-specific/linux/kernel/linux-3.0.nix
index 438228c4680..4ac4a4b263b 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.0.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.0.nix
@@ -230,7 +230,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.0.56";
+    version = "3.0.57";
 
     preConfigure = ''
       substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
@@ -238,7 +238,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-      sha256 = "0dfj8nlrlwyq9jp85y8acmhpm7f5bdd9668ikafyd7rljqmkq61f";
+      sha256 = "12rf48ymwsgr133d6cydsajjxb3zihrcrfhpdv185x07dbri9nbl";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.4.nix b/pkgs/os-specific/linux/kernel/linux-3.4.nix
index 0291d78f4e3..a03e3950891 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.4.nix
@@ -239,7 +239,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.4.23";
+    version = "3.4.24";
     testing = false;
 
     preConfigure = ''
@@ -248,7 +248,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "1xznslbhby6ks10sb7h6zh5647ffavpmfsxxb1c5hj4cyj4d9k2z";
+      sha256 = "1vxyb68ckzgm88jj7xzmwr2hmj5vdry5irvfr89klgqr95mmhkd1";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.6.nix b/pkgs/os-specific/linux/kernel/linux-3.6.nix
index e06a9e8224b..3fb47da7be6 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.6.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.6.nix
@@ -244,7 +244,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.6.10";
+    version = "3.6.11";
     testing = false;
 
     preConfigure = ''
@@ -253,7 +253,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0cqslk460yvgh3iv1m9lkdlnfy9v9ghcn4kjpf8019dsfia7pr7x";
+      sha256 = "0cnbdhsgxxdl44gqfqlh8nyf6yzmdz7xkfa0xh2rzdscwqh8085h";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.7.nix b/pkgs/os-specific/linux/kernel/linux-3.7.nix
index 6eda20a0789..1a02910b5c8 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.7.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.7.nix
@@ -245,18 +245,16 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.7";
+    version = "3.7.1";
     testing = false;
 
-    modDirVersion = "3.7.0";
-
     preConfigure = ''
       substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
     '';
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0n4lddghf0mvp3jrq4lckii88yvm6mwmfp0ibwsw7vkfyw5lv9k0";
+      sha256 = "0mbjvrr0658gg052hbf32vfcmlzfsr777wgmaxrpkpzbfs1qpjp1";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix b/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
index 34600870671..eae62c9e197 100644
--- a/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
+++ b/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
@@ -1,15 +1,23 @@
 { stdenv, fetchurl, pam, openssl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "pam_ssh_agent_auth-0.9.3";
+  name = "pam_ssh_agent_auth-0.9.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/pamsshagentauth/${name}.tar.bz2";
-    sha256 = "19p5mzplnr9g9vlp16nipf5rjw4v8zncvimarwgix958yml7j08h";
+    sha256 = "1a8cv223f30mvkxnyh9hk6kya0ynkwwkc5nhlz3rcqhxfw0fcva9";
   };
 
+  patches =
+    [ # Allow multiple colon-separated authorized keys files to be
+      # specified in the file= option.
+      ./multiple-key-files.patch
+    ];
+
   buildInputs = [ pam openssl perl ];
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://pamsshagentauth.sourceforge.net/;
     description = "PAM module for authentication through the SSH agent";
diff --git a/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch b/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch
new file mode 100644
index 00000000000..dc97b7d54f7
--- /dev/null
+++ b/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch
@@ -0,0 +1,338 @@
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.c pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.c
+--- pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.c	2012-12-17 19:29:16.014226336 +0000
+@@ -69,14 +69,14 @@
+     return cookie;
+ }
+ 
+-int
++const char *
+ pamsshagentauth_find_authorized_keys(uid_t uid)
+ {
+     Identity *id;
+     Key *key;
+     AuthenticationConnection *ac;
+     char *comment;
+-    uint8_t retval = 0;
++    const char *key_file = 0;
+ 
+     OpenSSL_add_all_digests();
+     session_id2 = pamsshagentauth_session_id2_gen();
+@@ -90,13 +90,11 @@
+                 id->key = key;
+                 id->filename = comment;
+                 id->ac = ac;
+-                if(userauth_pubkey_from_id(id)) {
+-                    retval = 1;
+-                }
++                key_file = userauth_pubkey_from_id(id);
+                 pamsshagentauth_xfree(id->filename);
+                 pamsshagentauth_key_free(id->key);
+                 pamsshagentauth_xfree(id);
+-                if(retval == 1)
++                if(key_file)
+                     break;
+             }
+         }
+@@ -107,5 +105,5 @@
+     }
+     pamsshagentauth_xfree(session_id2);
+     EVP_cleanup();
+-    return retval;
++    return key_file;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.h pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.h
+--- pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.h	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.h	2012-12-17 19:28:57.454334806 +0000
+@@ -31,6 +31,6 @@
+ #ifndef _ITERATE_SSH_AGENT_KEYS_H
+ #define _ITERATE_SSH_AGENT_KEYS_H
+ 
+-int pamsshagentauth_find_authorized_keys(uid_t);
++const char * pamsshagentauth_find_authorized_keys(uid_t);
+ 
+ #endif
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.c pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.c
+--- pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.c	2012-12-17 19:30:24.013830673 +0000
+@@ -60,7 +60,6 @@
+ 
+ #define strncasecmp_literal(A,B) strncasecmp( A, B, sizeof(B) - 1)
+ 
+-char           *authorized_keys_file = NULL;
+ uint8_t         allow_user_owned_authorized_keys_file = 0;
+ 
+ #if ! HAVE___PROGNAME || HAVE_BUNDLE
+@@ -161,15 +160,13 @@
+         goto cleanexit;
+     }
+ 
+-    if(authorized_keys_file_input && user) {
+-        /*
+-         * user is the name of the target-user, and so must be used for validating the authorized_keys file
+-         */
+-        parse_authorized_key_file(user, authorized_keys_file_input);
+-    } else {
+-        pamsshagentauth_verbose("Using default file=/etc/security/authorized_keys");
+-        authorized_keys_file = pamsshagentauth_xstrdup("/etc/security/authorized_keys");
+-    }
++    if (!authorized_keys_file_input || !user)
++        authorized_keys_file_input = "/etc/security/authorized_keys";
++
++    /*
++     * user is the name of the target-user, and so must be used for validating the authorized_keys file
++     */
++    parse_authorized_key_files(user, authorized_keys_file_input);
+ 
+     /* 
+      * PAM_USER and PAM_RUSER do not necessarily have to get set by the calling application, and we may be unable to divine the latter.
+@@ -177,16 +174,17 @@
+      */
+ 
+     if(user && strlen(ruser) > 0) {
+-        pamsshagentauth_verbose("Attempting authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++        pamsshagentauth_verbose("Attempting authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file_input);
+ 
+         /* 
+          * this pw_uid is used to validate the SSH_AUTH_SOCK, and so must be the uid of the ruser invoking the program, not the target-user
+          */
+-        if(pamsshagentauth_find_authorized_keys(getpwnam(ruser)->pw_uid)) {
+-            pamsshagentauth_logit("Authenticated: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++        const char *key_file;
++        if((key_file = pamsshagentauth_find_authorized_keys(getpwnam(ruser)->pw_uid))) {
++            pamsshagentauth_logit("Authenticated: `%s' as `%s' using %s", ruser, user, key_file);
+             retval = PAM_SUCCESS;
+         } else {
+-            pamsshagentauth_logit("Failed Authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++            pamsshagentauth_logit("Failed Authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file_input);
+         }
+     } else {
+         pamsshagentauth_logit("No %s specified, cannot continue with this form of authentication", (user) ? "ruser" : "user" );
+@@ -198,7 +196,7 @@
+     free(__progname);
+ #endif
+ 
+-    free(authorized_keys_file);
++    free_authorized_key_files();
+ 
+     return retval;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.pod pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.pod
+--- pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.pod	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.pod	2012-12-17 19:52:35.968965448 +0000
+@@ -26,7 +26,7 @@
+ 
+ =item file=<path to authorized_keys>
+ 
+-Specify the path to the authorized_keys file(s) you would like to use for authentication. Subject to tilde and % EXPANSIONS (below) 
++Specify the path(s) to the authorized_keys file(s) you would like to use for authentication. Subject to tilde and % EXPANSIONS (below). Paths are separated using colons.
+ 
+ =item allow_user_owned_authorized_keys_file
+ 
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.c pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.c
+--- pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.c	2012-12-17 19:32:20.830157313 +0000
+@@ -79,66 +79,96 @@
+ 
+ #include "identity.h"
+ #include "pam_user_key_allowed2.h"
++#include "pam_user_authorized_keys.h"
+ 
+-extern char    *authorized_keys_file;
++#define MAX_AUTHORIZED_KEY_FILES 16
++
++char           *authorized_keys_files[MAX_AUTHORIZED_KEY_FILES];
++unsigned int    nr_authorized_keys_files = 0;
+ extern uint8_t  allow_user_owned_authorized_keys_file;
+ uid_t           authorized_keys_file_allowed_owner_uid;
+ 
+ void
+-parse_authorized_key_file(const char *user, const char *authorized_keys_file_input)
++parse_authorized_key_files(const char *user, const char *authorized_keys_file_input)
+ {
+-    char            fqdn[HOST_NAME_MAX] = "";
++    const char      *pos = authorized_keys_file_input;
+     char            hostname[HOST_NAME_MAX] = "";
+-    char            auth_keys_file_buf[4096] = "";
+-    char           *slash_ptr = NULL;
+-    char            owner_uname[128] = "";
+-    size_t          owner_uname_len = 0;
+-
+-    /*
+-     * temporary copy, so that both tilde expansion and percent expansion both get to apply to the path
+-     */
+-    strncat(auth_keys_file_buf, authorized_keys_file_input, sizeof(auth_keys_file_buf) - 1);
++    char            fqdn[HOST_NAME_MAX] = "";
++
++#if HAVE_GETHOSTNAME
++    *hostname = '\0';
++    gethostname(fqdn, HOST_NAME_MAX);
++    strncat(hostname, fqdn, strcspn(fqdn,"."));
++#endif
+ 
+-    if(allow_user_owned_authorized_keys_file)
+-        authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++    while (pos) {
++        const char     *colon = strchr(pos, ':');
++        char            auth_keys_file_buf[4096] = "";
++        char           *slash_ptr = NULL;
++        char            owner_uname[128] = "";
++        size_t          owner_uname_len = 0;
++
++        strncat(auth_keys_file_buf, pos, sizeof(auth_keys_file_buf) - 1);
++        if (colon) {
++            auth_keys_file_buf[colon - pos] = 0;
++            pos = colon + 1;
++        } else {
++            pos = 0;
++        }
+ 
+-    if(*auth_keys_file_buf == '~') {
+-        if(*(auth_keys_file_buf+1) == '/') {
++        if(allow_user_owned_authorized_keys_file)
+             authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++
++        if(*auth_keys_file_buf == '~') {
++            if(*(auth_keys_file_buf+1) == '/') {
++                authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++            }
++            else {
++                slash_ptr = strchr(auth_keys_file_buf,'/');
++                if(!slash_ptr)
++                    pamsshagentauth_fatal("cannot expand tilde in path without a `/'");
++
++                owner_uname_len = slash_ptr - auth_keys_file_buf - 1;
++                if(owner_uname_len > (sizeof(owner_uname) - 1) ) 
++                    pamsshagentauth_fatal("Username too long");
++
++                strncat(owner_uname, auth_keys_file_buf + 1, owner_uname_len);
++                if(!authorized_keys_file_allowed_owner_uid)
++                    authorized_keys_file_allowed_owner_uid = getpwnam(owner_uname)->pw_uid;
++            }
++            char *tmp = pamsshagentauth_tilde_expand_filename(auth_keys_file_buf, authorized_keys_file_allowed_owner_uid);
++            strncpy(auth_keys_file_buf, tmp, sizeof(auth_keys_file_buf) - 1 );
++            pamsshagentauth_xfree(tmp);
+         }
+-        else {
+-            slash_ptr = strchr(auth_keys_file_buf,'/');
+-            if(!slash_ptr)
+-                pamsshagentauth_fatal("cannot expand tilde in path without a `/'");
+-
+-            owner_uname_len = slash_ptr - auth_keys_file_buf - 1;
+-            if(owner_uname_len > (sizeof(owner_uname) - 1) ) 
+-                pamsshagentauth_fatal("Username too long");
+-
+-            strncat(owner_uname, auth_keys_file_buf + 1, owner_uname_len);
+-            if(!authorized_keys_file_allowed_owner_uid)
+-                authorized_keys_file_allowed_owner_uid = getpwnam(owner_uname)->pw_uid;
++
++        if(strstr(auth_keys_file_buf, "%h")) {
++            authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
+         }
+-        authorized_keys_file = pamsshagentauth_tilde_expand_filename(auth_keys_file_buf, authorized_keys_file_allowed_owner_uid);
+-        strncpy(auth_keys_file_buf, authorized_keys_file, sizeof(auth_keys_file_buf) - 1 );
+-        pamsshagentauth_xfree(authorized_keys_file) /* when we percent_expand later, we'd step on this, so free it immediately */;
+-    }
+ 
+-    if(strstr(auth_keys_file_buf, "%h")) {
+-        authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++        if (nr_authorized_keys_files >= MAX_AUTHORIZED_KEY_FILES)
++            pamsshagentauth_fatal("Too many authorized key files");
++        authorized_keys_files[nr_authorized_keys_files++] =
++            pamsshagentauth_percent_expand(auth_keys_file_buf, "h", getpwnam(user)->pw_dir, "H", hostname, "f", fqdn, "u", user, NULL);
+     }
++}
+ 
+-#if HAVE_GETHOSTNAME
+-    *hostname = '\0';
+-    gethostname(fqdn, HOST_NAME_MAX);
+-    strncat(hostname, fqdn, strcspn(fqdn,"."));
+-#endif
+-    authorized_keys_file = pamsshagentauth_percent_expand(auth_keys_file_buf, "h", getpwnam(user)->pw_dir, "H", hostname, "f", fqdn, "u", user, NULL);
++void
++free_authorized_key_files()
++{
++    unsigned int n;
++    for (n = 0; n < nr_authorized_keys_files; n++)
++        free(authorized_keys_files[n]);
++    nr_authorized_keys_files = 0;
+ }
+ 
+-int
++const char *
+ pam_user_key_allowed(Key * key)
+ {
+-    return pam_user_key_allowed2(getpwuid(authorized_keys_file_allowed_owner_uid), key, authorized_keys_file)
+-        || pam_user_key_allowed2(getpwuid(0), key, authorized_keys_file);
++    unsigned int n;
++    for (n = 0; n < nr_authorized_keys_files; n++) {
++        if (pam_user_key_allowed2(getpwuid(authorized_keys_file_allowed_owner_uid), key, authorized_keys_files[n])
++            || pam_user_key_allowed2(getpwuid(0), key, authorized_keys_files[n]))
++            return authorized_keys_files[n];
++    }
++    return 0;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.h pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.h
+--- pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.h	2010-01-13 02:17:01.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.h	2012-12-17 19:24:34.477894517 +0000
+@@ -28,11 +28,12 @@
+  */
+ 
+ 
+-#ifndef _PAM_USER_KEY_ALLOWED_H
+-#define _PAM_USER_KEY_ALLOWED_H
++#ifndef _PAM_USER_AUTHORIZED_KEYS_H
++#define _PAM_USER_AUTHORIZED_KEYS_H
+ 
+ #include "identity.h"
+-int pam_user_key_allowed(Key *);
+-void parse_authorized_key_file(const char *, const char *);
++const char * pam_user_key_allowed(Key *);
++void parse_authorized_key_files(const char *, const char *);
++void free_authorized_key_files();
+ 
+ #endif
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.c pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.c
+--- pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.c	2012-12-17 19:27:30.813843933 +0000
+@@ -51,7 +51,7 @@
+ extern u_char  *session_id2;
+ extern uint8_t  session_id_len;
+ 
+-int
++const char *
+ userauth_pubkey_from_id(Identity * id)
+ {
+     Buffer          b = { 0 };
+@@ -59,11 +59,12 @@
+     u_char         *pkblob = NULL, *sig = NULL;
+     u_int           blen = 0, slen = 0;
+     int             authenticated = 0;
++    const char     *key_file;
+ 
+     pkalg = (char *) key_ssh_name(id->key);
+ 
+     /* first test if this key is even allowed */
+-    if(! pam_user_key_allowed(id->key))
++    if(!(key_file = pam_user_key_allowed(id->key)))
+         goto user_auth_clean_exit;
+ 
+     if(pamsshagentauth_key_to_blob(id->key, &pkblob, &blen) == 0)
+@@ -96,5 +97,5 @@
+     if(pkblob != NULL)
+         pamsshagentauth_xfree(pkblob);
+     CRYPTO_cleanup_all_ex_data();
+-    return authenticated;
++    return authenticated ? key_file : 0;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.h pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.h
+--- pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.h	2010-01-13 02:17:01.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.h	2012-12-17 19:25:54.893412987 +0000
+@@ -32,6 +32,6 @@
+ #define _USERAUTH_PUBKEY_FROM_ID_H
+ 
+ #include <identity.h>
+-int userauth_pubkey_from_id(Identity *);
++const char * userauth_pubkey_from_id(Identity *);
+ 
+ #endif
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index c31fc456d44..5943a231a85 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
 
 stdenv.mkDerivation {
-  name = "spl-0.6.0-rc12-${kernel.version}";
+  name = "spl-0.6.0-rc13-${kernel.version}";
   src = fetchurl {
-    url = http://github.com/downloads/zfsonlinux/spl/spl-0.6.0-rc12.tar.gz;
-    sha256 = "166853pqa294f78mn4j4x9pri79lyv3j2h8m9fzhfy7d7gxfqljk";
+    url = http://zfsonlinux.org/downloads/0.6.0-rc13/spl-0.6.0-rc13.tar.gz;
+    sha256 = "1frbifj1yd7pznlhsqsiksip5amx4ljvasg8h80haaxk0yvvkr9b";
   };
 
   patches = [ ./install_prefix.patch ./install_prefix_2.patch ./module_prefix.patch ];
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index f2b701695ff..b83019ea87a 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
 
 stdenv.mkDerivation {
-  name = "zfs-0.6.0-rc12-${kernel.version}";
+  name = "zfs-0.6.0-rc13-${kernel.version}";
 
   src = fetchurl {
-    url = http://github.com/downloads/zfsonlinux/zfs/zfs-0.6.0-rc12.tar.gz;
-    sha256 = "1mipy6v63y8z3c5chn813x8c2r8mwyja1v19dvars3j85105xf1y";
+    url = http://zfsonlinux.org/downloads/0.6.0-rc13/zfs-0.6.0-rc13.tar.gz;
+    sha256 = "1kpx7sa49ir93kmlrjwjzd6v4kzmda4j9cf6bv2p4s3yrmiz3cjv";
   };
 
   patches = [ ./module_perm_prefix.patch ./mount_zfs_prefix.patch ./kerneldir_path.patch ./no_absolute_paths_to_coreutils.patch ];
diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix
new file mode 100644
index 00000000000..6341fa952f5
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/9.2.x.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, zlib, readline }:
+
+let version = "9.2.2"; in
+
+stdenv.mkDerivation rec {
+  name = "postgresql-${version}";
+
+  src = fetchurl {
+    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
+    sha256 = "1wzphj8vdqpzaihqmrkm9p4wlfvgr9psg5hnrmzwp5l8m5aai9z1";
+  };
+
+  buildInputs = [ zlib readline ];
+
+  enableParallelBuilding = true;
+
+  LC_ALL = "C";
+
+  postInstall =
+    ''
+      mkdir -p $out/share/man
+      cp -rvd doc/src/sgml/man1 $out/share/man
+    '';
+
+  passthru = {
+    inherit readline;
+    psqlSchema = "9.1";
+  };
+
+  meta = {
+    homepage = http://www.postgresql.org/;
+    description = "A powerful, open source object-relational database system";
+    license = "bsd";
+  };
+}
diff --git a/pkgs/tools/networking/mu/default.nix b/pkgs/tools/networking/mu/default.nix
new file mode 100644
index 00000000000..7495c3bcd7f
--- /dev/null
+++ b/pkgs/tools/networking/mu/default.nix
@@ -0,0 +1,25 @@
+{ fetchurl, stdenv, sqlite, pkgconfig, xapian, glib, gmime, texinfo, emacs, guile }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.9";
+  name = "mu-${version}";
+
+  src = fetchurl {
+    url = "https://mu0.googlecode.com/files/mu-${version}.tar.gz";
+    sha256 = "04r0y05awsyb5hqwaxn1hq9jxijw20hwsgdbacqrma519f0y5y43";
+  };
+
+  buildInputs = [ sqlite pkgconfig xapian glib gmime texinfo emacs guile ];
+
+  meta = {
+    description = "mu is a collection of utilties for indexing and searching Maildirs";
+
+    licenses = [ "GPLv3+" ];
+
+    homepage = "http://www.djcbsoftware.nl/code/mu/";
+
+    platforms = stdenv.lib.platforms.all;
+
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  };
+}
diff --git a/pkgs/tools/networking/mu0/default.nix b/pkgs/tools/networking/mu0/default.nix
deleted file mode 100644
index a772f237500..00000000000
--- a/pkgs/tools/networking/mu0/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ fetchurl, stdenv, sqlite, pkgconfig, xapian, glib, gmime }:
-
-stdenv.mkDerivation rec {
-  name = "mu0-0.9.7";
-
-  src = fetchurl {
-    url = http://mu0.googlecode.com/files/mu-0.9.7.tar.gz;
-    sha256 = "14nyn791ficyllj9idhiq3mncwnrg71lfxk126804dxba1l90r72";
-  };
-
-  buildInputs = [ sqlite pkgconfig xapian glib gmime ];
-
-  /* The tests don't pass */
-  doCheck = false;
-
-  meta = {
-    description = "mu is a collection of utilties for indexing and searching Maildirs";
-
-    licenses = [ "GPLv3+" ];
-
-    homepage = http://code.google.com/p/mu0/;
-
-    platforms = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index e9e11d240f3..a0c0b650e20 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -373,6 +373,11 @@ let
 
   archivemount = callPackage ../tools/filesystems/archivemount { };
 
+  arduino_core = callPackage ../development/arduino/arduino-core {
+    jdk = jdk;
+    jre = jdk;
+  };
+
   argyllcms = callPackage ../tools/graphics/argyllcms {};
 
   ascii = callPackage ../tools/text/ascii { };
@@ -1047,8 +1052,6 @@ let
 
   lzop = callPackage ../tools/compression/lzop { };
 
-  mu0 = callPackage ../tools/networking/mu0 { };
-
   mailutils = callPackage ../tools/networking/mailutils {
     guile = guile_1_8;
   };
@@ -3072,6 +3075,28 @@ let
 
   distcc = callPackage ../development/tools/misc/distcc { };
 
+  # distccWrapper: wrapper that works as gcc or g++
+  # It can be used by setting in nixpkgs config like this, for example:
+  #    replaceStdenv = { pkgs }: pkgs.distccStdenv;
+  # But if you build in chroot, a default 'nix' will create
+  # a new net namespace, and won't have network access.
+  # You can use an override in packageOverrides to set extraConfig:
+  #    packageOverrides = pkgs: {
+  #     distccWrapper = pkgs.distccWrapper.override {
+  #       extraConfig = ''
+  #         DISTCC_HOSTS="myhost1 myhost2"
+  #       '';
+  #     };
+  #
+  distccWrapper = makeOverridable ({ extraConfig ? "" }:
+     wrapGCC (distcc.links extraConfig)) {};
+  distccStdenv = lowPrio (overrideGCC stdenv distccWrapper);
+
+  distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix {
+    gccRaw = gcc.gcc;
+    binutils = binutils;
+  };
+
   docutils = builderDefsPackage (import ../development/tools/documentation/docutils) {
     inherit python pil makeWrapper;
   };
@@ -3155,6 +3180,8 @@ let
 
   indent = callPackage ../development/tools/misc/indent { };
 
+  ino = callPackage ../development/arduino/ino { };
+
   inotifyTools = callPackage ../development/tools/misc/inotify-tools { };
 
   intelgen4asm = callPackage ../development/misc/intelgen4asm { };
@@ -4485,6 +4512,8 @@ let
 
   libxslt = callPackage ../development/libraries/libxslt { };
 
+  libxtc_dxtn = callPackage ../development/libraries/libxtc_dxtn { };
+
   libixp_for_wmii = lowPrio (import ../development/libraries/libixp_for_wmii {
     inherit fetchurl stdenv;
   });
@@ -4567,6 +4596,8 @@ let
 
   mtdev = callPackage ../development/libraries/mtdev { };
 
+  mu = callPackage ../tools/networking/mu { };
+
   muparser = callPackage ../development/libraries/muparser { };
 
   mygui = callPackage ../development/libraries/mygui {};
@@ -5471,6 +5502,8 @@ let
 
   postgresql91 = callPackage ../servers/sql/postgresql/9.1.x.nix { };
 
+  postgresql92 = callPackage ../servers/sql/postgresql/9.2.x.nix { };
+
   postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };
 
   psqlodbc = callPackage ../servers/sql/postgresql/psqlodbc {
@@ -7907,7 +7940,7 @@ let
     inherit (pkgs) python perl tcl ruby /*x11*/;
     lua = pkgs.lua5;
     # optional features by flags
-    flags = [ "X11" ]; # only flag "X11" by now
+    flags = [ "python" "X11" ]; # only flag "X11" by now
   };
 
   virtviewer = callPackage ../applications/virtualization/virt-viewer {};
@@ -8576,6 +8609,12 @@ let
 
   ### SCIENCE
 
+  celestia = callPackage ../applications/science/astronomy/celestia {
+    lua = lua5_1;
+    inherit (xlibs) libXmu;
+    inherit (pkgs.gnome) gtkglext;
+  };
+
   xplanet = callPackage ../applications/science/astronomy/xplanet { };
 
   gravit = callPackage ../applications/science/astronomy/gravit { };
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index 8cfd3f72d13..3d23010bbb6 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -523,7 +523,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   bloomfilter = callPackage ../development/libraries/haskell/bloomfilter {};
 
   bmp_1_2_2_1 = callPackage ../development/libraries/haskell/bmp/1.2.2.1.nix {};
-  bmp_1_2_3_2 = callPackage ../development/libraries/haskell/bmp/1.2.3.2.nix {};
+  bmp_1_2_3_4 = callPackage ../development/libraries/haskell/bmp/1.2.3.4.nix {};
   bmp = self.bmp_1_2_2_1;       # later versions work only with ghc 7.6 and beyond
 
   Boolean = callPackage ../development/libraries/haskell/Boolean {};
@@ -910,7 +910,9 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   happstackHamlet = callPackage ../development/libraries/haskell/happstack/happstack-hamlet.nix {};
 
-  hashable = callPackage ../development/libraries/haskell/hashable {};
+  hashable_1_1_2_5 = callPackage ../development/libraries/haskell/hashable/1.1.2.5.nix {};
+  hashable_1_3_0_2 = callPackage ../development/libraries/haskell/hashable/1.2.0.2.nix {};
+  hashable = self.hashable_1_1_2_5;
 
   hashedStorage = callPackage ../development/libraries/haskell/hashed-storage {};
 
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 7dad6abe419..9c81ffc2882 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -411,7 +411,7 @@ let pythonPackages = python.modules // rec {
 
     # ValueError: Could not parse auth file:
     # /tmp/nix-build-.../CoilMQ-0.6.1/coilmq/tests/resources/auth.ini
-    #doCheck = false;
+    doCheck = false;
 
     meta = {
       description = "Simple, lightweight, and easily extensible STOMP message broker";