Skip to content

Commit e26b3de

Browse files
drunkbatyagsurkov
andauthored
Upgrade to Qt6 Static (#170)
* Upgrade to Qt6 Static * Enable linkage to wayland platform plugins * Temporary disable docker layer caching * Enable docker layer cache * Exclude unnecessary X11 and wayland libraries --------- Co-authored-by: Georgii Surkov <[email protected]>
1 parent 9dfb53c commit e26b3de

File tree

5 files changed

+69
-30
lines changed

5 files changed

+69
-30
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ Note: STM32 Bootloader driver is not provided in this repository.
4646

4747
Setup dev container by running:
4848
```sh
49-
docker-compose up -d
49+
docker compose up -d
5050
```
5151
Compile qFlipper by running:
5252
```sh
53-
docker-compose exec dev ./build_linux.sh
53+
docker compose exec dev ./build_linux.sh
5454
```
5555

5656
#### Standalone build

application/application.pro

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ CONFIG += embed_translations
3131

3232
QML_IMPORT_PATH += $$PWD/imports
3333

34+
unix:!macx {
35+
QTPLUGIN.platforms = qxcb qwayland-egl qwayland-generic
36+
}
37+
3438
win32:!win32-g++ {
3539
PRE_TARGETDEPS += \
3640
$$OUT_PWD/../backend/backend.lib \

build_linux.sh

+17-5
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,27 @@ set -euxo pipefail;
55
TARGET="qFlipper"
66
BUILDDIR="build"
77
APPDIR_PREFIX="$PWD/$BUILDDIR/AppDir/usr"
8+
89
LIBSSL1_OVERRIDE="$(ldconfig -p | grep x86-64 | grep -oP '/[^\s]+/libssl.so.1.1' | head -n1)"
910

11+
LIBWAYLAND_EXCLUDE="libwayland*"
12+
LIBXCB_EXCLUDE="libxcb*"
13+
LIBXKB_EXCLUDE="libxkb*"
14+
LIBX11_EXCLUDE="libX*"
15+
1016
export OUTPUT="$TARGET-x86_64.AppImage"
11-
export QML_SOURCES_PATHS=".."
1217

13-
mkdir -p "$BUILDDIR"
14-
cd "$BUILDDIR"
15-
qmake "../$TARGET.pro" -spec linux-g++ CONFIG+=qtquickcompiler PREFIX="$APPDIR_PREFIX"
18+
mkdir -p "$BUILDDIR" && cd "$BUILDDIR"
19+
20+
qmake "../$TARGET.pro" -spec linux-g++ "CONFIG+=release qtquickcompiler" PREFIX="$APPDIR_PREFIX"
1621
make qmake_all
1722
make -j"$(nproc)"
1823
make install
19-
linuxdeploy --appdir=AppDir -o appimage --custom-apprun="../installer-assets/appimage/AppRun" --plugin=qt --library="$LIBSSL1_OVERRIDE"
24+
25+
linuxdeploy --appdir=AppDir -o appimage \
26+
--custom-apprun="../installer-assets/appimage/AppRun" \
27+
--library="$LIBSSL1_OVERRIDE" \
28+
--exclude-library="$LIBWAYLAND_EXCLUDE" \
29+
--exclude-library="$LIBXCB_EXCLUDE" \
30+
--exclude-library="$LIBXKB_EXCLUDE" \
31+
--exclude-library="$LIBX11_EXCLUDE"

docker/Dockerfile

+44-23
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,66 @@
1-
FROM ubuntu:18.04
1+
FROM ubuntu:20.04
22

33
WORKDIR /project
44

5-
RUN apt-get update && \
6-
DEBIAN_FRONTEND=noninteractive apt-get install -y \
7-
software-properties-common
8-
9-
RUN add-apt-repository ppa:beineri/opt-qt-5.15.2-bionic && \
10-
apt-get update && \
11-
DEBIAN_FRONTEND=noninteractive apt-get install -y \
5+
RUN DEBIAN_FRONTEND=noninteractive apt update
6+
RUN DEBIAN_FRONTEND=noninteractive apt install -y \
7+
software-properties-common \
128
wget \
139
file \
1410
pkg-config \
1511
git \
12+
curl \
1613
libfuse2 \
1714
zlib1g-dev \
1815
libusb-1.0-0-dev \
1916
ca-certificates \
2017
build-essential \
2118
libgl-dev \
22-
qt515tools \
23-
qt515base \
24-
qt5153d \
25-
qt515svg \
26-
qt515serialport \
27-
qt515declarative \
28-
qt515quickcontrols \
29-
qt515quickcontrols2 \
30-
qt515graphicaleffects \
31-
qt515wayland \
19+
libxkbcommon-x11-dev \
20+
libxcb-icccm4-dev \
21+
libxcb-image0-dev \
22+
libxcb-keysyms1-dev \
23+
libxcb-randr0-dev \
24+
libxcb-render-util0-dev \
25+
libxcb-sync-dev \
26+
libdbus-1-dev \
27+
libmd4c-dev \
28+
libegl-dev \
29+
libxcb-xfixes0-dev \
30+
libsm-dev \
31+
libice-dev \
32+
libxcb-glx0-dev \
33+
libdrm-dev \
34+
libx11-xcb-dev \
35+
libopengl-dev \
3236
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3337

34-
RUN wget https://update.flipperzero.one/builds/misc/linuxdeploy-x86_64-29092022.AppImage -O /usr/bin/linuxdeploy \
35-
&& chmod +x /usr/bin/linuxdeploy
38+
RUN echo 'deb http://download.opensuse.org/repositories/home:drunkbatya/xUbuntu_20.04/ /' \
39+
| tee /etc/apt/sources.list.d/home:drunkbatya.list
40+
RUN curl -fsSL https://download.opensuse.org/repositories/home:drunkbatya/xUbuntu_20.04/Release.key \
41+
| gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_drunkbatya.gpg > /dev/null
42+
43+
RUN DEBIAN_FRONTEND=noninteractive apt update
44+
RUN DEBIAN_FRONTEND=noninteractive apt -y install \
45+
qtbase6-static \
46+
qtwayland6-static \
47+
qt3d6-static \
48+
qtdeclarative6-static \
49+
qtserialport6-static \
50+
qtshadertools6-static \
51+
qtsvg6-static \
52+
qttools6-static \
53+
qt5compat6-static
54+
55+
RUN wget https://update.flipperzero.one/builds/misc/linuxdeploy-x86_64-29092022.AppImage \
56+
-O /usr/bin/linuxdeploy && chmod +x /usr/bin/linuxdeploy
3657

37-
RUN wget https://update.flipperzero.one/builds/misc/linuxdeploy-plugin-qt-x86_64-29092022.AppImage -O /usr/bin/linuxdeploy-plugin-qt \
38-
&& chmod +x /usr/bin/linuxdeploy-plugin-qt
58+
RUN wget https://update.flipperzero.one/builds/misc/linuxdeploy-plugin-qt-x86_64-29092022.AppImage \
59+
-O /usr/bin/linuxdeploy-plugin-qt && chmod +x /usr/bin/linuxdeploy-plugin-qt
3960

4061
RUN git config --global --replace-all safe.directory '*'
4162

42-
ENV QT_BASE_DIR=/opt/qt515
63+
ENV QT_BASE_DIR=/opt/qt6.4-static
4364

4465
ENV PATH="${QT_BASE_DIR}/bin:${PATH}"
4566

installer-assets/appimage/AppRun

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ elif [[ "$1" = 'gui' ]]; then
7474
"$THIS_DIR"/usr/bin/qFlipper "$@"
7575
elif [[ "$1" = 'cli' ]]; then
7676
shift 1
77+
export QT_QPA_PLATFORMTHEME=xdgdesktopportal
78+
unset QT_STYLE_OVERRIDE
7779
"$THIS_DIR"/usr/bin/qFlipper-cli "$@"
7880
elif [[ "$1" = 'rules' ]]; then
7981
case "$2" in

0 commit comments

Comments
 (0)