Commit db6d2c09 authored by beuc's avatar beuc

NDK-20b: first build

parent 510dcd0b
wd/
\ No newline at end of file
FROM ubuntu:trusty-20190515
MAINTAINER Sylvain Beucler <[email protected]>
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/
COPY repo.sh /home/android/repo.sh
RUN /home/android/repo.sh
CMD /bin/bash
.PHONY: all
VERSION=20b
all:
docker build -t android-rebuilds:ndk-$(VERSION) .
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-$(VERSION) /home/android/wd/build.sh
#!/bin/bash -ex
# https://android.googlesource.com/platform/ndk/+/master/docs/Building.md
# Preparing build tree
# Make 'repo' accessible to the build system later
export PATH=~/bin:$PATH
repo init --quiet -u https://android.googlesource.com/platform/manifest -b ndk-r20b
repo sync --quiet --current-branch -j4
# Fix o/ character support in prebuilts/ndk/platform/sysroot/NOTICE
(
cd ndk/ && patch -p1 <<EOF
diff --git a/ndk/checkbuild.py b/ndk/checkbuild.py
index 7e3e12ac..6566d914 100755
--- a/ndk/checkbuild.py
+++ b/ndk/checkbuild.py
@@ -2102,10 +2102,10 @@ def create_notice_file(path, for_group):
licenses = set()
for notice_path in notice_files:
- with open(notice_path) as notice_file:
+ with open(notice_path, encoding='UTF-8') as notice_file:
licenses.add(notice_file.read())
- with open(path, 'w') as output_file:
+ with open(path, 'w', encoding='UTF-8') as output_file:
# Sorting the contents here to try to make things deterministic.
output_file.write(os.linesep.join(sorted(list(licenses))))
EOF
)
# Build NDK - proper build
(
cd ndk/
python checkbuild.py --no-build-tests
# TODO:
#python checkbuild.py --no-build-tests --system windows
#python checkbuild.py --no-build-tests --system windows64
)
ls -lh out/dist/android-ndk-0-linux-x86_64.tar.bz2
#!/bin/bash -ex
# Configuration
#echo 'APT::Install-Recommends "false";' > /etc/apt/apt.conf.d/00InstallRecommends
# clean-up non-free sources
# AFAICS we need to update the base image as of 2018-11-22 as it's already partially upgraded
cat <<EOF > /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ trusty main universe
deb http://archive.ubuntu.com/ubuntu/ trusty-updates main universe
#deb http://security.ubuntu.com/ubuntu/ trusty-security main universe
#deb http://archive.ubuntu.com/ubuntu/ trusty-backports main universe
EOF
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
# https://android.googlesource.com/platform/ndk/+/master/infra/docker/Dockerfile
apt-get -y install \
bison build-essential curl dos2unix flex git make pbzip2 python python-pip \
texinfo uuid-runtime zip
pip install setuptools
# Missing dependency for recompiling Python3
apt-get -y install zlib1g-dev
#!/bin/bash -ex
#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 and errors
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git config --global color.ui true
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