-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild-cef.sh
More file actions
executable file
·45 lines (36 loc) · 2.2 KB
/
Copy pathbuild-cef.sh
File metadata and controls
executable file
·45 lines (36 loc) · 2.2 KB
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
#!/bin/bash -xe
# Packages required to download and run the Chromium bootstrap
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get dist-upgrade -y
apt-get install -y --no-install-recommends curl ca-certificates lsb-release python3 python3-pip file sudo procps
python3 -m pip install --break-system-packages dataclasses importlib_metadata
# Download the Chromium bootstrap at the selected version
CHROMIUM_VERSION=$(curl "https://raw.githubusercontent.com/chromiumembedded/cef/refs/heads/${CEF_BRANCH}/CHROMIUM_BUILD_COMPATIBILITY.txt" 2>/dev/null | sed -ne "s#.*'chromium_checkout': 'refs/tags/\([0-9.]\+\)'#\1#p")
curl "https://chromium.googlesource.com/chromium/src/+/refs/tags/${CHROMIUM_VERSION}/build/install-build-deps.py?format=TEXT" | base64 -d > install-build-deps.py
# Install deps with ARM cross-dependencies included
python3 ./install-build-deps.py --arm --no-syms --no-backwards-compatible --no-chromeos-fonts --no-nacl --no-prompt
rm -f ./install-build-deps.py
# Cleanup to reduce image size
apt-get clean
apt-get purge -y --auto-remove
# Download CEF automate script
mkdir -p cef/download
cd cef
curl "https://raw.githubusercontent.com/chromiumembedded/cef/refs/heads/${CEF_BRANCH}/tools/automate/automate-git.py" > automate-git.py
# Build CEF for x86_64 architecture
export CEF_ARCHIVE_FORMAT=tar.bz2
export GN_DEFINES="is_official_build=true use_sysroot=true symbol_level=1 is_cfi=false proprietary_codecs=true ffmpeg_branding=Chrome"
python3 ./automate-git.py --download-dir=$(pwd)/download --branch=${CEF_BRANCH} --minimal-distrib --force-clean --no-chromium-history --no-debug-build --build-target=cefsimple --x64-build --with-pgo-profiles
mkdir -p dist
rm -rf dist/*
mv -f download/chromium/src/cef/binary_distrib/*_minimal.tar.bz2 dist/
if [ "$BUILD_ARM64" = "true" ]; then
# Build CEF for aarch64 architecture
export CEF_INSTALL_SYSROOT=arm64
export GN_DEFINES="$GN_DEFINES use_thin_lto=false chrome_pgo_phase=0"
python3 ./automate-git.py --download-dir=$(pwd)/download --branch=${CEF_BRANCH} --minimal-distrib --force-clean --no-chromium-history --no-debug-build --build-target=cefsimple --arm64-build
mv -f download/chromium/src/cef/binary_distrib/*_minimal.tar.bz2 dist/
fi
cd ..
exit 0