On Fri, Jun 24, 2022 at 03:47:05PM +0000, Klemens Nanni wrote:
> On 24/06/2022 18:20, Sergey A. Osokin wrote:
> > On Fri, Jun 24, 2022 at 10:43:57AM +0000, Klemens Nanni wrote:
> > > On Thu, Jun 23, 2022 at 09:44:58PM +0000, Sergey A. Osokin wrote:
> > > > 
> > > > telegram-deskop 4.0.0, latest release, builds well with Qt5.
> > > 
> > > On which system?
> > 
> > FreeBSD 13.1-RELEASE amd64
> > 
> > > With patches?
> > 
> > A couple of patches is required, one from the vendor,
> > https://github.com/osokin/freebsd-ports/tree/tdesktop/net-im/telegram-desktop/files
> 
> Thanks, merely adding the media_view_pip.cpp patch to 4.0.0 without any
> other Qt related patches fixes the Qt5 build on OpenBSD, thanks.
> 
> So that should help updating to 4.0.0, but it still doesn't fix
> regressions with Qt6.
> 
> I can test and update tdesktop to 4.0.0 using Qt5 to drop our current
> patches, then I could send a simpler FLAVOR diff to add -qt6.

4.0.0 with Qt5 works for me, so I'd like to commit this update soon.

The Qt5 fix is added as qt5-patch-* such that a follow-up diff for the
-qt5 flavour can set PATCH_LIST conditionally and thus avoid the Qt5 fix
for the Qt6 build (if possible).

Feedback? OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/net/tdesktop/Makefile,v
retrieving revision 1.31
diff -u -p -r1.31 Makefile
--- Makefile    23 May 2022 01:49:40 -0000      1.31
+++ Makefile    25 Jun 2022 10:34:50 -0000
@@ -5,8 +5,7 @@ NOT_FOR_ARCHS =         ${BE_ARCHS} i386
 
 COMMENT =              Telegram Desktop messenger
 PORTROACH =            limit:-full$$
-V =                    3.7.5
-REVISION =             0
+V =                    4.0.0
 DISTNAME =             tdesktop-${V}-full
 PKGNAME =              ${DISTNAME:-full=}
 CATEGORIES =           net
@@ -16,13 +15,7 @@ DEBUG_PACKAGES =     ${BUILD_PACKAGES}
 HOMEPAGE =             https://desktop.telegram.org
 MASTER_SITES =         
https://github.com/telegramdesktop/tdesktop/releases/download/v${V}/
 
-MASTER_SITES0 =                
https://salsa.debian.org/debian/telegram-desktop/-/raw/
-FORCE_QT5_COMMIT =     93b4a99d86eb60141612767935b038b29db65345
-FORCE_QT5_ORIGPATCH =  ${FORCE_QT5_COMMIT}/debian/patches/Compatible-setScreen
-FORCE_QT5_NEWPATCH =   
tdesktop-force-qt5-${FORCE_QT5_COMMIT:C/(........).*/\1/}
-PATCHFILES +=          ${FORCE_QT5_NEWPATCH}{${FORCE_QT5_ORIGPATCH}}.patch:0
-
-PATCH_DIST_STRIP =     -p1
+PATCH_LIST +=          qt5-patch-*
 
 MAINTAINER =           Andrew Krasavin <noiseless...@yandex.ru>, \
                        Klemens Nanni <k...@openbsd.org>
Index: distinfo
===================================================================
RCS file: /cvs/ports/net/tdesktop/distinfo,v
retrieving revision 1.13
diff -u -p -r1.13 distinfo
--- distinfo    23 May 2022 01:49:40 -0000      1.13
+++ distinfo    23 Jun 2022 23:16:35 -0000
@@ -1,4 +1,2 @@
-SHA256 (tdesktop-3.7.5-full.tar.gz) = 
hUduVBtXhj6oIhjKSwX1rDggviX/T8tHm06BhJhhNoI=
-SHA256 (tdesktop-force-qt5-93b4a99d.patch) = 
pIv3XMgVL+dnAGNncU9gL4h3qBCmSYFCG8o8zqiQ7GI=
-SIZE (tdesktop-3.7.5-full.tar.gz) = 41570684
-SIZE (tdesktop-force-qt5-93b4a99d.patch) = 2282
+SHA256 (tdesktop-4.0.0-full.tar.gz) = 
9P8g4ayP/dQGbXCPg1+xFoyDv0t0ogpSyaMaAwXloMc=
+SIZE (tdesktop-4.0.0-full.tar.gz) = 41056249
Index: patches/qt5-patch-Telegram_SourceFiles_media_view_media_view_pip_cpp
===================================================================
RCS file: patches/qt5-patch-Telegram_SourceFiles_media_view_media_view_pip_cpp
diff -N patches/qt5-patch-Telegram_SourceFiles_media_view_media_view_pip_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/qt5-patch-Telegram_SourceFiles_media_view_media_view_pip_cpp        
25 Jun 2022 10:32:09 -0000
@@ -0,0 +1,14 @@
+Fix build against Qt5
+
+Index: Telegram/SourceFiles/media/view/media_view_pip.cpp
+--- Telegram/SourceFiles/media/view/media_view_pip.cpp.orig
++++ Telegram/SourceFiles/media/view/media_view_pip.cpp
+@@ -475,7 +475,7 @@ void PipPanel::setPositionDefault() {
+       const auto parentScreen = widgetScreen(_parent);
+       const auto myScreen = widgetScreen(widget());
+       if (parentScreen && myScreen && myScreen != parentScreen) {
+-              widget()->setScreen(parentScreen);
++              widget()->windowHandle()->setScreen(parentScreen);
+       }
+       auto position = Position();
+       position.snapped = RectPart::Top | RectPart::Left;

Reply via email to