Commit 2d5f40fa by beuc

Unattended NDK10e build

parent c9a39380
Pipeline #2701880 skipped in 0 seconds
wd/
\ No newline at end of file
FROM ubuntu:14.04
MAINTAINER Sylvain Beucler <beuc@beuc.net>
COPY dependencies.sh /usr/src/dependencies.sh
RUN /usr/src/dependencies.sh
RUN useradd android -m -s /bin/bash
USER android
RUN mkdir /home/android/wd/
WORKDIR /home/android/wd/
CMD /bin/bash
.PHONY: all
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 build.sh wd/
docker run -it -v "$$(pwd)/wd:/home/android/wd" android-rebuilds:ndk-10e /home/android/wd/build.sh
#!/bin/bash -ex
## Preparing build tree
git clone https://android.googlesource.com/platform/ndk.git ndk
git clone https://android.googlesource.com/platform/development.git development
git clone https://android.googlesource.com/platform/bionic.git 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/download-toolchain-sources.sh --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"/' \
ndk-dl/python/Python-2.7.5/Misc/python-config.sh.in
ln -s gdb-7.6 $NDK/sources/android/libthread_db/gdb-7.7
sed -i -e 's/CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --disable-inprocess-agent"/CONFIGURE_FLAGS=$CONFIGURE_FLAGS" \
--disable-inprocess-agent --enable-werror=no"/' \
$NDK/build/tools/build-gdbserver.sh
sed -i -e 's/&& version_is_at_least/\&\& ! version_is_at_least/' $NDK/build/tools/build-gnu-libstdc++.sh
## Build NDK - proper build
export NDK_TMPDIR=~/wd/ndk-tmp
mkdir -p $NDK_TMPDIR/release-r10e
time bash $NDK/build/tools/make-release.sh --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
#!/bin/bash
# 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 https://source.android.com/source/initializing.html, 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 https://android.googlesource.com/platform/ndk/+/master/README.md)
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