Bug 217019

Summary: [new port] net-im/linux-telegram-desktop: telegram desktop client
Product: Ports & Packages Reporter: Henry Hu <henry.hu.sh>
Component: Individual Port(s)Assignee: Alexey Dokuchaev <danfe>
Status: Closed FIXED    
Severity: Affects Only Me CC: danfe
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
new port shar file
none
poudriere log
none
new port shar file
none
shar for v1.0.14
none
update to 1.0.26
none
update to 1.0.29 none

Description Henry Hu 2017-02-12 05:13:38 UTC
Created attachment 179893 [details]
new port shar file

Telegram desktop client is the official desktop client for Telegram.
This is the Linux 32bit version.

Telegram desktop is actually open sourced. However, to build it, the process is fairly complex. You need to build a customized, patched Qt, some other patched libraries, and then build telegram desktop which links with them statically. Someday I may create a native port for it. At least this Linux version works well for me in the meanwhile.

The license is GPLv3, but I'm not sure if you can distribute it as a package, so RESTRICTED is specified.

linux-c6 is not enough for this port, the glibc version is too low.

Telegram loads libraries dynamically, like alsa, pulse, gtk2, and other ones. This makes it impossible to get the dependencies directly from ldd. This dependency list is obtained by analyzing the loaded libraries with the app running.
Comment 1 Henry Hu 2017-02-12 05:14:19 UTC
Created attachment 179894 [details]
poudriere log
Comment 2 Henry Hu 2017-02-12 05:19:01 UTC
Created attachment 179895 [details]
new port shar file

Forget to remove cpe from USES.
Comment 3 Henry Hu 2017-02-25 22:30:47 UTC
Created attachment 180299 [details]
shar for v1.0.14

Meanwhile, the app has updated to 1.0.14 (after updated to 1.0.13). Port updated.
Comment 4 Henry Hu 2017-03-31 02:36:05 UTC
Created attachment 181336 [details]
update to 1.0.26

Update to 1.0.26
Comment 5 Henry Hu 2017-04-06 15:40:44 UTC
Created attachment 181547 [details]
update to 1.0.29

Okay, telegram updated again. This is for 1.0.29.
Comment 6 Alexey Dokuchaev freebsd_committer freebsd_triage 2017-06-13 05:25:37 UTC
This submission requires a few changes before it can be committed, I'll handle it.
Comment 7 commit-hook freebsd_committer freebsd_triage 2017-06-13 19:16:44 UTC
A commit references this bug:

Author: danfe
Date: Tue Jun 13 19:15:43 UTC 2017
New revision: 443529
URL: https://svnweb.freebsd.org/changeset/ports/443529

Log:
  Linux version of the official desktop client for Telegram, a cloud-based
  messenger with a focus on security and speed.

  WWW: https://desktop.telegram.org/

  PR:		217019 (modified)
  Submitted by:	Henry Hu

Changes:
  head/net-im/Makefile
  head/net-im/linux-telegram-desktop/
  head/net-im/linux-telegram-desktop/Makefile
  head/net-im/linux-telegram-desktop/distinfo
  head/net-im/linux-telegram-desktop/files/
  head/net-im/linux-telegram-desktop/files/telegram-desktop.sh.in
  head/net-im/linux-telegram-desktop/pkg-descr
Comment 8 Alexey Dokuchaev freebsd_committer freebsd_triage 2017-06-13 19:30:24 UTC
Committed as ports r443529 with a number of modifications:

- Updated to version 1.1.7 and mirrored distfile so the port does not get broken when previous version(s) suddenly disappear from the official CDN
- Do not set RESTRICTED: lots of GNU/Linux distributions offer similar package (https://pkgs.org/download/telegram-desktop) so I believe it should be OK
- Provided better COMMENT and more elaborate port description text
- Added DESKTOP_ENTRIES (alas, no icon for the time being)
- Renamed s/tdesktop/telegram-desktop/ to avoid potential clash with some other similarly named software
- Minor whitespace and style nits in the Makefile

P.S.  I was also thinking about porting the native client.  If it does indeed load libraries via dlopen(), it should be possible to write thin swappers over modified Qt components to avoid local rebuild and static linking.  I might get to this one day, but as you say, this Linux version works fine as it is.  Thank you Henry!