Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/
Date: Thu, 18 Aug 2022 07:06:33
Message-Id: 1660806378.90a3d5fff1c032b3b2de6133c6eb9c7711daccb9.juippis@gentoo
1 commit: 90a3d5fff1c032b3b2de6133c6eb9c7711daccb9
2 Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz>
3 AuthorDate: Mon Aug 1 14:10:01 2022 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Aug 18 07:06:18 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90a3d5ff
7
8 net-im/bitlbee: Use system json-parser
9
10 - Applied patch allows us to use system json-parser, it is based on
11 upstream PR, see the link below
12 - Dropped arm64, ppc, ppc64 and x86 keywords because newly introduced
13 dev-libs/json-parser dependency has currently only ~amd64 keyword
14 - EAPI 7 -> 8
15
16 Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
17 Bug: https://bugs.gentoo.org/861371
18 Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
19 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
20
21 net-im/bitlbee/bitlbee-3.6-r3.ebuild | 157 +++++++++++++++++++++
22 .../files/bitlbee-3.6-system-json-parser.patch | 82 +++++++++++
23 2 files changed, 239 insertions(+)
24
25 diff --git a/net-im/bitlbee/bitlbee-3.6-r3.ebuild b/net-im/bitlbee/bitlbee-3.6-r3.ebuild
26 new file mode 100644
27 index 000000000000..72d2a7207ba2
28 --- /dev/null
29 +++ b/net-im/bitlbee/bitlbee-3.6-r3.ebuild
30 @@ -0,0 +1,157 @@
31 +# Copyright 1999-2022 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=8
35 +
36 +PYTHON_COMPAT=( python3_{8..11} )
37 +
38 +inherit python-any-r1 systemd toolchain-funcs
39 +
40 +if [[ ${PV} == "9999" ]]; then
41 + EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git"
42 + inherit git-r3
43 +else
44 + SRC_URI="https://get.bitlbee.org/src/${P}.tar.gz"
45 + KEYWORDS="~amd64"
46 +fi
47 +
48 +DESCRIPTION="irc to IM gateway that support multiple IM protocols"
49 +HOMEPAGE="https://www.bitlbee.org/"
50 +
51 +LICENSE="GPL-2"
52 +SLOT="0"
53 +IUSE_PROTOCOLS="msn oscar purple twitter +xmpp"
54 +IUSE="debug +gnutls ipv6 libevent nss otr +plugins selinux test xinetd
55 + ${IUSE_PROTOCOLS}"
56 +RESTRICT="!test? ( test )"
57 +
58 +REQUIRED_USE="
59 + || ( purple xmpp msn oscar )
60 + purple? ( plugins )
61 + test? ( plugins )
62 + xmpp? ( !nss )
63 +"
64 +
65 +COMMON_DEPEND="
66 + acct-group/bitlbee
67 + acct-user/bitlbee
68 + dev-libs/glib:2
69 + dev-libs/json-parser:=
70 + purple? ( net-im/pidgin )
71 + libevent? ( dev-libs/libevent:= )
72 + otr? ( >=net-libs/libotr-4 )
73 + gnutls? ( net-libs/gnutls:= )
74 + !gnutls? (
75 + nss? ( dev-libs/nss )
76 + !nss? (
77 + dev-libs/openssl:0=
78 + )
79 + )
80 +"
81 +DEPEND="${COMMON_DEPEND}
82 + selinux? ( sec-policy/selinux-bitlbee )
83 + test? ( dev-libs/check )
84 +"
85 +
86 +RDEPEND="${COMMON_DEPEND}
87 + xinetd? ( sys-apps/xinetd )
88 +"
89 +
90 +BDEPEND="${PYTHON_DEPS}
91 + virtual/pkgconfig
92 +"
93 +
94 +PATCHES=(
95 + "${FILESDIR}/${PN}-3.5-systemd-user.patch"
96 + "${FILESDIR}/${PN}-3.5-libcheck.patch"
97 + "${FILESDIR}/${PN}-3.5-libevent.patch"
98 + "${FILESDIR}/${P}-disabled-plugins-use.patch"
99 + "${FILESDIR}/${P}-system-json-parser.patch"
100 +)
101 +
102 +src_configure() {
103 + local myconf
104 +
105 + # setup plugins, protocol, ipv6 and debug
106 + myconf+=( --jabber=$(usex xmpp 1 0) )
107 + for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/+xmpp/} ; do
108 + myconf+=( --${flag}=$(usex ${flag} 1 0) )
109 + done
110 +
111 + # set otr
112 + if use otr && use plugins ; then
113 + myconf+=( --otr=plugin )
114 + else
115 + if use otr ; then
116 + ewarn "OTR support has been disabled automatically because it"
117 + ewarn "requires the plugins USE flag."
118 + fi
119 + myconf+=( --otr=0 )
120 + fi
121 +
122 + # setup ssl use flags
123 + if use gnutls ; then
124 + myconf+=( --ssl=gnutls )
125 + einfo "Using gnutls for SSL support"
126 + else
127 + ewarn "Only gnutls is officially supported by upstream."
128 + if use nss ; then
129 + myconf+=( --ssl=nss )
130 + einfo "Using nss for SSL support"
131 + else
132 + myconf+=( --ssl=openssl )
133 + einfo "Using openssl for SSL support"
134 + fi
135 + fi
136 +
137 + # set event handler
138 + if use libevent ; then
139 + myconf+=( --events=libevent )
140 + else
141 + myconf+=( --events=glib )
142 + fi
143 +
144 + # not autotools-based
145 + ./configure \
146 + --prefix=/usr \
147 + --datadir=/usr/share/bitlbee \
148 + --etcdir=/etc/bitlbee \
149 + --libdir=/usr/$(get_libdir) \
150 + --pcdir=/usr/$(get_libdir)/pkgconfig \
151 + --plugindir=/usr/$(get_libdir)/bitlbee \
152 + --externaljsonparser=1 \
153 + --systemdsystemunitdir=$(systemd_get_systemunitdir) \
154 + --doc=1 \
155 + --strip=0 \
156 + --verbose=1 \
157 + "${myconf[@]}" || die
158 +
159 + sed -i \
160 + -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
161 + Makefile.settings || die
162 +}
163 +
164 +src_compile() {
165 + emake CC="$(tc-getCC)" LD="$(tc-getLD)"
166 +}
167 +
168 +src_install() {
169 + emake DESTDIR="${D}" install install-etc install-doc install-dev install-systemd
170 +
171 + keepdir /var/lib/bitlbee
172 + fperms 700 /var/lib/bitlbee
173 + fowners bitlbee:bitlbee /var/lib/bitlbee
174 +
175 + dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
176 +
177 + if use xinetd ; then
178 + insinto /etc/xinetd.d
179 + newins doc/bitlbee.xinetd bitlbee
180 + fi
181 +
182 + newinitd "${FILESDIR}"/bitlbee.initd-r2 bitlbee
183 + newconfd "${FILESDIR}"/bitlbee.confd-r2 bitlbee
184 +
185 + exeinto /usr/share/bitlbee
186 + doexe utils/{convert_purple.py,bitlbee-ctl.pl}
187 +}
188
189 diff --git a/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch b/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch
190 new file mode 100644
191 index 000000000000..02d57e02d6d2
192 --- /dev/null
193 +++ b/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch
194 @@ -0,0 +1,82 @@
195 +This is adapted patch from upstream PR 151. Original PR defines
196 +--external-json-parser which breaks configuration, see [1]. It was changed to
197 +--externaljsonparser and $external_json_parser to $externaljsonparser.
198 +
199 +[1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
200 +
201 +Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
202 +
203 +diff --git a/configure b/configure
204 +index 4640c806..77b1213b 100755
205 +--- a/configure
206 ++++ b/configure
207 +@@ -47,6 +47,7 @@ plugins=1
208 + otr=0
209 +
210 + events=glib
211 ++externaljsonparser=auto
212 + ssl=auto
213 +
214 + pam=0
215 +@@ -148,6 +149,7 @@ Option Description Default
216 + --events=... Event handler (glib, libevent) $events
217 + --ssl=... SSL library to use (gnutls, nss, openssl, auto)
218 + $ssl
219 ++--externaljsonparser=0/1/auto Use External JSON parser $externaljsonparser
220 +
221 +
222 + --target=... Cross compilation target same as host
223 +@@ -398,6 +400,20 @@ else
224 + fi
225 + echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
226 +
227 ++if [ "$externaljsonparser" = "auto" ]; then
228 ++ if pkg-config --exists json-parser; then
229 ++ externaljsonparser=1
230 ++ else
231 ++ externaljsonparser=0
232 ++ fi
233 ++fi
234 ++echo "EXTERNAL_JSON_PARSER=$externaljsonparser" >> Makefile.settings
235 ++if [ "$externaljsonparser" = "1" ]; then
236 ++ echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings
237 ++ echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings
238 ++fi
239 ++
240 ++
241 + detect_gnutls()
242 + {
243 + if $PKG_CONFIG --exists gnutls; then
244 +@@ -979,6 +995,12 @@ else
245 + echo ' systemd disabled.'
246 + fi
247 +
248 ++if [ "$externaljsonparser" = "1" ]; then
249 ++ echo ' Using system JSON parser.'
250 ++else
251 ++ echo ' Using bundled JSON parser.'
252 ++fi
253 ++
254 + echo ' Using event handler: '$events
255 + echo ' Using SSL library: '$ssl
256 + #echo ' Building with these storage backends: '$STORAGES
257 +diff --git a/lib/Makefile b/lib/Makefile
258 +index fc46aedc..ad95d9cb 100644
259 +--- a/lib/Makefile
260 ++++ b/lib/Makefile
261 +@@ -12,7 +12,11 @@ _SRCDIR_ := $(_SRCDIR_)lib/
262 + endif
263 +
264 + # [SH] Program variables
265 +-objects = arc.o base64.o canohost.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o json.o json_util.o md5.o misc.o oauth.o oauth2.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o
266 ++objects = arc.o base64.o canohost.o $(EVENT_HANDLER) ftutil.o http_client.o ini.o json_util.o md5.o misc.o oauth.o oauth2.o proxy.o sha1.o $(SSL_CLIENT) url.o xmltree.o ns_parse.o
267 ++
268 ++ifneq ($(EXTERNAL_JSON_PARSER),1)
269 ++objects += json.o
270 ++endif
271 +
272 + LFLAGS += -r
273 +
274 +--
275 +2.35.1
276 +