Commit 2d5f40fa by beuc

Unattended NDK10e build

parent c9a39380
Pipeline #2701880 skipped
\ No newline at end of file
FROM ubuntu:14.04
MAINTAINER Sylvain Beucler <>
COPY /usr/src/
RUN /usr/src/
RUN useradd android -m -s /bin/bash
USER android
RUN mkdir /home/android/wd/
WORKDIR /home/android/wd/
CMD /bin/bash
.PHONY: all
docker pull ubuntu:14.04
docker build -t android-rebuilds:ndk-10e .
if [ ! -e wd/ ]; then mkdir wd/; fi
chown 1000:1000 wd/ || (echo "=> Please run this as root"; exit 1)
cp -a wd/
docker run -it -v "$$(pwd)/wd:/home/android/wd" android-rebuilds:ndk-10e /home/android/wd/
#!/bin/bash -ex
## Preparing build tree
git clone ndk
git clone development
git clone bionic
(cd ndk/ && git checkout 0de21a10c0a96c3570a283462dc213fcac373607)
(cd development/ && git checkout $(git rev-list -n 1 --before='2015-04-07T11:32:42+0000' HEAD))
(cd bionic/ && git checkout $(git rev-list -n 1 --before='2015-04-07T11:32:42+0000' HEAD))
## Build NDK - grab all sources
export USER=$(whoami)
export NDK=~/wd/ndk
export NDK_LOGFILE=~/wd/ndk.log
bash $NDK/build/tools/ --git-date='2015-04-07T11:32:42+0000' ~/wd/ndk-dl
## Build NDK - fix-ups
sed -i -e 's/LIBS="@LIBS@ $SYSLIBS -lpython${VERSION}${ABIFLAGS}"/LIBS="-lpython${VERSION}${ABIFLAGS} @LIBS@ $SYSLIBS"/' \
ln -s gdb-7.6 $NDK/sources/android/libthread_db/gdb-7.7
--disable-inprocess-agent --enable-werror=no"/' \
sed -i -e 's/&& version_is_at_least/\&\& ! version_is_at_least/' $NDK/build/tools/
## Build NDK - proper build
export NDK_TMPDIR=~/wd/ndk-tmp
mkdir -p $NDK_TMPDIR/release-r10e
time bash $NDK/build/tools/ --toolchain-src-dir=$HOME/wd/ndk-dl --release=r10e --incremental
## Repackage
cd /tmp/ndk-android/release/
tar xf android-ndk-r10e-linux-x86.tar.bz2
time 7za a -sfx ~/wd/android-ndk-r10e-linux-x86.bin android-ndk-r10e/ >/dev/null
ls -lh ~/wd/android-ndk-r10e-linux-x86.bin
# Configuration
echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/00InstallRecommends
# clean-up non-free sources
sed -i -e 's/ restricted//' -e 's/ multiverse//' /etc/apt/sources.list
dpkg --add-architecture i386
apt-get update
echo 'dash dash/sh boolean false' | debconf-set-selections
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure --pri=high dash
export DEBIAN_FRONTEND=noninteractive
# Base Android build dependencies (from, section "Installing required packages (Ubuntu 12.04)")
# Dropping mingw to skip windows builds for now.
# Installing g++-multilib first otherwise apt-get complains.
apt-get -y install build-essential g++-multilib
apt-get -y install bison git ca-certificates gperf libxml2-utils make python-networkx zlib1g-dev:i386 zip
apt-get -y install libncurses5-dev:i386
apt-get -y install libncurses5-dev # needed?
# Additional NDK build dependencies (completed from
apt-get -y install curl texinfo bison flex libtool pbzip2 groff
apt-get -y install autoconf automake
# Repackaging
apt-get -y install p7zip-full
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment