Bug 253334

Summary: [new port] net-im/tg_owt: webrtc library used by telegram-desktop
Product: Ports & Packages Reporter: Henry Hu <henry.hu.sh>
Component: Individual Port(s)Assignee: Li-Wen Hsu <lwhsu>
Status: Closed FIXED    
Severity: Affects Only Me CC: lwhsu
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 253336    
Attachments:
Description Flags
patch for the new port
none
patch for the new port
none
updated Makefile
none
updated distinfo
none
updated patch with github source only none

Description Henry Hu 2021-02-08 02:32:53 UTC
Created attachment 222255 [details]
patch for the new port

This is a port of https://github.com/desktop-app/tg_owt

net-im/telegram-desktop now uses the tg_owt library from github.com/desktop-app/tg_owt (also created by the same developers).
This library was downloaded and compiled together with telegram-desktop in the previous version. In this version, this library has its own sub-modules. Given its complexity, I think that it would be better to create a separate port for it.

This library is kind of different from other libraries telegram-desktop use. Other libraries are mostly configured as sub-modules of the git repo, and they're included in the -full.tar.gz source tarball. tg_owt is different: telegram-desktop's own build script seems to just grab the latest version and build it.

tg_owt has no release, and no tag. Thus, the port version is using the date. In the future, if it has named releases, we can use that.
Comment 1 Henry Hu 2021-02-08 03:04:45 UTC
I noticed a small problem; please don't commit this for now.
Comment 2 Henry Hu 2021-02-08 04:26:42 UTC
Created attachment 222256 [details]
patch for the new port

Patch updated. Now we use the install mechanism provided by the port, which installs 3k header files. It turns out that these files are needed to build telegram-desktop, so I just add them to pkg-plist.
Comment 4 Li-Wen Hsu freebsd_committer freebsd_triage 2021-02-08 13:48:02 UTC
Created attachment 222264 [details]
updated Makefile
Comment 5 Li-Wen Hsu freebsd_committer freebsd_triage 2021-02-08 13:48:23 UTC
Created attachment 222265 [details]
updated distinfo
Comment 6 Li-Wen Hsu freebsd_committer freebsd_triage 2021-02-08 13:50:39 UTC
There is a small error in Makefile, and the distfiles seem to be rerolled, can you check the updated Makefile and distinfo?

I am worried if the tar file from chromium.googlesource.com will be changed again. Also, I suggest we can name those distfile with more meaningful names, like libyuv-ad89006.tar.gz or put to a subdir named libyuv.
Comment 7 Li-Wen Hsu freebsd_committer freebsd_triage 2021-02-09 15:07:01 UTC
It looks ad89006.tar.gz is rerolled again, we need to have a way to get a deterministic distfile.
Comment 8 Henry Hu 2021-02-10 02:45:59 UTC
(In reply to Li-Wen Hsu from comment #7)
So, any suggestion on how we can deal with this?
I checked the libyuv port (graphics/libyuv), and it mentioned the same problem, and local distfiles were used.
libvpx port seems to be getting it from github (I guess it's a clone/synced repo?).

Should we also roll our own distfiles for these 2 libraries?
The reason the checksum is changing seems to be the file metadata: the file creation/modification time seems to be set to current time, so it changes every time.
Comment 9 Henry Hu 2021-02-10 02:54:58 UTC
One idea is depending on github.
libvpx already has an (official?) mirror at https://github.com/webmproject/libvpx/, and that's what libvpx port uses.
libyuv does not have an official mirror; I can create one. As long as the git hash matches, it should show that the mirror is exactly the same as the original one.
What do you think?
Comment 10 Henry Hu 2021-02-10 03:13:45 UTC
Created attachment 222313 [details]
updated patch with github source only

Now it's using github sources only:
* libvpx from webmproject
* libyuv from my clone

I'll update my clone every time I update this port.
Comment 11 commit-hook freebsd_committer freebsd_triage 2021-02-11 12:31:19 UTC
A commit references this bug:

Author: lwhsu
Date: Thu Feb 11 12:30:59 UTC 2021
New revision: 564937
URL: https://svnweb.freebsd.org/changeset/ports/564937

Log:
  Add net-im/tg_owt, webrtc library used by telegram-desktop

  PR:		253334
  Submitted by:	Henry Hu <henry.hu.sh@gmail.com>

Changes:
  head/net-im/Makefile
  head/net-im/tg_owt/
  head/net-im/tg_owt/Makefile
  head/net-im/tg_owt/distinfo
  head/net-im/tg_owt/files/
  head/net-im/tg_owt/files/patch-CMakeLists.txt
  head/net-im/tg_owt/files/patch-cmake_external.cmake
  head/net-im/tg_owt/files/patch-cmake_libevent.cmake
  head/net-im/tg_owt/files/patch-cmake_libyuv.cmake
  head/net-im/tg_owt/files/patch-src_rtc__base_byte__order.h
  head/net-im/tg_owt/files/patch-src_rtc__base_ip__address.cc
  head/net-im/tg_owt/files/patch-src_rtc__base_physical__socket__server.cc
  head/net-im/tg_owt/files/patch-src_rtc__base_physical__socket__server.h
  head/net-im/tg_owt/files/patch-src_rtc__base_platform__thread__types.cc
  head/net-im/tg_owt/pkg-descr
  head/net-im/tg_owt/pkg-plist