| 1 | == Mycroft Mark II - GUI using Qt 5.12 LTS == |
| 2 | |
| 3 | === Build QT 5.12 LTS for eglfs === |
| 4 | Install and compile Qt 5.12 LTS using this **excellent** guide: [https://www.tal.org/tutorials/building-qt-512-raspberry-pi]. |
| 5 | ==== Prerequisites ==== |
| 6 | I did add 1GB swap and set the GPU memory to 16MB while building which worked without problem and took about 10 hours. |
| 7 | ==== Download and build ==== |
| 8 | The following steps are from that guide and is only here so that it does not get lost. |
| 9 | * wget http://download.qt.io/official_releases/qt/5.12/5.12.7/single/qt-everywhere-src-5.12.7.tar.xz |
| 10 | * tar xf qt-everywhere-src-5.12.7.tar.xz |
| 11 | * git clone https://github.com/oniongarlic/qt-raspberrypi-configuration.git |
| 12 | * cd qt-raspberrypi-configuration && make install DESTDIR=../qt-everywhere-src-5.12.7 |
| 13 | * apt-get update |
| 14 | * apt-get install build-essential libfontconfig1-dev libdbus-1-dev libfreetype6-dev libicu-dev libinput-dev libxkbcommon-dev libsqlite3-dev libssl-dev libpng-dev libjpeg-dev libglib2.0-dev libraspberrypi-dev |
| 15 | * mkdir build |
| 16 | * cd build |
| 17 | then this command: |
| 18 | {{{ |
| 19 | PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig:/usr/share/pkgconfig \ |
| 20 | ../qt-everywhere-src-5.12.7/configure -platform linux-rpi-g++ \ |
| 21 | -v \ |
| 22 | -opengl es2 -eglfs \ |
| 23 | -no-gtk \ |
| 24 | -opensource -confirm-license -release \ |
| 25 | -reduce-exports \ |
| 26 | -force-pkg-config \ |
| 27 | -nomake examples -no-compile-examples \ |
| 28 | -skip qtwayland \ |
| 29 | -skip qtwebengine \ |
| 30 | -no-feature-geoservices_mapboxgl \ |
| 31 | -qt-pcre \ |
| 32 | -no-pch \ |
| 33 | -ssl \ |
| 34 | -evdev \ |
| 35 | -system-freetype \ |
| 36 | -fontconfig \ |
| 37 | -glib \ |
| 38 | -prefix /opt/Qt5.12 \ |
| 39 | -qpa eglfs |
| 40 | }}} |
| 41 | * make -j2 |
| 42 | * make install |
| 43 | This results in the complete build in /opt/Qt5.12 |
| 44 | |
| 45 | === Building Kirigami === |
| 46 | This is based on a combination of the official KDE guide to build the KDE framework at [https://community.kde.org/Get_Involved/development#Set_up_kdesrc-build] and this comprehensive guide at [https://jbbgameich.github.io/misc/2019/05/25/kdesrc-build-custom-qt.html] |
| 47 | As above these are the pure commands: |
| 48 | * mkdir -p ~/kde/src |
| 49 | * cd ~/kde/src/ |
| 50 | * git clone https://anongit.kde.org/kdesrc-build.git && cd kdesrc-build |
| 51 | * ./kdesrc-build --initial-setup |
| 52 | * source ~/.bashrc |
| 53 | * nano ~/.kdesrc-buildrc |
| 54 | change the qtdir so that it points to the Qt5.12 installation and comment the qt5-build-include and custom-qt5-libs-build-include |
| 55 | {{{ |
| 56 | # qtdir ~/kde/qt5 # Where to find Qt5 |
| 57 | qtdir /opt/Qt5.12 |
| 58 | ... |
| 59 | # Qt and some Qt-using middleware libraries |
| 60 | # include /home/pi/kde/src/kdesrc-build/qt5-build-include |
| 61 | # include /home/pi/kde/src/kdesrc-build/custom-qt5-libs-build-include |
| 62 | }}} |
| 63 | * kdesrc-build kirigami --include-dependencies |
| 64 | ==== Test Kirigami ==== |
| 65 | Use the exmaple from [https://api.kde.org/frameworks/kirigami/html/classorg_1_1kde_1_1kirigami_1_1ApplicationWindow.html] (also attached) and try to run it. |
| 66 | * mkdir -p ~/ws_qt/kirigami |
| 67 | * cd ~/ws_qt/kirigami |
| 68 | either edit the file and paste the content |
| 69 | * nano main.qml |
| 70 | or download the attachement |