FS#71542 - tdesktop and tg_owt shouldn't have *_SPECIAL_TARGET variables set

Attached to Project: Community Packages
Opened by Ilya Fedin (ilya-fedin) - Sunday, 18 July 2021, 18:06 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Wednesday, 04 August 2021, 22:23 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Jiachen Yang (farseerfc)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
*_SPECIAL_TARGET variables in tdesktop and related packages mean that official build mode should be turned on, leading to using hardcoded paths instead of using pkg-config/find_package, what also leads to the lack of dependencies in tg_owtConfig.cmake. All what should be set in tg_owt is:
```
cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
..
```
(and maybe `-DBUILD_SHARED_LIBS=OFF` if you want to build a static lib)

For tdesktop:
```
cmake . \
-B build \
-G Ninja \
-DCMAKE_INSTALL_PREFIX="/usr" \
-DCMAKE_BUILD_TYPE=Release \
-DTDESKTOP_API_ID=611335 \
-DTDESKTOP_API_HASH=d524b414d21f4d37f08684c1df41ac9c
```
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Wednesday, 04 August 2021, 22:23 GMT
Reason for closing:  Fixed
Comment by Sven-Hendrik Haase (Svenstaro) - Sunday, 01 August 2021, 23:02 GMT
I pushed the relevant packages to testing. They appear to work fine for me with video and everything but perhaps you could also take a look? The dynamic linking certainly helps quite a bit with package size.
Comment by Ilya Fedin (ilya-fedin) - Sunday, 01 August 2021, 23:13 GMT
You shouldn't need the lines after "force webrtc link to libjpeg and X11 libs" anymore. Even though dynamic link makes the package smaller, tg_owt is not ABI stable, so maybe it's better to leave it static?

btw, you can move gtk3 and webkit2gtk to optional dependencies since they're used with dlopen now, again.. You may also want to add xdg-desktop-portal to optional dependencies since tdesktop heavily uses portal API, e.g. for system dialogs (file dialog, open with dialog), for getting DE settings like dark mode.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 02 August 2021, 00:06 GMT
Alright, what happens if gtk3 and webkit2gtk are not found? What's the benefit of having them and what's the fallback?
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 02 August 2021, 00:08 GMT
Also, if xdg-desktop-portal is kind of important, shouldn't we add it to the fixed deps?

By the way, I don't think tg_owt not having a stable ABI is a problem since we'll rebuild telegram-desktop with every one of it's updates anyway.
Comment by Ilya Fedin (ilya-fedin) - Monday, 02 August 2021, 00:15 GMT
gtk is used for dialogs and DE settings as well, but portal is preferred. gtk is usually the last resort and there's some hardcoded values when portal/gtk aren't found (e.g. hardcoded title controls layout, no open with dialog, no auto-night mode). The only exception is file dialog that is implemented in Qt, so QFileDialog is used when no portals/gtk available.

webkit2gtk is used only for bot payments right now AFAIK and doesn't have any fallback (it will show a dialog that asks to install it). Although, they may use it for more features that require embedded browser in the future (like instant view).

xdg-desktop-portal/gtk3 aren't so important (at least in my view) to be in fixed deps. People who don't use gtk-based DEs won't benefit from reading gtk settings if they don't have it for anything else (so, not configured). And xdg-desktop-portal has only two full-feature backends AFAIK (gtk/kde).
Comment by Ilya Fedin (ilya-fedin) - Monday, 02 August 2021, 00:19 GMT
> By the way, I don't think tg_owt not having a stable ABI is a problem since we'll rebuild telegram-desktop with every one of it's updates anyway.

There are some packages in AUR that depend on it, but if you don't care, then ¯\_(ツ)_/¯
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 02 August 2021, 00:20 GMT
Ok, thanks that's quite helpful. Do all the then-optional deps need to be available at make time?
Comment by Ilya Fedin (ilya-fedin) - Monday, 02 August 2021, 00:21 GMT
gtk3/webkit2gtk are needed at build time since their headers are used. xdg-desktop-portal just provides D-Bus API, so it's not needed at build time.
Comment by Sven-Hendrik Haase (Svenstaro) - Monday, 02 August 2021, 00:32 GMT
Alright, thanks for all the suggestions. I pushed a new package to [community-testing]. Can you check it out and provide some feedback?
Comment by Ilya Fedin (ilya-fedin) - Monday, 02 August 2021, 01:06 GMT
Seem to work just fine

Loading...