forked from mmozeiko/build-angle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·68 lines (56 loc) · 1.6 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -euxo pipefail
export PATH="$(pwd)/depot_tools:$PATH"
# Download depot_tools
if [ ! -d "depot_tools" ]; then
mkdir depot_tools
pushd depot_tools
curl -L -O https://storage.googleapis.com/chrome-infra/depot_tools.zip
unzip depot_tools.zip
rm depot_tools.zip
popd
fi
# Download ANGLE source
if [ -d "angle_src" ]; then
pushd angle_src
if [ -d "build" ]; then
pushd build
git reset --hard HEAD
popd
fi
git pull --force --no-tags --depth 1
popd
else
git clone --single-branch --no-tags --depth 1 https://chromium.googlesource.com/angle/angle angle_src
pushd angle_src
python3 scripts/bootstrap.py
popd
fi
# Build ANGLE
pushd angle_src
gclient sync
gn gen out/Release --args="is_debug=false is_component_build=false"
autoninja -C out/Release
popd
# Prepare output folder
mkdir -p angle
mkdir -p angle/bin
# mkdir -p angle/lib
mkdir -p angle/include
cp angle_src/.git/refs/heads/main angle/commit.txt
cp angle_src/out/Release/libEGL.dylib angle/bin
cp angle_src/out/Release/libGLESv1_CM.dylib angle/bin
cp angle_src/out/Release/libGLESv2.dylib angle/bin
cp -R angle_src/include/KHR angle/include/KHR
cp -R angle_src/include/EGL angle/include/EGL
cp -R angle_src/include/GLES angle/include/GLES
cp -R angle_src/include/GLES2 angle/include/GLES2
cp -R angle_src/include/GLES3 angle/include/GLES3
# Zip up ANGLE folder
if [ ! -z "${GITHUB_WORKFLOW}" ]; then
ANGLE_COMMIT=$(cat angle/commit.txt)
BUILD_DATE=$(date +%Y-%m-%d)
zip -r angle-$BUILD_OS-$BUILD_DATE.zip angle
echo "ANGLE_COMMIT=$ANGLE_COMMIT" >> $GITHUB_OUTPUT
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_OUTPUT
fi