FS#72946 - [telegram-desktop] Build with Qt 6

Attached to Project: Community Packages
Opened by Ilya Fedin (ilya-fedin) - Tuesday, 07 December 2021, 16:25 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Saturday, 01 January 2022, 17:25 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The comment in PKGBUILD says: # Use Qt5 for the time being until kwayland has an easier way to work with Qt6.
But it's easy to build kwayland with Qt 6: just add kwayland build commands to telegram-desktop PKGBUILD, apply https://github.com/desktop-app/patches/blob/master/kwayland-qt6.patch, add -DBUILD_SHARED_LIBS=OFF to kwayland's build flags, set -DCMAKE_INSTALL_PREFIX to a subdir in kwayland source directory, cmake --install it without DESTDIR and set telegram-desktop's -DKF5Wayland_DIR to $kwayland_prefix/lib/cmake/KF5Wayland. It should build just fine, as a result you will have Qt6-based tdesktop with statically linked Qt6-based kwayland.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Saturday, 01 January 2022, 17:25 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 09 December 2021, 04:49 GMT
Antonio, any opinions?
Comment by Antonio Rojas (arojas) - Thursday, 09 December 2021, 07:27 GMT
The kwayand patch makes me cry. It doesn't even rename the library, so it will conflict with kwayland. If you want to do this, please use a separate pkgbase and call it kwayland-telegram or something like that to make it clear it's nowhere near an official Qt6 port.
Comment by Ilya Fedin (ilya-fedin) - Thursday, 09 December 2021, 07:30 GMT
I propose to build it right in tdesktop PKGBUILD, statically, so it won't conflict
Comment by Mark Wagie (yochananmarqos) - Friday, 24 December 2021, 03:50 GMT
Upstream is now using Qt6 as of the 3.3.1 Pre-release, FYI: https://github.com/telegramdesktop/tdesktop/releases/tag/v3.3.1
Comment by Ilya Fedin (ilya-fedin) - Friday, 24 December 2021, 09:45 GMT
It's used since 3.1.10
https://github.com/telegramdesktop/tdesktop/blob/dev/changelog.txt#L92

3.3.1 updates official builds to new patch version and simplifies build with kwayland
Comment by Mark Wagie (yochananmarqos) - Wednesday, 29 December 2021, 20:27 GMT
I built it with Qt6 successfully. However it looks like it may need a couple new dependencies. It built and ran fine without them, but I didn't test voice calls.

-- Checking for module 'rlottie'
-- Package 'rlottie', required by 'virtual:world', not found

-- Checking for module 'tgvoip'
-- Package 'tgvoip', required by 'virtual:world', not found
Comment by Ilya Fedin (ilya-fedin) - Wednesday, 29 December 2021, 20:30 GMT
rlottie and tgvoip were always here, if they're not found, bundled copies are used
Comment by Sven-Hendrik Haase (Svenstaro) - Thursday, 30 December 2021, 02:14 GMT
If you have a PKGBUILD for me, I'd be happy to give it a spin.
Comment by Mark Wagie (yochananmarqos) - Thursday, 30 December 2021, 04:35 GMT
Here you go: https://github.com/yochananmarqos/pkgbuilds/blob/master/telegram-desktop/PKGBUILD

I didn't bother doing the submodules properly yet, though.
Comment by Ilya Fedin (ilya-fedin) - Thursday, 30 December 2021, 05:05 GMT
It seems all you did is updated the existing PKGBUILD to 3.2.2, why did you change the URL to git rather than just update version in the pre-existing URL?
Comment by Ilya Fedin (ilya-fedin) - Friday, 31 December 2021, 17:34 GMT
I see you updated tdesktop to 3.4.1, building with Qt 6 should be straightforward now, just replace Qt 5 packages with Qt 6 and remove the -DDESKTOP_APP_QT6=OF
Comment by Ilya Fedin (ilya-fedin) - Friday, 31 December 2021, 17:35 GMT
Qt 6 versions of libdbusmenu and kwayland are inside of source tree now
Comment by Ilya Fedin (ilya-fedin) - Saturday, 01 January 2022, 03:38 GMT
Ok, here's PKGBUILD. I switched it to Qt 6, removed gtk3 since tdesktop fully migrated to portals/X libraries some time ago and webkit2gtk is not a build-time dependency for some time (source tree has all the needed definitions from webkit2gtk headers). tdesktop tries to load three versions of webkit2gtk, in that order: 5.0, 4.1, 4.0, so it might be a good idea to specify all the three or change it to webkit2gtk-5.0 at least.

I also see that you missing libdispatch (it seems it's present in AUR), it tries first to find system version, then tries to build the bundled version (but fails since can't find clang) and finally fallbacks to poor QThreadPool.
   PKGBUILD (1.6 KiB)
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 01 January 2022, 11:21 GMT
Thanks! I pushed a package to [ct], can you check?
Comment by Amin Vakil (aminvakil) - Saturday, 01 January 2022, 12:00 GMT
When you try to send an attachment, it used to open something like dolphin (I use KDE Plasma), it has been changed now

Not that it's important at all, just wanted to bring this up here.
Comment by Amin Vakil (aminvakil) - Saturday, 01 January 2022, 12:00 GMT
I also see this line opening telegram-desktop using konsole:

qt.gui.imageio.jpeg: Corrupt JPEG data: premature end of data segment
Comment by Amin Vakil (aminvakil) - Saturday, 01 January 2022, 12:05 GMT
Ah, it also happens using 3.4.2-1, only with a little change:

Corrupt JPEG data: premature end of data segment
Comment by Antonio Rojas (arojas) - Saturday, 01 January 2022, 14:20 GMT
> When you try to send an attachment, it used to open something like dolphin (I use KDE Plasma), it has been changed now

That is expected until the KDE platform plugin is ported to Qt6
Comment by Mark Wagie (yochananmarqos) - Saturday, 01 January 2022, 17:09 GMT
@Ilya: I completely forgot about adding clang to get around that. I just built it against libdispatch 5.5, PKGBUILD here: https://github.com/yochananmarqos/pkgbuilds/tree/master/libdispatch
Comment by Sven-Hendrik Haase (Svenstaro) - Saturday, 01 January 2022, 17:25 GMT
I'll consider the general issue here done. If there are follow-up issues with this, let's track those in new bugs so we can stay strictly on-topic.

Loading...