[PATCH] gnu: webrtc-for-telegram-desktop: Update to a45d8b8

  • Done
  • quality assurance status badge
Details
4 participants
  • Distopico
  • Hilton Chain
  • Raghav Gururajan
  • Saku Laesvuori
Owner
unassigned
Submitted by
Distopico
Severity
normal
D
D
Distopico wrote on 20 Jul 2023 19:18
(address . guix-patches@gnu.org)(name . Distopico)(address . distopico@riseup.net)
20230720171841.31901-1-distopico@riseup.net
Fixes telegram-desktop call not working with openSSL 3


* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
---
gnu/packages/telegram.scm | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)

Toggle diff (81 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index aa01c2f692..aeab249198 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,6 +97,21 @@ (define libyuv-for-telegram-desktop
(base32
"0mm56p8iapfild2xdw4w8zi35c3xm06fgagiali644gnxdmnym6c")))))
+(define libsrtp-for-telegram-desktop
+ (let ((commit "a566a9cfcd619e8327784aa7cff4a1276dc1e895")
+ (revision "1494"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cisco/libsrtp")
+ (commit commit)))
+ (file-name (git-file-name
+ "libsrtp-for-telegram-desktop"
+ (git-version "0" revision commit)))
+ (sha256
+ (base32
+ "1ichw2v9s2mggi5p2wbbmlg55q4r48dxi3ks7ykfcfkmh7pb1w1s")))))
+
(define cmake-helpers-for-telegram-desktop
(origin
(method git-fetch)
@@ -265,8 +281,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "a45d8b8f0a99bd0e5118dda1dc4a8b7b3ad5dcfd")
+ (revision "388"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -282,14 +298,14 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "1qs3ikkd6l56brj40cv6wlhx5gj5avisj9mj8ypjfwcyw9hb2n5y"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise" "libsrtp_config"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -311,9 +327,12 @@ (define-public webrtc-for-telegram-desktop
(add-after 'unpack 'unpack-additional-sources
(lambda _
(let* ((third-party (string-append (getcwd) "/src/third_party"))
- (libyuv-to (string-append third-party "/libyuv")))
+ (libyuv-to (string-append third-party "/libyuv"))
+ (libsrtp-to (string-append third-party "/libsrtp")))
(copy-recursively #$libyuv-for-telegram-desktop
- libyuv-to)))))))
+ libyuv-to)
+ (copy-recursively #$libsrtp-for-telegram-desktop
+ libsrtp-to)))))))
(native-inputs (list pkg-config python-wrapper yasm))
(inputs
(list abseil-cpp-cxxstd17

base-commit: 13cb9b302868b5a966a6ae177412c474084f4bf1
--
2.41.0
S
S
Saku Laesvuori wrote on 20 Jul 2023 21:33
(name . Distopico)(address . distopico@riseup.net)
20230720193353.gb75xe2ywl6nfvnr@X-kone
Toggle quote (6 lines)
> Fixes telegram-desktop call not working with openSSL 3
>
> see: https://github.com/telegramdesktop/tdesktop/issues/26108
>
> * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit

You should probably mention adding `libsrtp-for-telegram-desktop` in the
ChangeLog.

Toggle quote (20 lines)
> @@ -96,6 +97,21 @@ (define libyuv-for-telegram-desktop
> (base32
> "0mm56p8iapfild2xdw4w8zi35c3xm06fgagiali644gnxdmnym6c")))))
>
> +(define libsrtp-for-telegram-desktop
> + (let ((commit "a566a9cfcd619e8327784aa7cff4a1276dc1e895")
> + (revision "1494"))
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/cisco/libsrtp")
> + (commit commit)))
> + (file-name (git-file-name
> + "libsrtp-for-telegram-desktop"
> + (git-version "0" revision commit)))
> + (sha256
> + (base32
> + "1ichw2v9s2mggi5p2wbbmlg55q4r48dxi3ks7ykfcfkmh7pb1w1s")))))
> +

Have you tried using the libsrtp version packaged in Guix as an input to
`webrtc-for-telegram-desktop` instead of bundling it? If that doesn't
work, have you tried packaging libsrtp 2.5.0 and using it as an input?
It would probably be relatively easy with record inheriting.

I'm quite new to Guix (and couldn't push changes even if they were
perfect) so someone else might have more comments on this.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmS5jCEACgkQJX0oSiod
OjJOdBAAuF1bGiO/QoSdEuO3wK5h27JeyNachG3AwI32DkYmKEmlNrrREgMznFD1
90zSFUXbd+pJiDY3OmCAts2NLS4+VJm3dmloPUzP6Ce3FjbygMuPySsalbpx8Skq
9PQAOagOSXV0d8smOH6sfIMRDXFaGPBa8LuMa5YwMyMbbeuURAHEJlcRvMbYDQHL
NK/r17rx95MtXFAl57mgVBoIaJz3p4Vki7jCMrniFuW3slVnHHtVR5MYGsD+SNIS
RNlQLv7MsNwhFxPXR9pyy8129Yed6mPgS1KT89GtQUGUnIvBwEjhVMb3j6Bnm2x3
egaPMb4ZAOl5FBMUKbvDuWxe5JiDWKHV/1HvDEyBX3rpsxBmV/NwrR/GN+3WTMOT
Qn25PkJBDMhbP7P1LV7denmsCDye1KTXcRWD0SUMifTXanI8QhXMqIcriAhZBgoN
+v68PgSoUENmMNLcRa91sLeyOz47GogtGQgHayWtZTa4KLcetDbfm8WfYe1CufEp
7C4D51NHxAFsFKzat/YKUoAkw7VtAuTRfygE3+wOuYcmi6OX4vk2uyCcRtml3sl5
2jvDHXbyfrRNXrwO/F46PpUWPilgygXM68pDRJGxo3bNTglMKd35RYygdW+MJUcM
4YfnfEVOTOQezpaNHYkTwGKXN+E+74LYYRXuLtAkSSmysvxAJ7s=
=CVid
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 20 Jul 2023 22:21
(name . Saku Laesvuori)(address . saku@laesvuori.fi)
87a5vq9vr7.fsf@riseup.net
On 2023-07-20, Saku Laesvuori <saku@laesvuori.fi> wrote:

Toggle quote (4 lines)
>
> You should probably mention adding `libsrtp-for-telegram-desktop` in the
> ChangeLog.

Looks like it's not longer necessary, Changelog is auto-generated, that
said in the main Changelog

Toggle quote (10 lines)
>
> Have you tried using the libsrtp version packaged in Guix as an input to
> `webrtc-for-telegram-desktop` instead of bundling it? If that doesn't
> work, have you tried packaging libsrtp 2.5.0 and using it as an input?
> It would probably be relatively easy with record inheriting.
>
> I'm quite new to Guix (and couldn't push changes even if they were
> perfect) so someone else might have more comments on this.
>

I tried but it require source code inside libsrtp folder, for example
'/crypto/cipher/cipher.c', also libsrtp package is the compiled version
and webrtc-.. require source code from libsrtp.
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEEvYwofabWO6y953lVmAk6gHJUa/MFAmS5l/wVHGRpc3RvcGlj
b0ByaXNldXAubmV0AAoJEJgJOoByVGvzF4MH+gIXal19cwmlA2Tg/XVtvuONAFFS
pJQaGMrVOBbiIrsnSYDaj7s/A6RIgA+Vlc/0ZjC0V2LUGgvaQaXDZhtNtI9OqG7H
eVH5j5HrtXurOVKR++D3ViAE70jLxnjqgNKYXsPzig+5imANJwshm8YKfdX6TTQg
6s3ql40/4hWI4kwxX5Af84w4eSYDr/h1IDM84mY+tQk3uaSHhwXDOqOHLIeAXN4U
4lzvY5RuYshfvyO7LI5uKvXEn9jNWzcg8eDxngsjjymdIoJvBsrhcpw7L0crrLCW
3TuU6TOyvUNjC/dNeYjZy9EZ8uFtJhdlzYE7RVLQFi5dE70wvYgC/8OTa2Y=
=nQ2R
-----END PGP SIGNATURE-----

S
S
Saku Laesvuori wrote on 20 Jul 2023 23:06
(name . Distopico)(address . distopico@riseup.net)
20230720210600.2zwjtcdnoa63rmo4@X-kone
Toggle quote (6 lines)
> > You should probably mention adding `libsrtp-for-telegram-desktop` in the
> > ChangeLog.
>
> Looks like it's not longer necessary, Changelog is auto-generated, that
> said in the main Changelog

I mean the commit message. Now your commit message's ChangeLog only
mentions updating webrtc-for-telegram-desktop. See my last telegram
commit 6192acf8b77 for an example of what I'm talking about.

I would assume the ChangeLog file is autogenerated based on the commit
messages.

Toggle quote (12 lines)
> > Have you tried using the libsrtp version packaged in Guix as an input to
> > `webrtc-for-telegram-desktop` instead of bundling it? If that doesn't
> > work, have you tried packaging libsrtp 2.5.0 and using it as an input?
> > It would probably be relatively easy with record inheriting.
> >
> > I'm quite new to Guix (and couldn't push changes even if they were
> > perfect) so someone else might have more comments on this.
>
> I tried but it require source code inside libsrtp folder, for example
> '/crypto/cipher/cipher.c', also libsrtp package is the compiled version
> and webrtc-.. require source code from libsrtp.

You would probably have to patch the `CMakeLists.txt` so it doesn't try
to build libsrtp from source, see what I did with crc32c in the
mentioned commit for reference. It is quite possible that telegram
doesn't actually need the source code and they are simply using a git
submodule to simplify their own dependency versioning and development.

