Bug 277344 - net-im/telegram-desktop: Adding options group for choosing which desktop is using
Summary: net-im/telegram-desktop: Adding options group for choosing which desktop is u...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Dima Panov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-27 04:43 UTC by Sergey Kiselev
Modified: 2024-11-05 20:23 UTC (History)
6 users (show)

See Also:


Attachments
patch for net-im/telegram-desktop/Makefile (3.65 KB, patch)
2024-02-27 04:43 UTC, Sergey Kiselev
no flags Details | Diff
patch for net-im/telegram-desktop/Makefile (3.65 KB, patch)
2024-02-28 03:47 UTC, Sergey Kiselev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Kiselev 2024-02-27 04:43:05 UTC
Created attachment 248777 [details]
patch for net-im/telegram-desktop/Makefile

This patch adds two options for select between X11 or Wayland desktop integrations.

I'll tested build in my local poudriere with success.
Comment 1 Benjamin Takacs 2024-02-27 07:22:00 UTC
Why do you use OPTIONS_SINGLE here? Having support for both X11 and wayland works as that is the current behaviour, additional this would be a regression for package users on wayland, as you made X11 the default, so the package would miss wayland support for them. How about using OPTIONS_MULTI and having both X11 and WAYLAND as default option?
Comment 2 Sergey Kiselev 2024-02-27 08:27:51 UTC
(In reply to Benjamin Takacs from comment #1)
Regarding regression for users of wayland packages, I think that this is not the case. Because now the port is built without wayland support:

CMAKE_ON= DESKTOP_APP_USE_PACKAGED DESKTOP_APP_DISABLE_CRASH_REPORTS \
DESKTOP_APP_DISABLE_SCUDO\
DESKTOP_APP_DISABLE_WAYLAND_INTEGRATION


About OPTIONS_MULTI and its defaults - need to test
Comment 3 Benjamin Takacs 2024-02-27 08:50:11 UTC
ah, yes. I was thinking about whatever USE_QT=wayland influences here, but maybe it is a no-op with these CMAKE_ARGS. So it should be checked that telegram doesn't regress here if build for X11 and run on wayland and without having qt*-wayland installed (which would be possible with this if telegram was the only thing depending on qt*-wayland installed)
Comment 4 Jan Beich freebsd_committer freebsd_triage 2024-02-27 15:02:27 UTC
According to ${WRKSRC}/Telegram/SourceFiles/platform/linux/linux_wayland_integration.cpp mainly affects https://wayland.app/protocols/kde-plasma-shell but Plasma/Wayland fell into disrepair on FreeBSD due to lack of dogfooding by kde@ team. Otherwise, the port seems to work fine on Wayland (wlroots) but I've only tested login screen (don't have a Telegram account, so can't test screen sharing).

USE_QT=wayland is a generic way to enable Wayland support in Qt applications. Without it GUI apps would use Xwayland which can introduce glitches (e.g., copy/paste). Also, the binary packages appear to use qt?-wayland directly:

$ pkg install telegram-desktop
$ pkg delete -f qt5-wayland
ld-elf.so.1: Shared object "libQt5WaylandCompositor.so.5" not found, required by "telegram-desktop"

$ pkg install telegram-desktop-qt6
$ pkg delete -f qt6-wayland
ld-elf.so.1: Shared object "libQt6WaylandCompositor.so.6" not found, required by "telegram-desktop"
Comment 5 Sergey Kiselev 2024-02-28 03:47:37 UTC
Created attachment 248808 [details]
patch for net-im/telegram-desktop/Makefile

Replacing OPTION_SINGLE with OPTION_MULTI for the DESKTOP option

Test build with both X11 and WAYLAND selected completed successfully.
Any ideas about defaults are welcome.
Comment 6 commit-hook freebsd_committer freebsd_triage 2024-11-05 18:07:28 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=0d0c98e2c6f25d3532045f90d5def8dbe1c2318a

commit 0d0c98e2c6f25d3532045f90d5def8dbe1c2318a
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2024-11-05 16:40:11 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2024-11-05 18:06:12 +0000

    net-im/telegram-desktop: add ability to build TD without X11 or Wayland (+)

    Bring on two new OPTIONs here: X11 and WAYLAND which enable corresponding dependencies.

    Set both ON by default to mimics previous behaviour.

    PR:     277344 (based on)

 net-im/telegram-desktop/Makefile | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
Comment 7 Dima Panov freebsd_committer freebsd_triage 2024-11-05 20:23:02 UTC
Shipped with adjustments, thanks!