[glib: 1/2] ci: Update to latest Android NDK




commit 3a8622c9e1b3767bd011bff8cfb014ff72eb48a6
Author: Xavier Claessens <xavier claessens collabora com>
Date:   Tue Apr 26 10:50:36 2022 -0400

    ci: Update to latest Android NDK
    
    Move the NDK in the common Fedora image, better have 1 bigger image that
    gets cached into runners. It is also less images to maintain.
    
    Fixes: #2605

 .gitlab-ci.yml                                     |  9 +--
 .gitlab-ci/android-ndk.Dockerfile                  | 87 ----------------------
 .../{android-download-ndk.sh => android-ndk.sh}    | 15 ++--
 .gitlab-ci/android-setup-env.sh                    | 87 ----------------------
 .gitlab-ci/cross_file_android_arm64_31.txt         | 20 +++++
 .gitlab-ci/fedora.Dockerfile                       |  3 +
 6 files changed, 35 insertions(+), 186 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index d5db361d94..8488d2b8ef 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -10,10 +10,9 @@ cache:
     - _ccache/
 
 variables:
-  FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v14"
+  FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v15"
   COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v4"
   DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v10"
-  ANDROID_IMAGE: "registry.gitlab.gnome.org/gnome/glib/android-ndk:v7"
   MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v6"
   MESON_TEST_TIMEOUT_MULTIPLIER: 2
   G_MESSAGES_DEBUG: all
@@ -255,14 +254,14 @@ valgrind:
     paths:
       - "_build/meson-logs"
 
-cross-android_api28_arm64:
+cross-android_arm64:
   extends:
     - .cross-build-linux
     - .only-default
-  image: $ANDROID_IMAGE
+  image: $FEDORA_IMAGE
   script:
     # FIXME: add --werror
-    - meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_28.txt _build
+    - meson ${MESON_COMMON_OPTIONS} --cross-file=.gitlab-ci/cross_file_android_arm64_31.txt _build
     - ninja -C _build
 
 cross-mingw64:
diff --git a/.gitlab-ci/android-download-ndk.sh b/.gitlab-ci/android-ndk.sh
similarity index 70%
rename from .gitlab-ci/android-download-ndk.sh
rename to .gitlab-ci/android-ndk.sh
index 7739e39d5a..8357fd9595 100755
--- a/.gitlab-ci/android-download-ndk.sh
+++ b/.gitlab-ci/android-ndk.sh
@@ -1,7 +1,7 @@
 #!/bin/bash
 
 #
-# Copyright 2018 Collabora ltd.
+# Copyright 2022 Collabora ltd.
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -22,10 +22,11 @@
 set -e
 
 # Download Android NDK
-ANDROID_NDK_VERSION="r17b"
-ANDROID_NDK_SHA512="062fac12f747730f5563995089a8b4abab683fbbc621aa8582fdf35fe327daee5d69ed2437af257c10ec4ef54ecd3805a8f134a1400eb8f34ee76f55c8dc9ae9"
-wget --quiet "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip";
-echo "${ANDROID_NDK_SHA512}  android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip" | sha512sum -c
-unzip "android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip"
-rm "android-ndk-${ANDROID_NDK_VERSION}-linux-x86_64.zip"
+ANDROID_NDK_PATH=/opt/android-ndk
+ANDROID_NDK_VERSION="r23b"
+ANDROID_NDK_SHA512="5f2b58e605fc99d4fd3e9d2210e7f5e76e89245fa9428ce0d890e2e03b598c62c48ebd528fcb76556f04b46b87afea52e1e8d280f32cd1232f290e074bfa56fa"
+wget --quiet "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip";
+echo "${ANDROID_NDK_SHA512}  android-ndk-${ANDROID_NDK_VERSION}-linux.zip" | sha512sum -c
+unzip "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
+rm "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
 mv "android-ndk-${ANDROID_NDK_VERSION}" "${ANDROID_NDK_PATH}"
diff --git a/.gitlab-ci/cross_file_android_arm64_31.txt b/.gitlab-ci/cross_file_android_arm64_31.txt
new file mode 100644
index 0000000000..f65af29053
--- /dev/null
+++ b/.gitlab-ci/cross_file_android_arm64_31.txt
@@ -0,0 +1,20 @@
+[constants]
+ndk_path = '/opt/android-ndk'
+toolchain = ndk_path / 'toolchains/llvm/prebuilt/linux-x86_64'
+
+[host_machine]
+system = 'android'
+cpu_family = 'aarch64'
+cpu = 'aarch64'
+endian = 'little'
+
+[properties]
+sys_root = toolchain / 'sysroot'
+c_ld = 'gold'
+cpp_ld = 'gold'
+
+[binaries]
+c =     toolchain / 'bin/aarch64-linux-android31-clang'
+cpp =   toolchain / 'bin/aarch64-linux-android31-clang++'
+ar =    toolchain / 'bin/llvm-ar'
+strip = toolchain / 'bin/llvm-strip'
diff --git a/.gitlab-ci/fedora.Dockerfile b/.gitlab-ci/fedora.Dockerfile
index f00751879e..d67cd35115 100644
--- a/.gitlab-ci/fedora.Dockerfile
+++ b/.gitlab-ci/fedora.Dockerfile
@@ -85,6 +85,9 @@ ARG HOST_USER_ID=5555
 ENV HOST_USER_ID ${HOST_USER_ID}
 RUN useradd -u $HOST_USER_ID -G wheel -ms /bin/bash user
 
+COPY android-ndk.sh .
+RUN ./android-ndk.sh
+
 USER user
 WORKDIR /home/user
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]