1 | #!/bin/bash
|
---|
2 |
|
---|
3 | # build-cefpython.sh <builddir>
|
---|
4 | #
|
---|
5 | # Build CEF Python (the latest compatible version with the MAVA Logger X)
|
---|
6 | # for Linux in the given build directory.
|
---|
7 |
|
---|
8 | set -e -u -x
|
---|
9 |
|
---|
10 | CEF_VERSION_MAJOR="108"
|
---|
11 | CEF_VERSION_MINOR="4"
|
---|
12 | CEF_VERSION_SHORT="${CEF_VERSION_MAJOR}.${CEF_VERSION_MINOR}"
|
---|
13 | CEF_VERSION="${CEF_VERSION_SHORT}.13"
|
---|
14 | CEF_FULL_VERSION="${CEF_VERSION}+ga98cd4c+chromium-108.0.5359.125"
|
---|
15 |
|
---|
16 | CEF_NAME="cef_binary_${CEF_FULL_VERSION}_linux64"
|
---|
17 | CEFPYTHON_CEF_DIRNAME="cef${CEF_VERSION_MAJOR}_${CEF_FULL_VERSION}_linux64"
|
---|
18 | CEFPYTHON_SHA="941c589312b70c6e9d193da0e2fb17aacd9ef3c1"
|
---|
19 | MAKEJOBS="16"
|
---|
20 |
|
---|
21 | builddir="${1}"
|
---|
22 |
|
---|
23 | mkdir -p "${builddir}"
|
---|
24 |
|
---|
25 | cd "${builddir}"
|
---|
26 | rm -rf "${CEF_NAME}"
|
---|
27 | if test -f "${HOME}/sources/mlx/${CEF_NAME}.tar.bz2"; then
|
---|
28 | tar xf "${HOME}/sources/mlx/${CEF_NAME}.tar.bz2"
|
---|
29 | else
|
---|
30 | wget -O - "https://cef-builds.spotifycdn.com/${CEF_NAME}.tar.bz2" | bzip2 -dc | tar xf -
|
---|
31 | fi
|
---|
32 |
|
---|
33 | cd "${CEF_NAME}"
|
---|
34 | mv tests tests.orig
|
---|
35 | mkdir build
|
---|
36 | cd build
|
---|
37 | cmake -G "Unix Makefiles" ..
|
---|
38 | cd libcef_dll_wrapper
|
---|
39 | make -j${MAKEJOBS}
|
---|
40 |
|
---|
41 | cd "${builddir}"
|
---|
42 | rm -rf "cefpython-${CEFPYTHON_SHA}"
|
---|
43 |
|
---|
44 | wget -O - https://github.com/ivaradi/cefpython/archive/${CEFPYTHON_SHA}.tar.gz | gzip -dc | tar xf -
|
---|
45 |
|
---|
46 | cd "cefpython-${CEFPYTHON_SHA}"
|
---|
47 | mkdir build
|
---|
48 | cd build
|
---|
49 |
|
---|
50 | mkdir -p "${CEFPYTHON_CEF_DIRNAME}/bin"
|
---|
51 | mv "${builddir}/${CEF_NAME}/Release/"* "${CEFPYTHON_CEF_DIRNAME}/bin"
|
---|
52 | mv "${builddir}/${CEF_NAME}/Resources/"* "${CEFPYTHON_CEF_DIRNAME}/bin"
|
---|
53 |
|
---|
54 | mkdir -p "${CEFPYTHON_CEF_DIRNAME}/lib"
|
---|
55 | mv "${builddir}/${CEF_NAME}/build/libcef_dll_wrapper/libcef_dll_wrapper.a" "${CEFPYTHON_CEF_DIRNAME}/lib"
|
---|
56 |
|
---|
57 | mv "${builddir}/${CEF_NAME}/LICENSE.txt" "${CEFPYTHON_CEF_DIRNAME}"
|
---|
58 |
|
---|
59 | pip3 install --break-system-packages -r ../tools/requirements.txt
|
---|
60 |
|
---|
61 | python3 ../tools/build.py "${CEF_VERSION}" || true
|
---|
62 | python3 ../tools/make_installer.py "${CEF_VERSION_SHORT}"
|
---|
63 |
|
---|
64 | cd "cefpython3_${CEF_VERSION_SHORT}_linux64"
|
---|
65 | python3 setup.py bdist_wheel
|
---|
66 | mv "dist/cefpython3-${CEF_VERSION_SHORT}-"*".whl" "${builddir}"
|
---|