如何在树莓派5+ubunut24上编译Qt5.15.15
下载Qt 5.15.15源码包
wget https://download.qt.io/official_releases/qt/5.15/5.15.15/single/qt-everywhere-opensource-src-5.15.15.tar.xz
tar -xf qt-everywhere-opensource-src-5.15.15.tar.xz
cd qt-everywhere-src-5.15.15
打个Qt6不支持libxcbcommon 1.6.0的补丁
编辑源码文件 qtbase/src/platformsupport/input/xkbcommon/qxkbcommon.cpp 在第275行增加几行代码,如下:
Xkb2Qt<XKB_KEY_dead_greek, Qt::Key_Dead_Greek>,
#ifdef XKB_KEY_dead_lowline
Xkb2Qt<XKB_KEY_dead_lowline, Qt::Key_Dead_Lowline>,
Xkb2Qt<XKB_KEY_dead_aboveverticalline, Qt::Key_Dead_Aboveverticalline>,
Xkb2Qt<XKB_KEY_dead_belowverticalline, Qt::Key_Dead_Belowverticalline>,
Xkb2Qt<XKB_KEY_dead_longsolidusoverlay, Qt::Key_Dead_Longsolidusoverlay>,
#endif
// Special keys from X.org - This include multimedia keys,
// wireless/bluetooth/uwb keys, special launcher keys, etc.
安装依赖包、配置、构建、安装
sudo apt-get install build-essential
sudo apt-get install libx11-*
sudo apt-get install libx11*
sudo apt-get install libxcb-*
sudo apt-get install libxcb*
sudo apt-get install libxkbcommon-dev
sudo apt-get install libxkbcommon-x11-dev
./configure -opensource -confirm-license -release \
-nomake examples -nomake tests \
-iconv \
-no-icu \
-no-gtk \
-no-eglfs \
-dbus-runtime \
-skip qtlocation \
-skip qtwayland \
-skip qt3d \
-skip qtquick3d \
-skip qtcharts \
-skip qtdoc \
-skip qtandroidextras \
-skip qtwebengine \
-skip qtgamepad \
-skip qtmacextras \
-skip qtwebview \
-skip qtwinextras
make -j$(nproc) 2>&1 | tee build.log
sudo make install
参考:
Qt for Linux/X11 - Building from Source | Qt 5.15
Index of /official_releases/qt/5.15
qt/qtbase.git - Qt Base (Core, Gui, Widgets, Network, ...)