Gentoo Archives: gentoo-commits

From: Andrey Utkin <andrey_utkin@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/swift/, net-im/swift/files/
Date: Sat, 24 Nov 2018 02:46:39
Message-Id: 1543027496.69bd066772638de9aa56483b6dbd7b9bb5a79308.andrey_utkin@gentoo
1 commit: 69bd066772638de9aa56483b6dbd7b9bb5a79308
2 Author: Conrad Kostecki <conrad <AT> kostecki <DOT> com>
3 AuthorDate: Fri Nov 16 23:46:47 2018 +0000
4 Commit: Andrey Utkin <andrey_utkin <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 24 02:44:56 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69bd0667
7
8 net-im/swift: New package
9
10 An elegant, secure, adaptable and intuitive XMPP client.
11
12 Closes: https://bugs.gentoo.org/334887
13 Closes: https://bugs.gentoo.org/652464
14 Package-Manager: Portage-2.3.51, Repoman-2.3.12
15 Signed-off-by: Conrad Kostecki <conrad <AT> kostecki.com>
16 Signed-off-by: Andrey Utkin <andrey_utkin <AT> gentoo.org>
17
18 net-im/swift/Manifest | 1 +
19 ...generated-files-handle-unicode-characters.patch | 38 ++++
20 .../files/swift-4.0.2-qt-5.11-compatibility.patch | 35 ++++
21 net-im/swift/metadata.xml | 23 +++
22 net-im/swift/swift-4.0.2.ebuild | 207 +++++++++++++++++++++
23 5 files changed, 304 insertions(+)
24
25 diff --git a/net-im/swift/Manifest b/net-im/swift/Manifest
26 new file mode 100644
27 index 00000000000..d0e86af54c3
28 --- /dev/null
29 +++ b/net-im/swift/Manifest
30 @@ -0,0 +1 @@
31 +DIST swift-4.0.2.tar.gz 19083393 BLAKE2B de4ad1c3d68dfc4d693cdebdf4e18809210aa4e83af31b77bf730c7018507877852b5ea634623c037250de4005606108bd0372d39177093769c5dc5f72bd4812 SHA512 b7d4b90f387d5ea4ac3ca31794eabd1f12a64274628d75c7570f40269777b9003182884730a6340c5e0b5b7928a68bda5e49be623b47da9fa64fe4c3f25be167
32
33 diff --git a/net-im/swift/files/swift-4.0.2-make-generated-files-handle-unicode-characters.patch b/net-im/swift/files/swift-4.0.2-make-generated-files-handle-unicode-characters.patch
34 new file mode 100644
35 index 00000000000..7fd2e386d9d
36 --- /dev/null
37 +++ b/net-im/swift/files/swift-4.0.2-make-generated-files-handle-unicode-characters.patch
38 @@ -0,0 +1,38 @@
39 +From 39ff091cddf8fd5e01047d80c7ed60c150537705 Mon Sep 17 00:00:00 2001
40 +From: Thanos Doukoudakis <thanos.doukoudakis@×××××.com>
41 +Date: Fri, 11 May 2018 11:26:39 +0100
42 +Subject: Make generated files handle Unicode characters
43 +
44 +This patch handles a case where some of the files used to generate COPYING,
45 +were containing unicode strings, which could lead to a failure when building
46 +sid package. The code now will check the type of the string before writing to
47 +the file, and if needed it will transform it to the appropriate format.
48 +
49 +Test-Information:
50 +Generated the sid package with package_all_platforms script with no problems.
51 +Created a debian sid box and tested the installation of the generated
52 +packages. Validated the output generated in Windows 10 and Ubuntu 16.04 builds
53 +through the "About" dialog in Swift.
54 +
55 +Change-Id: I05e518b758f316d9fbf23c1079be5a462e75106c
56 +
57 +diff --git a/BuildTools/SCons/Tools/textfile.py b/BuildTools/SCons/Tools/textfile.py
58 +index 89f8963..9b424f2 100644
59 +--- a/BuildTools/SCons/Tools/textfile.py
60 ++++ b/BuildTools/SCons/Tools/textfile.py
61 +@@ -113,7 +113,11 @@ def _action(target, source, env):
62 + lsep = None
63 + for s in source:
64 + if lsep: fd.write(lsep)
65 +- fd.write(_do_subst(s, subs))
66 ++ stringtowrite = _do_subst(s, subs)
67 ++ if isinstance(stringtowrite, str):
68 ++ fd.write(stringtowrite)
69 ++ elif isinstance(stringtowrite, unicode):
70 ++ fd.write(stringtowrite.encode('utf-8'))
71 + lsep = linesep
72 + fd.close()
73 +
74 +--
75 +cgit v0.10.2-6-g49f6
76 +
77
78 diff --git a/net-im/swift/files/swift-4.0.2-qt-5.11-compatibility.patch b/net-im/swift/files/swift-4.0.2-qt-5.11-compatibility.patch
79 new file mode 100644
80 index 00000000000..db633945b49
81 --- /dev/null
82 +++ b/net-im/swift/files/swift-4.0.2-qt-5.11-compatibility.patch
83 @@ -0,0 +1,35 @@
84 +From 1d18148c86377787a8c77042b12ea66f20cb2ca9 Mon Sep 17 00:00:00 2001
85 +From: Tobias Markmann <tm@×××××.de>
86 +Date: Thu, 21 Jun 2018 13:04:56 +0200
87 +Subject: Add missing include for QAbstractItemModel
88 +
89 +This fixes building Swift with Qt 5.11.
90 +
91 +Test-Information:
92 +
93 +Builds and tests pass on macOS 10.13.5 with Qt 5.11.0.
94 +
95 +Change-Id: I1be2cd081d8a520ec38ab7cca5ada0d7fc39b777
96 +
97 +diff --git a/Swift/QtUI/UserSearch/QtUserSearchWindow.h b/Swift/QtUI/UserSearch/QtUserSearchWindow.h
98 +index 0714ac1..fe536ab 100644
99 +--- a/Swift/QtUI/UserSearch/QtUserSearchWindow.h
100 ++++ b/Swift/QtUI/UserSearch/QtUserSearchWindow.h
101 +@@ -1,5 +1,5 @@
102 + /*
103 +- * Copyright (c) 2010-2016 Isode Limited.
104 ++ * Copyright (c) 2010-2018 Isode Limited.
105 + * All rights reserved.
106 + * See the COPYING file for more information.
107 + */
108 +@@ -8,6 +8,7 @@
109 +
110 + #include <set>
111 +
112 ++#include <QAbstractItemModel>
113 + #include <QWizard>
114 +
115 + #include <Swiften/Base/Override.h>
116 +--
117 +cgit v0.10.2-6-g49f6
118 +
119
120 diff --git a/net-im/swift/metadata.xml b/net-im/swift/metadata.xml
121 new file mode 100644
122 index 00000000000..acb7295d48a
123 --- /dev/null
124 +++ b/net-im/swift/metadata.xml
125 @@ -0,0 +1,23 @@
126 +<?xml version="1.0" encoding="UTF-8"?>
127 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
128 +<pkgmetadata>
129 + <maintainer type="person">
130 + <email>ck+gentoo@××××××××.de</email>
131 + <name>Conrad Kostecki</name>
132 + </maintainer>
133 + <maintainer type="project">
134 + <email>proxy-maint@g.o</email>
135 + <name>Proxy Maintainers</name>
136 + </maintainer>
137 + <longdescription>
138 + Swift is an elegant, secure, adaptable and intuitive XMPP client,
139 + with features that make it suitable for a wide range of use scenarios.
140 + Swiften is a robust, high-quality, standards-compliant,
141 + cross-platform, and performant C++ library for
142 + implementing XMPP applications.
143 + </longdescription>
144 + <use>
145 + <flag name="client">Build the full graphical XMPP client.</flag>
146 + <flag name="gconf">Enable configuration through <pkg>gnome-base/gconf</pkg>.</flag>
147 + </use>
148 +</pkgmetadata>
149
150 diff --git a/net-im/swift/swift-4.0.2.ebuild b/net-im/swift/swift-4.0.2.ebuild
151 new file mode 100644
152 index 00000000000..c67278ade28
153 --- /dev/null
154 +++ b/net-im/swift/swift-4.0.2.ebuild
155 @@ -0,0 +1,207 @@
156 +# Copyright 1999-2018 Gentoo Authors
157 +# Distributed under the terms of the GNU General Public License v2
158 +
159 +EAPI=6
160 +
161 +inherit gnome2-utils scons-utils toolchain-funcs
162 +
163 +DESCRIPTION="An elegant, secure, adaptable and intuitive XMPP Client"
164 +HOMEPAGE="https://www.swift.im/"
165 +SRC_URI="https://swift.im/downloads/releases/${P}/${P}.tar.gz"
166 +
167 +LICENSE="BSD BSD-1 CC-BY-3.0 GPL-3 OFL-1.1"
168 +SLOT="4/0"
169 +KEYWORDS="~amd64"
170 +IUSE="client expat gconf +icu +idn lua spell test zeroconf"
171 +REQUIRED_USE="
172 + || ( icu idn )
173 + gconf? ( client )
174 + spell? ( client )
175 +"
176 +
177 +RDEPEND="
178 + dev-db/sqlite:3
179 + dev-libs/boost:=
180 + dev-libs/openssl:0=
181 + net-libs/libnatpmp
182 + net-libs/miniupnpc:=
183 + sys-libs/zlib:=
184 + client? (
185 + dev-qt/qtcore:5
186 + dev-qt/qtdbus:5
187 + dev-qt/qtgui:5
188 + dev-qt/qtmultimedia:5
189 + dev-qt/qtnetwork:5
190 + dev-qt/qtsvg:5
191 + dev-qt/qtwidgets:5
192 + dev-qt/qtwebkit:5
193 + dev-qt/qtx11extras:5
194 + net-dns/avahi
195 + )
196 + expat? ( dev-libs/expat )
197 + !expat? ( dev-libs/libxml2:2 )
198 + gconf? ( gnome-base/gconf:2 )
199 + icu? ( dev-libs/icu:= )
200 + idn? ( net-dns/libidn:= )
201 + lua? ( dev-lang/lua:= )
202 + spell? ( app-text/hunspell:= )
203 +"
204 +
205 +DEPEND="
206 + ${RDEPEND}
207 + >=dev-util/scons-3.0.1-r3
208 + client? ( dev-qt/linguist-tools:5 )
209 + test? ( net-dns/avahi )
210 +"
211 +
212 +# Tests don't run, as they fail with "[QA/UnitTest/**dummy**] Error -6".
213 +RESTRICT="test"
214 +
215 +DOCS=(
216 + "DEVELOPMENT.md"
217 + "README.md"
218 + "Swiften/ChangeLog.md"
219 +)
220 +
221 +PATCHES=(
222 + "${FILESDIR}"/${P}-make-generated-files-handle-unicode-characters.patch
223 + "${FILESDIR}"/${P}-qt-5.11-compatibility.patch
224 +)
225 +
226 +src_prepare() {
227 + default
228 +
229 + # Hack for finding Qt system libs
230 + mkdir "${T}"/qt || die
231 + ln -s "${EPREFIX%/}"/usr/$(get_libdir)/qt5/bin "${T}"/qt/bin || die
232 + ln -s "${EPREFIX%/}"/usr/$(get_libdir)/qt5 "${T}"/qt/lib || die
233 + ln -s "${EPREFIX%/}"/usr/include/qt5 "${T}"/qt/include || die
234 +
235 + # Remove parts of Swift, which a user don't want to compile
236 + if ! use client; then rm -fr Swift Slimber || die; fi
237 + if ! use lua; then rm -fr Sluift || die; fi
238 + if ! use zeroconf; then
239 + rm -fr Limber || die
240 + if use client; then rm -fr Slimber || die; fi
241 + fi
242 +
243 + # Remove '3rdParty', as the system libs should be used
244 + # `CppUnit`, `GoogleTest` and `HippoMocks` are needed for tests
245 + local my3rdparty=(
246 + Boost
247 + Breakpad
248 + DocBook
249 + Expat
250 + LCov
251 + Ldns
252 + LibIDN
253 + LibMiniUPnPc
254 + LibNATPMP
255 + Lua
256 + OpenSSL
257 + SCons
258 + SQLite
259 + Unbound
260 + ZLib
261 + )
262 +
263 + if use test; then
264 + cd 3rdParty && rm -fr "${my3rdparty[@]}" || die
265 + else
266 + rm -fr 3rdParty || die
267 + fi
268 +}
269 +
270 +src_configure() {
271 + MYSCONS=(
272 + ar="$(tc-getAR)"
273 + allow_warnings="yes"
274 + assertions="no"
275 + build_examples="yes"
276 + boost_bundled_enable="false"
277 + boost_force_bundled="false"
278 + cc="$(tc-getCC)"
279 + ccache="no"
280 + ccflags="${CFLAGS}"
281 + coverage="no"
282 + cxx="$(tc-getCXX)"
283 + cxxflags="${CXXFLAGS}"
284 + debug="no"
285 + distcc="no"
286 + experimental="yes"
287 + experimental_ft="yes"
288 + hunspell_enable="$(usex spell)"
289 + icu="$(usex icu)"
290 + install_git_hooks="no"
291 + libidn_bundled_enable="false"
292 + libminiupnpc_force_bundled="false"
293 + libnatpmp_force_bundled="false"
294 + link="$(tc-getCXX)"
295 + linkflags="${LDFLAGS}"
296 + max_jobs="no"
297 + optimize="no"
298 + qt="${T}/qt"
299 + qt5="$(usex client)"
300 + swiften_dll="true"
301 + swift_mobile="no"
302 + target="native"
303 + test="none"
304 + try_avahi="$(usex client)"
305 + try_expat="$(usex expat)"
306 + try_gconf="$(usex gconf)"
307 + try_libidn="$(usex idn)"
308 + try_libxml="$(usex !expat)"
309 + tls_backend="openssl"
310 + unbound="no"
311 + V="1"
312 + valgrind="no"
313 + zlib_bundled_enable="false"
314 + )
315 +}
316 +
317 +src_compile() {
318 + local myesconsinstall=(
319 + Swiften
320 + $(usex client Swift '')
321 + $(usex lua Sluift '')
322 + $(usex zeroconf Limber '')
323 + $(usex zeroconf "$(usex client Slimber '')" '')
324 + )
325 +
326 + escons "${MYSCONS[@]}" "${myesconsinstall[@]}"
327 +}
328 +
329 +src_test() {
330 + MYSCONS=(
331 + V="1"
332 + )
333 +
334 + escons "${MYSCONS[@]}" test=unit QA
335 +}
336 +
337 +src_install() {
338 + local myesconsinstall=(
339 + SWIFTEN_INSTALLDIR="${ED%/}/usr"
340 + SWIFTEN_LIBDIR="${ED%/}/usr/$(get_libdir)"
341 + $(usex client "SWIFT_INSTALLDIR=${ED%/}/usr" '')
342 + $(usex lua "SLUIFT_DIR=${ED%/}/usr" '')
343 + $(usex lua "SLUIFT_INSTALLDIR=${ED%/}/usr" '')
344 + "${ED}"
345 + )
346 +
347 + escons "${MYSCONS[@]}" "${myesconsinstall[@]}"
348 +
349 + use zeroconf && dobin Limber/limber
350 + use zeroconf && use client && newbin Slimber/CLI/slimber slimber-cli
351 + use zeroconf && use client && newbin Slimber/Qt/slimber slimber-qt
352 +
353 + einstalldocs
354 +}
355 +
356 +pkg_postinst() {
357 + use client && gnome2_icon_cache_update
358 +}
359 +
360 +pkg_postrm() {
361 + use client && gnome2_icon_cache_update
362 +}