Switch snap to Qt 6

This commit is contained in:
Ilya Fedin 2021-10-25 19:37:20 +04:00 committed by John Preston
parent 42015d6a72
commit e42f08f08d
1 changed files with 29 additions and 42 deletions

View File

@ -126,6 +126,7 @@ parts:
- -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_INSTALL_PREFIX=/usr
- -DTDESKTOP_API_ID=611335 - -DTDESKTOP_API_ID=611335
- -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c - -DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
- -DDESKTOP_APP_QT6=ON
- -DDESKTOP_APP_USE_PACKAGED_LAZY=ON - -DDESKTOP_APP_USE_PACKAGED_LAZY=ON
- -DTDESKTOP_LAUNCHER_BASENAME=telegram-desktop_telegram-desktop - -DTDESKTOP_LAUNCHER_BASENAME=telegram-desktop_telegram-desktop
override-pull: | override-pull: |
@ -150,7 +151,7 @@ parts:
stage: stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after: after:
- desktop-qt5 - desktop-qt
- extra-cmake-modules - extra-cmake-modules
- ffmpeg - ffmpeg
- kwayland - kwayland
@ -167,7 +168,7 @@ parts:
"*": patches/ "*": patches/
prime: [-./*] prime: [-./*]
desktop-qt5: desktop-qt:
source: https://github.com/desktop-app/snapcraft-desktop-helpers.git source: https://github.com/desktop-app/snapcraft-desktop-helpers.git
source-subdir: qt source-subdir: qt
plugin: make plugin: make
@ -190,12 +191,12 @@ parts:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
after: after:
- mozjpeg - mozjpeg
- qt5 - qt
extra-cmake-modules: extra-cmake-modules:
source: https://github.com/KDE/extra-cmake-modules.git source: https://github.com/KDE/extra-cmake-modules.git
source-depth: 1 source-depth: 1
source-tag: v5.77.0 source-tag: v5.87.0
plugin: cmake plugin: cmake
cmake-parameters: cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
@ -225,7 +226,7 @@ parts:
kwayland: kwayland:
source: https://github.com/KDE/kwayland.git source: https://github.com/KDE/kwayland.git
source-depth: 1 source-depth: 1
source-tag: v5.77.0 source-tag: v5.87.0
plugin: cmake plugin: cmake
build-packages: build-packages:
- libwayland-dev - libwayland-dev
@ -237,6 +238,9 @@ parts:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
- -DCMAKE_INSTALL_PREFIX=/usr - -DCMAKE_INSTALL_PREFIX=/usr
- -DBUILD_TESTING=OFF - -DBUILD_TESTING=OFF
override-pull: |
snapcraftctl pull
patch -p1 < $SNAPCRAFT_STAGE/patches/kwayland-qt6.patch
prime: prime:
- -./usr/include - -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libexec - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libexec
@ -246,7 +250,8 @@ parts:
- -./usr/share - -./usr/share
after: after:
- extra-cmake-modules - extra-cmake-modules
- desktop-qt5 - desktop-qt
- patches
- plasma-wayland-protocols - plasma-wayland-protocols
mozjpeg: mozjpeg:
@ -294,7 +299,7 @@ parts:
plasma-wayland-protocols: plasma-wayland-protocols:
source: https://github.com/KDE/plasma-wayland-protocols.git source: https://github.com/KDE/plasma-wayland-protocols.git
source-depth: 1 source-depth: 1
source-tag: v1.1.1 source-tag: v1.4.0
plugin: cmake plugin: cmake
cmake-parameters: cmake-parameters:
- -DCMAKE_BUILD_TYPE=Release - -DCMAKE_BUILD_TYPE=Release
@ -303,7 +308,7 @@ parts:
after: after:
- extra-cmake-modules - extra-cmake-modules
qt5: qt:
plugin: nil plugin: nil
build-packages: build-packages:
- libdbus-1-dev - libdbus-1-dev
@ -334,7 +339,6 @@ parts:
- libxcb-sync-dev - libxcb-sync-dev
- libxcb-util-dev - libxcb-util-dev
- libxcb-xfixes0-dev - libxcb-xfixes0-dev
- libxcb-xinerama0-dev
- libxcb-xinput-dev - libxcb-xinput-dev
- libxcb-xkb-dev - libxcb-xkb-dev
- libxcursor-dev - libxcursor-dev
@ -372,7 +376,6 @@ parts:
- libxcb-sync1 - libxcb-sync1
- libxcb-util1 - libxcb-util1
- libxcb-xfixes0 - libxcb-xfixes0
- libxcb-xinerama0
- libxcb-xinput0 - libxcb-xinput0
- libxcb-xkb1 - libxcb-xkb1
- libxcursor1 - libxcursor1
@ -380,64 +383,48 @@ parts:
- libxkbcommon-x11-0 - libxkbcommon-x11-0
- zlib1g - zlib1g
override-pull: | override-pull: |
QT=5_15_2 QT=6_2_0
git clone -b v5.15.2 --depth=1 git://code.qt.io/qt/qt5.git . git clone -b v6.2.0 --depth=1 git://code.qt.io/qt/qt5.git .
perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg perl init-repository --module-subset=qtbase,qtwayland,qtimageformats,qtsvg,qt5compat
git submodule update qtbase qtwayland qtimageformats qtsvg
cd qtbase cd qtbase
find $SNAPCRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply find $SNAPCRAFT_STAGE/patches/qtbase_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qtwayland cd ../qtwayland
find $SNAPCRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply find $SNAPCRAFT_STAGE/patches/qtwayland_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd ../qt5compat
find $SNAPCRAFT_STAGE/patches/qt5compat_${QT} -type f -print0 | sort -z | xargs -r0 git apply
cd .. cd ..
override-build: | override-build: |
./configure \ ./configure \
-prefix /usr \ -prefix /usr \
-bindir /usr/lib/qt5/bin \
-libdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET \ -libdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET \
-docdir /usr/share/qt5/doc \
-headerdir /usr/include/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-datadir /usr/share/qt5 \
-archdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-plugindir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins \
-importdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/imports \
-translationdir /usr/share/qt5/translations \
-hostdatadir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5 \
-sysconfdir /etc/xdg \
-examplesdir /usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples \
-release \ -release \
-opensource \ -opensource \
-confirm-license \ -confirm-license \
-no-feature-xcb-sm \
-no-feature-xcomposite-egl \
-no-feature-xcomposite-glx \
-no-feature-wayland-server \
-openssl-linked \ -openssl-linked \
-nomake examples \ -nomake examples \
-nomake tests \ -nomake tests
-I $SNAPCRAFT_STAGE/usr/include \
-L $SNAPCRAFT_STAGE/usr/lib/$SNAPCRAFT_ARCH_TRIPLET
make -j$SNAPCRAFT_PARALLEL_BUILD_COUNT cmake --build . -j$SNAPCRAFT_PARALLEL_BUILD_COUNT
make INSTALL_ROOT="$SNAPCRAFT_PART_INSTALL" install DESTDIR="$SNAPCRAFT_PART_INSTALL" cmake --install .
stage: stage:
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2 - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/libjpeg.so.8.2.2
prime: prime:
- -./usr/bin
- -./usr/doc
- -./usr/include - -./usr/include
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/cmake
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pkgconfig - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/metatypes
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/bin
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/mkspecs
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/examples
# Allow tdesktop's custom try-portal-and-fallback logic to work
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/qt5/plugins/platformthemes/libqxdgdesktopportal.so
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.a - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.a
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.la - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.la
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.prl - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.prl
- -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.so - -./usr/lib/$SNAPCRAFT_ARCH_TRIPLET/*.so
- -./usr/lib/qt5 - -./usr/libexec
- -./usr/share - -./usr/mkspecs
- -./usr/modules
# Allow tdesktop's custom try-portal-and-fallback logic to work
- -./usr/plugins/platformthemes/libqxdgdesktopportal.so
after: after:
- mozjpeg - mozjpeg
- patches - patches