Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/telegram-desktop/files/, net-im/telegram-desktop/
Date: Tue, 25 Feb 2020 02:53:28
Message-Id: 1582599122.e56291255f5727ec7706552f85107ce7b958362c.gyakovlev@gentoo
1 commit: e56291255f5727ec7706552f85107ce7b958362c
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 25 02:39:54 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 25 02:52:02 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5629125
7
8 net-im/telegram-desktop: bump to 1.9.17, enable hunspell by default
9
10 enchant is crashing from time to time.
11
12 added missing qtwayland dep.
13
14 Package-Manager: Portage-2.3.89, Repoman-2.3.20
15 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
16
17 net-im/telegram-desktop/Manifest | 1 +
18 .../files/1.9.17-hunspell-cmake.patch | 22 ++++
19 net-im/telegram-desktop/metadata.xml | 4 +
20 .../telegram-desktop-1.9.17.ebuild | 143 +++++++++++++++++++++
21 4 files changed, 170 insertions(+)
22
23 diff --git a/net-im/telegram-desktop/Manifest b/net-im/telegram-desktop/Manifest
24 index 5bed1039a64..8031465b0e3 100644
25 --- a/net-im/telegram-desktop/Manifest
26 +++ b/net-im/telegram-desktop/Manifest
27 @@ -1,3 +1,4 @@
28 DIST tdesktop-1.9.14-full.tar.gz 25324084 BLAKE2B 45c071aa573541b6e483d2ae712b7f3b672c1294e8e7e624d9292f7176482f4d68069c35541019dc27fdb1c66134c29fb4d3667f1197e7085e4f8a80c8ca603c SHA512 56efa64048d23b280782b51319c0071c6cef833cb7e2584e52c6e45488577755beb85185ec9187029c425cc8d4c9c1887142687c744697e7731a15abe2846056
29 DIST tdesktop-1.9.15-full.tar.gz 25327647 BLAKE2B 5d689f656a66d55b3e62d52d48106270fc16675a01ff8a2b865c122191c7ee4781c2e698d0652c765a10985148ade0ce5dd47f4938538f24348cd5b42fe0160c SHA512 457b568226e34cc23e379d34a9ad21d0d6c26fb69647cd17bf74aef48ad9ce35eae6697795af8c349f43e376b44bcab49e1939733b1cc20ec16ddf1c29a32c4e
30 DIST tdesktop-1.9.16-full.tar.gz 25328085 BLAKE2B 1d429964e67641a1cfa0f826820ed54eb7e37d9946fdd3292d5d67276609d736dcfb2b4c422f6b64364705eb68e78f6ac6bfa52096ca39d948a9e01bc152404b SHA512 89cdf12456d9bcaa4e332286d2d5c4da6cf715bd0e798e51e458adb7bf5c89044899beb9ac7b11a808b81e37958473a473e3774519420baf7a6bc34eb7938733
31 +DIST tdesktop-1.9.17-full.tar.gz 25840548 BLAKE2B ca824ceb691d244a6a7879d753c78559d763e023f77527bd843693035716f27576a9d4e97b38b4d25cc7b3950dbc593dcca21effda47199bc080ff5976c48612 SHA512 b545c39b9ae013a2ae96636895b6eedf27e6deda07af7516e3b2caf58bf7df6f67d9f9da281d7eb9589081b2dc61b95fdf6088afa6fc19e3b79f27e46505738c
32
33 diff --git a/net-im/telegram-desktop/files/1.9.17-hunspell-cmake.patch b/net-im/telegram-desktop/files/1.9.17-hunspell-cmake.patch
34 new file mode 100644
35 index 00000000000..bbf250861ad
36 --- /dev/null
37 +++ b/net-im/telegram-desktop/files/1.9.17-hunspell-cmake.patch
38 @@ -0,0 +1,22 @@
39 +From 81e27ccc0e7bf27405569ce98582860dfc9ea9bb Mon Sep 17 00:00:00 2001
40 +From: John Preston <johnprestonmail@×××××.com>
41 +Date: Tue, 25 Feb 2020 01:11:10 +0400
42 +Subject: [PATCH] Fix packaged build.
43 +
44 +---
45 + external/hunspell/CMakeLists.txt | 2 +-
46 + 1 file changed, 1 insertion(+), 1 deletion(-)
47 +
48 +diff --git a/cmake/external/hunspell/CMakeLists.txt b/cmake/external/hunspell/CMakeLists.txt
49 +index 6fec471..fbe2e95 100644
50 +--- a/cmake/external/hunspell/CMakeLists.txt
51 ++++ b/cmake/external/hunspell/CMakeLists.txt
52 +@@ -5,7 +5,7 @@
53 + # https://github.com/desktop-app/legal/blob/master/LEGAL
54 +
55 + if (DESKTOP_APP_USE_PACKAGED)
56 +- add_library(external_hunspell INTERFACE IMPORTED)
57 ++ add_library(external_hunspell INTERFACE IMPORTED GLOBAL)
58 + add_library(desktop-app::external_hunspell ALIAS external_hunspell)
59 +
60 + find_package(PkgConfig REQUIRED)
61
62 diff --git a/net-im/telegram-desktop/metadata.xml b/net-im/telegram-desktop/metadata.xml
63 index efcd58fe0b9..5eb4b12ceaa 100644
64 --- a/net-im/telegram-desktop/metadata.xml
65 +++ b/net-im/telegram-desktop/metadata.xml
66 @@ -5,4 +5,8 @@
67 <email>gyakovlev@g.o</email>
68 <name>Georgy Yakovlev</name>
69 </maintainer>
70 + <use>
71 + <flag name="enchant">Enable the app-text/aspell spell-checking backend</flag>
72 + <flag name="hunspell">Enable the app-text/hunspell spell-checking backend</flag>
73 + </use>
74 </pkgmetadata>
75
76 diff --git a/net-im/telegram-desktop/telegram-desktop-1.9.17.ebuild b/net-im/telegram-desktop/telegram-desktop-1.9.17.ebuild
77 new file mode 100644
78 index 00000000000..fd191f347c8
79 --- /dev/null
80 +++ b/net-im/telegram-desktop/telegram-desktop-1.9.17.ebuild
81 @@ -0,0 +1,143 @@
82 +# Copyright 2020 Gentoo Authors
83 +# Distributed under the terms of the GNU General Public License v2
84 +
85 +EAPI=7
86 +
87 +PYTHON_COMPAT=( python3_{6,7} )
88 +
89 +inherit cmake desktop flag-o-matic python-any-r1 xdg-utils
90 +
91 +MY_P="tdesktop-${PV}-full"
92 +
93 +DESCRIPTION="Official desktop client for Telegram"
94 +HOMEPAGE="https://desktop.telegram.org"
95 +SRC_URI="https://github.com/telegramdesktop/tdesktop/releases/download/v${PV}/${MY_P}.tar.gz"
96 +
97 +LICENSE="GPL-3-with-openssl-exception"
98 +SLOT="0"
99 +KEYWORDS="~amd64 ~ppc64"
100 +IUSE="+alsa +dbus enchant +hunspell libressl pulseaudio +spell"
101 +
102 +RDEPEND="
103 + !net-im/telegram-desktop-bin
104 + app-arch/lz4:=
105 + app-arch/xz-utils
106 + !libressl? ( dev-libs/openssl:0= )
107 + libressl? ( dev-libs/libressl:0= )
108 + >=dev-cpp/ms-gsl-2.1.0
109 + dev-cpp/range-v3
110 + dev-libs/xxhash
111 + dev-qt/qtcore:5
112 + dev-qt/qtimageformats:5
113 + dev-qt/qtnetwork:5
114 + dev-qt/qtsvg:5
115 + dev-qt/qtwayland:5
116 + media-libs/fontconfig:=
117 + >=media-libs/libtgvoip-2.4.4_p20200212[alsa?,pulseaudio?]
118 + media-libs/openal[alsa?,pulseaudio?]
119 + media-libs/opus:=
120 + media-video/ffmpeg:=[opus]
121 + sys-libs/zlib[minizip]
122 + virtual/libiconv
123 + x11-libs/libva:=[X,drm]
124 + x11-libs/libX11
125 + || (
126 + dev-qt/qtgui:5[jpeg,png,X(-)]
127 + dev-qt/qtgui:5[jpeg,png,xcb(-)]
128 + )
129 + || (
130 + dev-qt/qtwidgets:5[png,X(-)]
131 + dev-qt/qtwidgets:5[png,xcb(-)]
132 + )
133 + dbus? (
134 + dev-qt/qtdbus:5
135 + dev-libs/libdbusmenu-qt[qt5(+)]
136 + )
137 + enchant? ( app-text/enchant:= )
138 + hunspell? ( >=app-text/hunspell-1.7:= )
139 + pulseaudio? ( media-sound/pulseaudio )
140 +"
141 +
142 +DEPEND="
143 + ${PYTHON_DEPS}
144 + ${RDEPEND}
145 +"
146 +
147 +BDEPEND="
148 + >=dev-util/cmake-3.16
149 + virtual/pkgconfig
150 +"
151 +
152 +REQUIRED_USE="|| ( alsa pulseaudio )
153 + spell? (
154 + ^^ ( enchant hunspell )
155 + )
156 +"
157 +
158 +S="${WORKDIR}/${MY_P}"
159 +
160 +PATCHES=( "${FILESDIR}/${PV}-hunspell-cmake.patch" )
161 +
162 +src_configure() {
163 + local mycxxflags=(
164 + -Wno-deprecated-declarations
165 + -Wno-error=deprecated-declarations
166 + -Wno-switch
167 + )
168 +
169 + append-cxxflags "${mycxxflags[@]}"
170 +
171 + # TODO: unbundle header-only libs, ofc telegram uses git versions...
172 + # it fals with tl-expected-1.0.0, so we use bundled for now to avoid git rev snapshots
173 + # EXPECTED VARIANT
174 + local mycmakeargs=(
175 + -DDESKTOP_APP_DISABLE_CRASH_REPORTS=ON
176 + -DDESKTOP_APP_USE_GLIBC_WRAPS=OFF
177 + -DDESKTOP_APP_USE_PACKAGED=ON
178 + -DDESKTOP_APP_USE_PACKAGED_EXPECTED=OFF
179 + -DDESKTOP_APP_USE_PACKAGED_RLOTTIE=OFF
180 + -DDESKTOP_APP_USE_PACKAGED_VARIANT=OFF
181 + -DTDESKTOP_DISABLE_DESKTOP_FILE_GENERATION=ON
182 + -DTDESKTOP_LAUNCHER_BASENAME="${PN}"
183 + -DDESKTOP_APP_DISABLE_DBUS_INTEGRATION="$(usex dbus OFF ON)"
184 + -DDESKTOP_APP_DISABLE_SPELLCHECK="$(usex spell OFF ON)" # enables hunspell
185 + -DDESKTOP_APP_USE_ENCHANT="$(usex enchant ON OFF)" # enables enchant and disables hunspell
186 + )
187 +
188 + if [[ -n ${MY_TDESKTOP_API_ID} && -n ${MY_TDESKTOP_API_HASH} ]]; then
189 + einfo "Found custom API credentials"
190 + mycmakeargs+=(
191 + -DTDESKTOP_API_ID="${MY_TDESKTOP_API_ID}"
192 + -DTDESKTOP_API_HASH="${MY_TDESKTOP_API_HASH}"
193 + )
194 + else
195 + # https://github.com/telegramdesktop/tdesktop/blob/dev/snap/snapcraft.yaml
196 + # Building with snapcraft API credentials by default
197 + # Custom API credentials can be obtained here:
198 + # https://github.com/telegramdesktop/tdesktop/blob/dev/docs/api_credentials.md
199 + # After getting credentials you can export variables:
200 + # export MY_TDESKTOP_API_ID="17349""
201 + # export MY_TDESKTOP_API_HASH="344583e45741c457fe1862106095a5eb"
202 + # and restart the build"
203 + # you can set above variables (without export) in /etc/portage/env/net-im/telegram-desktop
204 + # portage will use custom variable every build automatically
205 + mycmakeargs+=(
206 + -DTDESKTOP_API_ID="611335"
207 + -DTDESKTOP_API_HASH="d524b414d21f4d37f08684c1df41ac9c"
208 + )
209 + fi
210 +
211 + cmake_src_configure
212 +}
213 +
214 +pkg_postinst() {
215 + xdg_desktop_database_update
216 + xdg_icon_cache_update
217 + xdg_mimeinfo_database_update
218 +}
219 +
220 +pkg_postrm() {
221 + xdg_desktop_database_update
222 + xdg_icon_cache_update
223 + xdg_mimeinfo_database_update
224 +}