You might also have to add a new libsrtp version because the one
packaged in Guix is not configured to use openssl unlike telegram
expects. I'd still try the packaged version first if compiling telegram
a few more times isn't a big problem for you.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmS5obgACgkQJX0oSiod
OjLtYhAAkwEa3lmWT7nOp+QuXf6nbvZ4m2FRmv5/9zIjcsPDyidA2LC3H1dLsz1l
ICdPDx/ZwhP0HBwiorCl31om8gMXLlD7nSgp4I+5swsoRuOGnYZ9FabTNrnxZkHT
CAR02LI+QtjOr1Cwu1nmfhcEQJt31voLFVkJMXXDobaDMs35tFccCAunbh5ExVgI
JUjuufX1JzKytDLxMpT5szLwKf5OGDz7oqbCimZALyb7aX/UYkyNQqoGvOJwA5wP
QUx275hrYNKmpGmxV9tcTf9jM6gcPoVi2v7yLKUTgp2RRu/b9wqQ8pjW5Xc1ECd8
L/juoJf30RDvpHWd/ff+gacfvu723AV6tJBSTLbtAdTXLDnTBGCXoMBx0nFiZwGE
MuVBssEhJnWZSXtcJz/hyQK75FjQD8Nr5BpZ4/F3Slj72i+5L4qgFQL62c4w9It1
saJJEXxkHAX6bK/gG1A+nLup4wTeVOfojLCZn5LL+AEdXvbTFNL1UF3ocqNNrHNr
q91N8z8hyDgE6DpVCqJ1ZHJjJtU1dPdJz+odBi8eMZQL46tZ6RqMm3XFCG2IMdWe
OoJ/59Lp5Dj8oWsVRjdsHDYkxihva+rbttnnLvONj8kODm8f+ZXSmBQmXIeai0g1
9uT7CmL7y6EIKzm6XM2A7zrJqM/VTzmXvhKP8pJLgDKIW0FZyJM=
=Kg9Y
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 21 Jul 2023 01:09
(name . Saku Laesvuori)(address . saku@laesvuori.fi)
87zg3q897e.fsf@riseup.net
On 2023-07-21, Saku Laesvuori <saku@laesvuori.fi> wrote:

Toggle quote (8 lines)
>
> I mean the commit message. Now your commit message's ChangeLog only
> mentions updating webrtc-for-telegram-desktop. See my last telegram
> commit 6192acf8b77 for an example of what I'm talking about.
>
> I would assume the ChangeLog file is autogenerated based on the commit
> messages.
>
Make sense, I'll update the patch to add more description

Toggle quote (12 lines)
>
> You would probably have to patch the `CMakeLists.txt` so it doesn't try
> to build libsrtp from source, see what I did with crc32c in the
> mentioned commit for reference. It is quite possible that telegram
> doesn't actually need the source code and they are simply using a git
> submodule to simplify their own dependency versioning and development.
>
> You might also have to add a new libsrtp version because the one
> packaged in Guix is not configured to use openssl unlike telegram
> expects. I'd still try the packaged version first if compiling telegram
> a few more times isn't a big problem for you.
>
I tried but didn't work, this change is similar to **libyuv**, that have
reference to the source code of that external library: example

So the case of **libsrtp** is similar, check for example:

So change that will require patch several files, not just
`CMakeLists.txt`, patch all those file will be make this package hard to
maintain.

but you can try if you want and let me know if works.
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEEvYwofabWO6y953lVmAk6gHJUa/MFAmS5wGUVHGRpc3RvcGlj
b0ByaXNldXAubmV0AAoJEJgJOoByVGvzATMH/2XU0ss7XBJATPE++FkVvYL3TQe1
6mxgnTGh5uHF9PbmG4T/J5fN2R54y8ub/riyKDwAtKnxWCT13X51rWphn4Y6y1r7
03IVzVov1NzvzFh8UMtTUOp2dXcv0gSMs+9EAbLPibTauy2vVwCivso5jBmMR0g3
kVi9C0xY/yFfb5yNyQ/d7Q5Fdrsvh2VOa49np/+MmsjpAVc7ANECsjNYOzeJqSix
2en9IIKJUcpKH7fAlanZN6SBq2rG/QQqm4BptkHkqqdFdS6SeRyPgVBXUTHtdr2S
IbsrGD5TiBzkel/5ohRwjq701klEEidB7wSgbs6RQwAQYQbgkbU6uLaPR7Q=
=Bi9D
-----END PGP SIGNATURE-----

D
D
Distopico wrote on 21 Jul 2023 01:26
[PATCH v2] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(address . 64748@debbugs.gnu.org)(name . Distopico)(address . distopico@riseup.net)
20230720232843.17471-1-distopico@riseup.net
Fixes telegram-desktop call not working with openSSL 3

Add libsrtp-for-telegram-desktop because webrtc (tg_owt) now use `libsrtp` as
submodule and in the code use code source directly from the submodule.


* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
* gnu/packages/telegram.scm (libsrtp-for-telegram-desktop): Add libsrtp a566a9 revision commit
---
Add more context about the change in the commit message

gnu/packages/telegram.scm | 31 +++++++++++++++++++++++++------
1 file changed, 25 insertions(+), 6 deletions(-)

