SDK 2.1 (GNU/Linux)

Recreate matching build environment

The current reference build environment for this version is Ubuntu 8.04.

Build dependencies

apt-get update

wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_i386.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-bin_1.5.0-22-0ubuntu0.8.04_i386.deb
wget --quiet http://old-releases.ubuntu.com/ubuntu/pool/multiverse/s/sun-java5/sun-java5-demo_1.5.0-22-0ubuntu0.8.04_i386.deb
checksumfile=$(mktemp)
cat <<'EOF' > $checksumfile
daf602b142c1125eb65126c6bfd416e6d56cb17a98e755a881251646abfc3240  sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_i386.deb
89866c3c359e71a14d90a6e851c9a09b941a768359fa1e3fdb973c7a8f850f5d  sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb
632ae901139246b829d2493b94f22a030f35dac604bb27d71f4b4bc3355695a5  sun-java5-bin_1.5.0-22-0ubuntu0.8.04_i386.deb
2e9a98d504831e7f9abee71a77c70e8c1de7b5d335dad540fe30311e3ff0e287  sun-java5-demo_1.5.0-22-0ubuntu0.8.04_i386.deb
EOF
sha256sum -c $checksumfile || exit 1

dpkg -i \
  sun-java5-jdk_1.5.0-22-0ubuntu0.8.04_i386.deb \
  sun-java5-jre_1.5.0-22-0ubuntu0.8.04_all.deb \
  sun-java5-bin_1.5.0-22-0ubuntu0.8.04_i386.deb \
  sun-java5-demo_1.5.0-22-0ubuntu0.8.04_i386.deb \
  || true
apt-get -y -f install

apt-get install -y git-core gnupg flex bison gperf build-essential zip \
  curl zlib1g-dev libc6-dev libncurses5-dev \
  x11proto-core-dev libx11-dev libreadline5-dev libz-dev \
  libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown \
  libxml2-utils xsltproc unzip

Prepare source tree

Install repo. Due to its recent dependencies (git, python, SSL certificates, SSL digest algorithms), this phase is done with Ubuntu 14.04.

sudo apt-get install curl ca-certificates git python
mkdir ~/bin/
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo

# avoid prompts
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
git config --global color.ui true

Checkout the source:

mkdir ~/wd/
cd ~/wd/
~/bin/repo init -u https://android.googlesource.com/platform/manifest -b android-2.1_r2.1s
time ~/bin/repo sync --current-branch -j4
# 12GB .repo

Build the SDK

export BUILD_NUMBER="userdebug.2.1_r2.1s"
. build/envsetup.sh
lunch sdk-userdebug
time make sdk -jXX showcommands dist

Results:

-rw-r--r-- 1 android android 144M Jul 15 15:45 out/dist/android-sdk_eng.android_linux-x86.zip
-rw-r--r-- 1 android android 144M Jul 15 15:45 out/host/linux-x86/sdk/android-sdk_eng.android_linux-x86.zip

TODO

Rebuild the prebuilts/ sub-directories.

Notes

Build result recap

$ JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 tools/bin/sdkmanager --list
Installed packages:
  Path                | Version | Description                   | Location                      
  -------             | ------- | -------                       | -------                       
  docs                | 1       | Documentation for Android SDK | docs/                         
  platforms;android-7 | 1       | Android SDK Platform 7        | platforms/android-2.1-update1/
  tools               | 5.0.0   | Android SDK Tools 5           | tools/                        

Available Updates:
  ID                  | Installed | Available
  -------             | -------   | -------  
  platforms;android-7 | 1         | 3        

build stats

r2.1s, using i5-6300HQ (4x2.30GHz), SSD disk, with dist target:

  • sdk: 18mn
  • du -sh wd/: 18G
  • du -sh wd/.repo/: 12G

Automated build recipe

https://gitlab.com/android-rebuilds/auto/tree/master/sdk-2.1