nixpkgs/pkgs/development/mobile/androidenv/generate-platforms.xsl
taku0 dd89ec5785 Bump Android packages to newest versions, add androidsdk_5_1_1 and androidsdk_5_1_1_extras to env
Detailed changes:
- android-sdk: update 24.0.1 -> 24.1.2
- android-platforms: add 5.1.1
- android-platform-tools: update 21 -> 22
- android-build-tools: update 21.1.2 -> 22.0.1
- android-support: update 21 -> 22.1.1
- android-support-repository: update 9 -> 14
2015-05-02 22:15:29 +09:00

55 lines
1.7 KiB
XML

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:sdk="http://schemas.android.com/sdk/android/repository/10">
<xsl:param name="os" />
<xsl:output omit-xml-declaration="yes" indent="no" />
<xsl:template name="repository-url">
<xsl:variable name="raw-url" select="sdk:archives/sdk:archive[sdk:host-os=$os or count(sdk:host-os) = 0]/sdk: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-ssl.google.com/android/repository/</xsl:text>
<xsl:value-of select="$raw-url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="/sdk:sdk-repository">
# This file is generated from generate-platforms.sh. DO NOT EDIT.
# Execute generate-platforms.sh or fetch.sh to update the file.
{stdenv, fetchurl, unzip}:
let
buildPlatform = args:
stdenv.mkDerivation (args // {
buildInputs = [ unzip ];
buildCommand = ''
mkdir -p $out
cd $out
unzip $src
'';
});
in
{
<xsl:for-each select="sdk:platform">
platform_<xsl:value-of select="sdk:api-level" /> = buildPlatform {
name = "android-platform-<xsl:value-of select="sdk:version" />";
src = fetchurl {
url = <xsl:call-template name="repository-url"/>;
sha1 = "<xsl:value-of select="sdk:archives/sdk:archive[sdk:host-os=$os or count(sdk:host-os) = 0]/sdk:checksum[@type='sha1']" />";
};
meta = {
description = "<xsl:value-of select="sdk:description" />";
<xsl:for-each select="sdk:desc-url"> url = <xsl:value-of select="." />;</xsl:for-each>
};
};
</xsl:for-each>
}
</xsl:template>
</xsl:stylesheet>