Toggle diff (81 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index aa01c2f692..aeab249198 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -96,6 +97,21 @@ (define libyuv-for-telegram-desktop
(base32
"0mm56p8iapfild2xdw4w8zi35c3xm06fgagiali644gnxdmnym6c")))))
+(define libsrtp-for-telegram-desktop
+ (let ((commit "a566a9cfcd619e8327784aa7cff4a1276dc1e895")
+ (revision "1494"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/cisco/libsrtp")
+ (commit commit)))
+ (file-name (git-file-name
+ "libsrtp-for-telegram-desktop"
+ (git-version "0" revision commit)))
+ (sha256
+ (base32
+ "1ichw2v9s2mggi5p2wbbmlg55q4r48dxi3ks7ykfcfkmh7pb1w1s")))))
+
(define cmake-helpers-for-telegram-desktop
(origin
(method git-fetch)
@@ -265,8 +281,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "a45d8b8f0a99bd0e5118dda1dc4a8b7b3ad5dcfd")
+ (revision "388"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -282,14 +298,14 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "1qs3ikkd6l56brj40cv6wlhx5gj5avisj9mj8ypjfwcyw9hb2n5y"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise" "libsrtp_config"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -311,9 +327,12 @@ (define-public webrtc-for-telegram-desktop
(add-after 'unpack 'unpack-additional-sources
(lambda _
(let* ((third-party (string-append (getcwd) "/src/third_party"))
- (libyuv-to (string-append third-party "/libyuv")))
+ (libyuv-to (string-append third-party "/libyuv"))
+ (libsrtp-to (string-append third-party "/libsrtp")))
(copy-recursively #$libyuv-for-telegram-desktop
- libyuv-to)))))))
+ libyuv-to)
+ (copy-recursively #$libsrtp-for-telegram-desktop
+ libsrtp-to)))))))
(native-inputs (list pkg-config python-wrapper yasm))
(inputs
(list abseil-cpp-cxxstd17

base-commit: 13cb9b302868b5a966a6ae177412c474084f4bf1
--
2.41.0
S
S
Saku Laesvuori wrote on 21 Jul 2023 09:22
Re: [bug#64748] [PATCH] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(name . Distopico)(address . distopico@riseup.net)
20230721072242.eso6juxdbhpdkgex@X-kone
Toggle quote (24 lines)
> > You would probably have to patch the `CMakeLists.txt` so it doesn't try
> > to build libsrtp from source, see what I did with crc32c in the
> > mentioned commit for reference. It is quite possible that telegram
> > doesn't actually need the source code and they are simply using a git
> > submodule to simplify their own dependency versioning and development.
> >
> > You might also have to add a new libsrtp version because the one
> > packaged in Guix is not configured to use openssl unlike telegram
> > expects. I'd still try the packaged version first if compiling telegram
> > a few more times isn't a big problem for you.
>
> I tried but didn't work, this change is similar to **libyuv**, that have
> reference to the source code of that external library: example
> https://github.com/desktop-app/tg_owt/blob/83-sdk/src/api/video/i010_buffer.cc#L17
>
> So the case of **libsrtp** is similar, check for example:
> - https://github.com/desktop-app/tg_owt/blob/master/src/pc/srtp_session_unittest.cc#L25
> - https://github.com/desktop-app/tg_owt/blob/master/src/pc/external_hmac.cc#L18
> - https://github.com/desktop-app/tg_owt/blob/master/src/pc/BUILD.gn#L174
>
> So change that will require patch several files, not just
> `CMakeLists.txt`, patch all those file will be make this package hard to
> maintain.

I see. I think libsrtp is small enough that unbundling it is not worth
the effort of patching all those files.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmS6MkIACgkQJX0oSiod
OjIGjQ/+KjHeivW0+qMqq9ETAM+lD0KreJhD3Yo/x3v4iGlnIeHX7v5KZtNz8PpP
T4rr9BfOpaK3LeUCfK/PFg8cfT5uUC4BZW0JiIe0pLXSpRjAUJkF/oIdJ513qVnw
8oENZi6HdjgcqAjmtuzw3JCGpHrk5gn0DL44b3fQ8ET3XzhBBle+Ofa0rUColC+V
8cKV9n4ur+zdDLGtwFwp2zKj3MnOiSOhE9fkIY89xLz4uB4lvOQp9e5Vdi/vIMPL
gxvZlIy1k82uwdwQQYlSjC6M+0tDDMqubEKuF/3Bltu52yll2d8dpwIe/jTOYbs1
gLrWMhoogw1Q+ErfxnKKSUppzK5NdyV+Bah1mG8n9Grb3ESUiM0kJXzGoFac7puM
shmV/VLiPDtbHQJZliGogQJpSkoWdrHdG6Ay3kFK0zlUBrndJ+sNr+LVY4RkbfWe
lmb5O/0FU3C8lv6P9kJgVjXIG2/w4tz2tK0XPoDy7aTxz02aBXM0xrLZceCDkvFc
uUj0gTvDWmqah90Qrj5j3vRHZsHbxiyV3NSCZ1yaS6ax3/yhB3vcHJmBxw+sjGT3
pKTZ09eDdCZvywa058gyyXETWbGthijhquFEJ6RZkyQ54gsnmCO1rbR1Kn/ik4O3
cGCa+ffThBVZVAc8MiqzAFEKmUL9TMOP/3EmgMQzrEpNDPvvb+A=
=nkoj
-----END PGP SIGNATURE-----


R
R
Raghav Gururajan wrote on 22 Jul 2023 08:36
ebaae3f6-d564-cb09-b1fe-da69e5faee59@raghavgururajan.name
If libsrtp in Guix uses something other than openssl by default, then we
could create a package-definition "libsrtp-openssl" which inherits from
"libsrtp" and build-flagged to use openssl. We can then use that for
telegram desktop.
Thoughts?
Regards,
RG.
Attachment: OpenPGP_signature
S
S
Saku Laesvuori wrote on 22 Jul 2023 10:25
(name . Raghav Gururajan)(address . rg@raghavgururajan.name)
20230722082516.yh5nwyfllmwzgjqu@X-kone
Toggle quote (5 lines)
> If libsrtp in Guix uses something other than openssl by default, then we
> could create a package-definition "libsrtp-openssl" which inherits from
> "libsrtp" and build-flagged to use openssl. We can then use that for
> telegram desktop.

Yes, but we would still need to patch webrtc-for-telegram-desktop as the
code currently refers to headers in the submodule directory. Now that I
think of it, it could actually be relatively easy with a regex substitution
(something like s!^#include "third_party/(srtp/[^"]*)"$!#include <\1>!)
on every file. That's of course assuming that the code only refers to
headers in the submodule.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmS7kmwACgkQJX0oSiod
OjLvkQ/+Lu3GLUjC7CQJJ0sti5NmmMDOcqxi6bWRKPkANwNxnvNXw9hKDTRp9beJ
3FWWwDZFrlwN1SDOCBnju5eouf7BnxaOHXPTSGUpZHkhFfz9pb6GyuvVFmIOC90g
++8UY8/Jt9PmNSZShRrBBXW7QvgZ1ZV41ySWFu569ZOdpW446b1kMXvBQX3BOBvT
FqxiZp91gPpCKyAWtNmKXChqJtV7LqdfF5mRNLdVIhp/8Rzvje7Php3JKydLE2cj
6bQqLa7MJEbAg3GaLUv6Uq8ZVsOpv/pcLodNES88U8qX/CP/ZbE4vpl/KDMbe2Yi
S+X1t0CW/xc1WC/I6Q3SopWg4bXZi7EtAPvmF8Taj45sCrx+Tppf9C/4w/W7KkDr
iFbkljhdK/xPHmMASPLBOeXYWU6JSH87rB6l9nMs1bDNjHGiXun1JwTcU5X4eGQf
7RTUtNzGLAHu8YlK0EJEZAOHuDufm2io0j3xKKV++TWeHUCmO7LmyOQ6P6fy6AOH
EMTuDyYNQb0fv5u/tyarbHeXyEl9etffTURE7FYBwwP4hABbdlTVBAVVImueJtJ5
5xBfcbteGFQWDdC7tND2Mh4GIwWSYr+yb8bNQ8nz+Whv4hEWmbS6FI7buW6FEcaW
NWb5X8/+oAW3f4V309oH/8x9bD4/Dot+Yq1dTfcVEYR2q7kboHA=
=ji6d
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 24 Jul 2023 19:07
(name . Saku Laesvuori)(address . saku@laesvuori.fi)
87h6ptnsb3.fsf@riseup.net
I just tested trying to replace all the libsrtp but not luck from side,
they use for example:
- third_party/libsrtp/crypto/include/crypto_types.h
- third_party/libsrtp/include/srtp.h

not exposed by "libsrtp" package, also they use a custom configuration
for that library

Also there is many other references to `libsrtp` .C source code

I was checking nix implementation and they just use the submodules
and not "srtp" package.

So I think the patch that i sent is a good solution, similar to the nix
one, but if someone else want to try another option would be great.


On 2023-07-22, Saku Laesvuori <saku@laesvuori.fi> wrote:

Toggle quote (14 lines)
> [[PGP Signed Part:Undecided]]
>> If libsrtp in Guix uses something other than openssl by default, then we
>> could create a package-definition "libsrtp-openssl" which inherits from
>> "libsrtp" and build-flagged to use openssl. We can then use that for
>> telegram desktop.
>
> Yes, but we would still need to patch webrtc-for-telegram-desktop as the
> code currently refers to headers in the submodule directory. Now that I
> think of it, it could actually be relatively easy with a regex substitution
> (something like s!^#include "third_party/(srtp/[^"]*)"$!#include <\1>!)
> on every file. That's of course assuming that the code only refers to
> headers in the submodule.
>
> [[End of PGP Signed Part]]
R
R
Raghav Gururajan wrote on 24 Jul 2023 22:17
f0d06f84-4eac-cde3-dbd3-bcf823fda389@raghavgururajan.name
Hello,
Toggle quote (11 lines)
> I just tested trying to replace all the libsrtp but not luck from side,
> they use for example:
> - third_party/libsrtp/crypto/include/crypto_types.h
> - third_party/libsrtp/include/srtp.h
>
>> Yes, but we would still need to patch webrtc-for-telegram-desktop as the
>> code currently refers to headers in the submodule directory. Now that I
>> think of it, it could actually be relatively easy with a regex substitution
>> (something like s!^#include "third_party/(srtp/[^"]*)"$!#include <\1>!)
>> on every file. That's of course assuming that the code only refers to
>> headers in the submodule.
I was wondering if we could add new phase after unpack that copies
contents from libsrtp package to `[build-dir]/third_party/libsrtp`.
Regards,
RG.
Attachment: OpenPGP_signature
S
S
Saku Laesvuori wrote on 26 Jul 2023 09:24
(name . Raghav Gururajan)(address . rg@raghavgururajan.name)
20230726072458.izqje3vvldxutste@X-kone
Toggle quote (3 lines)
> I was wondering if we could add new phase after unpack that copies
> contents from libsrtp package to `[build-dir]/third_party/libsrtp`.

Simply replacing #$libsrtp-for-telegram-desktop with #$(package-source
libsrtp) in the unpack-additional-sources phase seems to work (builds fine and
telegram doesn't crash; I haven't tried calls).
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmTAykoACgkQJX0oSiod
OjJKQw/+ImQcJm+p/haJ7MdA/0Je/Ryj5BbDP009PcRdOLc+sFMzSg/fkJM7zxNC
zXj09nyX4jedt6eTMaSXc49YOh+f7GsncFr7YxXnYOpg8RPsnrYX37RQ+mNSKzQd
pZQDKFWR4bKSvX9KTuttPvw/hRqTXG3h2t13fAVBjOgnGDhyCrjgjGh9L8Bi8mY2
eftRDViu1ZRP2Kk++vWfsTR1Rs9m1Jh5O9HhqG6aqMYFEyMHgqViD+I1RsoOWG6z
gPFWJnVnuJMcmejF8qTuhZGW98uGhHAtWBKQxwqqqfq3m4QDtcuvpSByl7wj6A9e
soaJfqItnHL5UDSoSMRhLiQP36s9hjEm/iBxVgp89Nfsc5jfVQs8GEgzj4YRx3C2
X9B+Ow0sw5Z0G4kEYvAK+kjBv/wXmlFoOZ3Zkh4q9LqVTApGddGclyQu2Bk4WiU9
I1ZuHPgnP4wcffx9p3XbCEWPbOWu7uDRb3CudGUpjqsah63yl0PchkwAk5Zy3RsZ
UZrlWMQcRK0xkxIIiojtHYSJ+kmkV/AQ2Lih0YHM6PZUVjV4RxgOvrRonIH/tTWy
G2zQUDjOPZhsZ8zhZu75ov7TWGeERQy21Z0854ClUvXocAaCwy12nEKXow71ZFA1
OxYkiorxrTaS6U1qnbYJApbfJLWRkeucklYRWVeLwq/HQfZIVkY=
=KaIb
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 26 Jul 2023 20:54
(name . Saku Laesvuori)(address . saku@laesvuori.fi)
87edku33m3.fsf@riseup.net
Tested with calls and works fine, changes in the last path

On 2023-07-26, Saku Laesvuori <saku@laesvuori.fi> wrote:

Toggle quote (9 lines)
> [[PGP Signed Part:Undecided]]
>> I was wondering if we could add new phase after unpack that copies
>> contents from libsrtp package to `[build-dir]/third_party/libsrtp`.
>
> Simply replacing #$libsrtp-for-telegram-desktop with #$(package-source
> libsrtp) in the unpack-additional-sources phase seems to work (builds fine and
> telegram doesn't crash; I haven't tried calls).
>
> [[End of PGP Signed Part]]
D
D
Distopico wrote on 26 Jul 2023 20:54
[PATCH v3] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(address . 64748@debbugs.gnu.org)
20230726185551.1911-1-distopico@riseup.net
Fixes telegram-desktop call not working with openSSL 3 ,
Use sources from `libsrtp` instead of the submodule.

gnu: libsrtp: Update to 2.5.0.


* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
* gnu/packages/telephony.scm (libsrtp): Update to 2.5.0.
---
use sources from existing `libsrtp` package,
update it to the last version

gnu/packages/telegram.scm | 17 +++++++++++------
gnu/packages/telephony.scm | 4 ++--
2 files changed, 13 insertions(+), 8 deletions(-)

Toggle diff (80 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index aa01c2f692..0b32b49d14 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -265,8 +266,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "a45d8b8f0a99bd0e5118dda1dc4a8b7b3ad5dcfd")
+ (revision "388"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -282,14 +283,14 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "1qs3ikkd6l56brj40cv6wlhx5gj5avisj9mj8ypjfwcyw9hb2n5y"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise" "libsrtp_config"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -311,9 +312,13 @@ (define-public webrtc-for-telegram-desktop
(add-after 'unpack 'unpack-additional-sources
(lambda _
(let* ((third-party (string-append (getcwd) "/src/third_party"))
- (libyuv-to (string-append third-party "/libyuv")))
+ (libyuv-to (string-append third-party "/libyuv"))
+ (libsrtp-to (string-append third-party "/libsrtp")))
(copy-recursively #$libyuv-for-telegram-desktop
- libyuv-to)))))))
+ libyuv-to)
+ (copy-recursively #$(package-source
+ libsrtp)
+ libsrtp-to)))))))
(native-inputs (list pkg-config python-wrapper yasm))
(inputs
(list abseil-cpp-cxxstd17
diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
index aa65c4eaad..dc0adc7334 100644
--- a/gnu/packages/telephony.scm
+++ b/gnu/packages/telephony.scm
@@ -456,7 +456,7 @@ (define-public sipwitch
(define-public libsrtp
(package
(name "libsrtp")
- (version "2.4.2")
+ (version "2.5.0")
(source (origin
(method git-fetch)
(uri (git-reference
@@ -465,7 +465,7 @@ (define-public libsrtp
(file-name (git-file-name name version))
(sha256
(base32
- "1gswpjm4jacfxmgglbf8hxi3yzsag4drk4q943p0wkmv21zj8l78"))))
+ "1ichw2v9s2mggi5p2wbbmlg55q4r48dxi3ks7ykfcfkmh7pb1w1s"))))
(native-inputs
(list psmisc ;some tests require 'killall'
procps))
--
2.41.0
S
S
Saku Laesvuori wrote on 26 Jul 2023 21:13
(name . Distopico)(address . distopico@riseup.net)
20230726191307.6urneppnevvaljad@X-kone
Toggle quote (11 lines)
> diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
> index aa65c4eaad..dc0adc7334 100644
> --- a/gnu/packages/telephony.scm
> +++ b/gnu/packages/telephony.scm
> @@ -456,7 +456,7 @@ (define-public sipwitch
> (define-public libsrtp
> (package
> (name "libsrtp")
> - (version "2.4.2")
> + (version "2.5.0")

This should be split to a separate commit (one package per commit).

Also, according to `guix refresh --list-dependent libsrtp` libsrtp has
739 (>300) dependent packages and should thus not be updated on master to avoid
a drop in substitute availability. Have you checked if the calls work
with libsrtp 2.4.2 so that the telegram update could be applied to
master without updating libsrtp?
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmTBcEMACgkQJX0oSiod
OjKzaRAAvebdCDaE2oMC+zZtemgt6IFGszEGKmK8fzQXHrPmbE4aa4+ZWgliJ8jc
ZFNL/Tfz35R6Wn7u8Xx+f1eHlXg6Qd1BCAWRuD/NN0fBT/cVgLw6xMWUgk1PZgxC
6j0VqrPkf89iUSUatsPfu9LvbKM13iTwz5g0DvzxVDOdl3zTdL3D3wd3k0cWYLWf
99m/M6rMJy4ME9lHUfmjJ+ahbaA6qSAw+pAJOJKab9WJ2WYMNrxidsZ7Z2nF1nib
K9VnfakzK+rpH2niDHjnhWyzwOb1M8MZRKn6wC1XfTSQOOVLoKPxhM14VU/7djbL
qY8/by44K3UVcpbMeGA+VicyB5N5FcLIE/yYBGDzC9pHp6pq44CkOpYsU6gyf31p
MG63K3n62x0986/kA+4PWocou76bWz9jKJDafF1xeG+1OFyUDlth75KTgRShMADS
aeCaE9/+yWf6kx71anZoV1aIADAlsX8xVNGZME7HPlwKj2cvRj9nyWU8wI4AT8OI
Tm0qnF/m7V0kQSeBrR+6LFCywUxrZ79oBYMZr/6SRmNuvuSarXlKp6ud2h+X91aP
KUliVWY7acAQfbiTRGsovc5+07yBMv1xKEufxZJH/hNqpGFLLzJGdN+p/l7gtw8H
k43C6lIvU4hVvY7G9yHMK/E4W+hX+CRqBGuRnivZ+CTuw2llvtU=
=M1MZ
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 26 Jul 2023 21:21
[PATCH v4] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(address . 64748@debbugs.gnu.org)
20230726192211.20232-1-distopico@riseup.net
Fixes telegram-desktop call not working with openSSL 3 ,
Use sources from `libsrtp` instead of the submodule.


* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
---
gnu/packages/telegram.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

Toggle diff (58 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index aa01c2f692..0b32b49d14 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -265,8 +266,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "a45d8b8f0a99bd0e5118dda1dc4a8b7b3ad5dcfd")
+ (revision "388"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -282,14 +283,14 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "1qs3ikkd6l56brj40cv6wlhx5gj5avisj9mj8ypjfwcyw9hb2n5y"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise" "libsrtp_config"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -311,9 +312,13 @@ (define-public webrtc-for-telegram-desktop
(add-after 'unpack 'unpack-additional-sources
(lambda _
(let* ((third-party (string-append (getcwd) "/src/third_party"))
- (libyuv-to (string-append third-party "/libyuv")))
+ (libyuv-to (string-append third-party "/libyuv"))
+ (libsrtp-to (string-append third-party "/libsrtp")))
(copy-recursively #$libyuv-for-telegram-desktop
- libyuv-to)))))))
+ libyuv-to)
+ (copy-recursively #$(package-source
+ libsrtp)
+ libsrtp-to)))))))
(native-inputs (list pkg-config python-wrapper yasm))
(inputs
(list abseil-cpp-cxxstd17
--
2.41.0
D
D
Distopico wrote on 26 Jul 2023 21:22
Re: [bug#64748] [PATCH v3] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(name . Saku Laesvuori)(address . saku@laesvuori.fi)
87a5vi32ax.fsf@riseup.net
actually I tested first with 2.4.2 and it works fine from my side.

On 2023-07-26, Saku Laesvuori <saku@laesvuori.fi> wrote:

Toggle quote (21 lines)
> [[PGP Signed Part:Undecided]]
>> diff --git a/gnu/packages/telephony.scm b/gnu/packages/telephony.scm
>> index aa65c4eaad..dc0adc7334 100644
>> --- a/gnu/packages/telephony.scm
>> +++ b/gnu/packages/telephony.scm
>> @@ -456,7 +456,7 @@ (define-public sipwitch
>> (define-public libsrtp
>> (package
>> (name "libsrtp")
>> - (version "2.4.2")
>> + (version "2.5.0")
>
> This should be split to a separate commit (one package per commit).
>
> Also, according to `guix refresh --list-dependent libsrtp` libsrtp has
> 739 (>300) dependent packages and should thus not be updated on master to avoid
> a drop in substitute availability. Have you checked if the calls work
> with libsrtp 2.4.2 so that the telegram update could be applied to
> master without updating libsrtp?
>
> [[End of PGP Signed Part]]
S
S
Saku Laesvuori wrote on 26 Jul 2023 22:09
Re: [bug#64748] [PATCH v4] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(name . Distopico)(address . distopico@riseup.net)
20230726200916.rwmqmutv7ig5wmbp@X-kone
Toggle quote (8 lines)
> Fixes telegram-desktop call not working with openSSL 3 ,
> Use sources from `libsrtp` instead of the submodule.
>
> see: https://github.com/telegramdesktop/tdesktop/issues/26108
>
> * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
> ---

I wonder if this ChangeLog should mention something about adding libsrtp
sources to the unpack-additional-sources phase. Otherwise it looks good
to me and is just waiting for someone with more experience/commit
access.
-----BEGIN PGP SIGNATURE-----

iQIzBAABCAAdFiEEoMkZR3NPB29fCOn/JX0oSiodOjIFAmTBfWwACgkQJX0oSiod
OjLHyQ/+LwjTf5ftuv6SNxy7E5cU6Opo+DdyLuU9fL16vTR4KWMHRelWKUOf9RSq
qn7VWgL0+pptf+Iupd/jBhvGVHLSsP+YlPXDPY9CwOpAcCkw5ze9HQK3srcGdg17
lKSPTmbBTGFJUUlRGijP/bvRsagjsckWLVlpav23TfbFuz7RvpE+b13CkMUcrklo
H46GsjoHZXqOKyvuEmwUPKJdhkqL25Xky1oEMl1POhuKI/R+ho6qfbhTk2oey8lX
w6krXB3LUqmmYsQATMg8PNKu/ZNE/CQJAKnWuX7wDIjoEmD3//Jc4NYlJnACy07i
PMMIecTdDNjiWonbfX1fGULLC8irG/Ko9i0zfvBVNCiLVPCjMUjl8s9N5mwzs+H0
89ENb1CX226b9Z6OY/MdsVEXQFxGtaTlXXFTgxC0BoL0Th1o69uH44tA0S12ZVUz
hqm1qhuxBsgWWdE0wP+aLj/7mjCDjBvaUBuBgKhgQE1dk2VuaPfZ6gssmUNkxh5k
k1JpV9HFHxdygfh7B3QrnjnWWaIC8v28tgYpYEZn3bjQXN9Htf1pPCwSZmzUaY9a
1TRkJLokg514fXNMqEOpBrQ4SgbfXJRP+v6MsJiMvQ6JGtp9d9Fk/Fuhsvb+285s
843m1pd3JA005EsdVC0D/RNKmZufcXyGKlbrh8XkcFzL9WfJCA8=
=Y/Dx
-----END PGP SIGNATURE-----


D
D
Distopico wrote on 5 Aug 2023 04:59
[PATCH] gnu: webrtc-for-telegram-desktop: Update to a45d8b8
(address . 64748@debbugs.gnu.org)
20230805030015.28796-1-distopico@riseup.net
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit

Fixes `telegram-desktop` calls that are not working with OpenSSL 3.
Now, `webrtc-for-telegram-desktop` uses sources from the Guix `libsrtp`
package instead of the submodule in the `unpack-additional-sources` phase.


---
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit

Fixes `telegram-desktop` calls that are not working with OpenSSL 3.
Now, `webrtc-for-telegram-desktop` uses sources from the Guix `libsrtp`
package instead of the submodule in the `unpack-additional-sources` phase.

gnu/packages/telegram.scm | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

Toggle diff (60 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index aa01c2f692..0b32b49d14 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -265,8 +266,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "a45d8b8f0a99bd0e5118dda1dc4a8b7b3ad5dcfd")
+ (revision "388"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -282,14 +283,14 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "1qs3ikkd6l56brj40cv6wlhx5gj5avisj9mj8ypjfwcyw9hb2n5y"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise" "libsrtp_config"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -311,9 +312,13 @@ (define-public webrtc-for-telegram-desktop
(add-after 'unpack 'unpack-additional-sources
(lambda _
(let* ((third-party (string-append (getcwd) "/src/third_party"))
- (libyuv-to (string-append third-party "/libyuv")))
+ (libyuv-to (string-append third-party "/libyuv"))
+ (libsrtp-to (string-append third-party "/libsrtp")))
(copy-recursively #$libyuv-for-telegram-desktop
- libyuv-to)))))))
+ libyuv-to)
+ (copy-recursively #$(package-source
+ libsrtp)
+ libsrtp-to)))))))
(native-inputs (list pkg-config python-wrapper yasm))
(inputs
(list abseil-cpp-cxxstd17

base-commit: cf9904bcc8dd03e73675475bb4d8746dc434e415
--
2.41.0
H
H
Hilton Chain wrote on 7 Aug 2023 11:38
(name . Distopico)(address . distopico@riseup.net)
87350vw5se.wl-hako@ultrarare.space
Hi,

Sorry for the late reply (in this thread).

On Sat, 05 Aug 2023 10:59:50 +0800,
Distopico wrote:
Toggle quote (16 lines)
>
> * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
>
> Fixes `telegram-desktop` calls that are not working with OpenSSL 3.
> Now, `webrtc-for-telegram-desktop` uses sources from the Guix `libsrtp`
> package instead of the submodule in the `unpack-additional-sources` phase.
>
> see: https://github.com/telegramdesktop/tdesktop/issues/26108
>
> ---
> * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to a45d8b8 revision commit
>
> Fixes `telegram-desktop` calls that are not working with OpenSSL 3.
> Now, `webrtc-for-telegram-desktop` uses sources from the Guix `libsrtp`
> package instead of the submodule in the `unpack-additional-sources` phase.

(Unbundle libSRTP) yet?

`git grep include.*libsrtp' shows that `srtp_priv.h' is used, and it's
not present in libsrtp@2.4.2. But since you have tested, I think it's
not an issue here.

For commit message, I think there's a 80-character limit and the long
sentences could be split into the [...] below as well.
Toggle snippet (5 lines)
* gnu/packages/telegram.scm (...): ...
[snippet]: [...]
[#:phases]<unpack-additional-sources>: [...]

0-388.a45d8b8 can be used to describe the version if you prefer.

Patch LGTM, but if the aforementioned patch works, it's better to add
it.

Thanks
H
H
Hilton Chain wrote on 7 Aug 2023 14:26
(name . Distopico)(address . distopico@riseup.net)
875y5rf37b.wl-hako@ultrarare.space
On Mon, 07 Aug 2023 17:38:57 +0800,
Hilton Chain wrote:
Toggle quote (4 lines)
> `git grep include.*libsrtp' shows that `srtp_priv.h' is used, and it's
> not present in libsrtp@2.4.2. But since you have tested, I think it's
> not an issue here.

Found it in libsrtp source! So the reply's unrelated here.
H
H
Hilton Chain wrote on 28 Aug 2023 15:30
[PATCH v6 0/2] gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.
(address . 64748@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
cover.1693229275.git.hako@ultrarare.space
Finished my own request for unbundling libSRTP and updated the package to the
latest commit.

Don't have a Telegram account, so I can't test the functionality. Please let
me know if it works.

Thanks

Distopico (1):
gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.

Hilton Chain (1):
gnu: libyuv-for-telegram-desktop: Update to 0-2439.77c2121.

gnu/local.mk | 1 +
...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++
gnu/packages/telegram.scm | 22 ++-
3 files changed, 152 insertions(+), 8 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch


base-commit: 3b927302124de6eadaa8e0a7280002cd85c04d33
--
2.41.0
H
H
Hilton Chain wrote on 28 Aug 2023 15:31
[PATCH v6 1/2] gnu: libyuv-for-telegram-desktop: Update to 0-2439.77c2121.
(address . 64748@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
7ae8d9ceb36788f7705d7f0bf687adccde45cc9a.1693229275.git.hako@ultrarare.space
* gnu/packages/telegram.scm (libyuv-for-telegram-desktop): Update to
0-2439.77c2121.
---
gnu/packages/telegram.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index dffc6b8ff4..88daea7d7d 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -83,8 +83,8 @@ (define-module (gnu packages telegram)
(define %telegram-version "4.8.1")
(define libyuv-for-telegram-desktop
- (let ((commit "00950840d1c9bcbb3eb6ebc5aac5793e71166c8b")
- (revision "2212"))
+ (let ((commit "77c2121f7e6b8e694d6e908bbbe9be24214097da")
+ (revision "2439"))
(origin
(method git-fetch)
(uri (git-reference
@@ -95,7 +95,7 @@ (define libyuv-for-telegram-desktop
(git-version "0" revision commit)))
(sha256
(base32
- "0mm56p8iapfild2xdw4w8zi35c3xm06fgagiali644gnxdmnym6c")))))
+ "1b4k8yskr9ffl5k8s9i0af1gn1pavsfixla26vh8bij69rdr7f9c")))))
(define cmake-helpers-for-telegram-desktop
(origin
--
2.41.0
H
H
Hilton Chain wrote on 28 Aug 2023 15:31
[PATCH v6 2/2] gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.
(address . 64748@debbugs.gnu.org)(name . Distopico)(address . distopico@riseup.net)
6bc3e221df4078fb77503f2106017c0c09528d40.1693229275.git.hako@ultrarare.space
From: Distopico <distopico@riseup.net>

* gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to
0-389.0532942, which fixes `telegram-desktop` calls that are not working with
OpenSSL 3.
[source]<patches>: Add the patch.
<snippet>: Unbundle libsrtp.
Keep libsrtp_config.
[inputs]: Add libsrtp.
---
gnu/local.mk | 1 +
...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++
gnu/packages/telegram.scm | 16 +-
3 files changed, 149 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch

Toggle diff (212 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 8f409b7ea8..684f9f3ec4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2094,6 +2094,7 @@ dist_patch_DATA = \
%D%/packages/patches/wdl-link-libs-and-fix-jnetlib.patch \
%D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch \
%D%/packages/patches/webrtc-audio-processing-big-endian.patch \
+ %D%/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch \
%D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \
%D%/packages/patches/wmctrl-64-fix.patch \
%D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
new file mode 100644
index 0000000000..486f0b1aa5
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
@@ -0,0 +1,137 @@
+From 62672f3756ecf218252098211d78c13369ab6d28 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas@guriev.su>
+Date: Thu, 4 May 2023 16:21:09 +0300
+Subject: [PATCH] Unbundle libSRTP
+
+Avoid private symbols and link against system-wide libSRTP. The excluded code
+in SrtpSession looks unreachable from the call integration in Telegram Desktop.
+---
+ CMakeLists.txt | 3 +++
+ cmake/libsrtp.cmake | 13 +++++++++++++
+ src/pc/external_hmac.cc | 1 -
+ src/pc/external_hmac.h | 9 ++++++---
+ src/pc/srtp_session.cc | 16 ++++++++++++++--
+ 5 files changed, 36 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index af7d24c21..66bec8fdf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2647,6 +2647,9 @@ if (TG_OWT_USE_PROTOBUF)
+ list(APPEND export_targets proto)
+ endif()
+
++if (LIBSRTP_FOUND)
++ target_compile_definitions(tg_owt PRIVATE HAVE_LIBSRTP)
++endif()
+ if (NOT absl_FOUND)
+ list(APPEND export_targets libabsl)
+ endif()
+diff --git a/cmake/libsrtp.cmake b/cmake/libsrtp.cmake
+index 5124312d2..01f051606 100644
+--- a/cmake/libsrtp.cmake
++++ b/cmake/libsrtp.cmake
+@@ -1,3 +1,16 @@
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(LIBSRTP libsrtp2)
++
++if (LIBSRTP_FOUND)
++ add_library(libsrtp INTERFACE EXCLUDE_FROM_ALL)
++ add_library(tg_owt::libsrtp ALIAS libsrtp)
++
++ target_include_directories(libsrtp INTERFACE ${LIBSRTP_INCLUDE_DIRS} ${LIBSRTP_CFLAGS_OTHER})
++ target_link_libraries(libsrtp INTERFACE ${LIBSRTP_LINK_LIBRARIES} ${LIBSRTP_LDFLAGS_OTHER})
++
++ return()
++endif()
++
+ add_library(libsrtp OBJECT EXCLUDE_FROM_ALL)
+ init_target(libsrtp)
+ add_library(tg_owt::libsrtp ALIAS libsrtp)
+diff --git a/src/pc/external_hmac.cc b/src/pc/external_hmac.cc
+index 27b5d0e5a..222f5d9ae 100644
+--- a/src/pc/external_hmac.cc
++++ b/src/pc/external_hmac.cc
+@@ -15,7 +15,6 @@
+
+ #include "rtc_base/logging.h"
+ #include "rtc_base/zero_memory.h"
+-#include "third_party/libsrtp/include/srtp.h"
+
+ // Begin test case 0 */
+ static const uint8_t kExternalHmacTestCase0Key[20] = {
+diff --git a/src/pc/external_hmac.h b/src/pc/external_hmac.h
+index c5071fc19..8fdc2f1a7 100644
+--- a/src/pc/external_hmac.h
++++ b/src/pc/external_hmac.h
+@@ -30,9 +30,12 @@
+
+ #include <stdint.h>
+
+-#include "third_party/libsrtp/crypto/include/crypto_types.h"
+-#include "third_party/libsrtp/include/srtp.h"
+-#include "third_party/libsrtp/include/srtp_priv.h"
++#ifdef HAVE_LIBSRTP
++# include <srtp2/auth.h>
++# include <srtp2/srtp.h>
++#else
++# include "srtp_priv.h"
++#endif
+
+ #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1
+ #define HMAC_KEY_LENGTH 20
+diff --git a/src/pc/srtp_session.cc b/src/pc/srtp_session.cc
+index 7d1aaf2d6..7b5a789b0 100644
+--- a/src/pc/srtp_session.cc
++++ b/src/pc/srtp_session.cc
+@@ -30,8 +30,12 @@
+ #include "rtc_base/thread_annotations.h"
+ #include "rtc_base/time_utils.h"
+ #include "system_wrappers/include/metrics.h"
+-#include "third_party/libsrtp/include/srtp.h"
+-#include "third_party/libsrtp/include/srtp_priv.h"
++
++#ifdef HAVE_LIBSRTP
++# include <srtp2/srtp.h>
++#else
++# include "srtp_priv.h"
++#endif
+
+ namespace cricket {
+
+@@ -290,6 +294,9 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {
+ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
+ RTC_DCHECK(thread_checker_.IsCurrent());
+ RTC_DCHECK(IsExternalAuthActive());
++#ifdef HAVE_LIBSRTP
++ return false;
++#else
+ if (!IsExternalAuthActive()) {
+ return false;
+ }
+@@ -313,6 +320,7 @@ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
+ *key_len = external_hmac->key_length;
+ *tag_len = rtp_auth_tag_len_;
+ return true;
++#endif
+ }
+
+ int SrtpSession::GetSrtpOverhead() const {
+@@ -336,6 +344,9 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
+ int in_len,
+ int64_t* index) {
+ RTC_DCHECK(thread_checker_.IsCurrent());
++#ifdef HAVE_LIBSRTP
++ return false;
++#else
+ srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p);
+ srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc);
+ if (!stream) {
+@@ -346,6 +357,7 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
+ *index = static_cast<int64_t>(rtc::NetworkToHost64(
+ srtp_rdbx_get_packet_index(&stream->rtp_rdbx) << 16));
+ return true;
++#endif
+ }
+
+ bool SrtpSession::DoSetKey(int type,
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 88daea7d7d..a3d5dc273a 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -1,8 +1,9 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
-;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
+;;; Copyright © 2022, 2023 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
;;; Copyright © 2023 Lu Hui <luhux76@gmail.com>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -266,8 +267,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
+ (revision "389"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -283,14 +284,18 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
+ (patches
+ (search-patches
+ ;; https://github.com/desktop-app/tg_owt/pull/123
+ "webrtc-for-telegram-desktop-unbundle-libsrtp.patch"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("libsrtp_config" "rnnoise"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -325,6 +330,7 @@ (define-public webrtc-for-telegram-desktop
libdrm
libglvnd
libjpeg-turbo
+ libsrtp
libvpx
libxcomposite
libxdamage
--
2.41.0
H
H
Hilton Chain wrote on 28 Aug 2023 16:56
[PATCH v7 0/2] gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.
(address . 64748@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
cover.1693234399.git.hako@ultrarare.space
V6 -> V7: Don't keep the unnecessary libsrtp_config.

Distopico (1):
gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.

Hilton Chain (1):
gnu: libyuv-for-telegram-desktop: Update to 0-2439.77c2121.

gnu/local.mk | 1 +
...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++
gnu/packages/telegram.scm | 22 ++-
3 files changed, 152 insertions(+), 8 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch


base-commit: 4a49a89b09d07d96f4d6ef3c0ca93801370f7b20
--
2.41.0
H
H
Hilton Chain wrote on 28 Aug 2023 17:00
[PATCH v7 1/2] gnu: libyuv-for-telegram-desktop: Update to 0-2439.77c2121.
(address . 64748@debbugs.gnu.org)(name . Hilton Chain)(address . hako@ultrarare.space)
61dfad1a1947a99fdc1104c2943aebdb4b79aebf.1693234399.git.hako@ultrarare.space
* gnu/packages/telegram.scm (libyuv-for-telegram-desktop): Update to
0-2439.77c2121.
---

(no change since v6)

gnu/packages/telegram.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index dffc6b8ff4..88daea7d7d 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -83,8 +83,8 @@ (define-module (gnu packages telegram)
(define %telegram-version "4.8.1")
(define libyuv-for-telegram-desktop
- (let ((commit "00950840d1c9bcbb3eb6ebc5aac5793e71166c8b")
- (revision "2212"))
+ (let ((commit "77c2121f7e6b8e694d6e908bbbe9be24214097da")
+ (revision "2439"))
(origin
(method git-fetch)
(uri (git-reference
@@ -95,7 +95,7 @@ (define libyuv-for-telegram-desktop
(git-version "0" revision commit)))
(sha256
(base32
- "0mm56p8iapfild2xdw4w8zi35c3xm06fgagiali644gnxdmnym6c")))))
+ "1b4k8yskr9ffl5k8s9i0af1gn1pavsfixla26vh8bij69rdr7f9c")))))
(define cmake-helpers-for-telegram-desktop
(origin
--
2.41.0
H
H
Hilton Chain wrote on 28 Aug 2023 17:00
[PATCH v7 2/2] gnu: webrtc-for-telegram-desktop: Update to 0-389.0532942.
(address . 64748@debbugs.gnu.org)
243d068053e6678cd4c89f2b2d9314b28473dbea.1693234399.git.hako@ultrarare.space
From: Distopico <distopico@riseup.net>

* gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch: New
file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to
0-389.0532942, which fixes `telegram-desktop` calls that are not working with
OpenSSL 3.
[source]<patches>: Add the patch.
<snippet>: Unbundle libsrtp.
[inputs]: Add libsrtp.

Signed-off-by: Hilton Chain <hako@ultrarare.space>
---
gnu/local.mk | 1 +
...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++
gnu/packages/telegram.scm | 16 +-
3 files changed, 149 insertions(+), 5 deletions(-)
create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch

Toggle diff (210 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index 48187d7e64..5ab021eaed 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2093,6 +2093,7 @@ dist_patch_DATA = \
%D%/packages/patches/wdl-link-libs-and-fix-jnetlib.patch \
%D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch \
%D%/packages/patches/webrtc-audio-processing-big-endian.patch \
+ %D%/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch \
%D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \
%D%/packages/patches/wmctrl-64-fix.patch \
%D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \
diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
new file mode 100644
index 0000000000..486f0b1aa5
--- /dev/null
+++ b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
@@ -0,0 +1,137 @@
+From 62672f3756ecf218252098211d78c13369ab6d28 Mon Sep 17 00:00:00 2001
+From: Nicholas Guriev <nicholas@guriev.su>
+Date: Thu, 4 May 2023 16:21:09 +0300
+Subject: [PATCH] Unbundle libSRTP
+
+Avoid private symbols and link against system-wide libSRTP. The excluded code
+in SrtpSession looks unreachable from the call integration in Telegram Desktop.
+---
+ CMakeLists.txt | 3 +++
+ cmake/libsrtp.cmake | 13 +++++++++++++
+ src/pc/external_hmac.cc | 1 -
+ src/pc/external_hmac.h | 9 ++++++---
+ src/pc/srtp_session.cc | 16 ++++++++++++++--
+ 5 files changed, 36 insertions(+), 6 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index af7d24c21..66bec8fdf 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2647,6 +2647,9 @@ if (TG_OWT_USE_PROTOBUF)
+ list(APPEND export_targets proto)
+ endif()
+
++if (LIBSRTP_FOUND)
++ target_compile_definitions(tg_owt PRIVATE HAVE_LIBSRTP)
++endif()
+ if (NOT absl_FOUND)
+ list(APPEND export_targets libabsl)
+ endif()
+diff --git a/cmake/libsrtp.cmake b/cmake/libsrtp.cmake
+index 5124312d2..01f051606 100644
+--- a/cmake/libsrtp.cmake
++++ b/cmake/libsrtp.cmake
+@@ -1,3 +1,16 @@
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(LIBSRTP libsrtp2)
++
++if (LIBSRTP_FOUND)
++ add_library(libsrtp INTERFACE EXCLUDE_FROM_ALL)
++ add_library(tg_owt::libsrtp ALIAS libsrtp)
++
++ target_include_directories(libsrtp INTERFACE ${LIBSRTP_INCLUDE_DIRS} ${LIBSRTP_CFLAGS_OTHER})
++ target_link_libraries(libsrtp INTERFACE ${LIBSRTP_LINK_LIBRARIES} ${LIBSRTP_LDFLAGS_OTHER})
++
++ return()
++endif()
++
+ add_library(libsrtp OBJECT EXCLUDE_FROM_ALL)
+ init_target(libsrtp)
+ add_library(tg_owt::libsrtp ALIAS libsrtp)
+diff --git a/src/pc/external_hmac.cc b/src/pc/external_hmac.cc
+index 27b5d0e5a..222f5d9ae 100644
+--- a/src/pc/external_hmac.cc
++++ b/src/pc/external_hmac.cc
+@@ -15,7 +15,6 @@
+
+ #include "rtc_base/logging.h"
+ #include "rtc_base/zero_memory.h"
+-#include "third_party/libsrtp/include/srtp.h"
+
+ // Begin test case 0 */
+ static const uint8_t kExternalHmacTestCase0Key[20] = {
+diff --git a/src/pc/external_hmac.h b/src/pc/external_hmac.h
+index c5071fc19..8fdc2f1a7 100644
+--- a/src/pc/external_hmac.h
++++ b/src/pc/external_hmac.h
+@@ -30,9 +30,12 @@
+
+ #include <stdint.h>
+
+-#include "third_party/libsrtp/crypto/include/crypto_types.h"
+-#include "third_party/libsrtp/include/srtp.h"
+-#include "third_party/libsrtp/include/srtp_priv.h"
++#ifdef HAVE_LIBSRTP
++# include <srtp2/auth.h>
++# include <srtp2/srtp.h>
++#else
++# include "srtp_priv.h"
++#endif
+
+ #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1
+ #define HMAC_KEY_LENGTH 20
+diff --git a/src/pc/srtp_session.cc b/src/pc/srtp_session.cc
+index 7d1aaf2d6..7b5a789b0 100644
+--- a/src/pc/srtp_session.cc
++++ b/src/pc/srtp_session.cc
+@@ -30,8 +30,12 @@
+ #include "rtc_base/thread_annotations.h"
+ #include "rtc_base/time_utils.h"
+ #include "system_wrappers/include/metrics.h"
+-#include "third_party/libsrtp/include/srtp.h"
+-#include "third_party/libsrtp/include/srtp_priv.h"
++
++#ifdef HAVE_LIBSRTP
++# include <srtp2/srtp.h>
++#else
++# include "srtp_priv.h"
++#endif
+
+ namespace cricket {
+
+@@ -290,6 +294,9 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {
+ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
+ RTC_DCHECK(thread_checker_.IsCurrent());
+ RTC_DCHECK(IsExternalAuthActive());
++#ifdef HAVE_LIBSRTP
++ return false;
++#else
+ if (!IsExternalAuthActive()) {
+ return false;
+ }
+@@ -313,6 +320,7 @@ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
+ *key_len = external_hmac->key_length;
+ *tag_len = rtp_auth_tag_len_;
+ return true;
++#endif
+ }
+
+ int SrtpSession::GetSrtpOverhead() const {
+@@ -336,6 +344,9 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
+ int in_len,
+ int64_t* index) {
+ RTC_DCHECK(thread_checker_.IsCurrent());
++#ifdef HAVE_LIBSRTP
++ return false;
++#else
+ srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p);
+ srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc);
+ if (!stream) {
+@@ -346,6 +357,7 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
+ *index = static_cast<int64_t>(rtc::NetworkToHost64(
+ srtp_rdbx_get_packet_index(&stream->rtp_rdbx) << 16));
+ return true;
++#endif
+ }
+
+ bool SrtpSession::DoSetKey(int type,
diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
index 88daea7d7d..4814c22b6c 100644
--- a/gnu/packages/telegram.scm
+++ b/gnu/packages/telegram.scm
@@ -1,8 +1,9 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
-;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
+;;; Copyright © 2022, 2023 Hilton Chain <hako@ultrarare.space>
;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
;;; Copyright © 2023 Lu Hui <luhux76@gmail.com>
+;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -266,8 +267,8 @@ (define tgcalls-for-telegram-desktop
"193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))

(define-public webrtc-for-telegram-desktop
- (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
- (revision "328"))
+ (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
+ (revision "389"))
(hidden-package
(package
(name "webrtc-for-telegram-desktop")
@@ -283,14 +284,18 @@ (define-public webrtc-for-telegram-desktop
(file-name
(git-file-name name version))
(sha256
- (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
+ (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
+ (patches
+ (search-patches
+ ;; https://github.com/desktop-app/tg_owt/pull/123
+ "webrtc-for-telegram-desktop-unbundle-libsrtp.patch"))
(modules '((guix build utils)
(ice-9 ftw)
(srfi srfi-1)))
(snippet
#~(begin
(let ((keep
- '("libsrtp" "rnnoise"
+ '("rnnoise"
;; Not available in Guix.
"pffft")))
(with-directory-excursion "src/third_party"
@@ -325,6 +330,7 @@ (define-public webrtc-for-telegram-desktop
libdrm
libglvnd
libjpeg-turbo
+ libsrtp
libvpx
libxcomposite
libxdamage
--
2.41.0
D
D
Distopico wrote on 29 Aug 2023 20:13
(name . Hilton Chain)(address . hako@ultrarare.space)(address . 64748@debbugs.gnu.org)
87msy990my.fsf@riseup.net
Build and the call works fine from my side

On 2023-08-28, Hilton Chain <hako@ultrarare.space> wrote:

Toggle quote (230 lines)
> From: Distopico <distopico@riseup.net>
>
> * gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch: New
> file.
> * gnu/local.mk (dist_patch_DATA): Register it.
> * gnu/packages/telegram.scm (webrtc-for-telegram-desktop): Update to
> 0-389.0532942, which fixes `telegram-desktop` calls that are not working with
> OpenSSL 3.
> [source]<patches>: Add the patch.
> <snippet>: Unbundle libsrtp.
> [inputs]: Add libsrtp.
>
> Signed-off-by: Hilton Chain <hako@ultrarare.space>
> ---
> gnu/local.mk | 1 +
> ...or-telegram-desktop-unbundle-libsrtp.patch | 137 ++++++++++++++++++
> gnu/packages/telegram.scm | 16 +-
> 3 files changed, 149 insertions(+), 5 deletions(-)
> create mode 100644 gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
>
> diff --git a/gnu/local.mk b/gnu/local.mk
> index 48187d7e64..5ab021eaed 100644
> --- a/gnu/local.mk
> +++ b/gnu/local.mk
> @@ -2093,6 +2093,7 @@ dist_patch_DATA = \
> %D%/packages/patches/wdl-link-libs-and-fix-jnetlib.patch \
> %D%/packages/patches/webkitgtk-adjust-bubblewrap-paths.patch \
> %D%/packages/patches/webrtc-audio-processing-big-endian.patch \
> + %D%/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch \
> %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \
> %D%/packages/patches/wmctrl-64-fix.patch \
> %D%/packages/patches/wmfire-update-for-new-gdk-versions.patch \
> diff --git a/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
> new file mode 100644
> index 0000000000..486f0b1aa5
> --- /dev/null
> +++ b/gnu/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch
> @@ -0,0 +1,137 @@
> +From 62672f3756ecf218252098211d78c13369ab6d28 Mon Sep 17 00:00:00 2001
> +From: Nicholas Guriev <nicholas@guriev.su>
> +Date: Thu, 4 May 2023 16:21:09 +0300
> +Subject: [PATCH] Unbundle libSRTP
> +
> +Avoid private symbols and link against system-wide libSRTP. The excluded code
> +in SrtpSession looks unreachable from the call integration in Telegram Desktop.
> +---
> + CMakeLists.txt | 3 +++
> + cmake/libsrtp.cmake | 13 +++++++++++++
> + src/pc/external_hmac.cc | 1 -
> + src/pc/external_hmac.h | 9 ++++++---
> + src/pc/srtp_session.cc | 16 ++++++++++++++--
> + 5 files changed, 36 insertions(+), 6 deletions(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index af7d24c21..66bec8fdf 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -2647,6 +2647,9 @@ if (TG_OWT_USE_PROTOBUF)
> + list(APPEND export_targets proto)
> + endif()
> +
> ++if (LIBSRTP_FOUND)
> ++ target_compile_definitions(tg_owt PRIVATE HAVE_LIBSRTP)
> ++endif()
> + if (NOT absl_FOUND)
> + list(APPEND export_targets libabsl)
> + endif()
> +diff --git a/cmake/libsrtp.cmake b/cmake/libsrtp.cmake
> +index 5124312d2..01f051606 100644
> +--- a/cmake/libsrtp.cmake
> ++++ b/cmake/libsrtp.cmake
> +@@ -1,3 +1,16 @@
> ++find_package(PkgConfig REQUIRED)
> ++pkg_check_modules(LIBSRTP libsrtp2)
> ++
> ++if (LIBSRTP_FOUND)
> ++ add_library(libsrtp INTERFACE EXCLUDE_FROM_ALL)
> ++ add_library(tg_owt::libsrtp ALIAS libsrtp)
> ++
> ++ target_include_directories(libsrtp INTERFACE ${LIBSRTP_INCLUDE_DIRS} ${LIBSRTP_CFLAGS_OTHER})
> ++ target_link_libraries(libsrtp INTERFACE ${LIBSRTP_LINK_LIBRARIES} ${LIBSRTP_LDFLAGS_OTHER})
> ++
> ++ return()
> ++endif()
> ++
> + add_library(libsrtp OBJECT EXCLUDE_FROM_ALL)
> + init_target(libsrtp)
> + add_library(tg_owt::libsrtp ALIAS libsrtp)
> +diff --git a/src/pc/external_hmac.cc b/src/pc/external_hmac.cc
> +index 27b5d0e5a..222f5d9ae 100644
> +--- a/src/pc/external_hmac.cc
> ++++ b/src/pc/external_hmac.cc
> +@@ -15,7 +15,6 @@
> +
> + #include "rtc_base/logging.h"
> + #include "rtc_base/zero_memory.h"
> +-#include "third_party/libsrtp/include/srtp.h"
> +
> + // Begin test case 0 */
> + static const uint8_t kExternalHmacTestCase0Key[20] = {
> +diff --git a/src/pc/external_hmac.h b/src/pc/external_hmac.h
> +index c5071fc19..8fdc2f1a7 100644
> +--- a/src/pc/external_hmac.h
> ++++ b/src/pc/external_hmac.h
> +@@ -30,9 +30,12 @@
> +
> + #include <stdint.h>
> +
> +-#include "third_party/libsrtp/crypto/include/crypto_types.h"
> +-#include "third_party/libsrtp/include/srtp.h"
> +-#include "third_party/libsrtp/include/srtp_priv.h"
> ++#ifdef HAVE_LIBSRTP
> ++# include <srtp2/auth.h>
> ++# include <srtp2/srtp.h>
> ++#else
> ++# include "srtp_priv.h"
> ++#endif
> +
> + #define EXTERNAL_HMAC_SHA1 SRTP_HMAC_SHA1 + 1
> + #define HMAC_KEY_LENGTH 20
> +diff --git a/src/pc/srtp_session.cc b/src/pc/srtp_session.cc
> +index 7d1aaf2d6..7b5a789b0 100644
> +--- a/src/pc/srtp_session.cc
> ++++ b/src/pc/srtp_session.cc
> +@@ -30,8 +30,12 @@
> + #include "rtc_base/thread_annotations.h"
> + #include "rtc_base/time_utils.h"
> + #include "system_wrappers/include/metrics.h"
> +-#include "third_party/libsrtp/include/srtp.h"
> +-#include "third_party/libsrtp/include/srtp_priv.h"
> ++
> ++#ifdef HAVE_LIBSRTP
> ++# include <srtp2/srtp.h>
> ++#else
> ++# include "srtp_priv.h"
> ++#endif
> +
> + namespace cricket {
> +
> +@@ -290,6 +294,9 @@ bool SrtpSession::UnprotectRtcp(void* p, int in_len, int* out_len) {
> + bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
> + RTC_DCHECK(thread_checker_.IsCurrent());
> + RTC_DCHECK(IsExternalAuthActive());
> ++#ifdef HAVE_LIBSRTP
> ++ return false;
> ++#else
> + if (!IsExternalAuthActive()) {
> + return false;
> + }
> +@@ -313,6 +320,7 @@ bool SrtpSession::GetRtpAuthParams(uint8_t** key, int* key_len, int* tag_len) {
> + *key_len = external_hmac->key_length;
> + *tag_len = rtp_auth_tag_len_;
> + return true;
> ++#endif
> + }
> +
> + int SrtpSession::GetSrtpOverhead() const {
> +@@ -336,6 +344,9 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
> + int in_len,
> + int64_t* index) {
> + RTC_DCHECK(thread_checker_.IsCurrent());
> ++#ifdef HAVE_LIBSRTP
> ++ return false;
> ++#else
> + srtp_hdr_t* hdr = reinterpret_cast<srtp_hdr_t*>(p);
> + srtp_stream_ctx_t* stream = srtp_get_stream(session_, hdr->ssrc);
> + if (!stream) {
> +@@ -346,6 +357,7 @@ bool SrtpSession::GetSendStreamPacketIndex(void* p,
> + *index = static_cast<int64_t>(rtc::NetworkToHost64(
> + srtp_rdbx_get_packet_index(&stream->rtp_rdbx) << 16));
> + return true;
> ++#endif
> + }
> +
> + bool SrtpSession::DoSetKey(int type,
> diff --git a/gnu/packages/telegram.scm b/gnu/packages/telegram.scm
> index 88daea7d7d..4814c22b6c 100644
> --- a/gnu/packages/telegram.scm
> +++ b/gnu/packages/telegram.scm
> @@ -1,8 +1,9 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
> -;;; Copyright © 2022 Hilton Chain <hako@ultrarare.space>
> +;;; Copyright © 2022, 2023 Hilton Chain <hako@ultrarare.space>
> ;;; Copyright © 2023 Saku Laesvuori <saku@laesvuori.fi>
> ;;; Copyright © 2023 Lu Hui <luhux76@gmail.com>
> +;;; Copyright © 2023 Camilo Q.S. (Distopico) <distopico@riseup.net>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -266,8 +267,8 @@ (define tgcalls-for-telegram-desktop
> "193m2gkvipijqbfd6a8mhg9nd63wlnshzgspk3pip57vk21l709z"))))
>
> (define-public webrtc-for-telegram-desktop
> - (let ((commit "5098730b9eb6173f0b52068fe2555b7c1015123a")
> - (revision "328"))
> + (let ((commit "0532942ac6176a66ef184fb728a4cbb02958fc0b")
> + (revision "389"))
> (hidden-package
> (package
> (name "webrtc-for-telegram-desktop")
> @@ -283,14 +284,18 @@ (define-public webrtc-for-telegram-desktop
> (file-name
> (git-file-name name version))
> (sha256
> - (base32 "1lk54zlrff59rj5k9dylsgz4sdds4728psrk8m3v9qn5y8d6z8qy"))
> + (base32 "0fary99yl1ddk5zjpfy0pyb5brd268j41plcnvv9qjyf0wj9hf2k"))
> + (patches
> + (search-patches
> + ;; https://github.com/desktop-app/tg_owt/pull/123
> + "webrtc-for-telegram-desktop-unbundle-libsrtp.patch"))
> (modules '((guix build utils)
> (ice-9 ftw)
> (srfi srfi-1)))
> (snippet
> #~(begin
> (let ((keep
> - '("libsrtp" "rnnoise"
> + '("rnnoise"
> ;; Not available in Guix.
> "pffft")))
> (with-directory-excursion "src/third_party"
> @@ -325,6 +330,7 @@ (define-public webrtc-for-telegram-desktop
> libdrm
> libglvnd
> libjpeg-turbo
> + libsrtp
> libvpx
> libxcomposite
> libxdamage
-----BEGIN PGP SIGNATURE-----

iQFJBAEBCAAzFiEEvYwofabWO6y953lVmAk6gHJUa/MFAmTuNYUVHGRpc3RvcGlj
b0ByaXNldXAubmV0AAoJEJgJOoByVGvzwoIIAIIEWB/aAsLK4OylOmgF+kdPWutE
dWWaa7OApM/kxUT6EiATpQ1BXWXPn8FWUCHuqJ/R19GXEQhHvBXeOi6PL3xBzCx0
Ehsc/J7xnb10vmUjMe2qDuF2zV142jyajXpylkvij/CE/vRntXqNbohYlQccIk0T
CNDoRD44ug3mLzsv3+I7H74/HLR17XxwSPI1zVb42QpRH7c2ydXrDALO512LBCeE
OVFp2mAoKdN7MTGZWQa7eMI9ACKMmzgcfTPwt5+qRp5u2sEdMCgbFHiAOpQ+SbfQ
awxTrr5lKOYqKZ3jPMrdQAqAdf2AOxKG5o5dFUfjY8BTU8S+wViMS92hG9U=
=UQ7p
-----END PGP SIGNATURE-----

H
H
Hilton Chain wrote on 1 Sep 2023 11:01
(name . Distopico)(address . distopico@riseup.net)
874jkel11w.wl-hako@ultrarare.space
On Wed, 30 Aug 2023 02:13:52 +0800,
Distopico wrote:
Toggle quote (5 lines)
>
> [1 <text/plain; utf-8 (quoted-printable)>]
> Build and the call works fine from my side
>

Thanks! Pushed as 33018f8c2506a1ed0b805d595f3309b90153ac23.
Closed
?