Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/telegram-desktop-bin/, net-im/telegram-desktop-bin/files/
Date: Fri, 17 Aug 2018 06:27:48
Message-Id: 1534487177.ffba6cf7974723a4a75bc61384556a1d093662ca.mgorny@gentoo
1 commit: ffba6cf7974723a4a75bc61384556a1d093662ca
2 Author: Henning Schild <henning <AT> hennsch <DOT> de>
3 AuthorDate: Sat Jul 28 14:05:42 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 17 06:26:17 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffba6cf7
7
8 net-im/telegram-desktop-bin: exclude from session management
9
10 The application seems to register with the X11 session manager but fails
11 to follow the protocol for remembering its state. The result is that a
12 session manager will restart it, and during that process the command
13 line argument for disabling the internal updater gets lost.
14 So on a restarted session the updater will be enabled again.
15
16 Do not let the application register at the session manager in the first
17 place, by unsetting the env variable used to find it.
18
19 Closes: https://bugs.gentoo.org/662330
20 Closes: https://github.com/gentoo/gentoo/pull/9366
21 Signed-off-by: Henning Schild <henning <AT> hennsch.de>
22
23 .../files/telegram-desktop-bin-r1 | 9 ++++
24 .../telegram-desktop-bin-1.3.10-r1.ebuild | 59 ++++++++++++++++++++++
25 2 files changed, 68 insertions(+)
26
27 diff --git a/net-im/telegram-desktop-bin/files/telegram-desktop-bin-r1 b/net-im/telegram-desktop-bin/files/telegram-desktop-bin-r1
28 new file mode 100644
29 index 00000000000..954b3bdeaea
30 --- /dev/null
31 +++ b/net-im/telegram-desktop-bin/files/telegram-desktop-bin-r1
32 @@ -0,0 +1,9 @@
33 +#!/bin/sh
34 +# this wrapper disables the auto-updater of telegram-desktop
35 +# This program is licensed under the same license as telegram-desktop
36 +
37 +# telegram-desktop fails to set RestartCommand with the session manager
38 +# exclude it from session management to prevent restarts without the argument
39 +unset SESSION_MANAGER
40 +
41 +exec /usr/lib/telegram-desktop-bin/Telegram -externalupdater $@
42
43 diff --git a/net-im/telegram-desktop-bin/telegram-desktop-bin-1.3.10-r1.ebuild b/net-im/telegram-desktop-bin/telegram-desktop-bin-1.3.10-r1.ebuild
44 new file mode 100644
45 index 00000000000..11ccb634fcf
46 --- /dev/null
47 +++ b/net-im/telegram-desktop-bin/telegram-desktop-bin-1.3.10-r1.ebuild
48 @@ -0,0 +1,59 @@
49 +# Copyright 1999-2018 Gentoo Foundation
50 +# Distributed under the terms of the GNU General Public License v2
51 +
52 +EAPI=6
53 +
54 +inherit desktop gnome2-utils xdg
55 +
56 +DESCRIPTION="Official desktop client for Telegram (binary package)"
57 +HOMEPAGE="https://desktop.telegram.org"
58 +SRC_URI="
59 + https://github.com/telegramdesktop/tdesktop/archive/v${PV}.tar.gz -> tdesktop-${PV}.tar.gz
60 + amd64? ( https://updates.tdesktop.com/tlinux/tsetup.${PV}.tar.xz )
61 + x86? ( https://updates.tdesktop.com/tlinux32/tsetup32.${PV}.tar.xz )
62 +"
63 +
64 +LICENSE="telegram"
65 +SLOT="0"
66 +KEYWORDS="~amd64 ~x86"
67 +
68 +QA_PREBUILT="usr/lib/${PN}/Telegram"
69 +
70 +RDEPEND="
71 + dev-libs/glib:2
72 + dev-libs/gobject-introspection
73 + >=sys-apps/dbus-1.4.20
74 + x11-libs/libX11
75 + >=x11-libs/libxcb-1.10[xkb]
76 +"
77 +
78 +S="${WORKDIR}/Telegram"
79 +
80 +src_install() {
81 + exeinto /usr/lib/${PN}
82 + doexe "Telegram"
83 + newbin "${FILESDIR}"/${PN}-r1 "telegram-desktop"
84 +
85 + local icon_size
86 + for icon_size in 16 32 48 64 128 256 512; do
87 + newicon -s "${icon_size}" \
88 + "${WORKDIR}/tdesktop-${PV}/Telegram/Resources/art/icon${icon_size}.png" \
89 + telegram-desktop.png
90 + done
91 +
92 + domenu "${WORKDIR}/tdesktop-${PV}"/lib/xdg/telegramdesktop.desktop
93 +}
94 +
95 +pkg_preinst() {
96 + xdg_pkg_preinst
97 +}
98 +
99 +pkg_postinst() {
100 + xdg_pkg_postinst
101 + gnome2_icon_cache_update
102 +}
103 +
104 +pkg_postrm() {
105 + xdg_pkg_postrm
106 + gnome2_icon_cache_update
107 +}