Skip to content

Instantly share code, notes, and snippets.

@penk
Last active October 2, 2021 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save penk/ff47c02e122bb5a4d8814219be935865 to your computer and use it in GitHub Desktop.
Save penk/ff47c02e122bb5a4d8814219be935865 to your computer and use it in GitHub Desktop.
Build QtWebEngine 6.2.0 on Raspberry Pi 4 for arm64

Build QtWebEngine 6.2.0 on Raspberry Pi 4 for arm64

Prebuilt binary

qt6.2.0-arm64.tgz

Get QtWebEngine source

Download file from download.qt.io.

Or

git clone http://code.qt.io/qt/qtwebengine.git --branch 6.2.0 --single-branch qtwebengine-6.2.0
cd qtwebengine-6.2.0
git submodule update --init --depth=1 --recursive --progress

Install cmake 3.19

QtWebEngine requires cmake >= 3.19, which Raspberry Pi OS shipped 3.16:

wget https://github.com/Kitware/CMake/releases/download/v3.19.8/cmake-3.19.8-Linux-aarch64.tar.gz
tar xvf cmake-3.19.8-Linux-aarch64.tar.gz 
cp -a cmake-3.19.8-Linux-aarch64/* /usr/local
export PATH=/usr/local/bin:$PATH 

Install clang-9

sudo apt install clang-9
sudo update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-9 60
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/clang-9 60

Fix python2 detection

Add the following line to configure.cmake:

set(Python2_FIND_STRATEGY VERSION)

Revert patch for skia/src/opts/SkRasterPipeline_opts.h

See https://github.com/qt/qtwebengine-chromium/commit/b2de8e8046dc1c558465f74b4afe11d57cbc6cf3

Configure QtWebEngine

cmake .. -DCMAKE_PREFIX_PATH="/opt/qt6" -DQT_FEATURE_webengine_embedded_build:INTERNAL=ON \
-DQT_FEATURE_webengine_system_ffmpeg:INTERNAL=ON \
-DQT_FEATURE_webengine_system_icu:INTERNAL=OFF

Find more feature flags in QT_KNOWN_FEATURES.

Set NINJAJOBS

vi ./src/core/CMakeFiles/QtWebEngineCore_Release_aarch64.dir/build.make 

Build & install

cmake --build . 
sudo cmake --install . 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment