This is the error during recent telegram-desktop's emerge. I use libressl 3.2.1. In file included from /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:20: /usr/include/openssl/dtls1.h:110:2: error: ‘SSL_SESSION’ does not name a type; did you mean ‘SSL2_VERSION’? 110 | SSL_SESSION *session; | ^~~~~~~~~~~ | SSL2_VERSION /usr/include/openssl/dtls1.h:173:2: error: ‘SSL3_BUFFER’ does not name a type 173 | SSL3_BUFFER rbuf; | ^~~~~~~~~~~ /usr/include/openssl/dtls1.h:174:2: error: ‘SSL3_RECORD’ does not name a type 174 | SSL3_RECORD rrec; | ^~~~~~~~~~~ /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc: In member function ‘virtual rtc::SSLProtocolVersion rtc::OpenSSLStreamAdapter::GetSslVersion() const’: /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:395:31: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’? 395 | } else if (ssl_version == DTLS1_2_VERSION) { | ^~~~~~~~~~~~~~~ | TLS1_2_VERSION /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc: In member function ‘SSL_CTX* rtc::OpenSSLStreamAdapter::SetupSSLContext()’: /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:988:47: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’? 988 | ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION); | ^~~~~~~~~~~~~~~ | TLS1_2_VERSION /var/tmp/portage/net-im/telegram-desktop-2.4.4/work/tg_owt/src/rtc_base/openssl_stream_adapter.cc:994:43: error: ‘DTLS1_2_VERSION’ was not declared in this scope; did you mean ‘TLS1_2_VERSION’? 994 | ctx, ssl_mode_ == SSL_MODE_DTLS ? DTLS1_2_VERSION : TLS1_2_VERSION); | ^~~~~~~~~~~~~~~ | TLS1_2_VERSION Reproducible: Always
Created attachment 668831 [details] build.log
Created attachment 669494 [details] telegram-desktop-2.4.5 ebuild, but with webrtc USE flag added back Did the impossible (according to maintainer). Added back the useflag for WebRTC, as it's not compatible with libressl and way easier to remove than patching the crap out of webRTC. With it disabled you lose voice/video support, but all regular IM functionality is retained. You will need this ebuild and this patch from VoidLinux. It's compatible with 2.4.3 through 2.4.5 in the least: https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/telegram-desktop/patches/no-webrtc-build.patch Obviously make sure you don't have WebRTC useflag set for telegram-desktop. To the maintainer: If you merge this please look at my dependencies, I would make libressl useflag block the webrtc useflag.
well, it's not impossible, but not very maintainable in the long run I think, that's what I meant. telegram upstream sometimes changes a LOT between releases, it would be hard to keep up. also they basically said they would not support webrtc-less build. https://github.com/telegramdesktop/tdesktop/issues/8483#issuecomment-702803741 and it's frustrating for user to deal with ever changing useflags. I can add this patch and add webrtc useflag back, but there's no guarantee it will be available on next version bump. if someone manages to merge webrtc ifdef patch upstream - that will be more sustainable.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=052e291b89bd1ccba37c8ba8cca4c4df8e5266c5 commit 052e291b89bd1ccba37c8ba8cca4c4df8e5266c5 Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2020-10-31 21:06:29 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2020-10-31 21:14:36 +0000 net-im/telegram-desktop: add webrtc flag back to 2.4.5 Closes: https://bugs.gentoo.org/751481 Thanks-to: Joe Kappus Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> .../telegram-desktop/files/no-webrtc-build.patch | 96 ++++++++++++++++++++++ net-im/telegram-desktop/metadata.xml | 1 + .../telegram-desktop/telegram-desktop-2.4.5.ebuild | 16 +++- 3 files changed, 110 insertions(+), 3 deletions(-)
since tg_owt is separate package now, I did it a bit differently, but still used void patch, thanks for pointers. 2.4.5 should be usable with libressl now if USE=-webrtc tg_owt requires openssl unconditionally.
Thanks, I can poke telegram's upstream about including this patch, I just know they have been hostile toward libressl support in the past (and things like basic accessibility). Unlike Gentoo, Voidlinux is in the position where they build everything off libressl so I would expect them to keep the patch up to date if things change.
good point about void. if the patch continues to be available and bumped within at most a week after release I see no problem depending on it. but not longer than a week. well at least making webrtc cmake switch to actually work is a good starting point. I no longer attempt to submit patches upstream as the focus seems to be "bundle all the things so it works on ubuntu 16 or in snap", not "package it properly". try referencing issue I linked, maybe they'll merge it. telegram used to just work with libressl since I started maintaining it, so I have no opinion there. but webrtc is just a disaster dependency and adding libressl support there may quite hard.
https://github.com/void-linux/void-packages/issues/20935 looks like VOID will be moving from libressl. Anyway, 2.4.5 is patched and will stay for some time in the tree.