about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/mobile
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/mobile')
-rw-r--r--nixpkgs/pkgs/development/mobile/abootimg/default.nix44
-rw-r--r--nixpkgs/pkgs/development/mobile/adb-sync/default.nix32
-rw-r--r--nixpkgs/pkgs/development/mobile/adbfs-rootless/default.nix42
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/build-app.nix48
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/build-tools.nix21
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/cmake.nix10
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/compose-android-packages.nix258
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/convertaddons.xsl128
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/convertpackages.xsl116
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/convertsystemimages.xsl47
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/default.nix26
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/deploy-androidpackage.nix45
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/emulate-app.nix136
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/emulator.nix20
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generate.sh16
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/addons.nix1145
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/packages.nix1927
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-tv.nix157
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear-cn.nix67
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear.nix97
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android.nix547
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis.nix502
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis_playstore.nix97
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/lldb.nix12
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/default.nix51
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/make_standalone_toolchain.py_18.patch44
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/platform-tools.nix19
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/querypackages.sh27
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/tools.nix26
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/tools/25.nix62
-rw-r--r--nixpkgs/pkgs/development/mobile/androidenv/tools/26.nix40
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/Gemfile3
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta5
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta.lock90
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/Gemfile.lock90
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/default.nix25
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/gemset-beta.nix363
-rw-r--r--nixpkgs/pkgs/development/mobile/cocoapods/gemset.nix335
-rwxr-xr-xnixpkgs/pkgs/development/mobile/cocoapods/update12
-rw-r--r--nixpkgs/pkgs/development/mobile/flashtool/default.nix62
-rw-r--r--nixpkgs/pkgs/development/mobile/genymotion/default.nix81
-rw-r--r--nixpkgs/pkgs/development/mobile/imgpatchtools/default.nix30
-rw-r--r--nixpkgs/pkgs/development/mobile/titaniumenv/build-app.nix188
-rw-r--r--nixpkgs/pkgs/development/mobile/titaniumenv/default.nix21
-rw-r--r--nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-7.5.nix107
-rw-r--r--nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix109
-rw-r--r--nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix97
-rw-r--r--nixpkgs/pkgs/development/mobile/webos/cmake-modules.nix32
-rw-r--r--nixpkgs/pkgs/development/mobile/webos/cmake-setup-hook.sh9
-rw-r--r--nixpkgs/pkgs/development/mobile/webos/novacom.nix27
-rw-r--r--nixpkgs/pkgs/development/mobile/webos/novacomd.nix40
-rw-r--r--nixpkgs/pkgs/development/mobile/xcodeenv/build-app.nix150
-rw-r--r--nixpkgs/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix33
-rw-r--r--nixpkgs/pkgs/development/mobile/xcodeenv/default.nix15
-rw-r--r--nixpkgs/pkgs/development/mobile/xcodeenv/install.html.template25
-rw-r--r--nixpkgs/pkgs/development/mobile/xcodeenv/simulate-app.nix56
-rw-r--r--nixpkgs/pkgs/development/mobile/xpwn/default.nix33
57 files changed, 7847 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/mobile/abootimg/default.nix b/nixpkgs/pkgs/development/mobile/abootimg/default.nix
new file mode 100644
index 000000000000..eed4b43d6a36
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/abootimg/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub, coreutils, cpio, findutils, gzip, makeWrapper, utillinux }:
+
+let
+  version = "0.6";
+in
+stdenv.mkDerivation {
+  pname = "abootimg";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "ggrandou";
+    repo = "abootimg";
+    rev = "7e127fee6a3981f6b0a50ce9910267cd501e09d4";
+    sha256 = "1qgx9fxwhylgnixzkz2mzv2707f65qq7rar2rsqak536vhig1z9a";
+  };
+
+  nativeBuildInputs = [ makeWrapper utillinux ];
+
+  postPatch = ''
+    cat <<EOF > version.h
+    #define VERSION_STR "${version}"
+    EOF
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -D -m 755 abootimg $out/bin
+    install -D -m444 ./debian/abootimg.1 $out/share/man/man1/abootimg.1;
+
+    install -D -m 755 abootimg-pack-initrd $out/bin
+    wrapProgram $out/bin/abootimg-pack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils cpio findutils gzip ]}
+
+    install -D -m 755 abootimg-unpack-initrd $out/bin
+    wrapProgram $out/bin/abootimg-unpack-initrd --prefix PATH : ${stdenv.lib.makeBinPath [ cpio gzip ]}
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ggrandou/abootimg;
+    description = "Manipulate Android Boot Images";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/adb-sync/default.nix b/nixpkgs/pkgs/development/mobile/adb-sync/default.nix
new file mode 100644
index 000000000000..ebba63353dab
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/adb-sync/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchgit, python3, platform-tools, makeWrapper }:
+
+stdenv.mkDerivation {
+  pname = "adb-sync";
+  version = "2016-08-31";
+
+  src = fetchgit {
+    url = "https://github.com/google/adb-sync";
+    rev = "7fc48ad1e15129ebe34e9f89b04bfbb68ced144d";
+    sha256 = "1y016bjky5sn58v91jyqfz7vw8qfqnfhb9s9jd32k8y29hy5vy4d";
+  };
+
+  buildInputs = [ python3 platform-tools makeWrapper ];
+
+  phases = "installPhase";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp $src/adb-channel $src/adb-sync $out/bin/
+    patchShebangs $out/bin
+    wrapProgram $out/bin/adb-sync --suffix PATH : ${platform-tools}/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A tool to synchronise files between a PC and an Android devices using ADB (Android Debug Bridge)";
+    homepage = https://github.com/google/adb-sync;
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    hydraPlatforms = [];
+    maintainers = with maintainers; [ scolobb ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/adbfs-rootless/default.nix b/nixpkgs/pkgs/development/mobile/adbfs-rootless/default.nix
new file mode 100644
index 000000000000..2033fa78ae58
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/adbfs-rootless/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, fuse, adb }:
+
+stdenv.mkDerivation rec {
+  pname = "adbfs-rootless";
+  version = "2016-10-02";
+
+  src = fetchFromGitHub {
+    owner = "spion";
+    repo = "adbfs-rootless";
+    rev = "b58963430e40c9246710a16cec58e7ffc88baa48";
+    sha256 = "1kjibl86k6pf7vciwaaxwv5m4q28zdpd2g7yhp71av32jq6j3wm8";
+  };
+
+  patches = [
+    (fetchpatch {
+      # https://github.com/spion/adbfs-rootless/issues/14
+      url = "https://github.com/kronenpj/adbfs-rootless/commit/35f87ce0a7aeddaaad118daed3022e01453b838d.patch";
+      sha256 = "1iigla74n3hphnyx9ffli9wqk7v71ylvsxama868czlg7851jqj9";
+    })
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ fuse ];
+
+  postPatch = ''
+    # very ugly way of replacing the adb calls
+    sed -e 's|"adb |"${adb}/bin/adb |g' \
+        -i adbfs.cpp
+  '';
+
+  installPhase = ''
+    install -D adbfs $out/bin/adbfs
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Mount Android phones on Linux with adb, no root required";
+    inherit (src.meta) homepage;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ Profpatsch ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/build-app.nix b/nixpkgs/pkgs/development/mobile/androidenv/build-app.nix
new file mode 100644
index 000000000000..6f4b32b486ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/build-app.nix
@@ -0,0 +1,48 @@
+{ composeAndroidPackages, stdenv, lib, ant, jdk, gnumake, gawk }:
+
+{ name
+, release ? false, keyStore ? null, keyAlias ? null, keyStorePassword ? null, keyAliasPassword ? null
+, antFlags ? ""
+, ...
+}@args:
+
+assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null;
+
+let
+  androidSdkFormalArgs = builtins.functionArgs composeAndroidPackages;
+  androidArgs = builtins.intersectAttrs androidSdkFormalArgs args;
+  androidsdk = (composeAndroidPackages androidArgs).androidsdk;
+
+  extraArgs = removeAttrs args ([ "name" ] ++ builtins.attrNames androidSdkFormalArgs);
+in
+stdenv.mkDerivation ({
+  name = lib.replaceChars [" "] [""] name; # Android APKs may contain white spaces in their names, but Nix store paths cannot
+  ANDROID_HOME = "${androidsdk}/libexec/android-sdk";
+  buildInputs = [ jdk ant ];
+  buildPhase = ''
+    ${lib.optionalString release ''
+      # Provide key singing attributes
+      ( echo "key.store=${keyStore}"
+        echo "key.alias=${keyAlias}"
+        echo "key.store.password=${keyStorePassword}"
+        echo "key.alias.password=${keyAliasPassword}"
+      ) >> ant.properties
+    ''}
+
+    export ANDROID_SDK_HOME=`pwd` # Key files cannot be stored in the user's home directory. This overrides it.
+
+    ${lib.optionalString (args ? includeNDK && args.includeNDK) ''
+      export GNUMAKE=${gnumake}/bin/make
+      export NDK_HOST_AWK=${gawk}/bin/gawk
+      ${androidsdk}/libexec/android-sdk/ndk-bundle/ndk-build
+    ''}
+    ant ${antFlags} ${if release then "release" else "debug"}
+  '';
+  installPhase = ''
+    mkdir -p $out
+    mv bin/*-${if release then "release" else "debug"}.apk $out
+
+    mkdir -p $out/nix-support
+    echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products
+  '';
+} // extraArgs)
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/build-tools.nix b/nixpkgs/pkgs/development/mobile/androidenv/build-tools.nix
new file mode 100644
index 000000000000..e648c83fa17d
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/build-tools.nix
@@ -0,0 +1,21 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, pkgs_i686}:
+
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook makeWrapper ] ++
+    lib.optionals (os == "linux") [ pkgs.glibc pkgs.zlib pkgs.ncurses5 pkgs_i686.glibc pkgs_i686.zlib pkgs_i686.ncurses5 ];
+  patchInstructions = ''
+    ${lib.optionalString (os == "linux") ''
+      addAutoPatchelfSearchPath $packageBaseDir/lib
+      if [[ -d $packageBaseDir/lib64 ]]; then
+        addAutoPatchelfSearchPath $packageBaseDir/lib64
+        autoPatchelf --no-recurse $packageBaseDir/lib64
+      fi
+      autoPatchelf --no-recurse $packageBaseDir
+    ''}
+
+    wrapProgram $PWD/mainDexClasses \
+      --prefix PATH : ${pkgs.jdk8}/bin
+  '';
+  noAuditTmpdir = true; # The checker script gets confused by the build-tools path that is incorrectly identified as a reference to /build
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/cmake.nix b/nixpkgs/pkgs/development/mobile/androidenv/cmake.nix
new file mode 100644
index 000000000000..1aeef467642c
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/cmake.nix
@@ -0,0 +1,10 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, pkgs}:
+
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook ]
+    ++ lib.optional (os == "linux") [ pkgs.stdenv.glibc pkgs.stdenv.cc.cc ];
+  patchInstructions = lib.optionalString (os == "linux") ''
+    autoPatchelf $packageBaseDir/bin
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/compose-android-packages.nix b/nixpkgs/pkgs/development/mobile/androidenv/compose-android-packages.nix
new file mode 100644
index 000000000000..fb548bf3f9f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/compose-android-packages.nix
@@ -0,0 +1,258 @@
+{requireFile, autoPatchelfHook, pkgs, pkgs_i686, licenseAccepted ? false}:
+
+{ toolsVersion ? "25.2.5"
+, platformToolsVersion ? "28.0.1"
+, buildToolsVersions ? [ "28.0.3" ]
+, includeEmulator ? false
+, emulatorVersion ? "28.0.14"
+, platformVersions ? []
+, includeSources ? false
+, includeDocs ? false
+, includeSystemImages ? false
+, systemImageTypes ? [ "default" ]
+, abiVersions ? [ "armeabi-v7a" ]
+, lldbVersions ? [ ]
+, cmakeVersions ? [ ]
+, includeNDK ? false
+, ndkVersion ? "18.1.5063045"
+, useGoogleAPIs ? false
+, useGoogleTVAddOns ? false
+, includeExtras ? []
+}:
+
+let
+  inherit (pkgs) stdenv lib fetchurl makeWrapper unzip;
+
+  # Determine the Android os identifier from Nix's system identifier
+  os = if stdenv.system == "x86_64-linux" then "linux"
+    else if stdenv.system == "x86_64-darwin" then "macosx"
+    else throw "No Android SDK tarballs are available for system architecture: ${stdenv.system}";
+
+  # Generated Nix packages
+  packages = import ./generated/packages.nix {
+    inherit fetchurl;
+  };
+
+  # Generated system images
+  system-images-packages-android = import ./generated/system-images-android.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages-android-tv = import ./generated/system-images-android-tv.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages-android-wear = import ./generated/system-images-android-wear.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages-android-wear-cn = import ./generated/system-images-android-wear-cn.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages-google_apis = import ./generated/system-images-google_apis.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages-google_apis_playstore = import ./generated/system-images-google_apis_playstore.nix {
+    inherit fetchurl;
+  };
+
+  system-images-packages =
+    lib.recursiveUpdate
+      system-images-packages-android
+      (lib.recursiveUpdate system-images-packages-android-tv
+        (lib.recursiveUpdate system-images-packages-android-wear
+          (lib.recursiveUpdate system-images-packages-android-wear-cn
+            (lib.recursiveUpdate system-images-packages-google_apis system-images-packages-google_apis_playstore))));
+
+  # Generated addons
+  addons = import ./generated/addons.nix {
+    inherit fetchurl;
+  };
+in
+rec {
+  deployAndroidPackage = import ./deploy-androidpackage.nix {
+    inherit stdenv unzip;
+  };
+
+  platform-tools = import ./platform-tools.nix {
+    inherit deployAndroidPackage os autoPatchelfHook pkgs lib;
+    package = packages.platform-tools.${platformToolsVersion};
+  };
+
+  build-tools = map (version:
+    import ./build-tools.nix {
+      inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs pkgs_i686 lib;
+      package = packages.build-tools.${version};
+    }
+  ) buildToolsVersions;
+
+  docs = deployAndroidPackage {
+    inherit os;
+    package = packages.docs."1";
+  };
+
+  emulator = import ./emulator.nix {
+    inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs pkgs_i686 lib;
+    package = packages.emulator.${emulatorVersion}.${os};
+  };
+
+  platforms = map (version:
+    deployAndroidPackage {
+      inherit os;
+      package = packages.platforms.${version};
+    }
+  ) platformVersions;
+
+  sources = map (version:
+    deployAndroidPackage {
+      inherit os;
+      package = packages.sources.${version};
+    }
+  ) platformVersions;
+
+  system-images = lib.flatten (map (apiVersion:
+    map (type:
+      map (abiVersion:
+        deployAndroidPackage {
+          inherit os;
+          package = system-images-packages.${apiVersion}.${type}.${abiVersion};
+          # Patch 'google_apis' system images so they're recognized by the sdk.
+          # Without this, `android list targets` shows 'Tag/ABIs : no ABIs' instead
+          # of 'Tag/ABIs : google_apis*/*' and the emulator fails with an ABI-related error.
+          patchInstructions = lib.optionalString (lib.hasPrefix "google_apis" type) ''
+            sed -i '/^Addon.Vendor/d' source.properties
+          '';
+        }
+      ) abiVersions
+    ) systemImageTypes
+  ) platformVersions);
+
+  lldb = map (version:
+    import ./lldb.nix {
+      inherit deployAndroidPackage os autoPatchelfHook pkgs lib;
+      package = packages.lldb.${version};
+    }
+  ) lldbVersions;
+
+  cmake = map (version:
+    import ./cmake.nix {
+      inherit deployAndroidPackage os autoPatchelfHook pkgs lib;
+      package = packages.cmake.${version};
+    }
+  ) cmakeVersions;
+
+  ndk-bundle = import ./ndk-bundle {
+    inherit deployAndroidPackage os autoPatchelfHook makeWrapper pkgs lib platform-tools;
+    package = packages.ndk-bundle.${ndkVersion};
+  };
+
+  google-apis = map (version:
+    deployAndroidPackage {
+      inherit os;
+      package = addons.addons.${version}.google_apis;
+    }
+  ) (builtins.filter (platformVersion: platformVersion < "26") platformVersions); # API level 26 and higher include Google APIs by default
+
+  google-tv-addons = map (version:
+    deployAndroidPackage {
+      inherit os;
+      package = addons.addons.${version}.google_tv_addon;
+    }
+  ) platformVersions;
+
+  # Function that automatically links all plugins for which multiple versions can coexist
+  linkPlugins = {name, plugins}:
+    lib.optionalString (plugins != []) ''
+      mkdir -p ${name}
+      ${lib.concatMapStrings (plugin: ''
+        ln -s ${plugin}/libexec/android-sdk/${name}/* ${name}
+      '') plugins}
+    '';
+
+  # Function that automatically links a plugin for which only one version exists
+  linkPlugin = {name, plugin, check ? true}:
+    lib.optionalString check ''
+      ln -s ${plugin}/libexec/android-sdk/* ${name}
+    '';
+
+  # Links all plugins related to a requested platform
+  linkPlatformPlugins = {name, plugins, check}:
+    lib.optionalString check ''
+      mkdir -p ${name}
+      ${lib.concatMapStrings (plugin: ''
+        ln -s ${plugin}/libexec/android-sdk/${name}/* ${name}
+      '') plugins}
+    ''; # */
+
+  # This derivation deploys the tools package and symlinks all the desired
+  # plugins that we want to use.
+
+  androidsdk = if !licenseAccepted then throw ''
+    You must accept the Android Software Development Kit License Agreement at
+    https://developer.android.com/studio/terms
+    by setting nixpkgs config option 'android_sdk.accept_license = true;'
+  '' else import ./tools.nix {
+    inherit deployAndroidPackage requireFile packages toolsVersion autoPatchelfHook makeWrapper os pkgs pkgs_i686 lib;
+
+    postInstall = ''
+      # Symlink all requested plugins
+
+      ${linkPlugin { name = "platform-tools"; plugin = platform-tools; }}
+      ${linkPlugins { name = "build-tools"; plugins = build-tools; }}
+      ${linkPlugin { name = "emulator"; plugin = emulator; check = includeEmulator; }}
+      ${linkPlugin { name = "docs"; plugin = docs; check = includeDocs; }}
+      ${linkPlugins { name = "platforms"; plugins = platforms; }}
+      ${linkPlatformPlugins { name = "sources"; plugins = sources; check = includeSources; }}
+      ${linkPlugins { name = "lldb"; plugins = lldb; }}
+      ${linkPlugins { name = "cmake"; plugins = cmake; }}
+      ${linkPlugin { name = "ndk-bundle"; plugin = ndk-bundle; check = includeNDK; }}
+
+      ${lib.optionalString includeSystemImages ''
+        mkdir -p system-images
+        ${lib.concatMapStrings (system-image: ''
+          apiVersion=$(basename $(echo ${system-image}/libexec/android-sdk/system-images/*))
+          type=$(basename $(echo ${system-image}/libexec/android-sdk/system-images/*/*))
+          mkdir -p system-images/$apiVersion/$type
+          ln -s ${system-image}/libexec/android-sdk/system-images/$apiVersion/$type/* system-images/$apiVersion/$type
+        '') system-images}
+      ''}
+
+      ${linkPlatformPlugins { name = "add-ons"; plugins = google-apis; check = useGoogleAPIs; }}
+      ${linkPlatformPlugins { name = "add-ons"; plugins = google-apis; check = useGoogleTVAddOns; }}
+
+      # Link extras
+      ${lib.concatMapStrings (identifier:
+        let
+          path = addons.extras.${identifier}.path;
+          addon = deployAndroidPackage {
+            inherit os;
+            package = addons.extras.${identifier};
+          };
+        in
+        ''
+          targetDir=$(dirname ${path})
+          mkdir -p $targetDir
+          ln -s ${addon}/libexec/android-sdk/${path} $targetDir
+        '') includeExtras}
+
+      # Expose common executables in bin/
+      mkdir -p $out/bin
+      find $PWD/tools -not -path '*/\.*' -type f -executable -mindepth 1 -maxdepth 1 | while read i
+      do
+          ln -s $i $out/bin
+      done
+
+      find $PWD/tools/bin -not -path '*/\.*' -type f -executable -mindepth 1 -maxdepth 1 | while read i
+      do
+          ln -s $i $out/bin
+      done
+
+      for i in ${platform-tools}/bin/*
+      do
+          ln -s $i $out/bin
+      done
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/convertaddons.xsl b/nixpkgs/pkgs/development/mobile/androidenv/convertaddons.xsl
new file mode 100644
index 000000000000..73f58ff5cdec
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/convertaddons.xsl
@@ -0,0 +1,128 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:addon="http://schemas.android.com/sdk/android/repo/addon2/01"
+  xmlns:sdk="http://schemas.android.com/repository/android/common/01"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+
+  <!-- Template that puts a google HTTP prefix in front of relative URLs -->
+  <xsl:template name="repository-url">
+    <xsl:variable name="raw-url" select="complete/url"/>
+    <xsl:choose>
+      <xsl:when test="starts-with($raw-url, 'http')">
+        <xsl:value-of select="$raw-url"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>https://dl.google.com/android/repository/</xsl:text>
+        <xsl:value-of select="$raw-url"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="/addon:sdk-addon">
+{fetchurl}:
+
+{
+  addons = {
+    <!-- Convert all addons, but skip the entry for google APIs version 25 because it is inconsistent with the spec -->
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:addonDetailsType' and archives/archive/complete/url != 'google_apis-25_r1.zip' ]"><xsl:sort select="@path" />
+    "<xsl:value-of select="type-details/api-level" />"."<xsl:value-of select="type-details/tag/id" />" = {
+      name = "<xsl:value-of select="type-details/tag/id" />";
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
+      revision = "<xsl:value-of select="type-details/api-level" />";
+      displayName = "<xsl:value-of select="display-name" />";
+      archives = {
+      <xsl:for-each select="archives/archive[not(host-os)]">
+        all = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
+        <xsl:value-of select="host-os" /> = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      };
+    };
+    </xsl:for-each>
+
+    <!-- Workaround to make google APIs version 25 work. Hopefully, we can get rid of this at some point -->
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:addonDetailsType' and archives/archive/complete/url = 'google_apis-25_r1.zip' ]">
+    "<xsl:value-of select="25" />"."<xsl:value-of select="type-details/tag/id" />" = {
+      name = "<xsl:value-of select="type-details/tag/id" />";
+      path = "add-ons/addon-google_apis-google-25";
+      revision = "<xsl:value-of select="25" />";
+      displayName = "<xsl:value-of select="display-name" />";
+      archives = {
+      <xsl:for-each select="archives/archive[not(host-os)]">
+        all = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
+        <xsl:value-of select="host-os" /> = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      };
+    };
+    </xsl:for-each>
+  };
+
+  extras = {
+    <!-- Convert all extras and maven artefacts -->
+    <xsl:for-each select="remotePackage[type-details/@xsi:type='addon:extraDetailsType' or type-details/@xsi:type='addon:mavenType']"><xsl:sort select="@path" />
+    
+    <!-- Compose revision string from revision attributes -->
+    <xsl:variable name="revision">
+      <xsl:choose>
+        <xsl:when test="revision/major">
+          <xsl:value-of select="revision/major" />
+        </xsl:when>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="revision/minor">.<xsl:value-of select="revision/minor" />
+        </xsl:when>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="revision/micro">.<xsl:value-of select="revision/micro" />
+        </xsl:when>
+      </xsl:choose>
+      <xsl:choose>
+        <xsl:when test="revision/preview">-rc<xsl:value-of select="revision/preview" />
+        </xsl:when>
+      </xsl:choose>
+    </xsl:variable>
+
+    "<xsl:value-of select="@path" />" = {
+      name = "<xsl:value-of select="translate(@path, ';', '-')" />";
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
+      revision = "<xsl:value-of select="$revision" />";
+      displayName = "<xsl:value-of select="display-name" />";
+      archives = {
+      <xsl:for-each select="archives/archive[not(host-os)]">
+        all = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
+        <xsl:value-of select="host-os" /> = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      };
+    };
+    </xsl:for-each>
+  };
+}
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/convertpackages.xsl b/nixpkgs/pkgs/development/mobile/androidenv/convertpackages.xsl
new file mode 100644
index 000000000000..9623e01abcd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/convertpackages.xsl
@@ -0,0 +1,116 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:common="http://schemas.android.com/repository/android/common/01"
+  xmlns:generic="http://schemas.android.com/repository/android/generic/01"
+  xmlns:sdk="http://schemas.android.com/sdk/android/repo/repository2/01"
+  xmlns:sdk-common="http://schemas.android.com/sdk/android/repo/common/01"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+
+  <!-- Template that puts a google HTTP prefix in front of relative URLs -->
+  <xsl:template name="repository-url">
+    <xsl:variable name="raw-url" select="complete/url"/>
+    <xsl:choose>
+      <xsl:when test="starts-with($raw-url, 'http')">
+        <xsl:value-of select="$raw-url"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>https://dl.google.com/android/repository/</xsl:text>
+        <xsl:value-of select="$raw-url"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="/sdk:sdk-repository">
+{fetchurl}:
+
+{
+  <!-- Convert all remote packages -->
+  <xsl:for-each select="remotePackage"><xsl:sort select="@path" />
+
+  <!-- Extract the package name from the path -->
+  <xsl:variable name="name">
+    <xsl:choose>
+      <xsl:when test="contains(@path, ';')">
+        <xsl:value-of select="substring-before(@path, ';')" />
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="@path" />
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
+
+  <!-- Compose version string from version attributes -->
+  <xsl:variable name="revision">
+    <xsl:choose>
+      <!-- Compose revision for a generic package from the revision attributes -->
+      <xsl:when test="type-details/@xsi:type='generic:genericDetailsType'">
+        <xsl:choose>
+          <xsl:when test="revision/major">
+            <xsl:value-of select="revision/major" />
+          </xsl:when>
+        </xsl:choose>
+        <xsl:choose>
+          <xsl:when test="revision/minor">.<xsl:value-of select="revision/minor" />
+          </xsl:when>
+        </xsl:choose>
+        <xsl:choose>
+          <xsl:when test="revision/micro">.<xsl:value-of select="revision/micro" />
+          </xsl:when>
+        </xsl:choose>
+        <xsl:choose>
+          <xsl:when test="revision/preview">-rc<xsl:value-of select="revision/preview" />
+          </xsl:when>
+        </xsl:choose>
+      </xsl:when>
+      <!-- Compose revision of a platform SDK from the API-level or codename if the latter exists -->
+      <xsl:when test="type-details/@xsi:type='sdk:platformDetailsType'">
+        <xsl:choose>
+          <xsl:when test="not(type-details/codename='')">
+            <xsl:value-of select="type-details/codename" />
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:value-of select="type-details/api-level" />
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <!-- Compose revision of a source SDK from the API-level -->
+      <xsl:when test="type-details/@xsi:type='sdk:sourceDetailsType'">
+        <xsl:value-of select="type-details/api-level" />
+      </xsl:when>
+    </xsl:choose>
+  </xsl:variable>
+
+  <xsl:choose>
+    <xsl:when test="@path='emulator'"> <!-- An emulator package provides one archive per operating system but the same versions -->
+  "<xsl:value-of select="$name" />"."<xsl:value-of select="$revision" />".<xsl:value-of select="archives/archive/host-os" /> = {
+    </xsl:when>
+    <xsl:otherwise>
+  "<xsl:value-of select="$name" />"."<xsl:value-of select="$revision" />" = {
+    </xsl:otherwise>
+  </xsl:choose>
+    name = "<xsl:value-of select="$name" />";
+    path = "<xsl:value-of select="translate(@path, ';', '/')" />";
+    revision = "<xsl:value-of select="$revision" />";
+    displayName = "<xsl:value-of select="display-name" />";
+    archives = {
+      <xsl:for-each select="archives/archive[not(host-os)]">
+        all = fetchurl {
+          url = <xsl:call-template name="repository-url"/>;
+          sha1 = "<xsl:value-of select="complete/checksum" />";
+        };
+      </xsl:for-each>
+      <xsl:for-each select="archives/archive[host-os and not(host-os = 'windows')]">
+        <xsl:value-of select="host-os" /> = fetchurl {
+        url = <xsl:call-template name="repository-url"/>;
+        sha1 = "<xsl:value-of select="complete/checksum" />";
+      };
+      </xsl:for-each>
+    };
+  };
+  </xsl:for-each>
+}
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/convertsystemimages.xsl b/nixpkgs/pkgs/development/mobile/androidenv/convertsystemimages.xsl
new file mode 100644
index 000000000000..42d19cb69651
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/convertsystemimages.xsl
@@ -0,0 +1,47 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:sys-img="http://schemas.android.com/sdk/android/repo/sys-img2/01"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+  <xsl:param name="imageType" />
+
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+
+  <xsl:template name="repository-url">
+    <xsl:variable name="raw-url" select="complete/url"/>
+    <xsl:choose>
+      <xsl:when test="starts-with($raw-url, 'http')">
+        <xsl:value-of select="$raw-url"/>
+      </xsl:when>
+      <xsl:otherwise>
+        https://dl.google.com/android/repository/sys-img/<xsl:value-of select="$imageType" />/<xsl:value-of select="$raw-url"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template match="/sys-img:sdk-sys-img">
+{fetchurl}:
+
+{
+  <xsl:for-each select="remotePackage[starts-with(@path, 'system-images;')]">
+    <xsl:variable name="revision">
+      <xsl:value-of select="type-details/api-level" />-<xsl:value-of select="type-details/tag/id" />-<xsl:value-of select="type-details/abi" />
+    </xsl:variable>
+
+    "<xsl:value-of select="type-details/api-level" />".<xsl:value-of select="type-details/tag/id" />."<xsl:value-of select="type-details/abi" />" = {
+      name = "system-image-<xsl:value-of select="$revision" />";
+      path = "<xsl:value-of select="translate(@path, ';', '/')" />";
+      revision = "<xsl:value-of select="$revision" />";
+      displayName = "<xsl:value-of select="display-name" />";
+      archives.all = fetchurl {
+      <xsl:for-each select="archives/archive">
+        url = <xsl:call-template name="repository-url"/>;
+        sha1 = "<xsl:value-of select="complete/checksum" />";
+      </xsl:for-each>
+      };
+  };
+  </xsl:for-each>
+}
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/default.nix b/nixpkgs/pkgs/development/mobile/androidenv/default.nix
new file mode 100644
index 000000000000..14882bc22438
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/default.nix
@@ -0,0 +1,26 @@
+{ config, pkgs ? import <nixpkgs> {}
+, pkgs_i686 ? import <nixpkgs> { system = "i686-linux"; }
+, licenseAccepted ? config.android_sdk.accept_license or false
+}:
+
+rec {
+  composeAndroidPackages = import ./compose-android-packages.nix {
+    inherit (pkgs) requireFile autoPatchelfHook;
+    inherit pkgs pkgs_i686 licenseAccepted;
+  };
+
+  buildApp = import ./build-app.nix {
+    inherit (pkgs) stdenv lib jdk ant gnumake gawk;
+    inherit composeAndroidPackages;
+  };
+
+  emulateApp = import ./emulate-app.nix {
+    inherit (pkgs) stdenv lib;
+    inherit composeAndroidPackages;
+  };
+
+  androidPkgs_9_0 = composeAndroidPackages {
+    platformVersions = [ "28" ];
+    abiVersions = [ "x86" "x86_64"];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/deploy-androidpackage.nix b/nixpkgs/pkgs/development/mobile/androidenv/deploy-androidpackage.nix
new file mode 100644
index 000000000000..839a14f7033c
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/deploy-androidpackage.nix
@@ -0,0 +1,45 @@
+{stdenv, unzip}:
+{package, os ? null, buildInputs ? [], patchInstructions ? "", meta ? {}, ...}@args:
+
+let
+  extraParams = removeAttrs args [ "package" "os" "buildInputs" "patchInstructions" ];
+in
+stdenv.mkDerivation ({
+  name = package.name + "-" + package.revision;
+  src = if os != null && builtins.hasAttr os package.archives then package.archives.${os} else package.archives.all;
+  buildInputs = [ unzip ] ++ buildInputs;
+  preferLocalBuild = true;
+
+  # Most Android Zip packages have a root folder, but some don't. We unpack
+  # the zip file in a folder and we try to discover whether it has a single root
+  # folder. If this is the case, we adjust the current working folder.
+  unpackPhase = ''
+    mkdir extractedzip
+    cd extractedzip
+    unpackFile "$src"
+    if [ "$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ]
+    then
+        cd "$(find . -mindepth 1 -maxdepth 1 -type d)"
+    fi
+    sourceRoot="$PWD"
+  '';
+
+  installPhase = ''
+    packageBaseDir=$out/libexec/android-sdk/${package.path}
+    mkdir -p $packageBaseDir
+    cd $packageBaseDir
+    cp -av $sourceRoot/* .
+    ${patchInstructions}
+  '';
+
+  # We never attempt to strip. This is not required since we're doing binary
+  # deployments. Moreover, some executables that have been patched with patchelf
+  # may not work any longer after they have been stripped.
+  dontStrip = true;
+  dontPatchELF = true;
+  dontAutoPatchelf = true;
+
+  meta = {
+    description = package.displayName;
+  } // meta;
+} // extraParams)
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/emulate-app.nix b/nixpkgs/pkgs/development/mobile/androidenv/emulate-app.nix
new file mode 100644
index 000000000000..fa9a56fadbad
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/emulate-app.nix
@@ -0,0 +1,136 @@
+{ composeAndroidPackages, stdenv, lib }:
+{ name, app ? null
+, platformVersion ? "16", abiVersion ? "armeabi-v7a", systemImageType ? "default"
+, enableGPU ? false, extraAVDFiles ? []
+, package ? null, activity ? null
+, avdHomeDir ? null, sdkExtraArgs ? {}
+}:
+
+let
+  sdkArgs = {
+    platformVersions = [ platformVersion ];
+    includeEmulator = true;
+    includeSystemImages = true;
+    systemImageTypes = [ systemImageType ];
+    abiVersions = [ abiVersion ];
+  } // sdkExtraArgs;
+
+  sdk = (composeAndroidPackages sdkArgs).androidsdk;
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  buildCommand = ''
+    mkdir -p $out/bin
+
+    cat > $out/bin/run-test-emulator << "EOF"
+    #! ${stdenv.shell} -e
+
+    # We need a TMPDIR
+    if [ "$TMPDIR" = "" ]
+    then
+        export TMPDIR=/tmp
+    fi
+
+    ${if avdHomeDir == null then ''
+      # Store the virtual devices somewhere else, instead of polluting a user's HOME directory
+      export ANDROID_SDK_HOME=$(mktemp -d $TMPDIR/nix-android-vm-XXXX)
+    '' else ''
+      mkdir -p "${avdHomeDir}"
+      export ANDROID_SDK_HOME="${avdHomeDir}"
+    ''}
+
+    # We need to specify the location of the Android SDK root folder
+    export ANDROID_SDK_ROOT=${sdk}/libexec/android-sdk
+
+    # We have to look for a free TCP port
+
+    echo "Looking for a free TCP port in range 5554-5584" >&2
+
+    for i in $(seq 5554 2 5584)
+    do
+        if [ -z "$(${sdk}/libexec/android-sdk/platform-tools/adb devices | grep emulator-$i)" ]
+        then
+            port=$i
+            break
+        fi
+    done
+
+    if [ -z "$port" ]
+    then
+        echo "Unfortunately, the emulator port space is exhausted!" >&2
+        exit 1
+    else
+        echo "We have a free TCP port: $port" >&2
+    fi
+
+    export ANDROID_SERIAL="emulator-$port"
+
+    # Create a virtual android device for testing if it does not exists
+    ${sdk}/libexec/android-sdk/tools/android list targets
+
+    if [ "$(${sdk}/libexec/android-sdk/tools/android list avd | grep 'Name: device')" = "" ]
+    then
+        # Create a virtual android device
+        yes "" | ${sdk}/libexec/android-sdk/tools/android create avd -n device -t 1 --abi ${systemImageType}/${abiVersion} $NIX_ANDROID_AVD_FLAGS
+
+        ${lib.optionalString enableGPU ''
+          # Enable GPU acceleration
+          echo "hw.gpu.enabled=yes" >> $ANDROID_SDK_HOME/.android/avd/device.avd/config.ini
+        ''}
+
+        ${lib.concatMapStrings (extraAVDFile: ''
+          ln -sf ${extraAVDFile} $ANDROID_SDK_HOME/.android/avd/device.avd
+        '') extraAVDFiles}
+    fi
+
+    # Launch the emulator
+    ${sdk}/libexec/android-sdk/emulator/emulator -avd device -no-boot-anim -port $port $NIX_ANDROID_EMULATOR_FLAGS &
+
+    # Wait until the device has completely booted
+    echo "Waiting until the emulator has booted the device and the package manager is ready..." >&2
+
+    ${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port wait-for-device
+
+    echo "Device state has been reached" >&2
+
+    while [ -z "$(${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell getprop dev.bootcomplete | grep 1)" ]
+    do
+        sleep 5
+    done
+
+    echo "dev.bootcomplete property is 1" >&2
+
+    #while [ -z "$(${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell getprop sys.boot_completed | grep 1)" ]
+    #do
+        #sleep 5
+    #done
+
+    #echo "sys.boot_completed property is 1" >&2
+
+    echo "ready" >&2
+
+    ${lib.optionalString (app != null) ''
+      # Install the App through the debugger, if it has not been installed yet
+
+      if [ -z "${package}" ] || [ "$(${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell pm list packages | grep package:${package})" = "" ]
+      then
+          if [ -d "${app}" ]
+          then
+              appPath="$(echo ${app}/*.apk)"
+          else
+              appPath="${app}"
+          fi
+
+          ${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port install "$appPath"
+      fi
+
+      # Start the application
+      ${lib.optionalString (package != null && activity != null) ''
+          ${sdk}/libexec/android-sdk/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/${activity}
+      ''}
+    ''}
+    EOF
+    chmod +x $out/bin/run-test-emulator
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/emulator.nix b/nixpkgs/pkgs/development/mobile/androidenv/emulator.nix
new file mode 100644
index 000000000000..7ba74eb900fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/emulator.nix
@@ -0,0 +1,20 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, pkgs_i686}:
+
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook makeWrapper ]
+    ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.xlibs.libX11 pkgs.xlibs.libXext pkgs.xlibs.libXdamage pkgs.xlibs.libXfixes pkgs.xlibs.libxcb pkgs.libGL pkgs.libpulseaudio pkgs.zlib pkgs.ncurses5 pkgs.stdenv.cc.cc pkgs_i686.glibc ];
+  patchInstructions = lib.optionalString (os == "linux") ''
+    addAutoPatchelfSearchPath $packageBaseDir/lib
+    addAutoPatchelfSearchPath $packageBaseDir/lib64
+    addAutoPatchelfSearchPath $packageBaseDir/lib64/qt/lib
+    autoPatchelf $out
+
+    # Wrap emulator so that it can load libdbus-1.so at runtime and it no longer complains about XKB keymaps
+    wrapProgram $out/libexec/android-sdk/emulator/emulator \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.dbus ]} \
+      --set QT_XKB_CONFIG_ROOT ${pkgs.xkeyboard_config}/share/X11/xkb \
+      --set QTCOMPOSE ${pkgs.xorg.libX11.out}/share/X11/locale
+  '';
+  dontMoveLib64 = true;
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generate.sh b/nixpkgs/pkgs/development/mobile/androidenv/generate.sh
new file mode 100644
index 000000000000..1c55734f5f42
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generate.sh
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+# Convert base packages
+curl https://dl.google.com/android/repository/repository2-1.xml -o xml/repository2-1.xml
+xsltproc convertpackages.xsl xml/repository2-1.xml > generated/packages.nix
+
+# Convert system images
+for img in android android-tv android-wear android-wear-cn google_apis google_apis_playstore
+do
+    curl https://dl.google.com/android/repository/sys-img/$img/sys-img2-1.xml -o xml/$img-sys-img2-1.xml
+    xsltproc --stringparam imageType $img convertsystemimages.xsl xml/$img-sys-img2-1.xml > generated/system-images-$img.nix
+done
+
+# Convert system addons
+curl https://dl.google.com/android/repository/addon2-1.xml -o xml/addon2-1.xml
+xsltproc convertaddons.xsl xml/addon2-1.xml > generated/addons.nix
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/addons.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/addons.nix
new file mode 100644
index 000000000000..d902b1116658
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/addons.nix
@@ -0,0 +1,1145 @@
+
+{fetchurl}:
+
+{
+  addons = {
+    
+    "10"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-10";
+      revision = "10";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-10_r02.zip;
+          sha1 = "cc0711857c881fa7534f90cf8cc09b8fe985484d";
+        };
+      
+      };
+    };
+    
+    "11"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-11";
+      revision = "11";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-11_r01.zip;
+          sha1 = "5eab5e81addee9f3576d456d205208314b5146a5";
+        };
+      
+      };
+    };
+    
+    "12"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-12";
+      revision = "12";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-12_r01.zip;
+          sha1 = "e9999f4fa978812174dfeceec0721c793a636e5d";
+        };
+      
+      };
+    };
+    
+    "13"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-13";
+      revision = "13";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-13_r01.zip;
+          sha1 = "3b153edd211c27dc736c893c658418a4f9041417";
+        };
+      
+      };
+    };
+    
+    "14"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-14";
+      revision = "14";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-14_r02.zip;
+          sha1 = "f8eb4d96ad0492b4c0db2d7e4f1a1a3836664d39";
+        };
+      
+      };
+    };
+    
+    "15"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-15";
+      revision = "15";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-15_r03.zip;
+          sha1 = "d0d2bf26805eb271693570a1aaec33e7dc3f45e9";
+        };
+      
+      };
+    };
+    
+    "16"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-16";
+      revision = "16";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-16_r04.zip;
+          sha1 = "ee6acf1b01020bfa8a8e24725dbc4478bee5e792";
+        };
+      
+      };
+    };
+    
+    "17"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-17";
+      revision = "17";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-17_r04.zip;
+          sha1 = "a076be0677f38df8ca5536b44dfb411a0c808c4f";
+        };
+      
+      };
+    };
+    
+    "18"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-18";
+      revision = "18";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-18_r04.zip;
+          sha1 = "6109603409debdd40854d4d4a92eaf8481462c8b";
+        };
+      
+      };
+    };
+    
+    "19"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-19";
+      revision = "19";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-19_r20.zip;
+          sha1 = "5b933abe830b2f25b4c0f171d45e9e0651e56311";
+        };
+      
+      };
+    };
+    
+    "21"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-21";
+      revision = "21";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-21_r01.zip;
+          sha1 = "66a754efb24e9bb07cc51648426443c7586c9d4a";
+        };
+      
+      };
+    };
+    
+    "22"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-22";
+      revision = "22";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-22_r01.zip;
+          sha1 = "5def0f42160cba8acff51b9c0c7e8be313de84f5";
+        };
+      
+      };
+    };
+    
+    "23"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-23";
+      revision = "23";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-23_r01.zip;
+          sha1 = "04c5cc1a7c88967250ebba9561d81e24104167db";
+        };
+      
+      };
+    };
+    
+    "24"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-24";
+      revision = "24";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-24_r1.zip;
+          sha1 = "31361c2868f27343ee917fbd259c1463821b6145";
+        };
+      
+      };
+    };
+    
+    "3"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-3";
+      revision = "3";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-3-r03.zip;
+          sha1 = "1f92abf3a76be66ae8032257fc7620acbd2b2e3a";
+        };
+      
+      };
+    };
+    
+    "4"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-4";
+      revision = "4";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-4_r02.zip;
+          sha1 = "9b6e86d8568558de4d606a7debc4f6049608dbd0";
+        };
+      
+      };
+    };
+    
+    "5"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-5";
+      revision = "5";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-5_r01.zip;
+          sha1 = "46eaeb56b645ee7ffa24ede8fa17f3df70db0503";
+        };
+      
+      };
+    };
+    
+    "6"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-6";
+      revision = "6";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-6_r01.zip;
+          sha1 = "5ff545d96e031e09580a6cf55713015c7d4936b2";
+        };
+      
+      };
+    };
+    
+    "7"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-7";
+      revision = "7";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-7_r01.zip;
+          sha1 = "2e7f91e0fe34fef7f58aeced973c6ae52361b5ac";
+        };
+      
+      };
+    };
+    
+    "8"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-8";
+      revision = "8";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-8_r02.zip;
+          sha1 = "3079958e7ec87222cac1e6b27bc471b27bf2c352";
+        };
+      
+      };
+    };
+    
+    "9"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-9";
+      revision = "9";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-9_r02.zip;
+          sha1 = "78664645a1e9accea4430814f8694291a7f1ea5d";
+        };
+      
+      };
+    };
+    
+    "12"."google_tv_addon" = {
+      name = "google_tv_addon";
+      path = "add-ons/addon-google_tv_addon-google-12";
+      revision = "12";
+      displayName = "Google TV Addon";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_tv-12_r02.zip;
+          sha1 = "92128a12e7e8b0fb5bac59153d7779b717e7b840";
+        };
+      
+      };
+    };
+    
+    "13"."google_tv_addon" = {
+      name = "google_tv_addon";
+      path = "add-ons/addon-google_tv_addon-google-13";
+      revision = "13";
+      displayName = "Google TV Addon";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_tv-13_r01.zip;
+          sha1 = "b73f7c66011ac8180b44aa4e83b8d78c66ea9a09";
+        };
+      
+      };
+    };
+    
+    "25"."google_apis" = {
+      name = "google_apis";
+      path = "add-ons/addon-google_apis-google-25";
+      revision = "25";
+      displayName = "Google APIs";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_apis-25_r1.zip;
+          sha1 = "550e83eea9513ab11c44919ac6da54b36084a9f3";
+        };
+      
+      };
+    };
+    
+  };
+
+  extras = {
+    
+
+    "extras;android;gapid;1" = {
+      name = "extras-android-gapid-1";
+      path = "extras/android/gapid/1";
+      revision = "1.0.3";
+      displayName = "GPU Debugging tools";
+      archives = {
+      linux = fetchurl {
+          url = https://dl.google.com/android/repository/gapid_r01_linux.zip;
+          sha1 = "7c9ef7544cf0aea030bcc29bd8e12c04fd53e653";
+        };
+      macosx = fetchurl {
+          url = https://dl.google.com/android/repository/gapid_r01_osx.zip;
+          sha1 = "597eb271349d890566274861eba2770a84ee4c69";
+        };
+      
+      };
+    };
+    
+
+    "extras;android;gapid;3" = {
+      name = "extras-android-gapid-3";
+      path = "extras/android/gapid/3";
+      revision = "3.1.0";
+      displayName = "GPU Debugging tools";
+      archives = {
+      linux = fetchurl {
+          url = https://dl.google.com/android/repository/gapid_2994895_linux.zip;
+          sha1 = "e40371ba191f617e4e79bc760d0ab2948ba8cf46";
+        };
+      macosx = fetchurl {
+          url = https://dl.google.com/android/repository/gapid_2994895_osx.zip;
+          sha1 = "ad86a2350b7b9908300277bf03d41649659de384";
+        };
+      
+      };
+    };
+    
+
+    "extras;android;m2repository" = {
+      name = "extras-android-m2repository";
+      path = "extras/android/m2repository";
+      revision = "47.0.0";
+      displayName = "Android Support Repository";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android_m2repository_r47.zip;
+          sha1 = "a0d22beacc106a6977321f2b07d692ce4979e96a";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;admob_ads_sdk" = {
+      name = "extras-google-admob_ads_sdk";
+      path = "extras/google/admob_ads_sdk";
+      revision = "11";
+      displayName = "Google AdMob Ads SDK";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/GoogleAdMobAdsSdkAndroid-6.4.1.zip;
+          sha1 = "0102859d9575baa0bf4fd5eb422af2ad0fe6cb82";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;analytics_sdk_v2" = {
+      name = "extras-google-analytics_sdk_v2";
+      path = "extras/google/analytics_sdk_v2";
+      revision = "3";
+      displayName = "Google Analytics App Tracking SDK";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/GoogleAnalyticsAndroid_2.0beta5.zip;
+          sha1 = "dc14026bf0ce78315cb5dd00552607de0894de83";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;auto" = {
+      name = "extras-google-auto";
+      path = "extras/google/auto";
+      revision = "1.1";
+      displayName = "Android Auto Desktop Head Unit emulator";
+      archives = {
+      linux = fetchurl {
+          url = https://dl.google.com/android/repository/desktop-head-unit-linux_r01.1.zip;
+          sha1 = "202a6e1b3009a0eb815f8c672d2d5b3717de6169";
+        };
+      macosx = fetchurl {
+          url = https://dl.google.com/android/repository/desktop-head-unit-macosx_r01.1.zip;
+          sha1 = "8179cbb3914493ebc5eb65b731cba061582f2e84";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;gcm" = {
+      name = "extras-google-gcm";
+      path = "extras/google/gcm";
+      revision = "3";
+      displayName = "Google Cloud Messaging for Android Library";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/gcm_r03.zip;
+          sha1 = "ad066fd0dc7fc99d8aadac09c65a3c2519fbc7bf";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;google_play_services" = {
+      name = "extras-google-google_play_services";
+      path = "extras/google/google_play_services";
+      revision = "49";
+      displayName = "Google Play services";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_play_services_v16_1_rc09.zip;
+          sha1 = "f95bf19634e2ab0430923247fe2c50246432d2e9";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;google_play_services_froyo" = {
+      name = "extras-google-google_play_services_froyo";
+      path = "extras/google/google_play_services_froyo";
+      revision = "12";
+      displayName = "Google Play services for Froyo";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_play_services_3265130_r12.zip;
+          sha1 = "92558dbc380bba3d55d0ec181167fb05ce7c79d9";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;instantapps" = {
+      name = "extras-google-instantapps";
+      path = "extras/google/instantapps";
+      revision = "1.5.0";
+      displayName = "Google Play Instant Development SDK";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/iasdk-1.5.0-1538000167.zip;
+          sha1 = "6c282b9c686e819fe7f5ac8f2249d2479acb63b4";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;m2repository" = {
+      name = "extras-google-m2repository";
+      path = "extras/google/m2repository";
+      revision = "58";
+      displayName = "Google Repository";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/google_m2repository_gms_v11_3_rc05_wear_2_0_5.zip;
+          sha1 = "05086add9e3a0eb1b67111108d7757a4337c3f10";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;market_apk_expansion" = {
+      name = "extras-google-market_apk_expansion";
+      path = "extras/google/market_apk_expansion";
+      revision = "1";
+      displayName = "Google Play APK Expansion library";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/market_apk_expansion-r03.zip;
+          sha1 = "5305399dc1a56814e86b8459ce24871916f78b8c";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;market_licensing" = {
+      name = "extras-google-market_licensing";
+      path = "extras/google/market_licensing";
+      revision = "1";
+      displayName = "Google Play Licensing Library";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/market_licensing-r02.zip;
+          sha1 = "355e8dc304a92a5616db235af8ee7bd554356254";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;simulators" = {
+      name = "extras-google-simulators";
+      path = "extras/google/simulators";
+      revision = "1";
+      displayName = "Android Auto API Simulators";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/simulator_r01.zip;
+          sha1 = "4fb5344e34e8faab4db18af07dace44c50db26a7";
+        };
+      
+      };
+    };
+    
+
+    "extras;google;usb_driver" = {
+      name = "extras-google-usb_driver";
+      path = "extras/google/usb_driver";
+      revision = "11";
+      displayName = "Google USB Driver";
+      archives = {
+      
+      };
+    };
+    
+
+    "extras;google;webdriver" = {
+      name = "extras-google-webdriver";
+      path = "extras/google/webdriver";
+      revision = "2";
+      displayName = "Google Web Driver";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/webdriver_r02.zip;
+          sha1 = "13f3a3b2670a5fc04a7342861644be9a01b07e38";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0.zip;
+          sha1 = "b621b9d5adf273bb0725948589863e60e96eeaf1";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha2";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha2.zip;
+          sha1 = "2e7fd5d8d158f4517ba52af824f84466ffede879";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha3" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha3";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha3";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha3";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha3.zip;
+          sha1 = "cd1cbbb2621c9034b835e9b69243dc558cdee4dc";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha4";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha4";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout-solver:1.0.0-alpha4";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha4.zip;
+          sha1 = "2aa2aceecc6ba172742d0af0b43f11d03924eeb8";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha5" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha5";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha5";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-alpha5";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha5.zip;
+          sha1 = "7ba6c82c7645ac023cf45c1e27a6ae3added308a";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha6" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha6";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha6";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-alpha6";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha6.zip;
+          sha1 = "b7e390f940704f4f78e1eaa5f5a5dba3bc3e81ad";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha7" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha7";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha7";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-alpha7";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha7.zip;
+          sha1 = "f08be3c306bf878de31c465e46a266c52014a13f";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha8";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha8";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-alpha8";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha8.zip;
+          sha1 = "cd13d16a8f0198c1d6040ec8b1d0d4e5bb7feb6a";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha9" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-alpha9";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-alpha9";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-alpha9";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-alpha9.zip;
+          sha1 = "2c52ddd883d83230a17042b8f4ba03669f0f5f40";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-beta1";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta1";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-beta1";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-beta1.zip;
+          sha1 = "042c25575e7650e96f0f5f5d1d3c54ed38eb821a";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-beta2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta2";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-beta2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-beta2.zip;
+          sha1 = "28492fd42b20ae1586591ff906556d459cfdaae8";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta3" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-beta3";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta3";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-beta3";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-beta3.zip;
+          sha1 = "268e763fa64bd217d8d830e59ce76be19aaba631";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta4" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-beta4";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta4";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-beta4";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-beta4.zip;
+          sha1 = "2213bf37e7a2869db2635895b8e90ca6841e79d2";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta5" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.0-beta5";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.0-beta5";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.0-beta5";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.0-beta5.zip;
+          sha1 = "3918cfef73e64048d0b3e048068e208b414e7e91";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.1";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.1";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.1";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.1.zip;
+          sha1 = "76f8823def9a6da8954a54737762a6820bc1d043";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-solver-1.0.2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout-solver/1.0.2";
+      revision = "1";
+      displayName = "Solver for ConstraintLayout 1.0.2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-solver-1.0.2.zip;
+          sha1 = "96d7ff669f0e808e9833b2c2e320702826ccc8be";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0.zip;
+          sha1 = "70acf99689b933bc6735645d5c3d92b91954b6cb";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha2";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha2.zip;
+          sha1 = "2edb4fc33745cc9d69d985f29fd48fefcd0aa9f0";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha3" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha3";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha3";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha3";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha3.zip;
+          sha1 = "1a26fb79d98421f315ead7ad15be167727533026";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha4";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4";
+      revision = "1";
+      displayName = "com.android.support.constraint:constraint-layout:1.0.0-alpha4";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha4.zip;
+          sha1 = "645a9be1f0c1177301e71cd0ddccf1dd67c554fe";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha5" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha5";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha5";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-alpha5";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha5.zip;
+          sha1 = "24f78daf491dcad74bcb2acfa79ea2d8e906f53b";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha6" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha6";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha6";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-alpha6";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha6.zip;
+          sha1 = "cb60e9ad4f6d3cc3c5b1b98cd3610c8d3204e651";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha7" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha7";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha7";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-alpha7";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha7.zip;
+          sha1 = "17ac210c85d24d7e8ace62847f05e4e45b640b73";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha8";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha8";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-alpha8";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha8.zip;
+          sha1 = "7912ba03b04831f918f523648f118c4ee4da7604";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha9" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-alpha9";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha9";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-alpha9";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-alpha9.zip;
+          sha1 = "89c2bbc005d4731c7a830a4d5aa98dae121a46a4";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta1" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-beta1";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-beta1";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-beta1";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-beta1.zip;
+          sha1 = "11f2f5cec4ff02986bad75435e5be77b704b4c64";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-beta2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-beta2";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-beta2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-beta2.zip;
+          sha1 = "623939865ede2e5c2c975dc55963e0d182bcce95";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta3" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-beta3";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-beta3";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-beta3";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-beta3.zip;
+          sha1 = "d78bb6a8ce92005fb1e4ed55d892a65b4258c60b";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta4" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-beta4";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-beta4";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-beta4";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-beta4.zip;
+          sha1 = "dc60844aab93a09a54a3c107685a77b18d7c1c39";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta5" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.0-beta5";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.0-beta5";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.0-beta5";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.0-beta5.zip;
+          sha1 = "4660f6c7a576ea1364f0c3225db71c29ca660d9a";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.1";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.1";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.1";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.1.zip;
+          sha1 = "342b0894b8651fff37586f80f383733e97aba9f9";
+        };
+      
+      };
+    };
+    
+
+    "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2" = {
+      name = "extras-m2repository-com-android-support-constraint-constraint-layout-1.0.2";
+      path = "extras/m2repository/com/android/support/constraint/constraint-layout/1.0.2";
+      revision = "1";
+      displayName = "ConstraintLayout for Android 1.0.2";
+      archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/com.android.support.constraint-constraint-layout-1.0.2.zip;
+          sha1 = "3d9688a50fe0ed7348275f85d1b02278f616d8a4";
+        };
+      
+      };
+    };
+    
+  };
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/packages.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/packages.nix
new file mode 100644
index 000000000000..fc9f50e13164
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/packages.nix
@@ -0,0 +1,1927 @@
+
+{fetchurl}:
+
+{
+  
+  "build-tools"."17.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/17.0.0";
+    revision = "17.0.0";
+    displayName = "Android SDK Build-Tools 17";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r17-linux.zip;
+        sha1 = "2c2872bc3806aabf16a12e3959c2183ddc866e6d";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r17-macosx.zip;
+        sha1 = "602ee709be9dbb8f179b1e4075148a57f9419930";
+      };
+      
+    };
+  };
+  
+  "build-tools"."18.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/18.0.1";
+    revision = "18.0.1";
+    displayName = "Android SDK Build-Tools 18.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.0.1-linux.zip;
+        sha1 = "f11618492b0d2270c332325d45d752d3656a9640";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.0.1-macosx.zip;
+        sha1 = "d84f5692fb44d60fc53e5b2507cebf9f24626902";
+      };
+      
+    };
+  };
+  
+  "build-tools"."18.1.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/18.1.0";
+    revision = "18.1.0";
+    displayName = "Android SDK Build-Tools 18.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.1-linux.zip;
+        sha1 = "f314a0599e51397f0886fe888b50dd98f2f050d8";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.1-macosx.zip;
+        sha1 = "16ddb299b8b43063e5bb3387ec17147c5053dfd8";
+      };
+      
+    };
+  };
+  
+  "build-tools"."18.1.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/18.1.1";
+    revision = "18.1.1";
+    displayName = "Android SDK Build-Tools 18.1.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.1.1-linux.zip;
+        sha1 = "68c9acbfc0cec2d51b19efaed39831a17055d998";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r18.1.1-macosx.zip;
+        sha1 = "a9d9d37f6ddf859e57abc78802a77aaa166e48d4";
+      };
+      
+    };
+  };
+  
+  "build-tools"."19.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/19.0.0";
+    revision = "19.0.0";
+    displayName = "Android SDK Build-Tools 19";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19-linux.zip;
+        sha1 = "55c1a6cf632e7d346f0002b275ec41fd3137fd83";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19-macosx.zip;
+        sha1 = "86ec1c12db1bc446b7bcaefc5cc14eb361044e90";
+      };
+      
+    };
+  };
+  
+  "build-tools"."19.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/19.0.1";
+    revision = "19.0.1";
+    displayName = "Android SDK Build-Tools 19.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.1-linux.zip;
+        sha1 = "18d2312dc4368858914213087f4e61445aca4517";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.1-macosx.zip;
+        sha1 = "efaf50fb19a3edb8d03efbff76f89a249ad2920b";
+      };
+      
+    };
+  };
+  
+  "build-tools"."19.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/19.0.2";
+    revision = "19.0.2";
+    displayName = "Android SDK Build-Tools 19.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.2-linux.zip;
+        sha1 = "a03a6bdea0091aea32e1b35b90a7294c9f04e3dd";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.2-macosx.zip;
+        sha1 = "145bc43065d45f756d99d87329d899052b9a9288";
+      };
+      
+    };
+  };
+  
+  "build-tools"."19.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/19.0.3";
+    revision = "19.0.3";
+    displayName = "Android SDK Build-Tools 19.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.3-linux.zip;
+        sha1 = "c2d6055478e9d2d4fba476ee85f99181ddd1160c";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.0.3-macosx.zip;
+        sha1 = "651cf8754373b2d52e7f6aab2c52eabffe4e9ea4";
+      };
+      
+    };
+  };
+  
+  "build-tools"."19.1.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/19.1.0";
+    revision = "19.1.0";
+    displayName = "Android SDK Build-Tools 19.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.1-linux.zip;
+        sha1 = "1ff20ac15fa47a75d00346ec12f180d531b3ca89";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r19.1-macosx.zip;
+        sha1 = "0d11aae3417de1efb4b9a0e0a7855904a61bcec1";
+      };
+      
+    };
+  };
+  
+  "build-tools"."20.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/20.0.0";
+    revision = "20.0.0";
+    displayName = "Android SDK Build-Tools 20";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r20-linux.zip;
+        sha1 = "b688905526a5584d1327a662d871a635ff502758";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r20-macosx.zip;
+        sha1 = "1240f629411c108a714c4ddd756937c7fab93f83";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.0.0";
+    revision = "21.0.0";
+    displayName = "Android SDK Build-Tools 21";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21-linux.zip;
+        sha1 = "4933328fdeecbd554a29528f254f4993468e1cf4";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21-macosx.zip;
+        sha1 = "9bef7989b51436bd4e5114d8a0330359f077cbfa";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.0.1";
+    revision = "21.0.1";
+    displayName = "Android SDK Build-Tools 21.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.0.1-linux.zip;
+        sha1 = "e573069eea3e5255e7a65bedeb767f4fd0a5f49a";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.0.1-macosx.zip;
+        sha1 = "b60c8f9b810c980abafa04896706f3911be1ade7";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.0.2";
+    revision = "21.0.2";
+    displayName = "Android SDK Build-Tools 21.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.0.2-linux.zip;
+        sha1 = "e1236ab8897b62b57414adcf04c132567b2612a5";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.0.2-macosx.zip;
+        sha1 = "f17471c154058f3734729ef3cc363399b1cd3de1";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.1.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.1.0";
+    revision = "21.1.0";
+    displayName = "Android SDK Build-Tools 21.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1-linux.zip;
+        sha1 = "b7455e543784d52a8925f960bc880493ed1478cb";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1-macosx.zip;
+        sha1 = "df619356c2359aa5eacdd48699d15b335d9bd246";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.1.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.1.1";
+    revision = "21.1.1";
+    displayName = "Android SDK Build-Tools 21.1.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1.1-linux.zip;
+        sha1 = "1c712ee3a1ba5a8b0548f9c32f17d4a0ddfd727d";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1.1-macosx.zip;
+        sha1 = "836a146eab0504aa9387a5132e986fe7c7381571";
+      };
+      
+    };
+  };
+  
+  "build-tools"."21.1.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/21.1.2";
+    revision = "21.1.2";
+    displayName = "Android SDK Build-Tools 21.1.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1.2-linux.zip;
+        sha1 = "5e35259843bf2926113a38368b08458735479658";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r21.1.2-macosx.zip;
+        sha1 = "e7c906b4ba0eea93b32ba36c610dbd6b204bff48";
+      };
+      
+    };
+  };
+  
+  "build-tools"."22.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/22.0.0";
+    revision = "22.0.0";
+    displayName = "Android SDK Build-Tools 22";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r22-linux.zip;
+        sha1 = "a8a1619dd090e44fac957bce6842e62abf87965b";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r22-macosx.zip;
+        sha1 = "af95429b24088d704bc5db9bd606e34ac1b82c0d";
+      };
+      
+    };
+  };
+  
+  "build-tools"."22.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/22.0.1";
+    revision = "22.0.1";
+    displayName = "Android SDK Build-Tools 22.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r22.0.1-linux.zip;
+        sha1 = "da8b9c5c3ede39298e6cf0283c000c2ee9029646";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r22.0.1-macosx.zip;
+        sha1 = "53dad7f608e01d53b17176ba11165acbfccc5bbf";
+      };
+      
+    };
+  };
+  
+  "build-tools"."23.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/23.0.0";
+    revision = "23.0.0";
+    displayName = "Android SDK Build-Tools 23";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23-linux.zip;
+        sha1 = "c1d6209212b01469f80fa804e0c1d39a06bc9060";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23-macosx.zip;
+        sha1 = "90ba6e716f7703a236cd44b2e71c5ff430855a03";
+      };
+      
+    };
+  };
+  
+  "build-tools"."23.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/23.0.1";
+    revision = "23.0.1";
+    displayName = "Android SDK Build-Tools 23.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.1-linux.zip;
+        sha1 = "b6ba7c399d5fa487d95289d8832e4ad943aed556";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.1-macosx.zip;
+        sha1 = "d96ec1522721e9a179ae2c591c99f75d31d39718";
+      };
+      
+    };
+  };
+  
+  "build-tools"."23.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/23.0.2";
+    revision = "23.0.2";
+    displayName = "Android SDK Build-Tools 23.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.2-linux.zip;
+        sha1 = "8a9f2b37f6fcf7a9fa784dc21aeaeb41bbb9f2c3";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.2-macosx.zip;
+        sha1 = "482c4cbceef8ff58aefd92d8155a38610158fdaf";
+      };
+      
+    };
+  };
+  
+  "build-tools"."23.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/23.0.3";
+    revision = "23.0.3";
+    displayName = "Android SDK Build-Tools 23.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.3-linux.zip;
+        sha1 = "368f2600feac7e9b511b82f53d1f2240ae4a91a3";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r23.0.3-macosx.zip;
+        sha1 = "fbc98cd303fd15a31d472de6c03bd707829f00b0";
+      };
+      
+    };
+  };
+  
+  "build-tools"."24.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/24.0.0";
+    revision = "24.0.0";
+    displayName = "Android SDK Build-Tools 24";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24-linux.zip;
+        sha1 = "c6271c4d78a5612ea6c7150688bcd5b7313de8d1";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24-macosx.zip;
+        sha1 = "97fc4ed442f23989cc488d02c1d1de9bdde241de";
+      };
+      
+    };
+  };
+  
+  "build-tools"."24.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/24.0.1";
+    revision = "24.0.1";
+    displayName = "Android SDK Build-Tools 24.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.1-linux.zip;
+        sha1 = "84f18c392919a074fcbb9b1d967984e6b2fef8b4";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.1-macosx.zip;
+        sha1 = "5c6457fcdfa07724fb086d8ff4e8316fc0742848";
+      };
+      
+    };
+  };
+  
+  "build-tools"."24.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/24.0.2";
+    revision = "24.0.2";
+    displayName = "Android SDK Build-Tools 24.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.2-linux.zip;
+        sha1 = "f199a7a788c3fefbed102eea34d6007737b803cf";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.2-macosx.zip;
+        sha1 = "8bb8fc575477491d5957de743089df412de55cda";
+      };
+      
+    };
+  };
+  
+  "build-tools"."24.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/24.0.3";
+    revision = "24.0.3";
+    displayName = "Android SDK Build-Tools 24.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.3-linux.zip;
+        sha1 = "9e8cc49d66e03fa1a8ecc1ac3e58f1324f5da304";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r24.0.3-macosx.zip;
+        sha1 = "a01c15f1b105c34595681075e1895d58b3fff48c";
+      };
+      
+    };
+  };
+  
+  "build-tools"."25.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/25.0.0";
+    revision = "25.0.0";
+    displayName = "Android SDK Build-Tools 25";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25-linux.zip;
+        sha1 = "f2bbda60403e75cabd0f238598c3b4dfca56ea44";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25-macosx.zip;
+        sha1 = "273c5c29a65cbed00e44f3aa470bbd7dce556606";
+      };
+      
+    };
+  };
+  
+  "build-tools"."25.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/25.0.1";
+    revision = "25.0.1";
+    displayName = "Android SDK Build-Tools 25.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.1-linux.zip;
+        sha1 = "ff063d252ab750d339f5947d06ff782836f22bac";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.1-macosx.zip;
+        sha1 = "7bf7f22d7d48ef20b6ab0e3d7a2912e5c088340f";
+      };
+      
+    };
+  };
+  
+  "build-tools"."25.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/25.0.2";
+    revision = "25.0.2";
+    displayName = "Android SDK Build-Tools 25.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.2-linux.zip;
+        sha1 = "ff953c0177e317618fda40516f3e9d95fd43c7ae";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.2-macosx.zip;
+        sha1 = "12a5204bb3b6e39437535469fde7ddf42da46b16";
+      };
+      
+    };
+  };
+  
+  "build-tools"."25.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/25.0.3";
+    revision = "25.0.3";
+    displayName = "Android SDK Build-Tools 25.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.3-linux.zip;
+        sha1 = "db95f3a0ae376534d4d69f4cdb6fad20649f3509";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r25.0.3-macosx.zip;
+        sha1 = "160d2fefb5ce68e443427fc30a793a703b63e26e";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.0";
+    revision = "26.0.0";
+    displayName = "Android SDK Build-Tools 26";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-linux.zip;
+        sha1 = "1cbe72929876f8a872ab1f1b1040a9f720261f59";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-macosx.zip;
+        sha1 = "d01a1aeca03747245f1f5936b3cb01759c66d086";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.0-rc1" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.0-rc1";
+    revision = "26.0.0-rc1";
+    displayName = "Android SDK Build-Tools 26-rc1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-rc1-linux.zip;
+        sha1 = "8cd6388dc96db2d7a49d06159cf990d3bbc78d04";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-rc1-macosx.zip;
+        sha1 = "5c5a1de7d5f4f000d36ae349229fe0be846d6137";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.0-rc2" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.0-rc2";
+    revision = "26.0.0-rc2";
+    displayName = "Android SDK Build-Tools 26-rc2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-rc2-linux.zip;
+        sha1 = "629bbd8d2e415bf64871fb0b4c0540fd6d0347a0";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26-rc2-macosx.zip;
+        sha1 = "cb1eb738a1f7003025af267a9b8cc2d259533c70";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.1";
+    revision = "26.0.1";
+    displayName = "Android SDK Build-Tools 26.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.1-linux.zip;
+        sha1 = "5378c2c78091b414d0eac40a6bd37f2faa31a365";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.1-macosx.zip;
+        sha1 = "cbde59de198916b390777dd0227921bfa2120832";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.2";
+    revision = "26.0.2";
+    displayName = "Android SDK Build-Tools 26.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.2-linux.zip;
+        sha1 = "5b2b7b66c7bf2151f2af183b5b50a17808850592";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.2-macosx.zip;
+        sha1 = "d9ed7c7f149ce38be5dc08979aea8acec1459ca0";
+      };
+      
+    };
+  };
+  
+  "build-tools"."26.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/26.0.3";
+    revision = "26.0.3";
+    displayName = "Android SDK Build-Tools 26.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.3-linux.zip;
+        sha1 = "8a2e6c1bcd845844523a68aa17e5442f0dce328c";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r26.0.3-macosx.zip;
+        sha1 = "5bb90ed935d99e5bc90686f43b852e68c5ad40df";
+      };
+      
+    };
+  };
+  
+  "build-tools"."27.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/27.0.0";
+    revision = "27.0.0";
+    displayName = "Android SDK Build-Tools 27";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27-linux.zip;
+        sha1 = "28542332ba97cf4a08c3eddfcf5edd70e3cf1260";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27-macosx.zip;
+        sha1 = "fb4e8d7e6b8d29a77090e34024077a80458d5ae1";
+      };
+      
+    };
+  };
+  
+  "build-tools"."27.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/27.0.1";
+    revision = "27.0.1";
+    displayName = "Android SDK Build-Tools 27.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.1-linux.zip;
+        sha1 = "7f4eedb1077ef948b848040dcd15de9e8a759f4a";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.1-macosx.zip;
+        sha1 = "1edd07bfdbadd95652d093040e16d858f7489594";
+      };
+      
+    };
+  };
+  
+  "build-tools"."27.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/27.0.2";
+    revision = "27.0.2";
+    displayName = "Android SDK Build-Tools 27.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.2-linux.zip;
+        sha1 = "b687ddf6be84f11607871138aad32cf857d0b837";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.2-macosx.zip;
+        sha1 = "6d5d9cf2a47877f273f4b742b19e712a051a31be";
+      };
+      
+    };
+  };
+  
+  "build-tools"."27.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/27.0.3";
+    revision = "27.0.3";
+    displayName = "Android SDK Build-Tools 27.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.3-linux.zip;
+        sha1 = "d85e7a6320eddffe7eeace3437605079dac938ca";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r27.0.3-macosx.zip;
+        sha1 = "61d9fb18790c68d66ff73bf1e7ad56bc1f1eef2d";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.0" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.0";
+    revision = "28.0.0";
+    displayName = "Android SDK Build-Tools 28";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-linux.zip;
+        sha1 = "d9f8a754d833ccd334f56fcc6089c5925cd82abb";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-macosx.zip;
+        sha1 = "72088d32d1d82cc3c2cf7cf6618b6130c0c84ade";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.0-rc1" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.0-rc1";
+    revision = "28.0.0-rc1";
+    displayName = "Android SDK Build-Tools 28-rc1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-rc1-linux.zip;
+        sha1 = "1601977fae25fd478bcfaa0481ca5ea3c609d840";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-rc1-macosx.zip;
+        sha1 = "2c77821967a2330b7b227072d0b1c02ef19fe2fc";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.0-rc2" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.0-rc2";
+    revision = "28.0.0-rc2";
+    displayName = "Android SDK Build-Tools 28-rc2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-rc2-linux.zip;
+        sha1 = "efe9c0dde0646a07544c864276390ca6e96b24dc";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28-rc2-macosx.zip;
+        sha1 = "0d0314b353589feb10e528b44c5a685b6658d797";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.1" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.1";
+    revision = "28.0.1";
+    displayName = "Android SDK Build-Tools 28.0.1";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.1-linux.zip;
+        sha1 = "ee70dfa1fccb58b37cebc9544830511f36a137a0";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.1-macosx.zip;
+        sha1 = "aeef42ad953f1630dd6f5d71eefdc0b825211462";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.2" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.2";
+    revision = "28.0.2";
+    displayName = "Android SDK Build-Tools 28.0.2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.2-linux.zip;
+        sha1 = "b4492209810a3fd48deaa982f9852fef12433d55";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.2-macosx.zip;
+        sha1 = "c10dd5a7825578622fb362a8a34f76eb3ba0c0a9";
+      };
+      
+    };
+  };
+  
+  "build-tools"."28.0.3" = {
+    
+    name = "build-tools";
+    path = "build-tools/28.0.3";
+    revision = "28.0.3";
+    displayName = "Android SDK Build-Tools 28.0.3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.3-linux.zip;
+        sha1 = "ea6f2f7103cd9da9ff0bdf6e37fbbba548fa4165";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/build-tools_r28.0.3-macosx.zip;
+        sha1 = "f8c333a2991b1ab05a671bc6248b78e00edcd83a";
+      };
+      
+    };
+  };
+  
+  "cmake"."3.10.2" = {
+    
+    name = "cmake";
+    path = "cmake/3.10.2.4988404";
+    revision = "3.10.2";
+    displayName = "CMake 3.10.2.4988404";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/cmake-3.10.2-darwin-x86_64.zip;
+        sha1 = "f227a85cb53dcb927ac52a5a717f647c4a29bf3b";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/cmake-3.10.2-linux-x86_64.zip;
+        sha1 = "439e8799bf59f724f104bf62784b2985f1bfe561";
+      };
+      
+    };
+  };
+  
+  "cmake"."3.6.4111459" = {
+    
+    name = "cmake";
+    path = "cmake/3.6.4111459";
+    revision = "3.6.4111459";
+    displayName = "CMake 3.6.4111459";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/cmake-3.6.4111459-darwin-x86_64.zip;
+        sha1 = "c9b02d630079783c6d67cb91488b622cfcd9765c";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/cmake-3.6.4111459-linux-x86_64.zip;
+        sha1 = "71c539b9c33f0943e9ad6251fea0b161c0b70782";
+      };
+      
+    };
+  };
+  
+  "docs"."1" = {
+    
+    name = "docs";
+    path = "docs";
+    revision = "1";
+    displayName = "Documentation for Android SDK";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/docs-24_r01.zip;
+          sha1 = "eef58238949ee9544876cb3e002f2d58e4ee7b5d";
+        };
+      
+    };
+  };
+  
+  "emulator"."27.3.10".linux = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "27.3.10";
+    displayName = "Android Emulator";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/emulator-linux-4969155.zip;
+        sha1 = "5b037b25bc6567fda3071457f0009c057670d9e8";
+      };
+      
+    };
+  };
+  
+  "emulator"."27.3.10".macosx = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "27.3.10";
+    displayName = "Android Emulator";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/emulator-darwin-4969155.zip;
+        sha1 = "28d2b51ee5c84bc544deee433419f33dc9e05b66";
+      };
+      
+    };
+  };
+  
+  "emulator"."27.3.10".windows = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "27.3.10";
+    displayName = "Android Emulator";
+    archives = {
+      
+    };
+  };
+  
+  "emulator"."28.0.14".linux = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "28.0.14";
+    displayName = "Android Emulator";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/emulator-linux-5092175.zip;
+        sha1 = "062ef9a1f6759481de897d6c5602d9d66e958a0b";
+      };
+      
+    };
+  };
+  
+  "emulator"."28.0.14".macosx = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "28.0.14";
+    displayName = "Android Emulator";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/emulator-darwin-5092175.zip;
+        sha1 = "6dc13599bddd5c2acdb559b25201c92a801d157c";
+      };
+      
+    };
+  };
+  
+  "emulator"."28.0.14".windows = {
+    
+    name = "emulator";
+    path = "emulator";
+    revision = "28.0.14";
+    displayName = "Android Emulator";
+    archives = {
+      
+    };
+  };
+  
+  "lldb"."2.0.2558144" = {
+    
+    name = "lldb";
+    path = "lldb/2.0";
+    revision = "2.0.2558144";
+    displayName = "LLDB 2.0";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.0.2558144-darwin-x86_64.zip;
+        sha1 = "d92e2f4c8284413eed4f27986e62b167d947033c";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.0.2558144-linux-x86_64.zip;
+        sha1 = "e7060d9b2ba58b28fd7b1a0ea85a151c8371a326";
+      };
+      
+    };
+  };
+  
+  "lldb"."2.1.2852477" = {
+    
+    name = "lldb";
+    path = "lldb/2.1";
+    revision = "2.1.2852477";
+    displayName = "LLDB 2.1";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.1.2852477-darwin-x86_64.zip;
+        sha1 = "d1e33880a53f1aa8c7e73534adef83a06f091185";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.1.2852477-linux-x86_64.zip;
+        sha1 = "eb9b96d320210fdfe82495b0597ad43e77f1c240";
+      };
+      
+    };
+  };
+  
+  "lldb"."2.2.3271982" = {
+    
+    name = "lldb";
+    path = "lldb/2.2";
+    revision = "2.2.3271982";
+    displayName = "LLDB 2.2";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.2.3271982-darwin-x86_64.zip;
+        sha1 = "62089f4e35775e6cedb82d1fa377fdc1de898005";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.2.3271982-linux-x86_64.zip;
+        sha1 = "413649617d97dd9ef163528f64c0500e1b7c4113";
+      };
+      
+    };
+  };
+  
+  "lldb"."2.3.3614996" = {
+    
+    name = "lldb";
+    path = "lldb/2.3";
+    revision = "2.3.3614996";
+    displayName = "LLDB 2.3";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.3.3614996-darwin-x86_64.zip;
+        sha1 = "6b0df112c7b9fa41654497fde2fcce990c831e52";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-2.3.3614996-linux-x86_64.zip;
+        sha1 = "d7abe655650efe9f6989df31835fa3b3f95c2d13";
+      };
+      
+    };
+  };
+  
+  "lldb"."3.0.4213617" = {
+    
+    name = "lldb";
+    path = "lldb/3.0";
+    revision = "3.0.4213617";
+    displayName = "LLDB 3.0";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-3.0.4213617-darwin-x86_64.zip;
+        sha1 = "2492651690a215317b86c755cd4d584ec9838677";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-3.0.4213617-linux-x86_64.zip;
+        sha1 = "61d49b6a58953faa61546d631409af5f60d8d9db";
+      };
+      
+    };
+  };
+  
+  "lldb"."3.1.4508709" = {
+    
+    name = "lldb";
+    path = "lldb/3.1";
+    revision = "3.1.4508709";
+    displayName = "LLDB 3.1";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-3.1.4508709-darwin-x86_64.zip;
+        sha1 = "2b37aa55b81a7e5b8a369febf1ac0bad6c7c5d58";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/lldb-3.1.4508709-linux-x86_64.zip;
+        sha1 = "462711c9ee94fec9ff8be5fa8180afec04d1af6f";
+      };
+      
+    };
+  };
+  
+  "ndk-bundle"."18.1.5063045" = {
+    
+    name = "ndk-bundle";
+    path = "ndk-bundle";
+    revision = "18.1.5063045";
+    displayName = "NDK";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-ndk-r18b-darwin-x86_64.zip;
+        sha1 = "98cb9909aa8c2dab32db188bbdc3ac6207e09440";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-ndk-r18b-linux-x86_64.zip;
+        sha1 = "500679655da3a86aecf67007e8ab230ea9b4dd7b";
+      };
+      
+    };
+  };
+  
+  "patcher"."1" = {
+    
+    name = "patcher";
+    path = "patcher/v4";
+    revision = "1";
+    displayName = "SDK Patch Applier v4";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/3534162-studio.sdk-patcher.zip.bak;
+          sha1 = "046699c5e2716ae11d77e0bad814f7f33fab261e";
+        };
+      
+    };
+  };
+  
+  "platform-tools"."28.0.1" = {
+    
+    name = "platform-tools";
+    path = "platform-tools";
+    revision = "28.0.1";
+    displayName = "Android SDK Platform-Tools";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/platform-tools_r28.0.1-darwin.zip;
+        sha1 = "ed1edad4a48c27655ce98d0a5821e7296e9de145";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/platform-tools_r28.0.1-linux.zip;
+        sha1 = "74ff83bc203f01c4f04bd9316ab5a2573f023fd1";
+      };
+      
+    };
+  };
+  
+  "platforms"."10" = {
+    
+    name = "platforms";
+    path = "platforms/android-10";
+    revision = "10";
+    displayName = "Android SDK Platform 10";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-2.3.3_r02.zip;
+          sha1 = "887e37783ec32f541ea33c2c649dda648e8e6fb3";
+        };
+      
+    };
+  };
+  
+  "platforms"."11" = {
+    
+    name = "platforms";
+    path = "platforms/android-11";
+    revision = "11";
+    displayName = "Android SDK Platform 11";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-3.0_r02.zip;
+          sha1 = "2c7d4bd13f276e76f6bbd87315fe27aba351dd37";
+        };
+      
+    };
+  };
+  
+  "platforms"."12" = {
+    
+    name = "platforms";
+    path = "platforms/android-12";
+    revision = "12";
+    displayName = "Android SDK Platform 12";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-3.1_r03.zip;
+          sha1 = "4a50a6679cd95bb68bb5fc032e754cd7c5e2b1bf";
+        };
+      
+    };
+  };
+  
+  "platforms"."13" = {
+    
+    name = "platforms";
+    path = "platforms/android-13";
+    revision = "13";
+    displayName = "Android SDK Platform 13";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-3.2_r01.zip;
+          sha1 = "6189a500a8c44ae73a439604363de93591163cd9";
+        };
+      
+    };
+  };
+  
+  "platforms"."14" = {
+    
+    name = "platforms";
+    path = "platforms/android-14";
+    revision = "14";
+    displayName = "Android SDK Platform 14";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-14_r04.zip;
+          sha1 = "d4f1d8fbca25225b5f0e7a0adf0d39c3d6e60b3c";
+        };
+      
+    };
+  };
+  
+  "platforms"."15" = {
+    
+    name = "platforms";
+    path = "platforms/android-15";
+    revision = "15";
+    displayName = "Android SDK Platform 15";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-15_r05.zip;
+          sha1 = "69ab4c443b37184b2883af1fd38cc20cbeffd0f3";
+        };
+      
+    };
+  };
+  
+  "platforms"."16" = {
+    
+    name = "platforms";
+    path = "platforms/android-16";
+    revision = "16";
+    displayName = "Android SDK Platform 16";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-16_r05.zip;
+          sha1 = "12a5ce6235a76bc30f62c26bda1b680e336abd07";
+        };
+      
+    };
+  };
+  
+  "platforms"."17" = {
+    
+    name = "platforms";
+    path = "platforms/android-17";
+    revision = "17";
+    displayName = "Android SDK Platform 17";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-17_r03.zip;
+          sha1 = "dbe14101c06e6cdb34e300393e64e64f8c92168a";
+        };
+      
+    };
+  };
+  
+  "platforms"."18" = {
+    
+    name = "platforms";
+    path = "platforms/android-18";
+    revision = "18";
+    displayName = "Android SDK Platform 18";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-18_r03.zip;
+          sha1 = "e6b09b3505754cbbeb4a5622008b907262ee91cb";
+        };
+      
+    };
+  };
+  
+  "platforms"."19" = {
+    
+    name = "platforms";
+    path = "platforms/android-19";
+    revision = "19";
+    displayName = "Android SDK Platform 19";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-19_r04.zip;
+          sha1 = "2ff20d89e68f2f5390981342e009db5a2d456aaa";
+        };
+      
+    };
+  };
+  
+  "platforms"."2" = {
+    
+    name = "platforms";
+    path = "platforms/android-2";
+    revision = "2";
+    displayName = "Android SDK Platform 2";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.1_r1-linux.zip;
+        sha1 = "c054d25c9b4c6251fa49c2f9c54336998679d3fe";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.1_r1-macosx.zip;
+        sha1 = "e21dbcff45b7356657449ebb3c7e941be2bb5ebe";
+      };
+      
+    };
+  };
+  
+  "platforms"."20" = {
+    
+    name = "platforms";
+    path = "platforms/android-20";
+    revision = "20";
+    displayName = "Android SDK Platform 20";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-20_r02.zip;
+          sha1 = "a9251f8a3f313ab05834a07a963000927637e01d";
+        };
+      
+    };
+  };
+  
+  "platforms"."21" = {
+    
+    name = "platforms";
+    path = "platforms/android-21";
+    revision = "21";
+    displayName = "Android SDK Platform 21";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-21_r02.zip;
+          sha1 = "53536556059bb29ae82f414fd2e14bc335a4eb4c";
+        };
+      
+    };
+  };
+  
+  "platforms"."22" = {
+    
+    name = "platforms";
+    path = "platforms/android-22";
+    revision = "22";
+    displayName = "Android SDK Platform 22";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-22_r02.zip;
+          sha1 = "5d1bd10fea962b216a0dece1247070164760a9fc";
+        };
+      
+    };
+  };
+  
+  "platforms"."23" = {
+    
+    name = "platforms";
+    path = "platforms/android-23";
+    revision = "23";
+    displayName = "Android SDK Platform 23";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-23_r03.zip;
+          sha1 = "027fede3de6aa1649115bbd0bffff30ccd51c9a0";
+        };
+      
+    };
+  };
+  
+  "platforms"."24" = {
+    
+    name = "platforms";
+    path = "platforms/android-24";
+    revision = "24";
+    displayName = "Android SDK Platform 24";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-24_r02.zip;
+          sha1 = "8912da3d4bfe7a9f28f0e5ce92d3a8dc96342aee";
+        };
+      
+    };
+  };
+  
+  "platforms"."25" = {
+    
+    name = "platforms";
+    path = "platforms/android-25";
+    revision = "25";
+    displayName = "Android SDK Platform 25";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-25_r03.zip;
+          sha1 = "00c2c5765e8988504be10a1eb66ed71fcdbd7fe8";
+        };
+      
+    };
+  };
+  
+  "platforms"."26" = {
+    
+    name = "platforms";
+    path = "platforms/android-26";
+    revision = "26";
+    displayName = "Android SDK Platform 26";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-26_r02.zip;
+          sha1 = "e4ae5d7aa557a3c827135838ee400da8443ac4ef";
+        };
+      
+    };
+  };
+  
+  "platforms"."27" = {
+    
+    name = "platforms";
+    path = "platforms/android-27";
+    revision = "27";
+    displayName = "Android SDK Platform 27";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-27_r03.zip;
+          sha1 = "35f747e7e70b2d16e0e4246876be28d15ea1c353";
+        };
+      
+    };
+  };
+  
+  "platforms"."28" = {
+    
+    name = "platforms";
+    path = "platforms/android-28";
+    revision = "28";
+    displayName = "Android SDK Platform 28";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-28_r06.zip;
+          sha1 = "9a4e52b1d55bd2e24216b150aafae2503d3efba6";
+        };
+      
+    };
+  };
+  
+  "platforms"."29" = {
+    
+    name = "platforms";
+    path = "platforms/android-29";
+    revision = "29";
+    displayName = "Android SDK Platform 29";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/platform-29_r03.zip;
+          sha1 = "670e2e104333dae90e16ea3b615f0b63da5883ae";
+        };
+      
+    };
+  };
+
+
+  "platforms"."3" = {
+    
+    name = "platforms";
+    path = "platforms/android-3";
+    revision = "3";
+    displayName = "Android SDK Platform 3";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.5_r04-linux.zip;
+        sha1 = "5c134b7df5f4b8bd5b61ba93bdaebada8fa3468c";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.5_r04-macosx.zip;
+        sha1 = "d3a67c2369afa48b6c3c7624de5031c262018d1e";
+      };
+      
+    };
+  };
+  
+  "platforms"."4" = {
+    
+    name = "platforms";
+    path = "platforms/android-4";
+    revision = "4";
+    displayName = "Android SDK Platform 4";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.6_r03-linux.zip;
+        sha1 = "483ed088e45bbdf3444baaf9250c8b02e5383cb0";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-1.6_r03-macosx.zip;
+        sha1 = "bdafad44f5df9f127979bdb21a1fdd87ee3cd625";
+      };
+      
+    };
+  };
+  
+  "platforms"."5" = {
+    
+    name = "platforms";
+    path = "platforms/android-5";
+    revision = "5";
+    displayName = "Android SDK Platform 5";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-2.0_r01-linux.zip;
+        sha1 = "be9be6a99ca32875c96ec7f91160ca9fce7e3c7d";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-2.0_r01-macosx.zip;
+        sha1 = "2a866d0870dbba18e0503cd41e5fae988a21b314";
+      };
+      
+    };
+  };
+  
+  "platforms"."6" = {
+    
+    name = "platforms";
+    path = "platforms/android-6";
+    revision = "6";
+    displayName = "Android SDK Platform 6";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/android-2.0.1_r01-linux.zip;
+        sha1 = "ce2c971dce352aa28af06bda92a070116aa5ae1a";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/android-2.0.1_r01-macosx.zip;
+        sha1 = "c3096f80d75a6fc8cb38ef8a18aec920e53d42c0";
+      };
+      
+    };
+  };
+  
+  "platforms"."7" = {
+    
+    name = "platforms";
+    path = "platforms/android-7";
+    revision = "7";
+    displayName = "Android SDK Platform 7";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-2.1_r03.zip;
+          sha1 = "5ce51b023ac19f8738500b1007a1da5de2349a1e";
+        };
+      
+    };
+  };
+  
+  "platforms"."8" = {
+    
+    name = "platforms";
+    path = "platforms/android-8";
+    revision = "8";
+    displayName = "Android SDK Platform 8";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-2.2_r03.zip;
+          sha1 = "231262c63eefdff8fd0386e9ccfefeb27a8f9202";
+        };
+      
+    };
+  };
+  
+  "platforms"."9" = {
+    
+    name = "platforms";
+    path = "platforms/android-9";
+    revision = "9";
+    displayName = "Android SDK Platform 9";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/android-2.3.1_r02.zip;
+          sha1 = "209f8a7a8b2cb093fce858b8b55fed3ba5206773";
+        };
+      
+    };
+  };
+  
+  "sources"."14" = {
+    
+    name = "sources";
+    path = "sources/android-14";
+    revision = "14";
+    displayName = "Sources for Android 14";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-14_r01.zip;
+          sha1 = "eaf4ed7dcac46e68516a1b4aa5b0d9e5a39a7555";
+        };
+      
+    };
+  };
+  
+  "sources"."15" = {
+    
+    name = "sources";
+    path = "sources/android-15";
+    revision = "15";
+    displayName = "Sources for Android 15";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-15_r02.zip;
+          sha1 = "e5992a5747c9590783fbbdd700337bf0c9f6b1fa";
+        };
+      
+    };
+  };
+  
+  "sources"."16" = {
+    
+    name = "sources";
+    path = "sources/android-16";
+    revision = "16";
+    displayName = "Sources for Android 16";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-16_r02.zip;
+          sha1 = "0f83c14ed333c45d962279ab5d6bc98a0269ef84";
+        };
+      
+    };
+  };
+  
+  "sources"."17" = {
+    
+    name = "sources";
+    path = "sources/android-17";
+    revision = "17";
+    displayName = "Sources for Android 17";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-17_r01.zip;
+          sha1 = "6f1f18cd2d2b1852d7f6892df9cee3823349d43a";
+        };
+      
+    };
+  };
+  
+  "sources"."18" = {
+    
+    name = "sources";
+    path = "sources/android-18";
+    revision = "18";
+    displayName = "Sources for Android 18";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-18_r01.zip;
+          sha1 = "8b49fdf7433f4881a2bfb559b5dd05d8ec65fb78";
+        };
+      
+    };
+  };
+  
+  "sources"."19" = {
+    
+    name = "sources";
+    path = "sources/android-19";
+    revision = "19";
+    displayName = "Sources for Android 19";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-19_r02.zip;
+          sha1 = "433a1d043ef77561571250e94cb7a0ef24a202e7";
+        };
+      
+    };
+  };
+  
+  "sources"."20" = {
+    
+    name = "sources";
+    path = "sources/android-20";
+    revision = "20";
+    displayName = "Sources for Android 20";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-20_r01.zip;
+          sha1 = "8da3e40f2625f9f7ef38b7e403f49f67226c0d76";
+        };
+      
+    };
+  };
+  
+  "sources"."21" = {
+    
+    name = "sources";
+    path = "sources/android-21";
+    revision = "21";
+    displayName = "Sources for Android 21";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-21_r01.zip;
+          sha1 = "137a5044915d32bea297a8c1552684802bbc2e25";
+        };
+      
+    };
+  };
+  
+  "sources"."22" = {
+    
+    name = "sources";
+    path = "sources/android-22";
+    revision = "22";
+    displayName = "Sources for Android 22";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-22_r01.zip;
+          sha1 = "98320e13976d11597a4a730a8d203ac9a03ed5a6";
+        };
+      
+    };
+  };
+  
+  "sources"."23" = {
+    
+    name = "sources";
+    path = "sources/android-23";
+    revision = "23";
+    displayName = "Sources for Android 23";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-23_r01.zip;
+          sha1 = "b0f15da2762b42f543c5e364c2b15b198cc99cc2";
+        };
+      
+    };
+  };
+  
+  "sources"."24" = {
+    
+    name = "sources";
+    path = "sources/android-24";
+    revision = "24";
+    displayName = "Sources for Android 24";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-24_r01.zip;
+          sha1 = "6b96115830a83d654479f32ce4b724ca9011148b";
+        };
+      
+    };
+  };
+  
+  "sources"."25" = {
+    
+    name = "sources";
+    path = "sources/android-25";
+    revision = "25";
+    displayName = "Sources for Android 25";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-25_r01.zip;
+          sha1 = "bbc72efd1a9bad87cc507e308f0d29aad438c52c";
+        };
+      
+    };
+  };
+  
+  "sources"."26" = {
+    
+    name = "sources";
+    path = "sources/android-26";
+    revision = "26";
+    displayName = "Sources for Android 26";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-26_r01.zip;
+          sha1 = "2af701ee3223d580409288540b1d06932fd8f9b9";
+        };
+      
+    };
+  };
+  
+  "sources"."27" = {
+    
+    name = "sources";
+    path = "sources/android-27";
+    revision = "27";
+    displayName = "Sources for Android 27";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-27_r01.zip;
+          sha1 = "7b714670561d08f54751af42aca929867b806596";
+        };
+      
+    };
+  };
+  
+  "sources"."28" = {
+    
+    name = "sources";
+    path = "sources/android-28";
+    revision = "28";
+    displayName = "Sources for Android 28";
+    archives = {
+      
+        all = fetchurl {
+          url = https://dl.google.com/android/repository/sources-28_r01.zip;
+          sha1 = "5610e0c24235ee3fa343c899ddd551be30315255";
+        };
+      
+    };
+  };
+  
+  "tools"."25.2.5" = {
+    
+    name = "tools";
+    path = "tools";
+    revision = "25.2.5";
+    displayName = "Android SDK Tools 25.2.5";
+    archives = {
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/tools_r25.2.5-linux.zip;
+        sha1 = "72df3aa1988c0a9003ccdfd7a13a7b8bd0f47fc1";
+      };
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/tools_r25.2.5-macosx.zip;
+        sha1 = "d2168d963ac5b616e3d3ddaf21511d084baf3659";
+      };
+      
+    };
+  };
+  
+  "tools"."26.1.1" = {
+    
+    name = "tools";
+    path = "tools";
+    revision = "26.1.1";
+    displayName = "Android SDK Tools";
+    archives = {
+      macosx = fetchurl {
+        url = https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip;
+        sha1 = "ed85ea7b59bc3483ce0af4c198523ba044e083ad";
+      };
+      linux = fetchurl {
+        url = https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip;
+        sha1 = "8c7c28554a32318461802c1291d76fccfafde054";
+      };
+      
+    };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-tv.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-tv.nix
new file mode 100644
index 000000000000..1aa49545254d
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-tv.nix
@@ -0,0 +1,157 @@
+
+{fetchurl}:
+
+{
+  
+
+    "21".android-tv."x86" = {
+      name = "system-image-21-android-tv-x86";
+      path = "system-images/android-21/android-tv/x86";
+      revision = "21-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-21_r03.zip;
+        sha1 = "2f8a1988188d6abfd6c6395baeb4471a034dc1e8";
+      
+      };
+  };
+  
+
+    "21".android-tv."armeabi-v7a" = {
+      name = "system-image-21-android-tv-armeabi-v7a";
+      path = "system-images/android-21/android-tv/armeabi-v7a";
+      revision = "21-android-tv-armeabi-v7a";
+      displayName = "Android TV ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/armeabi-v7a-21_r03.zip;
+        sha1 = "b63e28a47f11b639dd94981a458b7abfa89ac331";
+      
+      };
+  };
+  
+
+    "22".android-tv."x86" = {
+      name = "system-image-22-android-tv-x86";
+      path = "system-images/android-22/android-tv/x86";
+      revision = "22-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-22_r03.zip;
+        sha1 = "c78efd5a155622eb490be9d326f5783993375c35";
+      
+      };
+  };
+  
+
+    "23".android-tv."x86" = {
+      name = "system-image-23-android-tv-x86";
+      path = "system-images/android-23/android-tv/x86";
+      revision = "23-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-23_r17.zip;
+        sha1 = "6d42eb8f07e1c49c000e530fdb7de894144ea19b";
+      
+      };
+  };
+  
+
+    "23".android-tv."armeabi-v7a" = {
+      name = "system-image-23-android-tv-armeabi-v7a";
+      path = "system-images/android-23/android-tv/armeabi-v7a";
+      revision = "23-android-tv-armeabi-v7a";
+      displayName = "Android TV ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/armeabi-v7a-23_r12.zip;
+        sha1 = "bd84678ae8caf71d584f5210e866b2807e7b4b52";
+      
+      };
+  };
+  
+
+    "24".android-tv."x86" = {
+      name = "system-image-24-android-tv-x86";
+      path = "system-images/android-24/android-tv/x86";
+      revision = "24-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-24_r19.zip;
+        sha1 = "478e7073f9fcd588bcce89946aa632fbf302ac6a";
+      
+      };
+  };
+  
+
+    "25".android-tv."x86" = {
+      name = "system-image-25-android-tv-x86";
+      path = "system-images/android-25/android-tv/x86";
+      revision = "25-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-25_r13.zip;
+        sha1 = "fda1743a87331b43b1ff35cd70f3276ae0b1836d";
+      
+      };
+  };
+  
+
+    "26".android-tv."x86" = {
+      name = "system-image-26-android-tv-x86";
+      path = "system-images/android-26/android-tv/x86";
+      revision = "26-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-26_r11.zip;
+        sha1 = "5c4b0b3c0b9d04a3364956a7ba31d30c33ea57e7";
+      
+      };
+  };
+  
+
+    "27".android-tv."x86" = {
+      name = "system-image-27-android-tv-x86";
+      path = "system-images/android-27/android-tv/x86";
+      revision = "27-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-27_r06.zip;
+        sha1 = "6b69f1e95a3db3d973e19a95ab5da1adc7750d54";
+      
+      };
+  };
+  
+
+    "28".android-tv."x86" = {
+      name = "system-image-28-android-tv-x86";
+      path = "system-images/android-28/android-tv/x86";
+      revision = "28-android-tv-x86";
+      displayName = "Android TV Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-tv/x86-28_r07.zip;
+        sha1 = "3ed7e51036957cf350db7fa128cb485b61cbd061";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear-cn.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear-cn.nix
new file mode 100644
index 000000000000..372a751f41cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear-cn.nix
@@ -0,0 +1,67 @@
+
+{fetchurl}:
+
+{
+  
+
+    "25".android-wear."armeabi-v7a" = {
+      name = "system-image-25-android-wear-armeabi-v7a";
+      path = "system-images/android-25/android-wear-cn/armeabi-v7a";
+      revision = "25-android-wear-armeabi-v7a";
+      displayName = "China version of Android Wear ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear-cn/armeabi-v7a-25_r04.zip;
+        sha1 = "02d7bc86df054d1e89fe5856b3af1d2c142cab41";
+      
+      };
+  };
+  
+
+    "25".android-wear."x86" = {
+      name = "system-image-25-android-wear-x86";
+      path = "system-images/android-25/android-wear-cn/x86";
+      revision = "25-android-wear-x86";
+      displayName = "China version of Android Wear Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear-cn/x86-25_r04.zip;
+        sha1 = "73eab14c7cf2f6941e1fee61e0038ead7a2c7f4d";
+      
+      };
+  };
+  
+
+    "26".android-wear."x86" = {
+      name = "system-image-26-android-wear-x86";
+      path = "system-images/android-26/android-wear-cn/x86";
+      revision = "26-android-wear-x86";
+      displayName = "China version of Android Wear Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear-cn/x86-26_r04.zip;
+        sha1 = "fdc8a313f889a2d6522de1fbc00ee9e13547d096";
+      
+      };
+  };
+  
+
+    "28".android-wear."x86" = {
+      name = "system-image-28-android-wear-x86";
+      path = "system-images/android-P/android-wear-cn/x86";
+      revision = "28-android-wear-x86";
+      displayName = "China version of Wear OS Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear-cn/x86-P_r02.zip;
+        sha1 = "a61a2e453a11f77ab15b3e0bf1e017e0bb9d1bcc";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear.nix
new file mode 100644
index 000000000000..0c45a1162fef
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android-wear.nix
@@ -0,0 +1,97 @@
+
+{fetchurl}:
+
+{
+  
+
+    "23".android-wear."armeabi-v7a" = {
+      name = "system-image-23-android-wear-armeabi-v7a";
+      path = "system-images/android-23/android-wear/armeabi-v7a";
+      revision = "23-android-wear-armeabi-v7a";
+      displayName = "Android Wear ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/armeabi-v7a-23_r06.zip;
+        sha1 = "0df5d34b1cdaaaa3805a2f06bb889901eabe2e71";
+      
+      };
+  };
+  
+
+    "23".android-wear."x86" = {
+      name = "system-image-23-android-wear-x86";
+      path = "system-images/android-23/android-wear/x86";
+      revision = "23-android-wear-x86";
+      displayName = "Android Wear Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/x86-23_r06.zip;
+        sha1 = "3b15c123f3f71459d5b60c1714d49c5d90a5525e";
+      
+      };
+  };
+  
+
+    "25".android-wear."armeabi-v7a" = {
+      name = "system-image-25-android-wear-armeabi-v7a";
+      path = "system-images/android-25/android-wear/armeabi-v7a";
+      revision = "25-android-wear-armeabi-v7a";
+      displayName = "Android Wear ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/armeabi-v7a-25_r03.zip;
+        sha1 = "76d3568a4e08023047af7d13025a35c9bf1d7e5c";
+      
+      };
+  };
+  
+
+    "25".android-wear."x86" = {
+      name = "system-image-25-android-wear-x86";
+      path = "system-images/android-25/android-wear/x86";
+      revision = "25-android-wear-x86";
+      displayName = "Android Wear Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/x86-25_r03.zip;
+        sha1 = "693fce7b487a65491a4e88e9f740959688c9dbe6";
+      
+      };
+  };
+  
+
+    "26".android-wear."x86" = {
+      name = "system-image-26-android-wear-x86";
+      path = "system-images/android-26/android-wear/x86";
+      revision = "26-android-wear-x86";
+      displayName = "Android Wear Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/x86-26_r04.zip;
+        sha1 = "fbffa91b936ca18fcc1e0bab2b52a8b0835cbb1c";
+      
+      };
+  };
+  
+
+    "28".android-wear."x86" = {
+      name = "system-image-28-android-wear-x86";
+      path = "system-images/android-P/android-wear/x86";
+      revision = "28-android-wear-x86";
+      displayName = "Wear OS Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android-wear/x86-P_r02.zip;
+        sha1 = "cd0d3a56e114dbb0a2a77d58942d344db464b514";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android.nix
new file mode 100644
index 000000000000..915cceec5469
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-android.nix
@@ -0,0 +1,547 @@
+
+{fetchurl}:
+
+{
+  
+
+    "10".default."armeabi-v7a" = {
+      name = "system-image-10-default-armeabi-v7a";
+      path = "system-images/android-10/default/armeabi-v7a";
+      revision = "10-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armv7-10_r04.zip;
+        sha1 = "54680383118eb5c95a11e1cc2a14aa572c86ee69";
+      
+      };
+  };
+  
+
+    "14".default."armeabi-v7a" = {
+      name = "system-image-14-default-armeabi-v7a";
+      path = "system-images/android-14/default/armeabi-v7a";
+      revision = "14-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-14_r02.zip;
+        sha1 = "d8991b0c06b18d7d6ed4169d67460ee1add6661b";
+      
+      };
+  };
+  
+
+    "15".default."armeabi-v7a" = {
+      name = "system-image-15-default-armeabi-v7a";
+      path = "system-images/android-15/default/armeabi-v7a";
+      revision = "15-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-15_r04.zip;
+        sha1 = "363223bd62f5afc0b2bd760b54ce9d26b31eacf1";
+      
+      };
+  };
+  
+
+    "16".default."armeabi-v7a" = {
+      name = "system-image-16-default-armeabi-v7a";
+      path = "system-images/android-16/default/armeabi-v7a";
+      revision = "16-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/sysimg_armv7a-16_r04.zip;
+        sha1 = "39c093ea755098f0ee79f607be7df9e54ba4943f";
+      
+      };
+  };
+  
+
+    "17".default."armeabi-v7a" = {
+      name = "system-image-17-default-armeabi-v7a";
+      path = "system-images/android-17/default/armeabi-v7a";
+      revision = "17-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-17_r05.zip;
+        sha1 = "7460e8110f4a87f9644f1bdb5511a66872d50fd9";
+      
+      };
+  };
+  
+
+    "18".default."armeabi-v7a" = {
+      name = "system-image-18-default-armeabi-v7a";
+      path = "system-images/android-18/default/armeabi-v7a";
+      revision = "18-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-18_r04.zip;
+        sha1 = "0bf34ecf4ddd53f6b1b7fe7dfa12f2887c17e642";
+      
+      };
+  };
+  
+
+    "19".default."armeabi-v7a" = {
+      name = "system-image-19-default-armeabi-v7a";
+      path = "system-images/android-19/default/armeabi-v7a";
+      revision = "19-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-19_r05.zip;
+        sha1 = "d1a5fd4f2e1c013c3d3d9bfe7e9db908c3ed56fa";
+      
+      };
+  };
+  
+
+    "21".default."armeabi-v7a" = {
+      name = "system-image-21-default-armeabi-v7a";
+      path = "system-images/android-21/default/armeabi-v7a";
+      revision = "21-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-21_r04.zip;
+        sha1 = "8c606f81306564b65e41303d2603e4c42ded0d10";
+      
+      };
+  };
+  
+
+    "22".default."armeabi-v7a" = {
+      name = "system-image-22-default-armeabi-v7a";
+      path = "system-images/android-22/default/armeabi-v7a";
+      revision = "22-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-22_r02.zip;
+        sha1 = "2114ec015dbf3a16cbcb4f63e8a84a1b206a07a1";
+      
+      };
+  };
+  
+
+    "23".default."armeabi-v7a" = {
+      name = "system-image-23-default-armeabi-v7a";
+      path = "system-images/android-23/default/armeabi-v7a";
+      revision = "23-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-23_r06.zip;
+        sha1 = "7cf2ad756e54a3acfd81064b63cb0cb9dff2798d";
+      
+      };
+  };
+  
+
+    "24".default."armeabi-v7a" = {
+      name = "system-image-24-default-armeabi-v7a";
+      path = "system-images/android-24/default/armeabi-v7a";
+      revision = "24-default-armeabi-v7a";
+      displayName = "ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/armeabi-v7a-24_r07.zip;
+        sha1 = "3454546b4eed2d6c3dd06d47757d6da9f4176033";
+      
+      };
+  };
+  
+
+    "24".default."arm64-v8a" = {
+      name = "system-image-24-default-arm64-v8a";
+      path = "system-images/android-24/default/arm64-v8a";
+      revision = "24-default-arm64-v8a";
+      displayName = "ARM 64 v8a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/arm64-v8a-24_r07.zip;
+        sha1 = "e8ab2e49e4efe4b064232b33b5eeaded61437d7f";
+      
+      };
+  };
+  
+
+    "16".default."mips" = {
+      name = "system-image-16-default-mips";
+      path = "system-images/android-16/default/mips";
+      revision = "16-default-mips";
+      displayName = "MIPS System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/sysimg_mips-16_r04.zip;
+        sha1 = "67943c54fb3943943ffeb05fdd39c0b753681f6e";
+      
+      };
+  };
+  
+
+    "17".default."mips" = {
+      name = "system-image-17-default-mips";
+      path = "system-images/android-17/default/mips";
+      revision = "17-default-mips";
+      displayName = "MIPS System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/sysimg_mips-17_r01.zip;
+        sha1 = "f0c6e153bd584c29e51b5c9723cfbf30f996a05d";
+      
+      };
+  };
+  
+
+    "10".default."x86" = {
+      name = "system-image-10-default-x86";
+      path = "system-images/android-10/default/x86";
+      revision = "10-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-10_r04.zip;
+        sha1 = "655ffc5cc89dd45a3aca154b254009016e473aeb";
+      
+      };
+  };
+  
+
+    "15".default."x86" = {
+      name = "system-image-15-default-x86";
+      path = "system-images/android-15/default/x86";
+      revision = "15-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-15_r04.zip;
+        sha1 = "e45c728b64881c0e86529a8f7ea9c103a3cd14c1";
+      
+      };
+  };
+  
+
+    "16".default."x86" = {
+      name = "system-image-16-default-x86";
+      path = "system-images/android-16/default/x86";
+      revision = "16-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-16_r06.zip;
+        sha1 = "bf1bf8c5591346118d2235da1ad20e7be8a3e9cd";
+      
+      };
+  };
+  
+
+    "17".default."x86" = {
+      name = "system-image-17-default-x86";
+      path = "system-images/android-17/default/x86";
+      revision = "17-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-17_r04.zip;
+        sha1 = "03c6d022ab2dcbbcf655d78ba5ccb0431cadcaec";
+      
+      };
+  };
+  
+
+    "18".default."x86" = {
+      name = "system-image-18-default-x86";
+      path = "system-images/android-18/default/x86";
+      revision = "18-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-18_r03.zip;
+        sha1 = "03a0cb23465c3de15215934a1dbc9715b56e9458";
+      
+      };
+  };
+  
+
+    "19".default."x86" = {
+      name = "system-image-19-default-x86";
+      path = "system-images/android-19/default/x86";
+      revision = "19-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-19_r06.zip;
+        sha1 = "2ac82153aae97f7eae4c5a0761224fe04321d03d";
+      
+      };
+  };
+  
+
+    "21".default."x86" = {
+      name = "system-image-21-default-x86";
+      path = "system-images/android-21/default/x86";
+      revision = "21-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-21_r05.zip;
+        sha1 = "00f0eb0a1003efe3316347f762e20a85d8749cff";
+      
+      };
+  };
+  
+
+    "22".default."x86" = {
+      name = "system-image-22-default-x86";
+      path = "system-images/android-22/default/x86";
+      revision = "22-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-22_r06.zip;
+        sha1 = "e33e2a6cc3f1cc56b2019dbef3917d2eeb26f54e";
+      
+      };
+  };
+  
+
+    "23".default."x86" = {
+      name = "system-image-23-default-x86";
+      path = "system-images/android-23/default/x86";
+      revision = "23-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-23_r10.zip;
+        sha1 = "f6c3e3dd7bd951454795aa75c3a145fd05ac25bb";
+      
+      };
+  };
+  
+
+    "24".default."x86" = {
+      name = "system-image-24-default-x86";
+      path = "system-images/android-24/default/x86";
+      revision = "24-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-24_r08.zip;
+        sha1 = "c1cae7634b0216c0b5990f2c144eb8ca948e3511";
+      
+      };
+  };
+  
+
+    "25".default."x86" = {
+      name = "system-image-25-default-x86";
+      path = "system-images/android-25/default/x86";
+      revision = "25-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-25_r01.zip;
+        sha1 = "78ce7eb1387d598685633b9f7cbb300c3d3aeb5f";
+      
+      };
+  };
+  
+
+    "26".default."x86" = {
+      name = "system-image-26-default-x86";
+      path = "system-images/android-26/default/x86";
+      revision = "26-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-26_r01.zip;
+        sha1 = "e613d6e0da668e30daf547f3c6627a6352846f90";
+      
+      };
+  };
+  
+
+    "27".default."x86" = {
+      name = "system-image-27-default-x86";
+      path = "system-images/android-27/default/x86";
+      revision = "27-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-27_r01.zip;
+        sha1 = "4ec990fac7b62958decd12e18a4cd389dfe7c582";
+      
+      };
+  };
+  
+
+    "28".default."x86" = {
+      name = "system-image-28-default-x86";
+      path = "system-images/android-28/default/x86";
+      revision = "28-default-x86";
+      displayName = "Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86-28_r04.zip;
+        sha1 = "ce03c42d80c0fc6dc47f6455dbee7aa275d02780";
+      
+      };
+  };
+  
+
+    "21".default."x86_64" = {
+      name = "system-image-21-default-x86_64";
+      path = "system-images/android-21/default/x86_64";
+      revision = "21-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-21_r05.zip;
+        sha1 = "9078a095825a69e5e215713f0866c83cef65a342";
+      
+      };
+  };
+  
+
+    "22".default."x86_64" = {
+      name = "system-image-22-default-x86_64";
+      path = "system-images/android-22/default/x86_64";
+      revision = "22-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-22_r06.zip;
+        sha1 = "5db3b27f78cd9c4c5092b1cad5a5dd479fb5b2e4";
+      
+      };
+  };
+  
+
+    "23".default."x86_64" = {
+      name = "system-image-23-default-x86_64";
+      path = "system-images/android-23/default/x86_64";
+      revision = "23-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-23_r10.zip;
+        sha1 = "7cbc291483ca07dc67b71268c5f08a5755f50f51";
+      
+      };
+  };
+  
+
+    "24".default."x86_64" = {
+      name = "system-image-24-default-x86_64";
+      path = "system-images/android-24/default/x86_64";
+      revision = "24-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-24_r08.zip;
+        sha1 = "f6559e1949a5879f31a9662f4f0e50ad60181684";
+      
+      };
+  };
+  
+
+    "25".default."x86_64" = {
+      name = "system-image-25-default-x86_64";
+      path = "system-images/android-25/default/x86_64";
+      revision = "25-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-25_r01.zip;
+        sha1 = "7093d7b39216020226ff430a3b7b81c94d31ad37";
+      
+      };
+  };
+  
+
+    "26".default."x86_64" = {
+      name = "system-image-26-default-x86_64";
+      path = "system-images/android-26/default/x86_64";
+      revision = "26-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-26_r01.zip;
+        sha1 = "432f149c048bffce7f9de526ec65b336daf7a0a3";
+      
+      };
+  };
+  
+
+    "27".default."x86_64" = {
+      name = "system-image-27-default-x86_64";
+      path = "system-images/android-27/default/x86_64";
+      revision = "27-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-27_r01.zip;
+        sha1 = "2878261011a59ca3de29dc5b457a495fdb268d60";
+      
+      };
+  };
+  
+
+    "28".default."x86_64" = {
+      name = "system-image-28-default-x86_64";
+      path = "system-images/android-28/default/x86_64";
+      revision = "28-default-x86_64";
+      displayName = "Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/android/x86_64-28_r04.zip;
+        sha1 = "d47a85c8f4e9fd57df97814ad8884eeb0f3a0ef0";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis.nix
new file mode 100644
index 000000000000..3b0303b86b4b
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis.nix
@@ -0,0 +1,502 @@
+
+{fetchurl}:
+
+{
+  
+
+    "10".google_apis."armeabi-v7a" = {
+      name = "system-image-10-google_apis-armeabi-v7a";
+      path = "system-images/android-10/google_apis/armeabi-v7a";
+      revision = "10-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-10_r05.zip;
+        sha1 = "cb60221d4ff6686ae96560970d48d9aa60e80b3f";
+      
+      };
+  };
+  
+
+    "10".google_apis."x86" = {
+      name = "system-image-10-google_apis-x86";
+      path = "system-images/android-10/google_apis/x86";
+      revision = "10-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-10_r05.zip;
+        sha1 = "b8e8a4ab26890c4a395fb796bf9cb7ceb51c880e";
+      
+      };
+  };
+  
+
+    "15".google_apis."armeabi-v7a" = {
+      name = "system-image-15-google_apis-armeabi-v7a";
+      path = "system-images/android-15/google_apis/armeabi-v7a";
+      revision = "15-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-15_r05.zip;
+        sha1 = "1ec4e6f9014fcbe694511280f5b497aaf7dd750f";
+      
+      };
+  };
+  
+
+    "15".google_apis."x86" = {
+      name = "system-image-15-google_apis-x86";
+      path = "system-images/android-15/google_apis/x86";
+      revision = "15-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-15_r05.zip;
+        sha1 = "f2b98baaf847ff5b82b82fdc6c396b229067307b";
+      
+      };
+  };
+  
+
+    "16".google_apis."x86" = {
+      name = "system-image-16-google_apis-x86";
+      path = "system-images/android-16/google_apis/x86";
+      revision = "16-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-16_r05.zip;
+        sha1 = "7edc5c0836fa32f8d453788c002ca0ee1bc5a0a2";
+      
+      };
+  };
+  
+
+    "17".google_apis."armeabi-v7a" = {
+      name = "system-image-17-google_apis-armeabi-v7a";
+      path = "system-images/android-17/google_apis/armeabi-v7a";
+      revision = "17-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-17_r05.zip;
+        sha1 = "c990f2a81c24a61f9f1da5d5d205f2924ce548ae";
+      
+      };
+  };
+  
+
+    "17".google_apis."x86" = {
+      name = "system-image-17-google_apis-x86";
+      path = "system-images/android-17/google_apis/x86";
+      revision = "17-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-17_r06.zip;
+        sha1 = "7864c34faf0402b8923d8c6e609a5339f74cc8d6";
+      
+      };
+  };
+  
+
+    "18".google_apis."armeabi-v7a" = {
+      name = "system-image-18-google_apis-armeabi-v7a";
+      path = "system-images/android-18/google_apis/armeabi-v7a";
+      revision = "18-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-18_r05.zip;
+        sha1 = "c4e69a96d4584f7e311e358fe4ad0e5d1bf1605b";
+      
+      };
+  };
+  
+
+    "18".google_apis."x86" = {
+      name = "system-image-18-google_apis-x86";
+      path = "system-images/android-18/google_apis/x86";
+      revision = "18-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-18_r05.zip;
+        sha1 = "2b34741693eba9419cb6bf1a467596783234d37a";
+      
+      };
+  };
+  
+
+    "19".google_apis."x86" = {
+      name = "system-image-19-google_apis-x86";
+      path = "system-images/android-19/google_apis/x86";
+      revision = "19-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-19_r37.zip;
+        sha1 = "f02473420a166b3df7821d8ae5a623524058b4b8";
+      
+      };
+  };
+  
+
+    "19".google_apis."armeabi-v7a" = {
+      name = "system-image-19-google_apis-armeabi-v7a";
+      path = "system-images/android-19/google_apis/armeabi-v7a";
+      revision = "19-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-19_r37.zip;
+        sha1 = "b388072493ed010fe2ddf607c8c4239f54ce1a0b";
+      
+      };
+  };
+  
+
+    "21".google_apis."x86" = {
+      name = "system-image-21-google_apis-x86";
+      path = "system-images/android-21/google_apis/x86";
+      revision = "21-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-21_r29.zip;
+        sha1 = "1f5ac49e0ae603b0bfeda0c94cd7e0b850b9b50e";
+      
+      };
+  };
+  
+
+    "21".google_apis."x86_64" = {
+      name = "system-image-21-google_apis-x86_64";
+      path = "system-images/android-21/google_apis/x86_64";
+      revision = "21-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-21_r29.zip;
+        sha1 = "74ac387aec286fcee01259dcccd4762cbdb4b517";
+      
+      };
+  };
+  
+
+    "21".google_apis."armeabi-v7a" = {
+      name = "system-image-21-google_apis-armeabi-v7a";
+      path = "system-images/android-21/google_apis/armeabi-v7a";
+      revision = "21-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-21_r29.zip;
+        sha1 = "1d0c428ac7f5eb49c7389ad0beb09f07cb989b45";
+      
+      };
+  };
+  
+
+    "22".google_apis."x86" = {
+      name = "system-image-22-google_apis-x86";
+      path = "system-images/android-22/google_apis/x86";
+      revision = "22-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-22_r23.zip;
+        sha1 = "4ceda9ffd69d5b827a8cc2f56ccac62e72982b33";
+      
+      };
+  };
+  
+
+    "22".google_apis."armeabi-v7a" = {
+      name = "system-image-22-google_apis-armeabi-v7a";
+      path = "system-images/android-22/google_apis/armeabi-v7a";
+      revision = "22-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-22_r23.zip;
+        sha1 = "0a11bdffa6132303baf87e4a531987a74d5f0792";
+      
+      };
+  };
+  
+
+    "22".google_apis."x86_64" = {
+      name = "system-image-22-google_apis-x86_64";
+      path = "system-images/android-22/google_apis/x86_64";
+      revision = "22-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-22_r23.zip;
+        sha1 = "1dfee1c382574c18e3aa2bc2047793169f3ab125";
+      
+      };
+  };
+  
+
+    "23".google_apis."x86" = {
+      name = "system-image-23-google_apis-x86";
+      path = "system-images/android-23/google_apis/x86";
+      revision = "23-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-23_r30.zip;
+        sha1 = "1b8fd61e7e7c76d8c05a41b19370edfb015ed240";
+      
+      };
+  };
+  
+
+    "23".google_apis."x86_64" = {
+      name = "system-image-23-google_apis-x86_64";
+      path = "system-images/android-23/google_apis/x86_64";
+      revision = "23-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-23_r30.zip;
+        sha1 = "69a17c23c4e05e81a2820fe49884807fcebba546";
+      
+      };
+  };
+  
+
+    "23".google_apis."armeabi-v7a" = {
+      name = "system-image-23-google_apis-armeabi-v7a";
+      path = "system-images/android-23/google_apis/armeabi-v7a";
+      revision = "23-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-23_r30.zip;
+        sha1 = "c3966e3a25623a915902d879f90f6d9253dbb619";
+      
+      };
+  };
+  
+
+    "24".google_apis."x86" = {
+      name = "system-image-24-google_apis-x86";
+      path = "system-images/android-24/google_apis/x86";
+      revision = "24-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-24_r24.zip;
+        sha1 = "7a1adb4aa13946830763644d014fc9c6cc1f921d";
+      
+      };
+  };
+  
+
+    "24".google_apis."x86_64" = {
+      name = "system-image-24-google_apis-x86_64";
+      path = "system-images/android-24/google_apis/x86_64";
+      revision = "24-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-24_r24.zip;
+        sha1 = "53b26e8868c7cd27dda31c71ee2bcf999d6b9ce2";
+      
+      };
+  };
+  
+
+    "24".google_apis."armeabi-v7a" = {
+      name = "system-image-24-google_apis-armeabi-v7a";
+      path = "system-images/android-24/google_apis/armeabi-v7a";
+      revision = "24-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-24_r24.zip;
+        sha1 = "85068d55673bbf9417db8d70107ceed0952b5a28";
+      
+      };
+  };
+  
+
+    "24".google_apis."arm64-v8a" = {
+      name = "system-image-24-google_apis-arm64-v8a";
+      path = "system-images/android-24/google_apis/arm64-v8a";
+      revision = "24-google_apis-arm64-v8a";
+      displayName = "Google APIs ARM 64 v8a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/arm64-v8a-24_r24.zip;
+        sha1 = "93ab33d90fcdbb30ca2e927cd3eea447e933dfd9";
+      
+      };
+  };
+  
+
+    "25".google_apis."x86" = {
+      name = "system-image-25-google_apis-x86";
+      path = "system-images/android-25/google_apis/x86";
+      revision = "25-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-25_r15.zip;
+        sha1 = "5948473077341265a0b21a53a7e0afc2f980187c";
+      
+      };
+  };
+  
+
+    "25".google_apis."x86_64" = {
+      name = "system-image-25-google_apis-x86_64";
+      path = "system-images/android-25/google_apis/x86_64";
+      revision = "25-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-25_r15.zip;
+        sha1 = "5a81fc218a7fe82cc6af01f7fae54a8000900443";
+      
+      };
+  };
+  
+
+    "25".google_apis."armeabi-v7a" = {
+      name = "system-image-25-google_apis-armeabi-v7a";
+      path = "system-images/android-25/google_apis/armeabi-v7a";
+      revision = "25-google_apis-armeabi-v7a";
+      displayName = "Google APIs ARM EABI v7a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/armeabi-v7a-25_r15.zip;
+        sha1 = "813e25f9a5f6d775670ed6c5e67a39bffa1411bf";
+      
+      };
+  };
+  
+
+    "25".google_apis."arm64-v8a" = {
+      name = "system-image-25-google_apis-arm64-v8a";
+      path = "system-images/android-25/google_apis/arm64-v8a";
+      revision = "25-google_apis-arm64-v8a";
+      displayName = "Google APIs ARM 64 v8a System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/arm64-v8a-25_r15.zip;
+        sha1 = "c3049e32f031140757f71acb5b8f0179e6f27303";
+      
+      };
+  };
+  
+
+    "26".google_apis."x86" = {
+      name = "system-image-26-google_apis-x86";
+      path = "system-images/android-26/google_apis/x86";
+      revision = "26-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-26_r12.zip;
+        sha1 = "167c83bcfd87127c7376ce986b34701f74fe87ff";
+      
+      };
+  };
+  
+
+    "26".google_apis."x86_64" = {
+      name = "system-image-26-google_apis-x86_64";
+      path = "system-images/android-26/google_apis/x86_64";
+      revision = "26-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-26_r12.zip;
+        sha1 = "fcd46121c3486e2a759d0707c015e0b12bbab9db";
+      
+      };
+  };
+  
+
+    "27".google_apis."x86" = {
+      name = "system-image-27-google_apis-x86";
+      path = "system-images/android-27/google_apis/x86";
+      revision = "27-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-27_r08.zip;
+        sha1 = "623ee2638713b7dfde8044c91280c2afad5a1ade";
+      
+      };
+  };
+  
+
+    "28".google_apis."x86" = {
+      name = "system-image-28-google_apis-x86";
+      path = "system-images/android-28/google_apis/x86";
+      revision = "28-google_apis-x86";
+      displayName = "Google APIs Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86-28_r07.zip;
+        sha1 = "fe5d58355545ae82b0e6a55adc1d41573ac7dec1";
+      
+      };
+  };
+  
+
+    "28".google_apis."x86_64" = {
+      name = "system-image-28-google_apis-x86_64";
+      path = "system-images/android-28/google_apis/x86_64";
+      revision = "28-google_apis-x86_64";
+      displayName = "Google APIs Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis/x86_64-28_r07.zip;
+        sha1 = "068468683a56725326f741f75b6913ee1e7955ff";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis_playstore.nix b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis_playstore.nix
new file mode 100644
index 000000000000..a8bea61ff548
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/generated/system-images-google_apis_playstore.nix
@@ -0,0 +1,97 @@
+
+{fetchurl}:
+
+{
+  
+
+    "24".google_apis_playstore."x86" = {
+      name = "system-image-24-google_apis_playstore-x86";
+      path = "system-images/android-24/google_apis_playstore/x86";
+      revision = "24-google_apis_playstore-x86";
+      displayName = "Google Play Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-24_r19.zip;
+        sha1 = "b52e9593ffdde65c1a0970256a32e8967c89cc22";
+      
+      };
+  };
+  
+
+    "25".google_apis_playstore."x86" = {
+      name = "system-image-25-google_apis_playstore-x86";
+      path = "system-images/android-25/google_apis_playstore/x86";
+      revision = "25-google_apis_playstore-x86";
+      displayName = "Google Play Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-25_r09.zip;
+        sha1 = "6f6668954f7fd52f896fe7528aa122028c9b026c";
+      
+      };
+  };
+  
+
+    "26".google_apis_playstore."x86" = {
+      name = "system-image-26-google_apis_playstore-x86";
+      path = "system-images/android-26/google_apis_playstore/x86";
+      revision = "26-google_apis_playstore-x86";
+      displayName = "Google Play Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-26_r07.zip;
+        sha1 = "2c8bee7b97a309f099941532e63c42a7d4a06e19";
+      
+      };
+  };
+  
+
+    "27".google_apis_playstore."x86" = {
+      name = "system-image-27-google_apis_playstore-x86";
+      path = "system-images/android-27/google_apis_playstore/x86";
+      revision = "27-google_apis_playstore-x86";
+      displayName = "Google Play Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-27_r03.zip;
+        sha1 = "eb5a944ceb691ca0648d0a6f0d93893a47223b5d";
+      
+      };
+  };
+  
+
+    "28".google_apis_playstore."x86" = {
+      name = "system-image-28-google_apis_playstore-x86";
+      path = "system-images/android-28/google_apis_playstore/x86";
+      revision = "28-google_apis_playstore-x86";
+      displayName = "Google Play Intel x86 Atom System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-28_r05.zip;
+        sha1 = "4c570d259e93b0b27f97bad1aca2ac47f1e9b51a";
+      
+      };
+  };
+  
+
+    "28".google_apis_playstore."x86_64" = {
+      name = "system-image-28-google_apis_playstore-x86_64";
+      path = "system-images/android-28/google_apis_playstore/x86_64";
+      revision = "28-google_apis_playstore-x86_64";
+      displayName = "Google Play Intel x86 Atom_64 System Image";
+      archives.all = fetchurl {
+      
+        url = 
+        https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86_64-28_r05.zip;
+        sha1 = "5f6b238e4c7de41fd2a1c66841093bcf517255a1";
+      
+      };
+  };
+  
+}
+  
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/lldb.nix b/nixpkgs/pkgs/development/mobile/androidenv/lldb.nix
new file mode 100644
index 000000000000..e8a158c01ec7
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/lldb.nix
@@ -0,0 +1,12 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, pkgs}:
+
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook ]
+    ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.zlib pkgs.openssl_1_0_2.out pkgs.ncurses5 ];
+  patchInstructions = lib.optionalString (os == "linux") ''
+    addAutoPatchelfSearchPath $packageBaseDir/lib
+    autoPatchelf $packageBaseDir/lib
+    autoPatchelf $packageBaseDir/bin
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
new file mode 100644
index 000000000000..b81fab1ed76f
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/default.nix
@@ -0,0 +1,51 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, platform-tools}:
+
+let
+  runtime_paths = lib.makeBinPath [ pkgs.coreutils pkgs.file pkgs.findutils pkgs.gawk pkgs.gnugrep pkgs.gnused pkgs.jdk pkgs.python3 pkgs.which ] + ":${platform-tools}/platform-tools";
+in
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook makeWrapper pkgs.python2 ]
+    ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.stdenv.cc.cc pkgs.ncurses5 pkgs.zlib pkgs.libcxx.out ];
+  patchInstructions = lib.optionalString (os == "linux") ''
+    patchShebangs .
+
+    patch -p1 \
+      --no-backup-if-mismatch < ${./make_standalone_toolchain.py_18.patch}
+    wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${runtime_paths}"
+
+    # TODO: allow this stuff
+    rm -rf docs tests
+
+    # Patch the executables of the toolchains, but not the libraries -- they are needed for crosscompiling
+
+    addAutoPatchelfSearchPath $out/libexec/android-sdk/ndk-bundle/toolchains/renderscript/prebuilt/linux-x86_64/lib64
+    find toolchains -type d -name bin | while read dir
+    do
+        autoPatchelf "$dir"
+    done
+
+    # fix ineffective PROGDIR / MYNDKDIR determination
+    for i in ndk-build
+    do
+        sed -i -e 's|^PROGDIR=`dirname $0`|PROGDIR=`dirname $(readlink -f $(which $0))`|' $i
+    done
+
+    # Patch executables
+    autoPatchelf prebuilt/linux-x86_64
+
+    # wrap
+    for i in ndk-build
+    do
+        wrapProgram "$(pwd)/$i" --prefix PATH : "${runtime_paths}"
+    done
+
+    # make some executables available in PATH
+    mkdir -p $out/bin
+    for i in ndk-build
+    do
+        ln -sf ../libexec/android-sdk/ndk-bundle/$i $out/bin/$i
+    done
+  '';
+  noAuditTmpdir = true; # Audit script gets invoked by the build/ component in the path for the make standalone script
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/make_standalone_toolchain.py_18.patch b/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/make_standalone_toolchain.py_18.patch
new file mode 100644
index 000000000000..7af2d44a0f20
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/ndk-bundle/make_standalone_toolchain.py_18.patch
@@ -0,0 +1,44 @@
+diff -Naur android-ndk-r18b/build/tools/make_standalone_toolchain.py android-ndk-r18b-new/build/tools/make_standalone_toolchain.py
+--- android-ndk-r18b/build/tools/make_standalone_toolchain.py	2018-10-11 12:49:38.000000000 +0200
++++ android-ndk-r18b-new/build/tools/make_standalone_toolchain.py	2018-11-20 21:55:52.689991420 +0100
+@@ -30,7 +30,7 @@
+ import sys
+ import tempfile
+ import textwrap
+-
++import subprocess
+ 
+ THIS_DIR = os.path.realpath(os.path.dirname(__file__))
+ NDK_DIR = os.path.realpath(os.path.join(THIS_DIR, '../..'))
+@@ -173,6 +173,7 @@
+                 logger().debug('Copying %s', src_file)
+                 shutil.copy2(src_file, dst_dir)
+ 
++    subprocess.check_call(["chmod", "-R", "+w", dst])
+ 
+ def make_clang_scripts(install_dir, triple, api, windows):
+     """Creates Clang wrapper scripts.
+@@ -365,6 +366,7 @@
+     install_headers = os.path.join(install_sysroot, 'usr/include')
+     os.makedirs(os.path.dirname(install_headers))
+     shutil.copytree(headers, install_headers)
++    subprocess.check_call(["chmod", "-R", "+w", install_path])
+ 
+     arch_headers = os.path.join(sysroot, 'usr/include', triple)
+     copy_directory_contents(arch_headers, os.path.join(install_headers))
+@@ -375,6 +377,7 @@
+             install_sysroot, 'usr/lib{}'.format(lib_suffix))
+         if os.path.exists(lib_path):
+             shutil.copytree(lib_path, lib_install)
++            subprocess.check_call(["chmod", "-R", "+w", install_path])
+ 
+     static_lib_path = os.path.join(sysroot, 'usr/lib', triple)
+     static_lib_install = os.path.join(install_sysroot, 'usr/lib')
+@@ -389,6 +392,7 @@
+         NDK_DIR, 'prebuilt', 'android-' + arch, 'gdbserver')
+     gdbserver_install = os.path.join(install_path, 'share', 'gdbserver')
+     shutil.copytree(gdbserver_path, gdbserver_install)
++    subprocess.check_call(["chmod", "-R", "+w", install_path])
+ 
+     toolchain_lib_dir = os.path.join(gcc_path, 'lib/gcc', triple)
+     dirs = os.listdir(toolchain_lib_dir)
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/platform-tools.nix b/nixpkgs/pkgs/development/mobile/androidenv/platform-tools.nix
new file mode 100644
index 000000000000..c39d966959a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/platform-tools.nix
@@ -0,0 +1,19 @@
+{deployAndroidPackage, lib, package, os, autoPatchelfHook, pkgs}:
+
+deployAndroidPackage {
+  inherit package os;
+  buildInputs = [ autoPatchelfHook ]
+    ++ lib.optionals (os == "linux") [ pkgs.glibc pkgs.zlib pkgs.ncurses5 ];
+  patchInstructions = lib.optionalString (os == "linux") ''
+    addAutoPatchelfSearchPath $packageBaseDir/lib64
+    autoPatchelf --no-recurse $packageBaseDir/lib64
+    autoPatchelf --no-recurse $packageBaseDir
+  '' + ''
+    mkdir -p $out/bin
+    cd $out/bin
+    find $out/libexec/android-sdk/platform-tools -type f -executable -mindepth 1 -maxdepth 1 -not -name sqlite3 | while read i
+    do
+        ln -s $i
+    done
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/querypackages.sh b/nixpkgs/pkgs/development/mobile/androidenv/querypackages.sh
new file mode 100644
index 000000000000..0f31396b8766
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/querypackages.sh
@@ -0,0 +1,27 @@
+#!/bin/sh -e
+
+if [ "$1" = "" ]
+then
+    echo "Please select a package set: 'packages', 'addons', 'system-images'" >&2
+    exit 1
+fi
+
+if [ "$2" = "" ]
+then
+    echo "Please select a package group:" >&2
+    ( cat <<EOF
+builtins.attrNames (import ./generated/$1.nix {
+  fetchurl = null;
+})
+EOF
+) | nix-instantiate --eval-only -
+
+    exit 1
+fi
+
+( cat <<EOF
+builtins.attrNames (import ./generated/$1.nix {
+  fetchurl = null;
+}).$2
+EOF
+) | nix-instantiate --eval-only -
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/tools.nix b/nixpkgs/pkgs/development/mobile/androidenv/tools.nix
new file mode 100644
index 000000000000..92f53e5a7c20
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/tools.nix
@@ -0,0 +1,26 @@
+{deployAndroidPackage, requireFile, lib, packages, toolsVersion, autoPatchelfHook, makeWrapper, os, pkgs, pkgs_i686, postInstall ? ""}:
+
+if toolsVersion == "26.0.1" then import ./tools/26.nix {
+  inherit deployAndroidPackage lib autoPatchelfHook makeWrapper os pkgs pkgs_i686 postInstall;
+  package = {
+    name = "tools";
+    path = "tools";
+    revision = "26.0.1";
+    archives = {
+      linux = requireFile {
+        url = https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip;
+        sha256 = "185yq7qwxflw24ccm5d6zziwlc9pxmsm3f54pm9p7xm0ik724kj4";
+      };
+      macosx = requireFile {
+        url = https://dl.google.com/android/repository/sdk-tools-darwin-3859397.zip;
+        sha256 = "1ycx9gzdaqaw6n19yvxjawywacavn1jc6sadlz5qikhgfr57b0aa";
+      };
+    };
+  };
+} else if toolsVersion == "26.1.1" then import ./tools/26.nix {
+  inherit deployAndroidPackage lib autoPatchelfHook makeWrapper os pkgs pkgs_i686 postInstall;
+  package = packages.tools.${toolsVersion};
+} else import ./tools/25.nix {
+  inherit deployAndroidPackage lib autoPatchelfHook makeWrapper os pkgs pkgs_i686 postInstall;
+  package = packages.tools.${toolsVersion};
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/tools/25.nix b/nixpkgs/pkgs/development/mobile/androidenv/tools/25.nix
new file mode 100644
index 000000000000..80b5858031d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/tools/25.nix
@@ -0,0 +1,62 @@
+{deployAndroidPackage, lib, package, autoPatchelfHook, makeWrapper, os, pkgs, pkgs_i686, postInstall ? ""}:
+
+deployAndroidPackage {
+  name = "androidsdk";
+  buildInputs = [ autoPatchelfHook makeWrapper ]
+    ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.xlibs.libX11 pkgs.xlibs.libXext pkgs.xlibs.libXdamage pkgs.xlibs.libxcb pkgs.xlibs.libXfixes pkgs.xlibs.libXrender pkgs.fontconfig.lib pkgs.freetype pkgs.libGL pkgs.zlib pkgs.ncurses5 pkgs.libpulseaudio pkgs_i686.glibc pkgs_i686.xlibs.libX11 pkgs_i686.xlibs.libXrender pkgs_i686.fontconfig pkgs_i686.freetype pkgs_i686.zlib ];
+  inherit package os;
+
+  patchInstructions = ''
+    ${lib.optionalString (os == "linux") ''
+      # Auto patch all binaries
+      addAutoPatchelfSearchPath $PWD/lib64
+      addAutoPatchelfSearchPath $PWD/lib64/libstdc++
+      addAutoPatchelfSearchPath $PWD/lib64/qt/lib
+      addAutoPatchelfSearchPath $PWD/lib
+      addAutoPatchelfSearchPath $PWD/lib/libstdc++
+      autoPatchelf .
+    ''}
+
+    # Wrap all scripts that require JAVA_HOME
+    for i in bin
+    do
+        find $i -maxdepth 1 -type f -executable | while read program
+        do
+            if grep -q "JAVA_HOME" $program
+            then
+                wrapProgram $PWD/$program --prefix PATH : ${pkgs.jdk8}/bin
+            fi
+        done
+    done
+
+    # Wrap programs that require java
+    for i in draw9patch jobb lint screenshot2
+    do
+        wrapProgram $PWD/$i \
+          --prefix PATH : ${pkgs.jdk8}/bin
+    done
+
+    # Wrap programs that require java and SWT
+    for i in android ddms hierarchyviewer monitor monkeyrunner traceview uiautomatorviewer
+    do
+        wrapProgram $PWD/$i \
+          --prefix PATH : ${pkgs.jdk8}/bin \
+          --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.xlibs.libX11 pkgs.xlibs.libXtst ]}
+    done
+
+    ${lib.optionalString (os == "linux") ''
+      wrapProgram $PWD/emulator \
+        --prefix PATH : ${pkgs.file}/bin:${pkgs.glxinfo}/bin:${pkgs.pciutils}/bin \
+        --set QT_XKB_CONFIG_ROOT ${pkgs.xkeyboard_config}/share/X11/xkb \
+        --set QTCOMPOSE ${pkgs.xorg.libX11.out}/share/X11/locale
+    ''}
+
+    # Patch all script shebangs
+    patchShebangs .
+
+    cd ..
+    ${postInstall}
+  '';
+
+  meta.licenses = lib.licenses.unfree;
+}
diff --git a/nixpkgs/pkgs/development/mobile/androidenv/tools/26.nix b/nixpkgs/pkgs/development/mobile/androidenv/tools/26.nix
new file mode 100644
index 000000000000..0234c9f3d04b
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/androidenv/tools/26.nix
@@ -0,0 +1,40 @@
+{deployAndroidPackage, lib, package, autoPatchelfHook, makeWrapper, os, pkgs, pkgs_i686, postInstall ? ""}:
+
+deployAndroidPackage {
+  name = "androidsdk";
+  inherit os package;
+  buildInputs = [ autoPatchelfHook makeWrapper ]
+    ++ lib.optional (os == "linux") [ pkgs.glibc pkgs.xlibs.libX11 pkgs.xlibs.libXrender pkgs.xlibs.libXext pkgs.fontconfig pkgs.freetype pkgs_i686.glibc pkgs_i686.xlibs.libX11 pkgs_i686.xlibs.libXrender pkgs_i686.xlibs.libXext pkgs_i686.fontconfig.lib pkgs_i686.freetype pkgs_i686.zlib pkgs.fontconfig.lib ];
+
+  patchInstructions = ''
+    ${lib.optionalString (os == "linux") ''
+      # Auto patch all binaries
+      autoPatchelf .
+    ''}
+
+    # Wrap all scripts that require JAVA_HOME
+    for i in bin
+    do
+        find $i -maxdepth 1 -type f -executable | while read program
+        do
+            if grep -q "JAVA_HOME" $program
+            then
+                wrapProgram $PWD/$program --prefix PATH : ${pkgs.jdk8}/bin
+            fi
+        done
+    done
+
+    # Wrap monitor script
+    wrapProgram $PWD/monitor \
+      --prefix PATH : ${pkgs.jdk8}/bin \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.xlibs.libX11 pkgs.xlibs.libXtst ]}
+
+    # Patch all script shebangs
+    patchShebangs .
+
+    cd ..
+    ${postInstall}
+  '';
+
+  meta.licenses = lib.licenses.unfree;
+}
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile
new file mode 100644
index 000000000000..329b51518e4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile
@@ -0,0 +1,3 @@
+source 'https://rubygems.org' do
+  gem 'cocoapods'
+end
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta
new file mode 100644
index 000000000000..dd4b350b4372
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta
@@ -0,0 +1,5 @@
+source 'https://rubygems.org' do
+  # We need to specify a version including prerelease to pick up prereleases.
+  # This should pick up all future releases / prereleases.
+  gem 'cocoapods', '>=1.7.0.beta.1'
+end
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta.lock b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta.lock
new file mode 100644
index 000000000000..355608ca02e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile-beta.lock
@@ -0,0 +1,90 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    CFPropertyList (3.0.2)
+    activesupport (4.2.11.1)
+      i18n (~> 0.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.3, >= 0.3.4)
+      tzinfo (~> 1.1)
+    algoliasearch (1.27.1)
+      httpclient (~> 2.8, >= 2.8.3)
+      json (>= 1.5.1)
+    atomos (0.1.3)
+    claide (1.0.3)
+    cocoapods (1.9.1)
+      activesupport (>= 4.0.2, < 5)
+      claide (>= 1.0.2, < 2.0)
+      cocoapods-core (= 1.9.1)
+      cocoapods-deintegrate (>= 1.0.3, < 2.0)
+      cocoapods-downloader (>= 1.2.2, < 2.0)
+      cocoapods-plugins (>= 1.0.0, < 2.0)
+      cocoapods-search (>= 1.0.0, < 2.0)
+      cocoapods-stats (>= 1.0.0, < 2.0)
+      cocoapods-trunk (>= 1.4.0, < 2.0)
+      cocoapods-try (>= 1.1.0, < 2.0)
+      colored2 (~> 3.1)
+      escape (~> 0.0.4)
+      fourflusher (>= 2.3.0, < 3.0)
+      gh_inspector (~> 1.0)
+      molinillo (~> 0.6.6)
+      nap (~> 1.0)
+      ruby-macho (~> 1.4)
+      xcodeproj (>= 1.14.0, < 2.0)
+    cocoapods-core (1.9.1)
+      activesupport (>= 4.0.2, < 6)
+      algoliasearch (~> 1.0)
+      concurrent-ruby (~> 1.1)
+      fuzzy_match (~> 2.0.4)
+      nap (~> 1.0)
+      netrc (~> 0.11)
+      typhoeus (~> 1.0)
+    cocoapods-deintegrate (1.0.4)
+    cocoapods-downloader (1.3.0)
+    cocoapods-plugins (1.0.0)
+      nap
+    cocoapods-search (1.0.0)
+    cocoapods-stats (1.1.0)
+    cocoapods-trunk (1.4.1)
+      nap (>= 0.8, < 2.0)
+      netrc (~> 0.11)
+    cocoapods-try (1.1.0)
+    colored2 (3.1.2)
+    concurrent-ruby (1.1.6)
+    escape (0.0.4)
+    ethon (0.12.0)
+      ffi (>= 1.3.0)
+    ffi (1.12.2)
+    fourflusher (2.3.1)
+    fuzzy_match (2.0.4)
+    gh_inspector (1.1.3)
+    httpclient (2.8.3)
+    i18n (0.9.5)
+      concurrent-ruby (~> 1.0)
+    json (2.3.0)
+    minitest (5.14.0)
+    molinillo (0.6.6)
+    nanaimo (0.2.6)
+    nap (1.1.0)
+    netrc (0.11.0)
+    ruby-macho (1.4.0)
+    thread_safe (0.3.6)
+    typhoeus (1.3.1)
+      ethon (>= 0.9.0)
+    tzinfo (1.2.6)
+      thread_safe (~> 0.1)
+    xcodeproj (1.15.0)
+      CFPropertyList (>= 2.3.3, < 4.0)
+      atomos (~> 0.1.3)
+      claide (>= 1.0.2, < 2.0)
+      colored2 (~> 3.1)
+      nanaimo (~> 0.2.6)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  cocoapods (>= 1.7.0.beta.1)!
+
+BUNDLED WITH
+   1.17.3
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile.lock b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile.lock
new file mode 100644
index 000000000000..9aa7dfbf2301
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/Gemfile.lock
@@ -0,0 +1,90 @@
+GEM
+  remote: https://rubygems.org/
+  specs:
+    CFPropertyList (3.0.2)
+    activesupport (4.2.11.1)
+      i18n (~> 0.7)
+      minitest (~> 5.1)
+      thread_safe (~> 0.3, >= 0.3.4)
+      tzinfo (~> 1.1)
+    algoliasearch (1.27.1)
+      httpclient (~> 2.8, >= 2.8.3)
+      json (>= 1.5.1)
+    atomos (0.1.3)
+    claide (1.0.3)
+    cocoapods (1.9.1)
+      activesupport (>= 4.0.2, < 5)
+      claide (>= 1.0.2, < 2.0)
+      cocoapods-core (= 1.9.1)
+      cocoapods-deintegrate (>= 1.0.3, < 2.0)
+      cocoapods-downloader (>= 1.2.2, < 2.0)
+      cocoapods-plugins (>= 1.0.0, < 2.0)
+      cocoapods-search (>= 1.0.0, < 2.0)
+      cocoapods-stats (>= 1.0.0, < 2.0)
+      cocoapods-trunk (>= 1.4.0, < 2.0)
+      cocoapods-try (>= 1.1.0, < 2.0)
+      colored2 (~> 3.1)
+      escape (~> 0.0.4)
+      fourflusher (>= 2.3.0, < 3.0)
+      gh_inspector (~> 1.0)
+      molinillo (~> 0.6.6)
+      nap (~> 1.0)
+      ruby-macho (~> 1.4)
+      xcodeproj (>= 1.14.0, < 2.0)
+    cocoapods-core (1.9.1)
+      activesupport (>= 4.0.2, < 6)
+      algoliasearch (~> 1.0)
+      concurrent-ruby (~> 1.1)
+      fuzzy_match (~> 2.0.4)
+      nap (~> 1.0)
+      netrc (~> 0.11)
+      typhoeus (~> 1.0)
+    cocoapods-deintegrate (1.0.4)
+    cocoapods-downloader (1.3.0)
+    cocoapods-plugins (1.0.0)
+      nap
+    cocoapods-search (1.0.0)
+    cocoapods-stats (1.1.0)
+    cocoapods-trunk (1.4.1)
+      nap (>= 0.8, < 2.0)
+      netrc (~> 0.11)
+    cocoapods-try (1.1.0)
+    colored2 (3.1.2)
+    concurrent-ruby (1.1.6)
+    escape (0.0.4)
+    ethon (0.12.0)
+      ffi (>= 1.3.0)
+    ffi (1.12.2)
+    fourflusher (2.3.1)
+    fuzzy_match (2.0.4)
+    gh_inspector (1.1.3)
+    httpclient (2.8.3)
+    i18n (0.9.5)
+      concurrent-ruby (~> 1.0)
+    json (2.3.0)
+    minitest (5.14.0)
+    molinillo (0.6.6)
+    nanaimo (0.2.6)
+    nap (1.1.0)
+    netrc (0.11.0)
+    ruby-macho (1.4.0)
+    thread_safe (0.3.6)
+    typhoeus (1.3.1)
+      ethon (>= 0.9.0)
+    tzinfo (1.2.6)
+      thread_safe (~> 0.1)
+    xcodeproj (1.15.0)
+      CFPropertyList (>= 2.3.3, < 4.0)
+      atomos (~> 0.1.3)
+      claide (>= 1.0.2, < 2.0)
+      colored2 (~> 3.1)
+      nanaimo (~> 0.2.6)
+
+PLATFORMS
+  ruby
+
+DEPENDENCIES
+  cocoapods!
+
+BUNDLED WITH
+   1.17.3
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/default.nix b/nixpkgs/pkgs/development/mobile/cocoapods/default.nix
new file mode 100644
index 000000000000..c235b9e9a126
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/default.nix
@@ -0,0 +1,25 @@
+{ lib, bundlerApp, ruby
+, beta ? false }:
+
+bundlerApp {
+  inherit ruby;
+  pname = "cocoapods";
+  gemfile = if beta then ./Gemfile-beta else ./Gemfile;
+  lockfile = if beta then ./Gemfile-beta.lock else ./Gemfile.lock;
+  gemset = if beta then ./gemset-beta.nix else ./gemset.nix;
+  exes = [ "pod" ];
+
+  # toString prevents the update script from being copied into the nix store
+  passthru.updateScript = toString ./update;
+
+  meta = with lib; {
+    description     = "CocoaPods manages dependencies for your Xcode projects.";
+    homepage        = https://github.com/CocoaPods/CocoaPods;
+    license         = licenses.mit;
+    platforms       = platforms.darwin;
+    maintainers     = with maintainers; [
+      peterromfeldhk
+      lilyball
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/gemset-beta.nix b/nixpkgs/pkgs/development/mobile/cocoapods/gemset-beta.nix
new file mode 100644
index 000000000000..1a5912b89e8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/gemset-beta.nix
@@ -0,0 +1,363 @@
+{
+  activesupport = {
+    dependencies = ["i18n" "minitest" "thread_safe" "tzinfo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1vbq7a805bfvyik2q3kl9s3r418f5qzvysqbz2cwy4hr7m2q4ir6";
+      type = "gem";
+    };
+    version = "4.2.11.1";
+  };
+  algoliasearch = {
+    dependencies = ["httpclient" "json"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ayg8j3819ay2d8618jv32ca16fh8qsgjsiq9j32yd016c170nkj";
+      type = "gem";
+    };
+    version = "1.27.1";
+  };
+  atomos = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "17vq6sjyswr5jfzwdccw748kgph6bdw30bakwnn6p8sl4hpv4hvx";
+      type = "gem";
+    };
+    version = "0.1.3";
+  };
+  CFPropertyList = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1825ll26p28swjiw8n3x2pnh5ygsmg83spf82fnzcjn2p87vc5lf";
+      type = "gem";
+    };
+    version = "3.0.2";
+  };
+  claide = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0kasxsms24fgcdsq680nz99d5lazl9rmz1qkil2y5gbbssx89g0z";
+      type = "gem";
+    };
+    version = "1.0.3";
+  };
+  cocoapods = {
+    dependencies = ["activesupport" "claide" "cocoapods-core" "cocoapods-deintegrate" "cocoapods-downloader" "cocoapods-plugins" "cocoapods-search" "cocoapods-stats" "cocoapods-trunk" "cocoapods-try" "colored2" "escape" "fourflusher" "gh_inspector" "molinillo" "nap" "ruby-macho" "xcodeproj"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0wxr81qy4jsbxl066nlfp8zlqk31i6fsmd7f01xmi9bv04990hrs";
+      type = "gem";
+    };
+    version = "1.9.1";
+  };
+  cocoapods-core = {
+    dependencies = ["activesupport" "algoliasearch" "concurrent-ruby" "fuzzy_match" "nap" "netrc" "typhoeus"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0c1679fkyp06dwsh93r0ldzly9vc74g0br4jdngwvdl4g0j4fyzc";
+      type = "gem";
+    };
+    version = "1.9.1";
+  };
+  cocoapods-deintegrate = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bf524f1za92i6rlr4cr6jm3c4vfjszsdc9lsr6wk5125c76ipzn";
+      type = "gem";
+    };
+    version = "1.0.4";
+  };
+  cocoapods-downloader = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "08vn0pgcyn6w6fq5xjd7szv2h9s5rzl17kyidnd7fl5qdmzc9c54";
+      type = "gem";
+    };
+    version = "1.3.0";
+  };
+  cocoapods-plugins = {
+    dependencies = ["nap"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "16na82sfyc8801qs1n22nwq486s4j7yj6rj7fcp8cbxmj371fpbj";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
+  cocoapods-search = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02wmy5rbjk29c65zn62bffxv30qs11slql23qx65snkm0vd93mn6";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
+  cocoapods-stats = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1xhdh5v94p6l612rwrk290nd2hdfx8lbaqfbkmj34md218kilqww";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  cocoapods-trunk = {
+    dependencies = ["nap" "netrc"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0vrwsgaq3nf7v3pwksgqy0mhswrp3ipczrc96vl3ii2pcc9ilwkw";
+      type = "gem";
+    };
+    version = "1.4.1";
+  };
+  cocoapods-try = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1gf2zjmcjhh9psq15yfy82wz5jnlihf5bcw79f8hlv4cnqyspncj";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  colored2 = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0jlbqa9q4mvrm73aw9mxh23ygzbjiqwisl32d8szfb5fxvbjng5i";
+      type = "gem";
+    };
+    version = "3.1.2";
+  };
+  concurrent-ruby = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "094387x4yasb797mv07cs3g6f08y56virc2rjcpb1k79rzaj3nhl";
+      type = "gem";
+    };
+    version = "1.1.6";
+  };
+  escape = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0sa1xkfc9jvkwyw1jbz3jhkq0ms1zrvswi6mmfiwcisg5fp497z4";
+      type = "gem";
+    };
+    version = "0.0.4";
+  };
+  ethon = {
+    dependencies = ["ffi"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0gggrgkcq839mamx7a8jbnp2h7x2ykfn34ixwskwb0lzx2ak17g9";
+      type = "gem";
+    };
+    version = "0.12.0";
+  };
+  ffi = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10lfhahnnc91v63xpvk65apn61pib086zha3z5sp1xk9acfx12h4";
+      type = "gem";
+    };
+    version = "1.12.2";
+  };
+  fourflusher = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1afabh3g3gwj0ad53fs62waks815xcckf7pkci76l6vrghffcg8v";
+      type = "gem";
+    };
+    version = "2.3.1";
+  };
+  fuzzy_match = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "19gw1ifsgfrv7xdi6n61658vffgm1867f4xdqfswb2b5h6alzpmm";
+      type = "gem";
+    };
+    version = "2.0.4";
+  };
+  gh_inspector = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f8r9byajj3bi2c7c5sqrc7m0zrv3nblfcd4782lw5l73cbsgk04";
+      type = "gem";
+    };
+    version = "1.1.3";
+  };
+  httpclient = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "19mxmvghp7ki3klsxwrlwr431li7hm1lczhhj8z4qihl2acy8l99";
+      type = "gem";
+    };
+    version = "2.8.3";
+  };
+  i18n = {
+    dependencies = ["concurrent-ruby"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3";
+      type = "gem";
+    };
+    version = "0.9.5";
+  };
+  json = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nrmw2r4nfxlfgprfgki3hjifgrcrs3l5zvm3ca3gb4743yr25mn";
+      type = "gem";
+    };
+    version = "2.3.0";
+  };
+  minitest = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g73x65hmjph8dg1h3rkzfg7ys3ffxm35hj35grw75fixmq53qyz";
+      type = "gem";
+    };
+    version = "5.14.0";
+  };
+  molinillo = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1hh40z1adl4lw16dj4hxgabx4rr28mgqycih1y1d91bwww0jjdg6";
+      type = "gem";
+    };
+    version = "0.6.6";
+  };
+  nanaimo = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ajfyaqjw3dzykk612yw8sm21savfqy292hgps8h8l4lvxww1lz6";
+      type = "gem";
+    };
+    version = "0.2.6";
+  };
+  nap = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0xm5xssxk5s03wjarpipfm39qmgxsalb46v1prsis14x1xk935ll";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  netrc = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
+      type = "gem";
+    };
+    version = "0.11.0";
+  };
+  ruby-macho = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0lhdjn91jkifsy2hzq2hgcm0pp8pbik87m58zmw1ifh6hkp9adjb";
+      type = "gem";
+    };
+    version = "1.4.0";
+  };
+  thread_safe = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  typhoeus = {
+    dependencies = ["ethon"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0cni8b1idcp0dk8kybmxydadhfpaj3lbs99w5kjibv8bsmip2zi5";
+      type = "gem";
+    };
+    version = "1.3.1";
+  };
+  tzinfo = {
+    dependencies = ["thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "04f18jdv6z3zn3va50rqq35nj3izjpb72fnf21ixm7vanq6nc4fp";
+      type = "gem";
+    };
+    version = "1.2.6";
+  };
+  xcodeproj = {
+    dependencies = ["CFPropertyList" "atomos" "claide" "colored2" "nanaimo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ldb1jckfzkk9c74nv500z0q936nn25fn5mywzwrh7sjwgkaxp5z";
+      type = "gem";
+    };
+    version = "1.15.0";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/gemset.nix b/nixpkgs/pkgs/development/mobile/cocoapods/gemset.nix
new file mode 100644
index 000000000000..4d4979d56206
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/gemset.nix
@@ -0,0 +1,335 @@
+{
+  activesupport = {
+    dependencies = ["i18n" "minitest" "thread_safe" "tzinfo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1vbq7a805bfvyik2q3kl9s3r418f5qzvysqbz2cwy4hr7m2q4ir6";
+      type = "gem";
+    };
+    version = "4.2.11.1";
+  };
+  algoliasearch = {
+    dependencies = ["httpclient" "json"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ayg8j3819ay2d8618jv32ca16fh8qsgjsiq9j32yd016c170nkj";
+      type = "gem";
+    };
+    version = "1.27.1";
+  };
+  atomos = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "17vq6sjyswr5jfzwdccw748kgph6bdw30bakwnn6p8sl4hpv4hvx";
+      type = "gem";
+    };
+    version = "0.1.3";
+  };
+  CFPropertyList = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1825ll26p28swjiw8n3x2pnh5ygsmg83spf82fnzcjn2p87vc5lf";
+      type = "gem";
+    };
+    version = "3.0.2";
+  };
+  claide = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0kasxsms24fgcdsq680nz99d5lazl9rmz1qkil2y5gbbssx89g0z";
+      type = "gem";
+    };
+    version = "1.0.3";
+  };
+  cocoapods = {
+    dependencies = ["activesupport" "claide" "cocoapods-core" "cocoapods-deintegrate" "cocoapods-downloader" "cocoapods-plugins" "cocoapods-search" "cocoapods-stats" "cocoapods-trunk" "cocoapods-try" "colored2" "escape" "fourflusher" "gh_inspector" "molinillo" "nap" "ruby-macho" "xcodeproj"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0wxr81qy4jsbxl066nlfp8zlqk31i6fsmd7f01xmi9bv04990hrs";
+      type = "gem";
+    };
+    version = "1.9.1";
+  };
+  cocoapods-core = {
+    dependencies = ["activesupport" "algoliasearch" "concurrent-ruby" "fuzzy_match" "nap" "netrc" "typhoeus"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0c1679fkyp06dwsh93r0ldzly9vc74g0br4jdngwvdl4g0j4fyzc";
+      type = "gem";
+    };
+    version = "1.9.1";
+  };
+  cocoapods-deintegrate = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0bf524f1za92i6rlr4cr6jm3c4vfjszsdc9lsr6wk5125c76ipzn";
+      type = "gem";
+    };
+    version = "1.0.4";
+  };
+  cocoapods-downloader = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "08vn0pgcyn6w6fq5xjd7szv2h9s5rzl17kyidnd7fl5qdmzc9c54";
+      type = "gem";
+    };
+    version = "1.3.0";
+  };
+  cocoapods-plugins = {
+    dependencies = ["nap"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "16na82sfyc8801qs1n22nwq486s4j7yj6rj7fcp8cbxmj371fpbj";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
+  cocoapods-search = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "02wmy5rbjk29c65zn62bffxv30qs11slql23qx65snkm0vd93mn6";
+      type = "gem";
+    };
+    version = "1.0.0";
+  };
+  cocoapods-stats = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1xhdh5v94p6l612rwrk290nd2hdfx8lbaqfbkmj34md218kilqww";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  cocoapods-trunk = {
+    dependencies = ["nap" "netrc"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0vrwsgaq3nf7v3pwksgqy0mhswrp3ipczrc96vl3ii2pcc9ilwkw";
+      type = "gem";
+    };
+    version = "1.4.1";
+  };
+  cocoapods-try = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1gf2zjmcjhh9psq15yfy82wz5jnlihf5bcw79f8hlv4cnqyspncj";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  colored2 = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0jlbqa9q4mvrm73aw9mxh23ygzbjiqwisl32d8szfb5fxvbjng5i";
+      type = "gem";
+    };
+    version = "3.1.2";
+  };
+  concurrent-ruby = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "094387x4yasb797mv07cs3g6f08y56virc2rjcpb1k79rzaj3nhl";
+      type = "gem";
+    };
+    version = "1.1.6";
+  };
+  escape = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0sa1xkfc9jvkwyw1jbz3jhkq0ms1zrvswi6mmfiwcisg5fp497z4";
+      type = "gem";
+    };
+    version = "0.0.4";
+  };
+  ethon = {
+    dependencies = ["ffi"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0gggrgkcq839mamx7a8jbnp2h7x2ykfn34ixwskwb0lzx2ak17g9";
+      type = "gem";
+    };
+    version = "0.12.0";
+  };
+  ffi = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10lfhahnnc91v63xpvk65apn61pib086zha3z5sp1xk9acfx12h4";
+      type = "gem";
+    };
+    version = "1.12.2";
+  };
+  fourflusher = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1afabh3g3gwj0ad53fs62waks815xcckf7pkci76l6vrghffcg8v";
+      type = "gem";
+    };
+    version = "2.3.1";
+  };
+  fuzzy_match = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "19gw1ifsgfrv7xdi6n61658vffgm1867f4xdqfswb2b5h6alzpmm";
+      type = "gem";
+    };
+    version = "2.0.4";
+  };
+  gh_inspector = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0f8r9byajj3bi2c7c5sqrc7m0zrv3nblfcd4782lw5l73cbsgk04";
+      type = "gem";
+    };
+    version = "1.1.3";
+  };
+  httpclient = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "19mxmvghp7ki3klsxwrlwr431li7hm1lczhhj8z4qihl2acy8l99";
+      type = "gem";
+    };
+    version = "2.8.3";
+  };
+  i18n = {
+    dependencies = ["concurrent-ruby"];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3";
+      type = "gem";
+    };
+    version = "0.9.5";
+  };
+  json = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nrmw2r4nfxlfgprfgki3hjifgrcrs3l5zvm3ca3gb4743yr25mn";
+      type = "gem";
+    };
+    version = "2.3.0";
+  };
+  minitest = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0g73x65hmjph8dg1h3rkzfg7ys3ffxm35hj35grw75fixmq53qyz";
+      type = "gem";
+    };
+    version = "5.14.0";
+  };
+  molinillo = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1hh40z1adl4lw16dj4hxgabx4rr28mgqycih1y1d91bwww0jjdg6";
+      type = "gem";
+    };
+    version = "0.6.6";
+  };
+  nanaimo = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0ajfyaqjw3dzykk612yw8sm21savfqy292hgps8h8l4lvxww1lz6";
+      type = "gem";
+    };
+    version = "0.2.6";
+  };
+  nap = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0xm5xssxk5s03wjarpipfm39qmgxsalb46v1prsis14x1xk935ll";
+      type = "gem";
+    };
+    version = "1.1.0";
+  };
+  netrc = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0gzfmcywp1da8nzfqsql2zqi648mfnx6qwkig3cv36n9m0yy676y";
+      type = "gem";
+    };
+    version = "0.11.0";
+  };
+  ruby-macho = {
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0lhdjn91jkifsy2hzq2hgcm0pp8pbik87m58zmw1ifh6hkp9adjb";
+      type = "gem";
+    };
+    version = "1.4.0";
+  };
+  thread_safe = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0nmhcgq6cgz44srylra07bmaw99f5271l0dpsvl5f75m44l0gmwy";
+      type = "gem";
+    };
+    version = "0.3.6";
+  };
+  typhoeus = {
+    dependencies = ["ethon"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "0cni8b1idcp0dk8kybmxydadhfpaj3lbs99w5kjibv8bsmip2zi5";
+      type = "gem";
+    };
+    version = "1.3.1";
+  };
+  tzinfo = {
+    dependencies = ["thread_safe"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "04f18jdv6z3zn3va50rqq35nj3izjpb72fnf21ixm7vanq6nc4fp";
+      type = "gem";
+    };
+    version = "1.2.6";
+  };
+  xcodeproj = {
+    dependencies = ["CFPropertyList" "atomos" "claide" "colored2" "nanaimo"];
+    groups = ["default"];
+    platforms = [];
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "1ldb1jckfzkk9c74nv500z0q936nn25fn5mywzwrh7sjwgkaxp5z";
+      type = "gem";
+    };
+    version = "1.15.0";
+  };
+}
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/mobile/cocoapods/update b/nixpkgs/pkgs/development/mobile/cocoapods/update
new file mode 100755
index 000000000000..309142e0e1d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/cocoapods/update
@@ -0,0 +1,12 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p bash bundix bundler
+
+set -e
+
+cd "$(dirname "${BASH_SOURCE[0]}")"
+
+rm -f Gemfile.lock Gemfile-beta.lock
+bundler lock
+BUNDLE_GEMFILE=Gemfile-beta bundler lock --lockfile=Gemfile-beta.lock
+bundix --gemfile=Gemfile --lockfile=Gemfile.lock --gemset=gemset.nix
+bundix --gemfile=Gemfile-beta --lockfile=Gemfile-beta.lock --gemset=gemset-beta.nix
diff --git a/nixpkgs/pkgs/development/mobile/flashtool/default.nix b/nixpkgs/pkgs/development/mobile/flashtool/default.nix
new file mode 100644
index 000000000000..f78a10d82663
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/flashtool/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, requireFile, p7zip, jre, libusb1, platform-tools, gtk2, glib, libXtst }:
+
+# TODO:
+#
+#   The FlashTool and FlashToolConsole scripts are messy and should probably we
+#   replaced entirely. All these scripts do is try to guess the environment in
+#   which to run the Java binary (and they guess wrong on NixOS).
+#
+#   The FlashTool scripts run 'chmod' on the binaries installed in the Nix
+#   store. These commands fail, naturally, because the Nix story is (hopefully)
+#   mounted read-only. This doesn't matter, though, because the build
+#   instructions fix the executable bits already.
+
+stdenv.mkDerivation rec {
+  name = "flashtool-0.9.14.0";
+
+  src = requireFile {
+    url = "http://dfiles.eu/files/n8c1c3pgc";
+    name = "flashtool-0.9.14.0-linux.tar.7z";
+    sha256 = "0mfjdjj7clz2dhkg7lzy1m8hk8ngla7zgcryf51aki1gnpbb2zc1";
+  };
+
+  buildInputs = [ p7zip jre ];
+
+  unpackPhase = ''
+    7z e ${src}
+    tar xf ${name}-linux.tar
+    sourceRoot=FlashTool
+  '';
+
+  buildPhase = ''
+    ln -s ${platform-tools}/libexec/android-sdk/platform-tools/adb x10flasher_lib/adb.linux
+    ln -s ${platform-tools}/libexec/android-sdk/platform-tools/fastboot x10flasher_lib/fastboot.linux
+    ln -s ${libusb1.out}/lib/libusb-1.0.so.0 ./x10flasher_lib/linux/lib32/libusbx-1.0.so
+
+    chmod +x x10flasher_lib/unyaffs.linux.x86 x10flasher_lib/bin2elf x10flasher_lib/bin2sin
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" x10flasher_lib/unyaffs.linux.x86
+    ln -sf unyaffs.linux.x86 x10flasher_lib/unyaffs.linux
+
+    ln -s swt32.jar x10flasher_lib/swtlin/swt.jar
+
+    sed -i \
+      -e 's|$(uname -m)|i686|' \
+      -e 's|export JAVA_HOME=.*|export JAVA_HOME=${jre}|' \
+      -e 's|export LD_LIBRARY_PATH=.*|export LD_LIBRARY_PATH=${stdenv.lib.makeLibraryPath [ libXtst glib gtk2 ]}:./x10flasher_lib/linux/lib32|' \
+      FlashTool FlashToolConsole
+  '';
+
+  installPhase = ''
+    mkdir -p $out
+    mv * $out/
+  '';
+
+  meta = {
+    homepage = http://www.flashtool.net/;
+    description = "S1 flashing software for Sony phones from X10 to Xperia Z Ultra";
+    license = stdenv.lib.licenses.unfreeRedistributableFirmware;
+    platforms = [ "i686-linux" ];
+    hydraPlatforms = stdenv.lib.platforms.none;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/genymotion/default.nix b/nixpkgs/pkgs/development/mobile/genymotion/default.nix
new file mode 100644
index 000000000000..0ea74377a5fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/genymotion/default.nix
@@ -0,0 +1,81 @@
+{ stdenv, fetchurl, makeWrapper, which, zlib, libGL, glib, xorg, libxkbcommon
+, xdg_utils
+# For glewinfo
+, libXmu, libXi, libXext }:
+
+let
+  packages = [
+    stdenv.cc.cc zlib glib xorg.libX11 libxkbcommon libXmu libXi libXext libGL
+  ];
+  libPath = stdenv.lib.makeLibraryPath packages;
+in
+stdenv.mkDerivation rec {
+  pname = "genymotion";
+  version = "2.8.0";
+  src = fetchurl {
+    url = "https://dl.genymotion.com/releases/genymotion-${version}/genymotion-${version}-linux_x64.bin";
+    name = "genymotion-${version}-linux_x64.bin";
+    sha256 = "0lvfdlpmmsyq2i9gs4mf6a8fxkfimdr4rhyihqnfhjij3fzxz4lk";
+  };
+
+  buildInputs = [ makeWrapper which xdg_utils ];
+
+  unpackPhase = ''
+    mkdir -p phony-home $out/share/applications
+    export HOME=$TMP/phony-home
+
+    mkdir ${pname}
+    echo "y" | sh $src -d ${pname}
+    sourceRoot=${pname}
+
+    substitute phony-home/.local/share/applications/genymobile-genymotion.desktop \
+      $out/share/applications/genymobile-genymotion.desktop --replace "$TMP/${pname}" "$out/libexec"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/libexec
+    mv genymotion $out/libexec/
+    ln -s $out/libexec/genymotion/{genymotion,player} $out/bin
+  '';
+
+  fixupPhase = ''
+    patchInterpreter() {
+      patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        "$out/libexec/genymotion/$1"
+    }
+
+    patchExecutable() {
+      patchInterpreter "$1"
+      wrapProgram "$out/libexec/genymotion/$1" \
+        --set "LD_LIBRARY_PATH" "${libPath}"
+    }
+
+    patchTool() {
+      patchInterpreter "tools/$1"
+      wrapProgram "$out/libexec/genymotion/tools/$1" \
+        --set "LD_LIBRARY_PATH" "${libPath}"
+    }
+
+    patchExecutable genymotion
+    patchExecutable player
+
+    patchTool adb
+    patchTool aapt
+    patchTool glewinfo
+
+    rm $out/libexec/genymotion/libxkbcommon*
+  '';
+
+  meta = {
+    description = "Fast and easy Android emulation";
+    longDescription = ''
+      Genymotion is a relatively fast Android emulator which comes with
+      pre-configured Android (x86 with OpenGL hardware acceleration) images,
+      suitable for application testing.
+     '';
+    homepage = https://www.genymotion.com/;
+    license = stdenv.lib.licenses.unfree;
+    platforms = ["x86_64-linux"];
+    maintainers = [ stdenv.lib.maintainers.puffnfresh ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/imgpatchtools/default.nix b/nixpkgs/pkgs/development/mobile/imgpatchtools/default.nix
new file mode 100644
index 000000000000..706fa2c65998
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/imgpatchtools/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchzip, bzip2, openssl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "imgpatchtools";
+  version = "0.3";
+
+  src = fetchzip {
+    url = "https://github.com/erfanoabdi/imgpatchtools/archive/${version}.tar.gz";
+    sha256 = "1cwp1hfhip252dz0mbkhrsrkws6m15k359n4amw2vfnglnls8czd";
+  };
+
+  buildInputs = [ bzip2 openssl zlib ];
+
+  installPhase = "install -Dt $out/bin bin/*";
+
+  meta = with stdenv.lib; {
+    description = "Tools to manipulate Android OTA archives";
+    longDescription = ''
+      This package is useful for Android development. In particular, it can be
+      used to extract ext4 /system image from Android distribution ZIP archives
+      such as those distributed by LineageOS and Replicant, via BlockImageUpdate
+      utility. It also includes other, related, but arguably more advanced tools
+      for OTA manipulation.
+    '';
+    homepage = https://github.com/erfanoabdi/imgpatchtools;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/titaniumenv/build-app.nix b/nixpkgs/pkgs/development/mobile/titaniumenv/build-app.nix
new file mode 100644
index 000000000000..a7e158bd3bb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/titaniumenv/build-app.nix
@@ -0,0 +1,188 @@
+{stdenv, composeAndroidPackages, composeXcodeWrapper, titaniumsdk, titanium, alloy, jdk, python, nodejs, which, file}:
+{ name, src, preBuild ? "", target, tiVersion ? null
+, release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null
+, iosMobileProvisioningProfile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosVersion ? "12.1", iosBuildStore ? false
+, enableWirelessDistribution ? false, installURL ? null
+, xcodeBaseDir ? "/Applications/Xcode.app"
+, androidsdkArgs ? {}
+, xcodewrapperArgs ? {}
+, ...
+}@args:
+
+assert (release && target == "android") -> androidKeyStore != null && androidKeyAlias != null && androidKeyStorePassword != null;
+assert (release && target == "iphone") -> iosMobileProvisioningProfile != null && iosCertificateName != null && iosCertificate != null && iosCertificatePassword != null;
+assert enableWirelessDistribution -> installURL != null;
+
+let
+  realAndroidsdkArgs = {
+    platformVersions = [ "28" ];
+  } // androidsdkArgs;
+
+  androidsdk = (composeAndroidPackages realAndroidsdkArgs).androidsdk;
+
+  xcodewrapper = composeXcodeWrapper xcodewrapperArgs;
+
+  deleteKeychain = ''
+    if [ -f $HOME/lock-keychain ]
+    then
+        security default-keychain -s login.keychain
+        security delete-keychain $keychainName
+        rm -f $HOME/lock-keychain
+    fi
+  '';
+
+  extraArgs = removeAttrs args [ "name" "preRebuild" "androidsdkArgs" "xcodewrapperArgs" ];
+in
+stdenv.mkDerivation ({
+  name = stdenv.lib.replaceChars [" "] [""] name;
+
+  buildInputs = [ nodejs titanium alloy python which file jdk ];
+
+  buildPhase = ''
+    ${preBuild}
+
+    ${stdenv.lib.optionalString stdenv.isDarwin ''
+      # Hack that provides a writable alloy package on macOS. Without it the build fails because of a file permission error.
+      alloy=$(dirname $(type -p alloy))/..
+      cp -rv $alloy/* alloy
+      chmod -R u+w alloy
+      export PATH=$(pwd)/alloy/bin:$PATH
+    ''}
+
+    export HOME=${if target == "iphone" then "/Users/$(whoami)" else "$TMPDIR"}
+
+    ${stdenv.lib.optionalString (tiVersion != null) ''
+      # Replace titanium version by the provided one
+      sed -i -e "s|<sdk-version>[0-9a-zA-Z\.]*</sdk-version>|<sdk-version>${tiVersion}</sdk-version>|" tiapp.xml
+    ''}
+
+    # Simulate a login
+    mkdir -p $HOME/.titanium
+    cat > $HOME/.titanium/auth_session.json <<EOF
+    { "loggedIn": true }
+    EOF
+
+    # Configure the paths to the Titanium SDK and modules
+    echo "{}" > $TMPDIR/config.json
+    titanium --config-file $TMPDIR/config.json --no-colors config sdk.defaultInstallLocation ${titaniumsdk}
+    titanium --config-file $TMPDIR/config.json --no-colors config paths.modules ${titaniumsdk}
+
+    mkdir -p $out
+
+    ${if target == "android" then ''
+      titanium config --config-file $TMPDIR/config.json --no-colors android.sdkPath ${androidsdk}/libexec/android-sdk
+
+      export PATH=${androidsdk}/libexec/android-sdk/tools:$(echo ${androidsdk}/libexec/android-sdk/build-tools/android-*):$PATH
+      export GRADLE_USER_HOME=$TMPDIR/gradle
+
+      ${if release then ''
+        ${stdenv.lib.optionalString stdenv.isDarwin ''
+          # Signing the app does not work with OpenJDK on macOS, use host SDK instead
+          export JAVA_HOME="$(/usr/libexec/java_home -v 1.8)"
+        ''}
+        titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target dist-playstore --keystore ${androidKeyStore} --alias "${androidKeyAlias}" --store-password "${androidKeyStorePassword}" --output-dir $out
+      '' else ''
+        titanium build --config-file $TMPDIR/config.json --no-colors --force --platform android --target emulator --build-only -B foo --output $out
+      ''}
+    ''
+    else if target == "iphone" then ''
+      # Be sure that the Xcode wrapper has priority over everything else.
+      # When using buildInputs this does not seem to be the case.
+      export PATH=${xcodewrapper}/bin:$PATH
+
+      # Configure the path to Xcode
+      titanium --config-file $TMPDIR/config.json --no-colors config paths.xcode ${xcodeBaseDir}
+
+      # Link the modules folder
+      if [ ! -e modules ]
+      then
+          ln -s ${titaniumsdk}/modules modules
+          createdModulesSymlink=1
+      fi
+
+      ${if release then ''
+        # Create a keychain with the component hash name (should always be unique)
+        export keychainName=$(basename $out)
+
+        security create-keychain -p "" $keychainName
+        security default-keychain -s $keychainName
+        security unlock-keychain -p "" $keychainName
+        security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
+        security set-key-partition-list -S apple-tool:,apple: -s -k "" $keychainName
+        provisioningId=$(grep UUID -A1 -a ${iosMobileProvisioningProfile} | grep -o "[-A-Za-z0-9]\{36\}")
+
+        # Ensure that the requested provisioning profile can be found
+
+        if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision" ]
+        then
+            mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+            cp ${iosMobileProvisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
+        fi
+
+        # Take precautions to prevent concurrent builds blocking the keychain
+        while [ -f $HOME/lock-keychain ]
+        do
+            echo "Keychain locked, waiting for a couple of seconds, or remove $HOME/lock-keychain to unblock..."
+            sleep 3
+        done
+
+        touch $HOME/lock-keychain
+
+        security default-keychain -s $keychainName
+
+        # Do the actual build
+        titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target ${if iosBuildStore then "dist-appstore" else "dist-adhoc"} --pp-uuid $provisioningId --distribution-name "${iosCertificateName}" --keychain $HOME/Library/Keychains/$keychainName-db --device-family universal --ios-version ${iosVersion} --output-dir $out
+
+        # Remove our generated keychain
+        ${deleteKeychain}
+      '' else ''
+        # Copy all sources to the output store directory.
+        # Why? Debug application include *.js files, which are symlinked into their
+        # sources. If they are not copied, we have dangling references to the
+        # temp folder.
+
+        cp -av * $out
+        cd $out
+
+        # Execute the build
+        titanium build --config-file $TMPDIR/config.json --force --no-colors --platform ios --target simulator --build-only --device-family universal --ios-version ${iosVersion} --output-dir $out
+
+        # Remove the modules symlink
+        if [ "$createdModulesSymlink" = "1" ]
+        then
+            rm $out/modules
+        fi
+      ''}
+    '' else throw "Target: ${target} is not supported!"}
+  '';
+
+  installPhase = ''
+    ${if target == "android" then ''
+      ${if release then ""
+      else ''
+        cp "$(ls build/android/bin/*.apk | grep -v '\-unsigned.apk')" $out
+      ''}
+
+      mkdir -p $out/nix-support
+      echo "file binary-dist \"$(ls $out/*.apk)\"" > $out/nix-support/hydra-build-products
+    ''
+    else if target == "iphone" then
+      if release then ''
+        mkdir -p $out/nix-support
+        echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
+
+        ${stdenv.lib.optionalString enableWirelessDistribution ''
+          appname="$(basename $out/*.ipa .ipa)"
+          bundleId=$(grep '<id>[a-zA-Z0-9.]*</id>' tiapp.xml | sed -e 's|<id>||' -e 's|</id>||' -e 's/ //g')
+          version=$(grep '<version>[a-zA-Z0-9.]*</version>' tiapp.xml | sed -e 's|<version>||' -e 's|</version>||' -e 's/ //g')
+
+          sed -e "s|@INSTALL_URL@|${installURL}?bundleId=$bundleId\&amp;version=$version\&amp;title=$appname|" ${../xcodeenv/install.html.template} > "$out/$appname.html"
+          echo "doc install \"$out/$appname.html\"" >> $out/nix-support/hydra-build-products
+        ''}
+      ''
+      else ""
+    else throw "Target: ${target} is not supported!"}
+  '';
+
+  failureHook = stdenv.lib.optionalString (release && target == "iphone") deleteKeychain;
+} // extraArgs)
diff --git a/nixpkgs/pkgs/development/mobile/titaniumenv/default.nix b/nixpkgs/pkgs/development/mobile/titaniumenv/default.nix
new file mode 100644
index 000000000000..5e0f943a158d
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/titaniumenv/default.nix
@@ -0,0 +1,21 @@
+{pkgs, androidenv, xcodeenv, tiVersion ? "8.3.2.GA"}:
+
+rec {
+  titaniumsdk = let
+    titaniumSdkFile = if tiVersion == "8.2.1.GA" then ./titaniumsdk-8.2.nix
+      else if tiVersion == "7.5.1.GA" then ./titaniumsdk-7.5.nix
+      else if tiVersion == "8.3.2.GA" then ./titaniumsdk-8.3.nix
+      else throw "Titanium version not supported: "+tiVersion;
+    in
+    import titaniumSdkFile {
+      inherit (pkgs) stdenv fetchurl unzip makeWrapper;
+    };
+
+  buildApp = import ./build-app.nix {
+    inherit (pkgs) stdenv python which file jdk nodejs;
+    inherit (pkgs.nodePackages_10_x) alloy titanium;
+    inherit (androidenv) composeAndroidPackages;
+    inherit (xcodeenv) composeXcodeWrapper;
+    inherit titaniumsdk;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-7.5.nix b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-7.5.nix
new file mode 100644
index 000000000000..5c1cd0a265ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-7.5.nix
@@ -0,0 +1,107 @@
+{stdenv, fetchurl, unzip, makeWrapper}:
+
+let
+  # Gradle is a build system that bootstraps itself. This is what it actually
+  # downloads in the bootstrap phase.
+  gradleAllZip = fetchurl {
+    url = http://services.gradle.org/distributions/gradle-4.1-all.zip;
+    sha256 = "1rcrh263vq7a0is800y5z36jj97p67c6zpqzzfcbr7r0qaxb61sw";
+  };
+
+  # A Titanium-Android build requires proguard plugins. We create a fake
+  # repository so that Gradle does not attempt to download them in the builder.
+  # Since there are only 3 plugins required, this is still (sort of) manageable
+  # without a generator.
+  proguardVersion = "5.3.3";
+
+  proguardGradlePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom";
+    sha256 = "03v9zm3ykfkyb5cs5ald07ph103fh68d5c33rv070r29p71dwszj";
+  };
+  proguardGradleJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar";
+    sha256 = "0shhpsjfc5gam15jnv1hk718v5c7vi7dwdc3gvmnid6dc85kljzk";
+  };
+  proguardParentPOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom";
+    sha256 = "0mv0zbwyw8xa4mkc5kw69y5xqashkz9gp123akfvh9f6152l3202";
+  };
+  proguardBasePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom";
+    sha256 = "1jnr6zsxfimb8wglqlwa6rrdc3g3nqf1dyw0k2dq9cj0q4pgn7p5";
+  };
+  proguardBaseJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar";
+    sha256 = "11nwdb9y84cghcx319nsjjf9m035s4s1184zrhzpvaxq2wvqhbhx";
+  };
+
+  # Put the downloaded plugins in a fake Maven repository
+  fakeMavenRepo = stdenv.mkDerivation {
+    name = "fake-maven-repo";
+    buildCommand = ''
+      mkdir -p $out
+      cd $out
+      mkdir -p net/sf/proguard/proguard-gradle/${proguardVersion}
+      cp ${proguardGradlePOM} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom
+      cp ${proguardGradleJAR} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar
+      mkdir -p net/sf/proguard/proguard-parent/${proguardVersion}
+      cp ${proguardParentPOM} net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom
+      mkdir -p net/sf/proguard/proguard-base/${proguardVersion}
+      cp ${proguardBasePOM} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom
+      cp ${proguardBaseJAR} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar
+    '';
+  };
+in
+stdenv.mkDerivation {
+  name = "mobilesdk-7.5.1.GA";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = https://builds.appcelerator.com/mobile/7_5_X/mobilesdk-7.5.1.v20190124152315-linux.zip;
+    sha256 = "1ihyh6szl9a2gbdgv13msd3g7i3xi9ifmgsh6v562hqlfi4lixng";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = https://builds.appcelerator.com/mobile/7_5_X/mobilesdk-7.5.1.v20190124152315-osx.zip;
+    sha256 = "1whs1j7fkk2hxr4nxq50d7ic5wj83b1i1jl0p722sqbvkmgxssa2";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+
+  buildInputs = [ unzip makeWrapper ];
+
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    (yes y | unzip $src) || true
+
+    # Rename ugly version number
+    cd mobilesdk/*
+    mv * 7.5.1.GA
+    cd *
+
+    # Patch bundled gradle build infrastructure to make shebangs work
+    patchShebangs android/templates/gradle
+
+    # Substitute the gradle-all zip URL by a local file to prevent downloads from happening while building an Android app
+    sed -i -e "s|distributionUrl=|#distributionUrl=|" android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+    cp ${gradleAllZip} android/templates/gradle/gradle/wrapper/gradle-4.1-all.zip
+    echo "distributionUrl=gradle-4.1-all.zip" >> android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+
+    # Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts
+    sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle
+
+    # Patch the strip frameworks script in the iPhone build template to not let
+    # it skip the strip phase. This is caused by an assumption on the file
+    # permissions in which Nix deviates from the standard.
+    sed -i -e "s|-perm +111|-perm /111|" iphone/templates/build/strip-frameworks.sh
+
+    # Patch some executables
+
+    ${if stdenv.system == "i686-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
+      ''
+      else ""}
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix
new file mode 100644
index 000000000000..45523fad9082
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.2.nix
@@ -0,0 +1,109 @@
+{stdenv, fetchurl, unzip, makeWrapper}:
+
+let
+  # Gradle is a build system that bootstraps itself. This is what it actually
+  # downloads in the bootstrap phase.
+  gradleAllZip = fetchurl {
+    url = http://services.gradle.org/distributions/gradle-4.1-all.zip;
+    sha256 = "1rcrh263vq7a0is800y5z36jj97p67c6zpqzzfcbr7r0qaxb61sw";
+  };
+
+  # A Titanium-Android build requires proguard plugins. We create a fake
+  # repository so that Gradle does not attempt to download them in the builder.
+  # Since there are only 3 plugins required, this is still (sort of) manageable
+  # without a generator.
+  proguardVersion = "5.3.3";
+
+  proguardGradlePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom";
+    sha256 = "03v9zm3ykfkyb5cs5ald07ph103fh68d5c33rv070r29p71dwszj";
+  };
+  proguardGradleJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar";
+    sha256 = "0shhpsjfc5gam15jnv1hk718v5c7vi7dwdc3gvmnid6dc85kljzk";
+  };
+  proguardParentPOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom";
+    sha256 = "0mv0zbwyw8xa4mkc5kw69y5xqashkz9gp123akfvh9f6152l3202";
+  };
+  proguardBasePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom";
+    sha256 = "1jnr6zsxfimb8wglqlwa6rrdc3g3nqf1dyw0k2dq9cj0q4pgn7p5";
+  };
+  proguardBaseJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar";
+    sha256 = "11nwdb9y84cghcx319nsjjf9m035s4s1184zrhzpvaxq2wvqhbhx";
+  };
+
+  # Put the downloaded plugins in a fake Maven repository
+  fakeMavenRepo = stdenv.mkDerivation {
+    name = "fake-maven-repo";
+    buildCommand = ''
+      mkdir -p $out
+      cd $out
+      mkdir -p net/sf/proguard/proguard-gradle/${proguardVersion}
+      cp ${proguardGradlePOM} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom
+      cp ${proguardGradleJAR} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar
+      mkdir -p net/sf/proguard/proguard-parent/${proguardVersion}
+      cp ${proguardParentPOM} net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom
+      mkdir -p net/sf/proguard/proguard-base/${proguardVersion}
+      cp ${proguardBasePOM} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom
+      cp ${proguardBaseJAR} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar
+    '';
+  };
+in
+stdenv.mkDerivation {
+  name = "mobilesdk-8.2.1.GA";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = https://builds.appcelerator.com/mobile/8_2_X/mobilesdk-8.2.1.v20191025070136-linux.zip;
+    sha256 = "1nvcmm6cby6bmwdiacq46n5y4zjpz9qlipakvglw27j3p4rbmkwl";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = https://builds.appcelerator.com/mobile/8_2_X/mobilesdk-8.2.1.v20191025070136-osx.zip;
+    sha256 = "1nxwmyw3vqc5wghj38kpksisy0i808x0x3pa8w3p290w709g311l";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+
+  buildInputs = [ unzip makeWrapper ];
+
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    (yes y | unzip $src) || true
+
+    # Rename ugly version number
+    cd mobilesdk/*
+    mv * 8.2.1.GA
+    cd *
+
+    # Patch bundled gradle build infrastructure to make shebangs work
+    patchShebangs android/templates/gradle
+
+    # Substitute the gradle-all zip URL by a local file to prevent downloads from happening while building an Android app
+    sed -i -e "s|distributionUrl=|#distributionUrl=|" android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+    cp ${gradleAllZip} android/templates/gradle/gradle/wrapper/gradle-4.1-all.zip
+    echo "distributionUrl=gradle-4.1-all.zip" >> android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+
+    # Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts
+    sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle
+
+    ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+      # Patch the strip frameworks script in the iPhone build template to not let
+      # it skip the strip phase. This is caused by an assumption on the file
+      # permissions in which Nix deviates from the standard.
+      sed -i -e "s|-perm +111|-perm /111|" iphone/templates/build/strip-frameworks.sh
+    ''}
+
+    # Patch some executables
+
+    ${if stdenv.system == "i686-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 android/titanium_prep.linux32
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2 android/titanium_prep.linux64
+      ''
+      else ""}
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix
new file mode 100644
index 000000000000..b8e6b5a2271d
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/titaniumenv/titaniumsdk-8.3.nix
@@ -0,0 +1,97 @@
+{stdenv, fetchurl, unzip, makeWrapper}:
+
+let
+  # Gradle is a build system that bootstraps itself. This is what it actually
+  # downloads in the bootstrap phase.
+  gradleAllZip = fetchurl {
+    url = http://services.gradle.org/distributions/gradle-4.1-all.zip;
+    sha256 = "1rcrh263vq7a0is800y5z36jj97p67c6zpqzzfcbr7r0qaxb61sw";
+  };
+
+  # A Titanium-Android build requires proguard plugins. We create a fake
+  # repository so that Gradle does not attempt to download them in the builder.
+  # Since there are only 3 plugins required, this is still (sort of) manageable
+  # without a generator.
+  proguardVersion = "5.3.3";
+
+  proguardGradlePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom";
+    sha256 = "03v9zm3ykfkyb5cs5ald07ph103fh68d5c33rv070r29p71dwszj";
+  };
+  proguardGradleJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar";
+    sha256 = "0shhpsjfc5gam15jnv1hk718v5c7vi7dwdc3gvmnid6dc85kljzk";
+  };
+  proguardParentPOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom";
+    sha256 = "0mv0zbwyw8xa4mkc5kw69y5xqashkz9gp123akfvh9f6152l3202";
+  };
+  proguardBasePOM = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom";
+    sha256 = "1jnr6zsxfimb8wglqlwa6rrdc3g3nqf1dyw0k2dq9cj0q4pgn7p5";
+  };
+  proguardBaseJAR = fetchurl {
+    url = "https://repo1.maven.org/maven2/net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar";
+    sha256 = "11nwdb9y84cghcx319nsjjf9m035s4s1184zrhzpvaxq2wvqhbhx";
+  };
+
+  # Put the downloaded plugins in a fake Maven repository
+  fakeMavenRepo = stdenv.mkDerivation {
+    name = "fake-maven-repo";
+    buildCommand = ''
+      mkdir -p $out
+      cd $out
+      mkdir -p net/sf/proguard/proguard-gradle/${proguardVersion}
+      cp ${proguardGradlePOM} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.pom
+      cp ${proguardGradleJAR} net/sf/proguard/proguard-gradle/${proguardVersion}/proguard-gradle-${proguardVersion}.jar
+      mkdir -p net/sf/proguard/proguard-parent/${proguardVersion}
+      cp ${proguardParentPOM} net/sf/proguard/proguard-parent/${proguardVersion}/proguard-parent-${proguardVersion}.pom
+      mkdir -p net/sf/proguard/proguard-base/${proguardVersion}
+      cp ${proguardBasePOM} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.pom
+      cp ${proguardBaseJAR} net/sf/proguard/proguard-base/${proguardVersion}/proguard-base-${proguardVersion}.jar
+    '';
+  };
+in
+stdenv.mkDerivation {
+  name = "mobilesdk-8.3.2.GA";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = https://builds.appcelerator.com/mobile/8_3_X/mobilesdk-8.3.2.v20200117111803-linux.zip;
+    sha256 = "04pfw21jrx9w259lphynwykqjk4c9hm0zix4d40s7mf8mmh3xdx9";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = https://builds.appcelerator.com/mobile/8_3_X/mobilesdk-8.3.2.v20200117111803-osx.zip;
+    sha256 = "1zflq5hc96lrriw71ya623kkskkisi9yayg8qs03zimi0gksizxw";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+
+  buildInputs = [ unzip makeWrapper ];
+
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    unzip $src
+
+    # Rename ugly version number
+    cd mobilesdk/*
+    mv * 8.3.2.GA
+    cd *
+
+    # Patch bundled gradle build infrastructure to make shebangs work
+    patchShebangs android/templates/gradle
+
+    # Substitute the gradle-all zip URL by a local file to prevent downloads from happening while building an Android app
+    sed -i -e "s|distributionUrl=|#distributionUrl=|" android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+    cp ${gradleAllZip} android/templates/gradle/gradle/wrapper/gradle-4.1-all.zip
+    echo "distributionUrl=gradle-4.1-all.zip" >> android/templates/gradle/gradle/wrapper/gradle-wrapper.properties
+
+    # Patch maven central repository with our own local directory. This prevents the builder from downloading Maven artifacts
+    sed -i -e 's|mavenCentral()|maven { url "${fakeMavenRepo}" }|' android/templates/build/proguard.gradle
+
+    ${stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+      # Patch the strip frameworks script in the iPhone build template to not let
+      # it skip the strip phase. This is caused by an assumption on the file
+      # permissions in which Nix deviates from the standard.
+      sed -i -e "s|-perm +111|-perm /111|" iphone/templates/build/strip-frameworks.sh
+    ''}
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/webos/cmake-modules.nix b/nixpkgs/pkgs/development/mobile/webos/cmake-modules.nix
new file mode 100644
index 000000000000..cd58ea4e20cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/webos/cmake-modules.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "cmake-modules-webos";
+  version = "19";
+
+  src = fetchFromGitHub {
+    owner = "openwebos";
+    repo = "cmake-modules-webos";
+    rev = "submissions/${version}";
+    sha256 = "1l4hpcmgc98kp9g1642sy111ki5qyk3q7j10xzkgmnvz8lqffnxp";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  prePatch = ''
+    substituteInPlace CMakeLists.txt --replace "CMAKE_ROOT}/Modules" "CMAKE_INSTALL_PREFIX}/lib/cmake"
+    substituteInPlace webOS/webOS.cmake \
+      --replace ' ''${CMAKE_ROOT}/Modules' " $out/lib/cmake" \
+      --replace 'INSTALL_ROOT}/usr' 'INSTALL_ROOT}'
+
+    sed -i '/CMAKE_INSTALL_PREFIX/d' webOS/webOS.cmake
+  '';
+
+  setupHook = ./cmake-setup-hook.sh;
+
+  meta = with stdenv.lib; {
+    description = "CMake modules needed to build Open WebOS components";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/webos/cmake-setup-hook.sh b/nixpkgs/pkgs/development/mobile/webos/cmake-setup-hook.sh
new file mode 100644
index 000000000000..7e52681e9a91
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/webos/cmake-setup-hook.sh
@@ -0,0 +1,9 @@
+_addWebOSCMakeFlags() {
+  # Help find the webOS cmake module
+  cmakeFlagsArray+=(-DCMAKE_MODULE_PATH=@out@/lib/cmake)
+
+  # fix installation path (doesn't use CMAKE_INSTALL_PREFIX)
+  cmakeFlagsArray+=(-DWEBOS_INSTALL_ROOT=${!outputBin})
+}
+
+preConfigureHooks+=(_addWebOSCMakeFlags)
diff --git a/nixpkgs/pkgs/development/mobile/webos/novacom.nix b/nixpkgs/pkgs/development/mobile/webos/novacom.nix
new file mode 100644
index 000000000000..e7afdb32137b
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/webos/novacom.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchFromGitHub, webos, cmake, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  pname = "novacom";
+  version = "18";
+
+  src = fetchFromGitHub {
+    owner = "openwebos";
+    repo = "novacom";
+    rev = "submissions/${version}";
+    sha256 = "12s6g7l20kakyjlhqpli496miv2kfsdp17lcwhdrzdxvxl6hnf4n";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig webos.cmake-modules ];
+
+  postInstall = ''
+    install -Dm755 -t $out/bin ../scripts/novaterm
+    substituteInPlace $out/bin/novaterm --replace "exec novacom" "exec $out/bin/novacom"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Utility for communicating with WebOS devices";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ dtzWill ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/webos/novacomd.nix b/nixpkgs/pkgs/development/mobile/webos/novacomd.nix
new file mode 100644
index 000000000000..4d62dd305d3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/webos/novacomd.nix
@@ -0,0 +1,40 @@
+{ stdenv,
+fetchFromGitHub, fetchpatch,
+webos, cmake, pkgconfig,
+libusb }:
+
+stdenv.mkDerivation rec {
+  pname = "novacomd";
+  version = "127";
+
+  src = fetchFromGitHub {
+    owner = "openwebos";
+    repo = "novacomd";
+    rev = "submissions/${version}";
+    sha256 = "1gahc8bvvvs4d6svrsw24iw5r0mhy4a2ars3j2gz6mp6sh42bznl";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-Use-usb_bulk_-read-write-instead-of-homemade-handler.patch?h=palm-novacom-git";
+      sha256 = "116r6p4l767fqxfvq03sy6v7vxja8pkxlrc5hqby351a40b5dkiv";
+    })
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/feniksa/webos-overlay/40e2c113fc9426d50bdf37779da57ce4ff06ee6e/net-misc/novacomd/files/0011-Remove-verbose-output.patch";
+      sha256 = "09lmv06ziwkfg19b1h3jsmkm6g1f0nxxq1717dircjx8m45ypjq9";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkgconfig webos.cmake-modules ];
+
+  buildInputs = [ libusb ];
+
+  cmakeFlags = [ "-DWEBOS_TARGET_MACHINE_IMPL=host" ];
+
+  meta = with stdenv.lib; {
+    description = "Daemon for communicating with WebOS devices";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ dtzWill ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/xcodeenv/build-app.nix b/nixpkgs/pkgs/development/mobile/xcodeenv/build-app.nix
new file mode 100644
index 000000000000..fa108c8e4706
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xcodeenv/build-app.nix
@@ -0,0 +1,150 @@
+{stdenv, composeXcodeWrapper}:
+{ name
+, src
+, sdkVersion ? "13.1"
+, target ? null
+, configuration ? null
+, scheme ? null
+, sdk ? null
+, xcodeFlags ? ""
+, release ? false
+, certificateFile ? null
+, certificatePassword ? null
+, provisioningProfile ? null
+, codeSignIdentity ? null
+, signMethod ? null
+, generateIPA ? false
+, generateXCArchive ? false
+, enableWirelessDistribution ? false
+, installURL ? null
+, bundleId ? null
+, appVersion ? null
+, ...
+}@args:
+
+assert release -> certificateFile != null && certificatePassword != null && provisioningProfile != null && signMethod != null && codeSignIdentity != null;
+assert enableWirelessDistribution -> installURL != null && bundleId != null && appVersion != null;
+
+let
+  # Set some default values here
+
+  _target = if target == null then name else target;
+
+  _configuration = if configuration == null
+    then
+      if release then "Release" else "Debug"
+    else configuration;
+
+  _sdk = if sdk == null
+    then
+      if release then "iphoneos" + sdkVersion else "iphonesimulator" + sdkVersion
+    else sdk;
+
+  # The following is to prevent repetition
+  deleteKeychain = ''
+    security default-keychain -s login.keychain
+    security delete-keychain $keychainName
+  '';
+
+  xcodewrapperFormalArgs = builtins.functionArgs composeXcodeWrapper;
+  xcodewrapperArgs = builtins.intersectAttrs xcodewrapperFormalArgs args;
+  xcodewrapper = composeXcodeWrapper xcodewrapperArgs;
+
+  extraArgs = removeAttrs args ([ "name" "scheme" "xcodeFlags" "release" "certificateFile" "certificatePassword" "provisioningProfile" "signMethod" "generateIPA" "generateXCArchive" "enableWirelessDistribution" "installURL" "bundleId" "version" ] ++ builtins.attrNames xcodewrapperFormalArgs);
+in
+stdenv.mkDerivation ({
+  name = stdenv.lib.replaceChars [" "] [""] name; # iOS app names can contain spaces, but in the Nix store this is not allowed
+  buildPhase = ''
+    # Be sure that the Xcode wrapper has priority over everything else.
+    # When using buildInputs this does not seem to be the case.
+    export PATH=${xcodewrapper}/bin:$PATH
+    
+    ${stdenv.lib.optionalString release ''
+      export HOME=/Users/$(whoami)
+      keychainName="$(basename $out)"
+
+      # Create a keychain
+      security create-keychain -p "" $keychainName
+      security default-keychain -s $keychainName
+      security unlock-keychain -p "" $keychainName
+
+      # Import the certificate into the keychain
+      security import ${certificateFile} -k $keychainName -P "${certificatePassword}" -A 
+
+      # Grant the codesign utility permissions to read from the keychain
+      security set-key-partition-list -S apple-tool:,apple: -s -k "" $keychainName
+
+      # Determine provisioning ID
+      PROVISIONING_PROFILE=$(grep UUID -A1 -a ${provisioningProfile} | grep -o "[-A-Za-z0-9]\{36\}")
+
+      if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$PROVISIONING_PROFILE.mobileprovision" ]
+      then
+          # Copy provisioning profile into the home directory
+          mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+          cp ${provisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$PROVISIONING_PROFILE.mobileprovision"
+      fi
+
+      # Check whether the identity can be found
+      security find-identity -p codesigning $keychainName
+    ''}
+
+    # Do the building
+    export LD=/usr/bin/clang # To avoid problem with -isysroot parameter that is unrecognized by the stock ld. Comparison with an impure build shows that it uses clang instead. Ugly, but it works
+
+    xcodebuild -target ${_target} -configuration ${_configuration} ${stdenv.lib.optionalString (scheme != null) "-scheme ${scheme}"} -sdk ${_sdk} TARGETED_DEVICE_FAMILY="1, 2" ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateIPA || generateXCArchive then "-archivePath \"${name}.xcarchive\" archive" else ""} ${if release then '' PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName-db"'' else ""} ${xcodeFlags}
+
+    ${stdenv.lib.optionalString release ''
+      ${stdenv.lib.optionalString generateIPA ''
+        # Create export plist file
+        cat > "${name}.plist" <<EOF
+        <?xml version="1.0" encoding="UTF-8"?>
+        <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+        <plist version="1.0">
+        <dict>
+            <key>signingCertificate</key>
+            <string>${codeSignIdentity}</string>
+            <key>provisioningProfiles</key>
+            <dict>
+                <key>${bundleId}</key>
+                <string>$PROVISIONING_PROFILE</string>
+            </dict>
+            <key>signingStyle</key>
+            <string>manual</string>
+            <key>method</key>
+            <string>${signMethod}</string>
+            ${stdenv.lib.optionalString (signMethod == "enterprise" || signMethod == "ad-hoc") ''
+              <key>compileBitcode</key>
+              <false/>
+            ''}
+        </dict>
+        </plist>
+        EOF
+
+        # Produce an IPA file
+        xcodebuild -exportArchive -archivePath "${name}.xcarchive" -exportOptionsPlist "${name}.plist" -exportPath $out
+
+        # Add IPA to Hydra build products
+        mkdir -p $out/nix-support
+        echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
+
+        ${stdenv.lib.optionalString enableWirelessDistribution ''
+          # Add another hacky build product that enables wireless adhoc installations
+          appname="$(basename "$(echo $out/*.ipa)" .ipa)"
+          sed -e "s|@INSTALL_URL@|${installURL}?bundleId=${bundleId}\&amp;version=${appVersion}\&amp;title=$appname|" ${./install.html.template} > $out/''${appname}.html
+          echo "doc install \"$out/''${appname}.html\"" >> $out/nix-support/hydra-build-products
+        ''}
+      ''}
+      ${stdenv.lib.optionalString generateXCArchive ''
+        mkdir -p $out
+        mv "${name}.xcarchive" $out
+      ''}
+
+      # Delete our temp keychain
+      ${deleteKeychain}
+    ''}
+  '';
+
+  failureHook = stdenv.lib.optionalString release deleteKeychain;
+
+  installPhase = "true";
+} // extraArgs)
diff --git a/nixpkgs/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix b/nixpkgs/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix
new file mode 100644
index 000000000000..0a469da418a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xcodeenv/compose-xcodewrapper.nix
@@ -0,0 +1,33 @@
+{stdenv}:
+{version ? "11.1", xcodeBaseDir ? "/Applications/Xcode.app"}:
+
+assert stdenv.isDarwin;
+
+stdenv.mkDerivation {
+  name = "xcode-wrapper-"+version;
+  buildCommand = ''
+    mkdir -p $out/bin
+    cd $out/bin
+    ln -s /usr/bin/xcode-select
+    ln -s /usr/bin/security
+    ln -s /usr/bin/codesign
+    ln -s /usr/bin/xcrun
+    ln -s /usr/bin/plutil
+    ln -s /usr/bin/clang
+    ln -s /usr/bin/lipo
+    ln -s /usr/bin/file
+    ln -s /usr/bin/rev
+    ln -s "${xcodeBaseDir}/Contents/Developer/usr/bin/xcodebuild"
+    ln -s "${xcodeBaseDir}/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator"
+
+    cd ..
+    ln -s "${xcodeBaseDir}/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs"
+
+    # Check if we have the xcodebuild version that we want
+    if [ -z "$($out/bin/xcodebuild -version | grep -x 'Xcode ${version}')" ]
+    then
+        echo "We require xcodebuild version: ${version}"
+        exit 1
+    fi
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/xcodeenv/default.nix b/nixpkgs/pkgs/development/mobile/xcodeenv/default.nix
new file mode 100644
index 000000000000..47686e6d69e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xcodeenv/default.nix
@@ -0,0 +1,15 @@
+{stdenv}:
+
+rec {
+  composeXcodeWrapper = import ./compose-xcodewrapper.nix {
+    inherit stdenv;
+  };
+
+  buildApp = import ./build-app.nix {
+    inherit stdenv composeXcodeWrapper;
+  };
+
+  simulateApp = import ./simulate-app.nix {
+    inherit stdenv composeXcodeWrapper;
+  };
+}
diff --git a/nixpkgs/pkgs/development/mobile/xcodeenv/install.html.template b/nixpkgs/pkgs/development/mobile/xcodeenv/install.html.template
new file mode 100644
index 000000000000..d48fda7f38b9
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xcodeenv/install.html.template
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<html>
+    <head>
+        <title>Install IPA</title>
+    </head>
+
+    <body>
+        <a id="forwardlink" href="@INSTALL_URL@">Go to the install page or wait a second</a>
+
+        <script type="text/javascript">
+            setTimeout(function() {
+                var link = document.getElementById('forwardlink');
+
+                if(document.createEvent) {
+                    var eventObj = document.createEvent('MouseEvents');
+                    eventObj.initEvent('click', true, false);
+                    link.dispatchEvent(eventObj);
+                } else if(document.createEventObject) {
+                    link.fireEvent('onclick');
+                }
+            }, 1000);
+        </script>
+    </body>
+</html>
diff --git a/nixpkgs/pkgs/development/mobile/xcodeenv/simulate-app.nix b/nixpkgs/pkgs/development/mobile/xcodeenv/simulate-app.nix
new file mode 100644
index 000000000000..1a55f8366a3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xcodeenv/simulate-app.nix
@@ -0,0 +1,56 @@
+{stdenv, composeXcodeWrapper}:
+{name, app ? null, bundleId ? null, ...}@args:
+
+assert app != null -> bundleId != null;
+
+let
+  xcodewrapperArgs = builtins.intersectAttrs (builtins.functionArgs composeXcodeWrapper) args;
+
+  xcodewrapper = composeXcodeWrapper xcodewrapperArgs;
+in
+stdenv.mkDerivation {
+  name = stdenv.lib.replaceChars [" "] [""] name;
+  buildCommand = ''
+    mkdir -p $out/bin
+    cat > $out/bin/run-test-simulator << "EOF"
+    #! ${stdenv.shell} -e
+
+    if [ "$1" = "" ]
+    then
+        # Show the user the possibile UDIDs and let him pick one, if none is provided as a command-line parameter
+        xcrun simctl list
+
+        echo "Please provide a UDID of a simulator:"
+        read udid
+    else
+        # If a parameter has been provided, consider that a device UDID and use that
+        udid="$1"
+    fi
+
+    # Open the simulator instance
+    open -a "$(readlink "${xcodewrapper}/bin/Simulator")" --args -CurrentDeviceUDID $udid
+
+    ${stdenv.lib.optionalString (app != null) ''
+      # Copy the app and restore the write permissions
+      appTmpDir=$(mktemp -d -t appTmpDir)
+      cp -r "$(echo ${app}/*.app)" "$appTmpDir"
+      chmod -R 755 "$(echo $appTmpDir/*.app)"
+
+      # Wait for the simulator to start
+      echo "Press enter when the simulator is started..."
+      read
+
+      # Install the app
+      xcrun simctl install "$udid" "$(echo $appTmpDir/*.app)"
+
+      # Remove the app tempdir
+      rm -Rf $appTmpDir
+
+      # Launch the app in the simulator
+      xcrun simctl launch $udid "${bundleId}"
+      EOF
+
+      chmod +x $out/bin/run-test-simulator
+    ''}
+  '';
+}
diff --git a/nixpkgs/pkgs/development/mobile/xpwn/default.nix b/nixpkgs/pkgs/development/mobile/xpwn/default.nix
new file mode 100644
index 000000000000..9ec5977d5947
--- /dev/null
+++ b/nixpkgs/pkgs/development/mobile/xpwn/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cmake, zlib, libpng, bzip2, libusb, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "xpwn";
+  version = "0.5.8git";
+
+  src = fetchFromGitHub {
+    owner = "planetbeing";
+    repo = pname;
+    rev = "ac362d4ffe4d0489a26144a1483ebf3b431da899";
+    sha256 = "1qw9vbk463fpnvvvfgzxmn9add2p30k832s09mlycr7z1hrh3wyf";
+  };
+
+  preConfigure = ''
+    rm BUILD # otherwise `mkdir build` fails on case insensitive file systems
+    sed -r -i \
+      -e 's/(install.*TARGET.*DESTINATION )\.\)/\1bin)/' \
+      -e 's!(install.*(FILE|DIR).*DESTINATION )([^)]*)!\1share/xpwn/\3!' \
+      */CMakeLists.txt
+    sed -i -e '/install/d' CMakeLists.txt
+  '';
+
+  strictDeps = true;
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib libpng bzip2 libusb openssl ];
+
+  meta = with stdenv.lib; {
+    homepage    = "http://planetbeing.lighthouseapp.com/projects/15246-xpwn";
+    description = "Custom NOR firmware loader/IPSW generator for the iPhone";
+    license     = licenses.gpl3Plus;
+    platforms   = with platforms; linux ++ darwin;
+  };
+}