Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

androidenv: update packages #58131

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{stdenv, fetchurl, requireFile, makeWrapper, unzip, autoPatchelfHook, pkgs, pkgs_i686, licenseAccepted ? false}:

{ toolsVersion ? "25.2.5"
, platformToolsVersion ? "28.0.1"
{ toolsVersion ? "26.1.1"
, platformToolsVersion ? "28.0.2"
, buildToolsVersions ? [ "28.0.3" ]
, includeEmulator ? false
, emulatorVersion ? "28.0.14"
, emulatorVersion ? "28.0.23"
, platformVersions ? []
, includeSources ? false
, includeDocs ? false
Expand All @@ -14,7 +14,7 @@
, lldbVersions ? [ ]
, cmakeVersions ? [ ]
, includeNDK ? false
, ndkVersion ? "18.1.5063045"
, ndkVersion ? "19.2.5345600"
, useGoogleAPIs ? false
, useGoogleTVAddOns ? false
, includeExtras ? []
Expand Down
69 changes: 49 additions & 20 deletions pkgs/development/mobile/androidenv/convertsystemimages.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<xsl:param name="imageType" />

<xsl:output omit-xml-declaration="yes" indent="no" />
<xsl:output method="text" omit-xml-declaration="yes" indent="no" />

<xsl:template name="repository-url">
<xsl:variable name="raw-url" select="complete/url"/>
Expand All @@ -15,33 +15,62 @@
<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:text>https://dl.google.com/android/repository/sys-img/</xsl:text><xsl:value-of select="$imageType" /><xsl:text>/</xsl:text><xsl:value-of select="$raw-url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template mode="revision" match="type-details[codename]">
<xsl:value-of select="codename" />-<xsl:value-of select="tag/id" />-<xsl:value-of select="abi" />
</xsl:template>

<xsl:template mode="revision" match="type-details[not(codename)]">
<xsl:value-of select="api-level" />-<xsl:value-of select="tag/id" />-<xsl:value-of select="abi" />
</xsl:template>

<xsl:template mode="attrkey" match="type-details[codename]">
<xsl:text>"</xsl:text>
<xsl:value-of select="codename" />
<xsl:text>".</xsl:text>
<xsl:value-of select="tag/id" />
<xsl:text>."</xsl:text>
<xsl:value-of select="abi" />
<xsl:text>"</xsl:text>
</xsl:template>

<xsl:template mode="attrkey" match="type-details[not(codename)]">
<xsl:text>"</xsl:text>
<xsl:value-of select="api-level" />
<xsl:text>".</xsl:text>
<xsl:value-of select="tag/id" />
<xsl:text>."</xsl:text>
<xsl:value-of select="abi" />
<xsl:text>"</xsl:text>
</xsl:template>

<xsl:template match="/sys-img:sdk-sys-img">
{fetchurl}:
<xsl:text>{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:text><xsl:for-each select="remotePackage[starts-with(@path, 'system-images;')]">
<xsl:variable name="revision"><xsl:apply-templates mode="revision" select="type-details" /></xsl:variable>

<xsl:variable name="attrkey"><xsl:apply-templates mode="attrkey" select="type-details" /></xsl:variable>

<xsl:text> </xsl:text><xsl:value-of select="$attrkey" /><xsl:text> = {
name = "system-image-</xsl:text><xsl:value-of select="$revision" /><xsl:text>";
path = "</xsl:text><xsl:value-of select="translate(@path, ';', '/')" /><xsl:text>";
revision = "</xsl:text><xsl:value-of select="$revision" /><xsl:text>";
displayName = "</xsl:text><xsl:value-of select="display-name" /><xsl:text>";
archives.all = fetchurl {</xsl:text>
<xsl:for-each select="archives/archive"><xsl:text>
url = </xsl:text><xsl:call-template name="repository-url"/><xsl:text>;
sha1 = "</xsl:text><xsl:value-of select="complete/checksum" /><xsl:text>";</xsl:text>
</xsl:for-each><xsl:text>
};
};
</xsl:text>
</xsl:for-each>
}
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>
28 changes: 24 additions & 4 deletions pkgs/development/mobile/androidenv/generate.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
#!/bin/sh -e
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl libxslt

set -e

die() {
echo "$1" >&2
exit 1
}

fetch() {
local url="https://dl.google.com/android/repository/$1"
echo "$url -> $2"
curl -s "$url" -o "$2" || die "Failed to fetch $url"
}

pushd "$(dirname "$0")" &>/dev/null || exit 1

mkdir -p xml

# Convert base packages
curl https://dl.google.com/android/repository/repository2-1.xml -o xml/repository2-1.xml
fetch repository2-1.xml 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
fetch sys-img/$img/sys-img2-1.xml 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
fetch addon2-1.xml xml/addon2-1.xml
xsltproc convertaddons.xsl xml/addon2-1.xml > generated/addons.nix

popd &>/dev/null
6 changes: 3 additions & 3 deletions pkgs/development/mobile/androidenv/generated/addons.nix
Original file line number Diff line number Diff line change
Expand Up @@ -525,13 +525,13 @@
"extras;google;instantapps" = {
name = "extras-google-instantapps";
path = "extras/google/instantapps";
revision = "1.5.0";
revision = "1.6.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";
url = https://dl.google.com/android/repository/iasdk-1.6.0-1540933685.zip;
sha1 = "0bb546a846815f5b5ccd2ed00549c9912d1d48cb";
};

};
Expand Down
Loading