10
apt-get install -y --no-remove $EPHEMERAL
12
# Fetch the NDK and extract just the toolchain we want.
14
wget -O $ndk.zip https://dl.google.com/android/repository/$ndk-linux-x86_64.zip
15
unzip -d / $ndk.zip "$ndk/toolchains/llvm/*"
17
# Since it was packed as a zip file, symlinks/hardlinks got turned into
18
# duplicate files. Turn them into hardlinks to save on container space.
19
rdfind -makehardlinks true -makeresultsfile false /android-ndk-r21d/
20
# Drop some large tools we won't use in this build.
21
find /android-ndk-r21d/ -type f | egrep -i "clang-check|clang-tidy|lldb" | xargs rm -f
23
sh .gitlab-ci/container/create-android-ndk-pc.sh /$ndk zlib.pc "" "-lz" "1.2.3"
25
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk x86_64-linux-android x86_64 x86_64
26
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk i686-linux-android x86 x86
27
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk aarch64-linux-android arm armv8
28
sh .gitlab-ci/container/create-android-cross-file.sh /$ndk arm-linux-androideabi arm armv7hl armv7a-linux-androideabi
30
# Not using build-libdrm.sh because we don't want its cleanup after building
31
# each arch. Fetch and extract now.
32
export LIBDRM_VERSION=libdrm-2.4.102
33
wget https://dri.freedesktop.org/libdrm/$LIBDRM_VERSION.tar.xz
34
tar -xf $LIBDRM_VERSION.tar.xz && rm $LIBDRM_VERSION.tar.xz
37
x86_64-linux-android \
39
aarch64-linux-android \
40
arm-linux-androideabi ; do
45
--cross-file=/cross_file-$arch.txt \
54
ninja -C build-$arch install
58
rm -rf $LIBDRM_VERSION
60
apt-get purge -y $EPHEMERAL