Bug 255719

Summary: net-im/telegram-desktop: update to 2.7.4
Product: Ports & Packages Reporter: Henry Hu <henry.hu.sh>
Component: Individual Port(s)Assignee: Charlie Li <vishwin>
Status: Closed FIXED    
Severity: Affects Only Me CC: madpilot, nc, vishwin
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on: 255505    
Bug Blocks:    
Attachments:
Description Flags
port for 2.7.4
henry.hu.sh: maintainer-approval+
patch none

Description Henry Hu 2021-05-09 02:17:05 UTC
Many versions have passed, but the patch is simple.

* There's a commit after the version cut in lib_base, which is required for building to success. It'll get removed in the next port update, as it should be incorporated into the source code by then.
* We no longer define Q_OS_LINUX, so the patch to change #ifdef Q_OS_LINUX can be reverted.
* New dependency: glibmm.

This one may depend on PR 255716. Better submit that first.

Poudriere log: https://raw.githubusercontent.com/HenryHu/ports/master/.logs/12.2-amd64/telegram-desktop-2.7.4.log

Changelog:

2.7.4 (28.04.21)

- Fix crash in viewing an invoice after a payment is made.
- Respect Focus Assist only for native notifications.
- Mark messages as read only in active window.

2.7.3 (27.04.21)

- Fix crash on some versions of Linux.
- Fix video not stopping when PiP window is closed.
- Fix messages marking as read if the Windows session is locked.

2.7.2 (26.04.21)

- Offer real goods and services for sale in any group, channel or bot – Telegram doesn't charge a commission.
- Pay for goods securely using one of the 8 integrated payment providers – Telegram doesn't collect your payment info.
- See how this works in our @TestStore.
- Schedule voice chats to let participants know about them in advance.
- View a countdown to the voice chat and get notified when it starts.
- Try two new, fully-featured versions of Telegram Web – both supporting animated stickers, dark mode, chat folders and more: https://webk.telegram.org/ and https://webz.telegram.org/.

2.7.1 (20.03.21)

- Fix editing 'Manage Voice Chats' rights for channel admins.
- Fix verification check display in voice chat participants list.
- Allow removing and blocking channels from voice chats.

2.7 (19.03.21)

- Start limitless Voice Chats in Groups and Channels.
- Host discussions that can be listened to by millions of people simultaneously.
- Record voice chats to share or publish in Channels later.
- See that a chat is being recorded from the red dot next to its title.
- See user bio texts right from the list of participants.
- Raise your hand to show admins you want to speak.
- Create separate Voice Chat Invite Links for listeners or speakers.
- Change the title of your Voice Chat to give people an idea of the current topic.
- Join Voice Chats as one of your Channels to hide your personal account.

2.6.8 beta (18.03.21)

- Fix connecting and getting allowed to speak on voice chats.
- MPRIS support on Linux.

2.6.7 beta (18.03.21)

- Improve voice chat participants list updating.

2.6.6 beta (18.03.21)

- Fix joining popular voice chats.

2.6.5 beta (17.03.21)

- Improvements and fixes in new voice chat features.

2.6.4 beta (16.03.21)

- Fix freeze in voice chats.
- Make default interface scale 110% on macOS Retina screens.

2.6.3 beta (16.03.21)

- Fix audio device selection in voice chats.
- Fix blinking self profile photo in case the profile photo privacy is used.
- Fix voice chat admin menu on macOS.

2.6.2 beta (13.03.21)

- Fix text disappearing because of cloud drafts sync.
Comment 1 Henry Hu 2021-05-09 02:18:00 UTC
Created attachment 224783 [details]
port for 2.7.4

Forget to attach the patch.
Comment 2 Neel Chauhan freebsd_committer freebsd_triage 2021-05-09 05:06:49 UTC
There are build errors with this patch:

warning: unknown warning option '-Wno-unused-but-set-variable'; did you mean '-Wno-unused-const-variable'? [-Wunknown-warning-option]                           
warning: unknown warning option '-Wno-stringop-overflow'; did you mean '-Wno-shift-overflow'? [-Wunknown-warning-option]                                        
warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]                                       
warning: unknown warning option '-Werror=class-memaccess'; did you mean '-Werror=class-varargs'? [-Wunknown-warning-option]                                     
4 warnings generated.                                                           
ninja: build stopped: subcommand failed.                                        
===> Compilation failed unexpectedly.                                           
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to     
the maintainer.                                                                 
*** Error code 1                                                                
                                                                                
Stop.                                                                           
make: stopped in /usr/ports/net-im/telegram-desktop

