1 |
commit: 635645e4df3d22ce0163e2c070b29f7e661f3786 |
2 |
Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 27 13:50:27 2020 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 27 14:02:28 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=635645e4 |
7 |
|
8 |
net-im/swift: fix compilation |
9 |
|
10 |
Closes: https://bugs.gentoo.org/761691 |
11 |
Package-Manager: Portage-3.0.12, Repoman-3.0.2 |
12 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
13 |
|
14 |
net-im/swift/swift-4.0.2-r102.ebuild | 201 +++++++++++++++++++++++++++++++++++ |
15 |
1 file changed, 201 insertions(+) |
16 |
|
17 |
diff --git a/net-im/swift/swift-4.0.2-r102.ebuild b/net-im/swift/swift-4.0.2-r102.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..00166ea9823 |
20 |
--- /dev/null |
21 |
+++ b/net-im/swift/swift-4.0.2-r102.ebuild |
22 |
@@ -0,0 +1,201 @@ |
23 |
+# Copyright 1999-2020 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=7 |
27 |
+ |
28 |
+LUA_COMPAT=( lua5-{1..2} luajit ) |
29 |
+PYTHON_COMPAT=( python3_{6..9} ) |
30 |
+ |
31 |
+inherit lua-single python-any-r1 scons-utils toolchain-funcs |
32 |
+ |
33 |
+DESCRIPTION="An elegant, secure, adaptable and intuitive XMPP Client" |
34 |
+HOMEPAGE="https://www.swift.im/" |
35 |
+SRC_URI=" |
36 |
+ https://swift.im/downloads/releases/${P}/${P}.tar.gz |
37 |
+ https://dev.gentoo.org/~conikost/distfiles/patches/swift-4.0.2-python3-compatibility.patch.gz" |
38 |
+ |
39 |
+LICENSE="BSD BSD-1 CC-BY-3.0 GPL-3 OFL-1.1" |
40 |
+SLOT="4/0" |
41 |
+KEYWORDS="~amd64" |
42 |
+IUSE="expat +icu +idn lua test zeroconf" |
43 |
+REQUIRED_USE=" |
44 |
+ || ( icu idn ) |
45 |
+ lua? ( ${LUA_REQUIRED_USE} ) |
46 |
+" |
47 |
+ |
48 |
+RDEPEND=" |
49 |
+ dev-db/sqlite:3 |
50 |
+ dev-libs/boost:= |
51 |
+ dev-libs/openssl:0= |
52 |
+ net-libs/libnatpmp |
53 |
+ net-libs/miniupnpc:= |
54 |
+ sys-libs/zlib |
55 |
+ expat? ( dev-libs/expat ) |
56 |
+ !expat? ( dev-libs/libxml2:2 ) |
57 |
+ icu? ( dev-libs/icu:= ) |
58 |
+ idn? ( net-dns/libidn:= ) |
59 |
+ lua? ( ${LUA_DEPS} ) |
60 |
+" |
61 |
+ |
62 |
+DEPEND=" |
63 |
+ ${RDEPEND} |
64 |
+ >=dev-util/scons-3.0.1-r3 |
65 |
+ test? ( net-dns/avahi ) |
66 |
+" |
67 |
+ |
68 |
+# Tests don't run, as they fail with "[QA/UnitTest/**dummy**] Error -6". |
69 |
+RESTRICT="test" |
70 |
+ |
71 |
+DOCS=( |
72 |
+ "DEVELOPMENT.md" |
73 |
+ "README.md" |
74 |
+ "Swiften/ChangeLog.md" |
75 |
+) |
76 |
+ |
77 |
+PATCHES=( |
78 |
+ "${FILESDIR}"/${P}-boost-1.69-compatibility.patch |
79 |
+ "${WORKDIR}"/${P}-python3-compatibility.patch |
80 |
+ "${FILESDIR}"/${P}-qt-5.11-compatibility.patch |
81 |
+ "${FILESDIR}"/${P}-qt-5.15-compatibility.patch |
82 |
+) |
83 |
+ |
84 |
+pkg_setup() { |
85 |
+ python-any-r1_pkg_setup |
86 |
+ use lua && lua-single_pkg_setup |
87 |
+} |
88 |
+ |
89 |
+src_prepare() { |
90 |
+ default |
91 |
+ |
92 |
+ # Don't include '/usr/lib*' in the link command line for `swiften-config` |
93 |
+ sed -e '/_LIBDIRFLAGS/d' -i Swiften/Config/SConscript || die |
94 |
+ |
95 |
+ # Use correct LIBDIR for Lua |
96 |
+ sed -e "s/lib/$(get_libdir)/g" -i Sluift/SConscript.variant || die |
97 |
+ |
98 |
+ # Hack for finding Qt system libs |
99 |
+ mkdir "${T}"/qt || die |
100 |
+ ln -s "${EPREFIX}"/usr/$(get_libdir)/qt5/bin "${T}"/qt/bin || die |
101 |
+ ln -s "${EPREFIX}"/usr/$(get_libdir)/qt5 "${T}"/qt/lib || die |
102 |
+ ln -s "${EPREFIX}"/usr/include/qt5 "${T}"/qt/include || die |
103 |
+ |
104 |
+ # Remove parts of Swift, which a user don't want to compile |
105 |
+ rm -fr Swift Slimber || die |
106 |
+ if ! use lua; then rm -fr Sluift || die; fi |
107 |
+ if ! use zeroconf; then rm -fr Limber || die; fi |
108 |
+ |
109 |
+ # Remove '3rdParty', as the system libs should be used |
110 |
+ # `CppUnit`, `GoogleTest` and `HippoMocks` are needed for tests |
111 |
+ local my3rdparty=( |
112 |
+ Boost |
113 |
+ Breakpad |
114 |
+ DocBook |
115 |
+ Expat |
116 |
+ LCov |
117 |
+ Ldns |
118 |
+ LibIDN |
119 |
+ LibMiniUPnPc |
120 |
+ LibNATPMP |
121 |
+ Lua |
122 |
+ OpenSSL |
123 |
+ SCons |
124 |
+ SQLite |
125 |
+ Unbound |
126 |
+ ZLib |
127 |
+ ) |
128 |
+ |
129 |
+ if use test; then |
130 |
+ cd 3rdParty && rm -fr "${my3rdparty[@]}" || die |
131 |
+ else |
132 |
+ rm -fr 3rdParty || die |
133 |
+ fi |
134 |
+} |
135 |
+ |
136 |
+src_configure() { |
137 |
+ MYSCONS=( |
138 |
+ ar="$(tc-getAR)" |
139 |
+ allow_warnings="yes" |
140 |
+ assertions="no" |
141 |
+ build_examples="yes" |
142 |
+ boost_bundled_enable="false" |
143 |
+ boost_force_bundled="false" |
144 |
+ cc="$(tc-getCC)" |
145 |
+ ccache="no" |
146 |
+ ccflags="${CFLAGS}" |
147 |
+ coverage="no" |
148 |
+ cxx="$(tc-getCXX)" |
149 |
+ cxxflags="${CXXFLAGS}" |
150 |
+ debug="no" |
151 |
+ distcc="no" |
152 |
+ experimental="no" |
153 |
+ experimental_ft="yes" |
154 |
+ hunspell_enable="no" |
155 |
+ icu="$(usex icu)" |
156 |
+ install_git_hooks="no" |
157 |
+ libidn_bundled_enable="false" |
158 |
+ libminiupnpc_force_bundled="false" |
159 |
+ libnatpmp_force_bundled="false" |
160 |
+ link="$(tc-getCXX)" |
161 |
+ linkflags="${LDFLAGS}" |
162 |
+ max_jobs="no" |
163 |
+ optimize="no" |
164 |
+ qt="${T}/qt" |
165 |
+ qt5="no" |
166 |
+ swiften_dll="true" |
167 |
+ swift_mobile="no" |
168 |
+ target="native" |
169 |
+ test="none" |
170 |
+ try_avahi="no" |
171 |
+ try_expat="$(usex expat)" |
172 |
+ try_gconf="no" |
173 |
+ try_libidn="$(usex idn)" |
174 |
+ try_libxml="$(usex !expat)" |
175 |
+ tls_backend="openssl" |
176 |
+ unbound="no" |
177 |
+ V="1" |
178 |
+ valgrind="no" |
179 |
+ zlib_bundled_enable="false" |
180 |
+ ) |
181 |
+ |
182 |
+ if use lua; then |
183 |
+ MYSCONS+=( |
184 |
+ lua_includedir="$(lua_get_include_dir)" |
185 |
+ lua_libdir="${EPREFIX}/usr/$(get_libdir)" |
186 |
+ lua_libname="$(basename -s '.so' $(lua_get_shared_lib))" |
187 |
+ ) |
188 |
+ fi |
189 |
+} |
190 |
+ |
191 |
+src_compile() { |
192 |
+ local myesconsinstall=( |
193 |
+ Swiften |
194 |
+ $(usex lua Sluift '') |
195 |
+ $(usex zeroconf Limber '') |
196 |
+ ) |
197 |
+ |
198 |
+ escons "${MYSCONS[@]}" "${myesconsinstall[@]}" |
199 |
+} |
200 |
+ |
201 |
+src_test() { |
202 |
+ MYSCONS=( |
203 |
+ V="1" |
204 |
+ ) |
205 |
+ |
206 |
+ escons "${MYSCONS[@]}" test=unit QA |
207 |
+} |
208 |
+ |
209 |
+src_install() { |
210 |
+ local myesconsinstall=( |
211 |
+ SWIFTEN_INSTALLDIR="${ED}/usr" |
212 |
+ SWIFTEN_LIBDIR="${ED}/usr/$(get_libdir)" |
213 |
+ $(usex lua "SLUIFT_DIR=${ED}/usr" '') |
214 |
+ $(usex lua "SLUIFT_INSTALLDIR=${ED}/usr" '') |
215 |
+ "${ED}" |
216 |
+ ) |
217 |
+ |
218 |
+ escons "${MYSCONS[@]}" "${myesconsinstall[@]}" |
219 |
+ |
220 |
+ use zeroconf && dobin Limber/limber |
221 |
+ |
222 |
+ einstalldocs |
223 |
+} |