2012-11-07 21:10:39 +01:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
|
|
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
2015-10-06 14:27:49 +02:00
|
|
|
xmlns:sdk="http://schemas.android.com/sdk/android/repository/11">
|
2012-11-07 21:10:39 +01:00
|
|
|
|
|
|
|
<xsl:param name="os" />
|
|
|
|
<xsl:output omit-xml-declaration="yes" indent="no" />
|
2015-05-02 15:15:29 +02: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 14:27:49 +02:00
|
|
|
<xsl:text>https://dl.google.com/android/repository/</xsl:text>
|
2015-05-02 15:15:29 +02:00
|
|
|
<xsl:value-of select="$raw-url"/>
|
|
|
|
</xsl:otherwise>
|
|
|
|
</xsl:choose>
|
|
|
|
</xsl:template>
|
|
|
|
|
2012-11-07 21:10:39 +01:00
|
|
|
<xsl:template match="/sdk:sdk-repository">
|
2015-05-02 15:15:29 +02: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 21:10:39 +01:00
|
|
|
{stdenv, fetchurl, unzip}:
|
|
|
|
|
|
|
|
let
|
|
|
|
buildPlatform = args:
|
2014-09-02 19:18:30 +02:00
|
|
|
stdenv.mkDerivation (args // {
|
2012-11-07 21:10:39 +01:00
|
|
|
buildInputs = [ unzip ];
|
|
|
|
buildCommand = ''
|
|
|
|
mkdir -p $out
|
|
|
|
cd $out
|
|
|
|
unzip $src
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
2016-06-19 04:26:34 +02:00
|
|
|
<xsl:for-each select="sdk:platform"><xsl:sort select="sdk:api-level" data-type="number"/>
|
2012-11-07 21:10:39 +01:00
|
|
|
platform_<xsl:value-of select="sdk:api-level" /> = buildPlatform {
|
|
|
|
name = "android-platform-<xsl:value-of select="sdk:version" />";
|
|
|
|
src = fetchurl {
|
2015-05-02 15:15:29 +02:00
|
|
|
url = <xsl:call-template name="repository-url"/>;
|
2014-09-02 19:18:30 +02: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 21:10:39 +01:00
|
|
|
};
|
|
|
|
meta = {
|
|
|
|
description = "<xsl:value-of select="sdk:description" />";
|
2017-06-10 02:25:55 +02:00
|
|
|
<xsl:for-each select="sdk:desc-url"> homepage = <xsl:value-of select="." />;</xsl:for-each>
|
2012-11-07 21:10:39 +01:00
|
|
|
};
|
|
|
|
};
|
2015-05-02 15:15:29 +02:00
|
|
|
</xsl:for-each>
|
2012-11-07 21:10:39 +01:00
|
|
|
}
|
2015-05-02 15:15:29 +02:00
|
|
|
</xsl:template>
|
2012-11-07 21:10:39 +01:00
|
|
|
</xsl:stylesheet>
|