Tested with poudriere with 13.0-RELEASE amd64.
Comment 3 Henry Hu 2021-05-09 20:29:27 UTC
(In reply to Neel Chauhan from comment #2)
Interesting, I've tested it on 12.2-RELEASE. Let me try on 13.0-RELEASE.
There's also a recent update to microsoft-gsl, which may impact it.
Comment 4 Henry Hu 2021-05-09 20:33:15 UTC
btw, would you please post the full build log somewhere? The last few lines are all warnings.
Comment 5 Henry Hu 2021-05-09 21:00:55 UTC
I synced to latest ports, and tested on 12.2-RELEASE again, and it still works.
Interestingly, I'm running 13-STABLE myself, and it builds fine.
I'll proceed to run it in poudriere on 13.0-RELEASE, while I'd still like to see your full build log.
Comment 6 Henry Hu 2021-05-10 00:36:46 UTC
I tried poudriere on 13.0/amd64, and it still works. See logs at https://raw.githubusercontent.com/HenryHu/ports/master/.logs/13.0-amd64/telegram-desktop-2.7.4.log

One thing to notice that I'm using some updated ports (microsoft-gsl 3.1.0, committed; range-v3 0.11.0, not committed, being discussed in PR 255505; tg_owt 20210422, committed). On the other hand, my host machine does not have microsoft-gsl or range-v3 updated, so they should not matter.
Comment 7 Neel Chauhan freebsd_committer freebsd_triage 2021-05-10 16:10:08 UTC
Committed!
Comment 8 commit-hook freebsd_committer freebsd_triage 2021-05-10 16:17:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c463b7d6bf5219f4a5c3cb87d4f4c505905582b4

commit c463b7d6bf5219f4a5c3cb87d4f4c505905582b4
Author:     Henry Hu <henry.hu.sh@gmail.com>
AuthorDate: 2021-05-10 16:09:14 +0000
Commit:     Neel Chauhan <nc@FreeBSD.org>
CommitDate: 2021-05-10 16:15:48 +0000

    net-im/telegram-desktop: Update to 2.7.4

    PR:     255719

 net-im/telegram-desktop/Makefile                   |  4 +--
 net-im/telegram-desktop/distinfo                   |  6 ++--
 ...ase_platform_linux_base__info__linux.cpp (gone) | 41 ----------------------
 3 files changed, 5 insertions(+), 46 deletions(-)
Comment 9 Charlie Li freebsd_committer freebsd_triage 2021-05-10 20:22:33 UTC
Looks like this requires www/webkit2-gtk3 as a LIB_DEPENDS now. Errored out during configure.
Comment 10 Guido Falsi freebsd_committer freebsd_triage 2021-05-10 20:57:39 UTC
(In reply to Charlie Li from comment #9)

After adding the webkit dependency it errors out later anyway:

/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp:40:6: error: no member named 'gdk_x11_window_get_xid' in the global namespace; did you mean simply 'gdk_x11_window_get_xid'?
                && LOAD_GTK_SYMBOL(gtk, gdk_x11_window_get_xid)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.7.4-full/Telegram/lib_base/base/platform/linux/base_linux_gtk_integration_p.h:23:44: note: expanded from macro 'LOAD_GTK_SYMBOL'
#define LOAD_GTK_SYMBOL(lib, func) (func = ::func)
                                           ^~
/wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.h:35:17: note: 'gdk_x11_window_get_xid' declared here
inline Window (*gdk_x11_window_get_xid)(GdkWindow *window);
                ^

I don't have a suggestion on how to fix this right away.
Comment 11 Guido Falsi freebsd_committer freebsd_triage 2021-05-10 21:07:09 UTC
(In reply to Guido Falsi from comment #10)

Oh, looks like the commit lost adding the file files/patch-0b4100d7 from the patch posted here, which looks closely related.
Comment 12 Charlie Li freebsd_committer freebsd_triage 2021-05-10 21:08:53 UTC
(In reply to Guido Falsi from comment #11)
That's exactly it.

https://github.com/desktop-app/lib_webview/commit/0b4100d7cecc4e748c51f3f51ebfd1392ec3978a
Comment 13 Charlie Li freebsd_committer freebsd_triage 2021-05-10 21:11:25 UTC
Also this new dependency is only needed when GTK option is enabled:

--- net-im/telegram-desktop/Makefile    Mon May 10 15:17:26 2021 -0400
+++ net-im/telegram-desktop/Makefile    Mon May 10 17:10:03 2021 -0400
@@ -80,16 +80,12 @@

 ALSA_LIB_DEPENDS=      libasound.so:audio/alsa-lib
 GTK_CMAKE_BOOL_OFF=    DESKTOP_APP_DISABLE_GTK_INTEGRATION
+GTK_LIB_DEPENDS=       libwebkit2gtk-4.0.so:www/webkit2-gtk3
+GTK_USE=       GNOME=gtk30
 PULSEAUDIO_LIB_DEPENDS=        libpulse.so:audio/pulseaudio

 # Telegram asks each custom build to have its own API ID and hash.
 TELEGRAM_API_HASH=     20a3432aab43f24bb4460fceac5ba38d
 TELEGRAM_API_ID=       601761

-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MGTK}
-USE_GNOME+=    gtk30
-.endif
-
 .include <bsd.port.mk>

Clean up some syntax while here.
Comment 14 Henry Hu 2021-05-12 01:43:55 UTC
(In reply to Charlie Li from comment #13)
I see, sorry for missing this new dependency.
I've enabled GTK option in local poudriere config now.
Has the fix been submitted?
Comment 15 Charlie Li freebsd_committer freebsd_triage 2021-05-12 04:33:47 UTC
(In reply to Henry Hu from comment #14)
Up as review D30224. I put the fixer patches as two files generated using makepatch since I also included the commit after 0b4100d7cecc4e748c51f3f51ebfd1392ec3978a.
Comment 16 commit-hook freebsd_committer freebsd_triage 2021-05-14 03:06:10 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=80762637bb7d34dcc3e8049b869db0908f404b2c

commit 80762637bb7d34dcc3e8049b869db0908f404b2c
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2021-05-12 04:21:02 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2021-05-14 02:48:39 +0000

    net-im/telegram-desktop: fix build with GTK option

    Telegram now includes a WebView feature when GTK is enabled, which
    uses www/webkit2-gtk3.

    While here, fix the following minor items:
    - allow building with Python newer than 3.7
    - devel/dee is not needed for build, remove
    - clean up USES= syntax in the GTK option

    Obtained from:  https://github.com/desktop-app/lib_webview/commit/0b4100d7cecc4e748c51f3f51ebfd1392ec3978a
                    https://github.com/desktop-app/lib_webview/commit/48d70e5258754b2415b07c88f0376212596e09a7
    Approved by:    Henry Hu <henry.hu.sh@gmail.com> (maintainer),
                    arrowd (mentor), fluffy (mentor)
    PR:             255719
    Differential Revision: https://reviews.freebsd.org/D30224

 net-im/telegram-desktop/Makefile                     | 11 +++--------
 ...tform_linux_webview__linux__webkit__gtk.cpp (new) | 20 ++++++++++++++++++++
 ...latform_linux_webview__linux__webkit__gtk.h (new) | 13 +++++++++++++
 3 files changed, 36 insertions(+), 8 deletions(-)
Comment 17 Guido Falsi freebsd_committer freebsd_triage 2021-05-14 09:42:35 UTC
This is still failing for me with GTK enabled:

wrkdirs/usr/ports/net-im/telegram-desktop/work/tdesktop-2.7.4-full/Telegram/lib_webview/webview/platform/linux/webview_linux_webkit_gtk.cpp:41:27: error: no member named 'LoadGtkLibrary' in namespace 'base::Platform::Gtk'
                && base::Platform::Gtk::LoadGtkLibrary(webkit2gtk, "libwebkit2gtk-4.0.so.37")
                   ~~~~~~~~~~~~~~~~~~~~~^



looks like upstream patch https://github.com/desktop-app/lib_webview/commit/48d70e5258754b2415b07c88f0376212596e09a7 is causing issues.

I'm going to back out locally that part and test again.
Comment 18 Guido Falsi freebsd_committer freebsd_triage 2021-05-14 10:07:16 UTC
Created attachment 224926 [details]
patch

This simple patch makes it work fine.
Comment 19 Charlie Li freebsd_committer freebsd_triage 2021-05-14 11:53:10 UTC
Ah, looks like the second commit depended on https://github.com/desktop-app/lib_base/commit/1b949f5ca250a47cd1261dd27fd83c174665f8fb

I'll back out the second commit then.
Comment 20 commit-hook freebsd_committer freebsd_triage 2021-05-14 18:54:53 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ec8a052e5d1c8fb8c9440a879de5735c1e899766

commit ec8a052e5d1c8fb8c9440a879de5735c1e899766
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2021-05-14 18:47:28 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2021-05-14 18:54:29 +0000

    net-im/telegram-desktop: fix build with GTK option (again)

    Remove https://github.com/desktop-app/lib_webview/commit/48d70e5258754b2415b07c88f0376212596e09a7,
    as it depends on function changes from https://github.com/desktop-app/lib_base/commit/1b949f5ca250a47cd1261dd27fd83c174665f8fb

    Reported by:    madpilot
    Fixes:          80762637bb7d net-im/telegram-desktop: fix build with GTK option
    Pointy hat to:  vishwin
    Approved by:    Henry Hu <henry.hu.sh@gmail.com> (maintainer, implicit),
                    arrowd (mentor, implicit), fluffy (mentor, implicit)
    PR:             255719

 ...iew_webview_platform_linux_webview__linux__webkit__gtk.cpp | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)