diff --git a/.circleci/config.yml b/.circleci/config.yml index 8319d67..e9fa417 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -84,7 +84,26 @@ jobs: - save_cache: key: android-x86-assets-{{ .Revision }} paths: ~/docker/android-x86.tar - + android-x86_64: + <<: *build-settings + steps: + - restore_cache: + key: base-assets-{{ .Revision }} + - run: + name: android-x86_64 build + no_output_timeout: 1.5h + command: | + docker load -i ~/docker/base.tar + make android-x86_64 + tagged=$(docker images -q -f 'since=dockcross/android-x86_64:latest' --format '{{.Repository}}:{{.Tag}}' | grep android-x86_64) + docker save -o ~/docker/android-x86_64.tar dockcross/android-x86_64:latest $tagged + - run: + name: android-x86_64 test + command: | + make android-x86_64.test + - save_cache: + key: android-x86_64-assets-{{ .Revision }} + paths: ~/docker/android-x86_64.tar web-wasm: <<: *build-settings steps: @@ -695,6 +714,18 @@ jobs: tagged=$(docker images -q -f 'since=dockcross/android-x86:latest' --format '{{.Repository}}:{{.Tag}}' | grep android-x86) docker push $tagged fi + - restore_cache: + key: android-x86_64-assets-{{ .Revision }} + - deploy: + name: Deploy android-x86_64 + command: | + docker load -i ~/docker/android-x86_64.tar + if [ "${CIRCLE_BRANCH}" == "master" ]; then + docker login -u $DOCKER_USER -p $DOCKER_PASS + docker push dockcross/android-x86_64:latest + tagged=$(docker images -q -f 'since=dockcross/android-x86_64:latest' --format '{{.Repository}}:{{.Tag}}' | grep android-x86_64) + docker push $tagged + fi - restore_cache: key: web-wasm-assets-{{ .Revision }} - deploy: @@ -1037,6 +1068,9 @@ workflows: - android-x86: requires: - base + - android-x86_64: + requires: + - base - web-wasm: requires: - base @@ -1127,6 +1161,7 @@ workflows: - android-arm - android-arm64 - android-x86 + - android-x86_64 - web-wasm - linux-arm64 - linux-arm64-musl diff --git a/Makefile b/Makefile index 39e4dad..2fb3291 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ ORG = dockcross BIN = ./bin # These images are built using the "build implicit rule" -STANDARD_IMAGES = linux-s390x android-arm android-arm64 android-x86 linux-x86 linux-x64 linux-arm64 linux-arm64-musl linux-armv5 linux-armv5-musl linux-armv6 linux-armv6-musl linux-armv7 linux-armv7a linux-armv7l-musl linux-mips linux-mipsel linux-ppc64le windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix +STANDARD_IMAGES = linux-s390x android-arm android-arm64 android-x86 android-x86_64 linux-x86 linux-x64 linux-arm64 linux-arm64-musl linux-armv5 linux-armv5-musl linux-armv6 linux-armv6-musl linux-armv7 linux-armv7a linux-armv7l-musl linux-mips linux-mipsel linux-ppc64le windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix # Generated Dockerfiles. GEN_IMAGES = linux-s390x linux-mips manylinux1-x64 manylinux1-x86 manylinux2010-x64 manylinux2010-x86 manylinux2014-x64 manylinux2014-x86 manylinux2014-aarch64 web-wasm linux-arm64 linux-arm64-musl windows-static-x86 windows-static-x64 windows-static-x64-posix windows-shared-x86 windows-shared-x64 windows-shared-x64-posix linux-armv7 linux-armv7a linux-armv7l-musl linux-armv6-musl linux-armv5 linux-armv5-musl linux-ppc64le diff --git a/README.rst b/README.rst index 92b37f4..aebf4e6 100644 --- a/README.rst +++ b/README.rst @@ -112,6 +112,14 @@ dockcross/android-x86 architecture. +.. |android-x86_64-images| image:: https://images.microbadger.com/badges/image/dockcross/android-x86_64.svg + :target: https://microbadger.com/images/dockcross/android-x86_64 + +dockcross/android-x86_64 + |android-x86_64-images| The Android NDK standalone toolchain for the x86_64 + architecture. + + .. |linux-arm64-images| image:: https://images.microbadger.com/badges/image/dockcross/linux-arm64.svg :target: https://microbadger.com/images/dockcross/linux-arm64 diff --git a/android-x86_64/Dockerfile b/android-x86_64/Dockerfile new file mode 100644 index 0000000..0603680 --- /dev/null +++ b/android-x86_64/Dockerfile @@ -0,0 +1,47 @@ +FROM dockcross/base:latest + +RUN apt-get update && apt-get install -y unzip + +ENV CROSS_TRIPLE=x86_64-linux-android +ENV CROSS_ROOT=/usr/${CROSS_TRIPLE} +ENV AS=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-as \ + AR=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ar \ + CC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang \ + CPP=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-cpp \ + CXX=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-clang++ \ + LD=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-ld \ + FC=${CROSS_ROOT}/bin/${CROSS_TRIPLE}-gfortran + +ENV ANDROID_NDK_REVISION 21d +ENV ANDROID_NDK_API 21 +RUN mkdir -p /build && \ + cd /build && \ + curl -O https://dl.google.com/android/repository/android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ + unzip ./android-ndk-r${ANDROID_NDK_REVISION}-linux-x86_64.zip && \ + cd android-ndk-r${ANDROID_NDK_REVISION} && \ + ./build/tools/make_standalone_toolchain.py \ + --arch x86_64 \ + --api ${ANDROID_NDK_API} \ + --stl=libc++ \ + --install-dir=${CROSS_ROOT} && \ + cd / && \ + rm -rf /build && \ + find ${CROSS_ROOT} -exec chmod a+r '{}' \; && \ + find ${CROSS_ROOT} -executable -exec chmod a+x '{}' \; + +COPY Toolchain.cmake ${CROSS_ROOT}/ +ENV CMAKE_TOOLCHAIN_FILE ${CROSS_ROOT}/Toolchain.cmake + +# Build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG IMAGE=dockcross/android-x86_64 +ARG VERSION=latest +ARG VCS_REF +ARG VCS_URL +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.name=$IMAGE \ + org.label-schema.version=$VERSION \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-url=$VCS_URL \ + org.label-schema.schema-version="1.0" +ENV DEFAULT_DOCKCROSS_IMAGE ${IMAGE}:${VERSION} diff --git a/android-x86_64/Toolchain.cmake b/android-x86_64/Toolchain.cmake new file mode 100644 index 0000000..0c443bc --- /dev/null +++ b/android-x86_64/Toolchain.cmake @@ -0,0 +1,20 @@ +set(CMAKE_SYSTEM_NAME Android) +set(CMAKE_SYSTEM_VERSION 1) +set(CMAKE_ANDROID_ARCH_ABI x86_64) + +set(cross_triple x86_64-linux-android) +set(CMAKE_ANDROID_STANDALONE_TOOLCHAIN $ENV{CROSS_ROOT}) +set(CMAKE_ANDROID_ARM_MODE ON) +set(CMAKE_ANDROID_ARM_NEON ON) + +set(CMAKE_C_COMPILER $ENV{CC}) +set(CMAKE_CXX_COMPILER $ENV{CXX}) +set(CMAKE_Fortran_COMPILER $ENV{FC}) +set(CMAKE_EXE_LINKER_FLAGS "-llog") +set(CMAKE_SHARED_LINKER_FLAGS "-llog") + +set(CMAKE_FIND_ROOT_PATH $ENV{CROSS_ROOT}) +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) +set(CMAKE_SYSROOT $ENV{CROSS_ROOT}/sysroot)