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