diff options
author | David Carlier <[email protected]> | 2019-07-03 14:03:14 +0000 |
---|---|---|
committer | David Carlier <[email protected]> | 2019-07-03 14:03:14 +0000 |
commit | 8393ac028fac8c3519ca0c291546806099b22d12 (patch) | |
tree | 2f769d9d5355b84aafa9ae16fa664de178114ad5 | |
parent | 110af949412e7c4b28b447a3600a947ddf2a2f2f (diff) |
Android docker build proposal.
Using external image just for the NDK and focusing on the two
most popular architectures.
-rw-r--r-- | doc/building.rst | 11 | ||||
-rw-r--r-- | src/scripts/Dockerfile.android | 22 | ||||
-rwxr-xr-x | src/scripts/docker-android.sh | 6 |
3 files changed, 39 insertions, 0 deletions
diff --git a/doc/building.rst b/doc/building.rst index 9bc5c03ad..b4cdb7a12 100644 --- a/doc/building.rst +++ b/doc/building.rst @@ -250,6 +250,17 @@ executed on a browser, use:: em++ -s ALLOW_MEMORY_GROWTH=1 -s DISABLE_EXCEPTION_CATCHING=0 -s WASM=1 \ --preload-file src/tests/data botan-test.bc -o botan-test.html +Docker +-------- + +To build android version, there is the possibility to use +the docker way:: + + sudo SDK=21 src/scripts/docker-android.sh + +This will produce the docker-builds/android folder containing +each architecture compiled. + Supporting Older Distros -------------------------- diff --git a/src/scripts/Dockerfile.android b/src/scripts/Dockerfile.android new file mode 100644 index 000000000..57514532c --- /dev/null +++ b/src/scripts/Dockerfile.android @@ -0,0 +1,22 @@ +FROM debian:stretch AS debian +ARG SDK +RUN apt-get update && apt-get -y --no-install-recommends install \ + libboost-all-dev \ + make \ + python3-sphinx + +RUN mkdir -p /botan/android +WORKDIR /botan +COPY --from=bitriseio/android-ndk /opt/android-ndk android-ndk +COPY configure.py configure.py +COPY src src +COPY doc doc +COPY license.txt license.txt +COPY news.rst news.rst +ENV PATH=$PATH:android-ndk/toolchains/llvm/prebuilt/linux-x86_64/bin/ +RUN ./configure.py --prefix=android/arm --os=android --cpu=arm --cc=clang --cc-bin=armv7a-linux-androideabi${SDK}-clang++ --ar-command=arm-linux-androideabi-ar --with-sphinx +RUN make -j`getconf _NPROCESSORS_ONLN` +RUN make install && make clean +RUN ./configure.py --prefix=android/arm64 --os=android --cpu=arm64 --cc=clang --cc-bin=aarch64-linux-android${SDK}-clang++ --ar-command=aarch64-linux-android-ar --with-sphinx +RUN make -j`getconf _NPROCESSORS_ONLN` +RUN make install diff --git a/src/scripts/docker-android.sh b/src/scripts/docker-android.sh new file mode 100755 index 000000000..1428c5526 --- /dev/null +++ b/src/scripts/docker-android.sh @@ -0,0 +1,6 @@ +VERSION=`./configure.py --version` +mkdir -p docker-builds +docker build -f src/scripts/Dockerfile.android --force-rm -t botan-android-${VERSION} --build-arg SDK=${SDK} . +docker create --name botan-android-${VERSION} botan-android-${VERSION} +docker cp botan-android-${VERSION}:/botan/android docker-builds +docker rm -f botan-android-${VERSION} |