1#!/usr/bin/env bash 2 3# When changing this file, you need to bump the following 4# .gitlab-ci/image-tags.yml tags: 5# KERNEL_ROOTFS_TAG 6 7set -uex 8 9uncollapsed_section_start angle "Building angle" 10 11ANGLE_REV="76025caa1a059f464a2b0e8f879dbd4746f092b9" 12SCRIPTS_DIR="$(pwd)/.gitlab-ci" 13ANGLE_PATCH_DIR="${SCRIPTS_DIR}/container/patches" 14 15# DEPOT tools 16git clone --depth 1 https://chromium.googlesource.com/chromium/tools/depot_tools.git /depot-tools 17export PATH=/depot-tools:$PATH 18export DEPOT_TOOLS_UPDATE=0 19 20mkdir /angle-build 21mkdir /angle 22pushd /angle-build 23git init 24git remote add origin https://chromium.googlesource.com/angle/angle.git 25git fetch --depth 1 origin "$ANGLE_REV" 26git checkout FETCH_HEAD 27 28angle_patch_files=( 29 build-angle_deps_Make-more-sources-conditional.patch 30) 31for patch in "${angle_patch_files[@]}"; do 32 echo "Apply patch to ANGLE from ${patch}" 33 GIT_COMMITTER_DATE="$(LC_TIME=C date -d@0)" git am < "${ANGLE_PATCH_DIR}/${patch}" 34done 35 36{ 37 echo "ANGLE base version $ANGLE_REV" 38 echo "The following local patches are applied on top:" 39 git log --reverse --oneline $ANGLE_REV.. --format='- %s' 40} > /angle/version 41 42# source preparation 43gclient config --name REPLACE-WITH-A-DOT --unmanaged \ 44 --custom-var='angle_enable_cl=False' \ 45 --custom-var='angle_enable_cl_testing=False' \ 46 --custom-var='angle_enable_vulkan_validation_layers=False' \ 47 --custom-var='angle_enable_wgpu=False' \ 48 --custom-var='build_allow_regenerate=False' \ 49 --custom-var='build_angle_deqp_tests=False' \ 50 --custom-var='build_angle_perftests=False' \ 51 --custom-var='build_with_catapult=False' \ 52 --custom-var='build_with_swiftshader=False' \ 53 https://chromium.googlesource.com/angle/angle.git 54sed -e 's/REPLACE-WITH-A-DOT/./;' -i .gclient 55gclient sync -j"${FDO_CI_CONCURRENT:-4}" 56 57mkdir -p out/Release 58echo ' 59angle_build_all=false 60angle_build_tests=false 61angle_enable_cl=false 62angle_enable_cl_testing=false 63angle_enable_gl=false 64angle_enable_gl_desktop_backend=false 65angle_enable_null=false 66angle_enable_swiftshader=false 67angle_enable_trace=false 68angle_enable_wgpu=false 69angle_enable_vulkan=true 70angle_enable_vulkan_api_dump_layer=false 71angle_enable_vulkan_validation_layers=false 72angle_has_frame_capture=false 73angle_has_histograms=false 74angle_use_custom_libvulkan=false 75angle_egl_extension="so.1" 76angle_glesv2_extension="so.2" 77build_angle_deqp_tests=false 78dcheck_always_on=true 79enable_expensive_dchecks=false 80is_debug=false 81' > out/Release/args.gn 82 83if [[ "$DEBIAN_ARCH" = "arm64" ]]; then 84 build/linux/sysroot_scripts/install-sysroot.py --arch=arm64 85fi 86 87gn gen out/Release 88# depot_tools overrides ninja with a version that doesn't work. We want 89# ninja with FDO_CI_CONCURRENT anyway. 90/usr/local/bin/ninja -C out/Release/ libEGL libGLESv2 91 92rm -f out/Release/libvulkan.so* out/Release/*.so.TOC 93cp out/Release/lib*.so* /angle/ 94ln -s libEGL.so.1 /angle/libEGL.so 95ln -s libGLESv2.so.2 /angle/libGLESv2.so 96 97rm -rf out 98 99popd 100rm -rf /depot-tools 101rm -rf /angle-build 102 103section_end angle 104