-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
get-cef.sh
executable file
·49 lines (42 loc) · 1.34 KB
/
get-cef.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
#!/bin/sh
# Check processor architecture to download the correction version
LINUX_ARCH=`uname -m`
if [ "$LINUX_ARCH" = "x86_64" ]; then
CEF_ARCH="64"
elif [ "$LINUX_ARCH" = "arm" ]; then
CEF_ARCH="arm"
elif [ "$LINUX_ARCH" = "aarch64" ]; then
CEF_ARCH="arm64"
elif [ "$LINUX_ARCH" = "aarch64_be" ]; then
CEF_ARCH="arm64"
elif [ "$LINUX_ARCH" = "armv8b" ]; then
CEF_ARCH="arm64"
elif [ "$LINUX_ARCH" = "armv8l" ]; then
CEF_ARCH="arm64"
else
echo "Your system has a processor architecture that is unsupported by CEF: \"$LINUX_ARCH\""
exit 1
fi
# Download CEF archive
CEF_ARCHIVE="cef_binary_122.1.12+g6e69d20+chromium-122.0.6261.112_linux${CEF_ARCH}_minimal"
if [ ! -f /tmp/cef.tar.bz2 ]; then
curl -o /tmp/cef.tar.bz2.part "https://cef-builds.spotifycdn.com/$CEF_ARCHIVE.tar.bz2"
mv /tmp/cef.tar.bz2.part /tmp/cef.tar.bz2
fi
mkdir -p cef
tar -xvf /tmp/cef.tar.bz2 -C cef
export CEF_PATH="$PWD/cef/$CEF_ARCHIVE"
# Build CEF
(
cd "$CEF_PATH"
echo $CEF_PATH
# Add compilation definitions to the top of the CMakeLists.txt file
mv CMakeLists.txt CMakeLists.txt.old
echo "add_compile_definitions(DCHECK_ALWAYS_ON=1)" > CMakeLists.txt
cat CMakeLists.txt.old >> CMakeLists.txt
# Build
cmake .
cmake --build .
)
echo "CEF is ready, please put the following line somewhere to set the environment variable, e.g. in .profile:"
echo "export CEF_PATH=\"$CEF_PATH\""