summaryrefslogtreecommitdiff
path: root/net-im/bitlbee
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-08-18 14:34:38 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-08-18 14:34:38 +0100
commit3fb6e94893672e0dfbae682e6a3418e3f1260bf2 (patch)
tree6b19e4b8d9cb929c7caba132adbd596883f582ca /net-im/bitlbee
parent933ed80ab9b645de54b16eeb7410c0a54f47574f (diff)
gentoo auto-resync : 18:08:2022 - 14:34:37
Diffstat (limited to 'net-im/bitlbee')
-rw-r--r--net-im/bitlbee/Manifest8
-rw-r--r--net-im/bitlbee/bitlbee-3.6-r2.ebuild (renamed from net-im/bitlbee/bitlbee-3.6-r1.ebuild)4
-rw-r--r--net-im/bitlbee/bitlbee-3.6-r3.ebuild157
-rw-r--r--net-im/bitlbee/bitlbee-9999.ebuild10
-rw-r--r--net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch31
-rw-r--r--net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch82
-rw-r--r--net-im/bitlbee/files/bitlbee-9999-system-json-parser.patch83
7 files changed, 369 insertions, 6 deletions
diff --git a/net-im/bitlbee/Manifest b/net-im/bitlbee/Manifest
index bcdfa4991de2..6e2b53648d93 100644
--- a/net-im/bitlbee/Manifest
+++ b/net-im/bitlbee/Manifest
@@ -2,9 +2,13 @@ AUX bitlbee-3.5-libcheck.patch 17203 BLAKE2B 14cb1ba02178e89ed098518a8fb48b6f312
AUX bitlbee-3.5-libevent.patch 1942 BLAKE2B a6233d97f17d2695efe13a6bd395ba77e72e7c5c3177ae8aaf3223ac3f0979b9650cefcbb000d5e4ccc9ecb8fdab97173ad59022453c5b13c8486fb095b4ff14 SHA512 b8937c542eda36aa5dcdd3213513f6dd5a928166f1017ef370a78765dbc511552072fe46d8322dea27ee716126fd859245e6c2fa713f6b255fb6e7a4ce2c1328
AUX bitlbee-3.5-systemd-user.patch 188 BLAKE2B 9cdb3713aaf213b741a8dbef0a790a35458b955515bb720987471c519848ec6b9a232fe136ca554a3fe1eb0c184d96b8774cee4a41c0cd3d822a33598ac50e79 SHA512 1775b5dce7bdd4fbe52a46e361d8a9b0127be2dc32a3e8b438fca8fce9139903feb91c968847f002e099553eb8d4a110914cfb19121ae79a3f6c9eb100846edd
AUX bitlbee-3.6-disabled-plugins-use.patch 1695 BLAKE2B 5c5ab3f330921a471da5fcc39c2156322eb040683ad0ee6894a4c9d189868e9af126c6530ff46879d48878771007c76c1e77b266ea3bcfdba5fc2fe7121ac7ac SHA512 9e7f2a25c70a0d2eca9b6731f568fc3b639b057bebf8131aa9f4089f0ce28761cd03035320cd88ba58c622ec342d08946f31fdec20e45d3b25fb316ac4fe0dfc
+AUX bitlbee-3.6-strict-aliasing.patch 1081 BLAKE2B 69dfd5114e763a40da4a4032fa10b94db69e9a3440f93462396de56078be1980e07bcc3e1c89e3422d8be568c5732c45df9c971c5db0b629f5c396618a660f29 SHA512 f1aa18124a8d6a3bbad2bf6b9c5f6572dd765a33a9a678719f5b980b04a235adfe6c06ff31fe31200260380ec4131202c5f58fd41296525fc6f73974d7ab43f4
+AUX bitlbee-3.6-system-json-parser.patch 2416 BLAKE2B f3b3e2f38fd92893120ddcf2b3825c81df5ae08a1fbf838f5421c0e085956f0a913783bddd2d8218e77bb6d1db0e0591e469d18099e42355a0cc411ad8a8c410 SHA512 f017205c67e0a57d74fc6480eb7a77a942626b83cd09a47201f4dd5f4e8f21f66643f3f448299d58aba5ef8254ca57d527e65d8d624453fef3a738d09d054206
+AUX bitlbee-9999-system-json-parser.patch 2448 BLAKE2B 70d0591724bd40ceb7a4e3da1dd1364b9b08238c6bf6ce0790b13657854a37a20f297d54597501c0bc628b8ab08b6ef2edc9e3de1710307f69b55307a4689799 SHA512 433e243e37df230ea8a3ef7a1ceeadbad3d5f556b25a67122522bdd6b5e51d03639e7a785e1bba667256687690f036d90bbc2297646498d3d48aee3c90748464
AUX bitlbee.confd-r2 303 BLAKE2B 01ac57be4d6d50be227d6528425909a98231d3e5e2d7718ee71195890123145169a4be1568514b41b9509b992e747c4169022d31fb33c62e00a00f757307d8d8 SHA512 4ba7b8a81d5b77bd8ccd94431b065d4850c97bb153ca715f5f4ea6a1f9a6c90ab2c99fb9d6342311ae948bd34904a9cc2b3696f1b8f09e2475b79d254f744ae4
AUX bitlbee.initd-r2 244 BLAKE2B 1f4900c9bcad2469ad97e4a4c34e58124e4e3634bbcb8d3c6d30b16ab343995870cfa27a33cfaff04df59fc52f888368d173966a2d5306b2adae98c72c28a305 SHA512 c965f8bbd2b3d13a6c66455a3cc503a94ea0c8000a0e41e283ce1828ee59105d162552979343e8ebb6513fd15bf44a4274b0558928ae0e89b424773cdb8b7b97
DIST bitlbee-3.6.tar.gz 534961 BLAKE2B 007681a384fcb2c0736b901dfdc213ba0829ca006ad3204aca1bc4520a3874760867df6165a9218a9deeabb13bc06f118c9e2f804a97e671a348734f6cb7e963 SHA512 ccbf0f23e228de2de147241f36f59744b2256cba958e2fabfba0cfa60935e55bbb7d7e20fffa54da9a345e55ffa9ca82cb62e9b99dc738ba35c6e268c6561a8d
-EBUILD bitlbee-3.6-r1.ebuild 3349 BLAKE2B 6fdcc45ce8c781104c6d99833f5dbc6a58869fef831c9fcedc5f51c2712eaef88d538162fe1ee5371dd052d7e1cd2ecd82ce449a045d73f8f26f80e852e143a0 SHA512 8c4d2d82c6d9af52690d176c7712399bd5661c691025903f45cf4bee57cbf18b89406b7e098467dad21c2c66a60aab2ff750f7f2b0e8e9bc8d41a0d4fde24f81
-EBUILD bitlbee-9999.ebuild 3218 BLAKE2B 52f5e6430c79a63512a5287b2fe5e252b47e135bf780406caa713a87b8e4cd16bf789a6f20616b725ecdedc4d11622849e0037f6b9654c9ba967109ec53d0bd0 SHA512 5dc19698ce6f2336c9e9d64d0164b58c277674e0d31b623b0e5d062a3d9eec3f76e6023d411396f90dfc6d1115e8cdbfb30ff7e9ee583722c8f68cb0abd82060
+EBUILD bitlbee-3.6-r2.ebuild 3429 BLAKE2B 6fe3a53244299cd65de9bef03574e80d682057b16927aaf311574b4bea67e7df4704eddab070f99e7d5f2c5882bdaa0eb18cb9b22168ccf52c6fa20ba553941a SHA512 d5dbd63b8ba6253b90c485a2587d951a4803f2fad76b838e73549929bed25e78ff378d59b16043896b3ec89040af40e497f2088d50b09f103c67e0e543da4394
+EBUILD bitlbee-3.6-r3.ebuild 3456 BLAKE2B ca4c8c900f0f2a4162cf81b01823c9e433b36ff5cba7ff2d639ff5a239143d0bbe0334d8a4bdd90685911605d427d3d4a2b3b06ed444f496ad72f9761a095a61 SHA512 2d6eac5608a402cdc889bd512b078a6e92ccf247ff2182a4720559264ae46ff6598886f29ab840e4e776584af5eae40a97f07a87ed72ad98ad9c591040b47643
+EBUILD bitlbee-9999.ebuild 3353 BLAKE2B 77f1d077fd562d6c995dedc72e7fbbb5449138ce25b5246b0a908f3fe4ef803a25bb0a44e1298b26d70fc3ffa3b7fadca1650d5f692acfb900d72d55cbe2c014 SHA512 603a0df44a93590b9a3d642e95da80c5305be5b62cb282686a7a934b7f3f690a78ff1401360bc4bb113b3cdfa89876cd9e8a8308376b74c6808f3026dfe9dc72
MISC metadata.xml 1249 BLAKE2B c632b9333f1ece9f3ff98937466943f3e3cd00040402d77a3036e916f26a31cd6db4fd0448f84236830875b2e4bb8611d9cd3925166aff6840ab6d0511ac0d1f SHA512 6ebc32ca990a8904828f5b120e489669e5544e2d0dbba17aa627dde28d511d3cb7f9de86363134a0b5d629ad84e659a8834dac70dcdde0816e7ce1961dcd45eb
diff --git a/net-im/bitlbee/bitlbee-3.6-r1.ebuild b/net-im/bitlbee/bitlbee-3.6-r2.ebuild
index c54da3fb2392..127f0a88198d 100644
--- a/net-im/bitlbee/bitlbee-3.6-r1.ebuild
+++ b/net-im/bitlbee/bitlbee-3.6-r2.ebuild
@@ -18,7 +18,7 @@ fi
DESCRIPTION="irc to IM gateway that support multiple IM protocols"
HOMEPAGE="https://www.bitlbee.org/"
-LICENSE="GPL-2"
+LICENSE="GPL-2 BSD-2"
SLOT="0"
IUSE_PROTOCOLS="msn oscar purple twitter +xmpp"
IUSE="debug +gnutls ipv6 libevent nss otr +plugins selinux test xinetd
@@ -65,6 +65,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-3.5-libcheck.patch
"${FILESDIR}"/${PN}-3.5-libevent.patch
"${FILESDIR}"/${P}-disabled-plugins-use.patch
+ "${FILESDIR}"/${P}-strict-aliasing.patch
)
src_configure() {
@@ -114,6 +115,7 @@ src_configure() {
--prefix=/usr \
--datadir=/usr/share/bitlbee \
--etcdir=/etc/bitlbee \
+ --libdir=/usr/$(get_libdir) \
--plugindir=/usr/$(get_libdir)/bitlbee \
--pcdir=/usr/$(get_libdir)/pkgconfig \
--systemdsystemunitdir=$(systemd_get_systemunitdir) \
diff --git a/net-im/bitlbee/bitlbee-3.6-r3.ebuild b/net-im/bitlbee/bitlbee-3.6-r3.ebuild
new file mode 100644
index 000000000000..72d2a7207ba2
--- /dev/null
+++ b/net-im/bitlbee/bitlbee-3.6-r3.ebuild
@@ -0,0 +1,157 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit python-any-r1 systemd toolchain-funcs
+
+if [[ ${PV} == "9999" ]]; then
+ EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git"
+ inherit git-r3
+else
+ SRC_URI="https://get.bitlbee.org/src/${P}.tar.gz"
+ KEYWORDS="~amd64"
+fi
+
+DESCRIPTION="irc to IM gateway that support multiple IM protocols"
+HOMEPAGE="https://www.bitlbee.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE_PROTOCOLS="msn oscar purple twitter +xmpp"
+IUSE="debug +gnutls ipv6 libevent nss otr +plugins selinux test xinetd
+ ${IUSE_PROTOCOLS}"
+RESTRICT="!test? ( test )"
+
+REQUIRED_USE="
+ || ( purple xmpp msn oscar )
+ purple? ( plugins )
+ test? ( plugins )
+ xmpp? ( !nss )
+"
+
+COMMON_DEPEND="
+ acct-group/bitlbee
+ acct-user/bitlbee
+ dev-libs/glib:2
+ dev-libs/json-parser:=
+ purple? ( net-im/pidgin )
+ libevent? ( dev-libs/libevent:= )
+ otr? ( >=net-libs/libotr-4 )
+ gnutls? ( net-libs/gnutls:= )
+ !gnutls? (
+ nss? ( dev-libs/nss )
+ !nss? (
+ dev-libs/openssl:0=
+ )
+ )
+"
+DEPEND="${COMMON_DEPEND}
+ selinux? ( sec-policy/selinux-bitlbee )
+ test? ( dev-libs/check )
+"
+
+RDEPEND="${COMMON_DEPEND}
+ xinetd? ( sys-apps/xinetd )
+"
+
+BDEPEND="${PYTHON_DEPS}
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-3.5-systemd-user.patch"
+ "${FILESDIR}/${PN}-3.5-libcheck.patch"
+ "${FILESDIR}/${PN}-3.5-libevent.patch"
+ "${FILESDIR}/${P}-disabled-plugins-use.patch"
+ "${FILESDIR}/${P}-system-json-parser.patch"
+)
+
+src_configure() {
+ local myconf
+
+ # setup plugins, protocol, ipv6 and debug
+ myconf+=( --jabber=$(usex xmpp 1 0) )
+ for flag in debug ipv6 plugins ${IUSE_PROTOCOLS/+xmpp/} ; do
+ myconf+=( --${flag}=$(usex ${flag} 1 0) )
+ done
+
+ # set otr
+ if use otr && use plugins ; then
+ myconf+=( --otr=plugin )
+ else
+ if use otr ; then
+ ewarn "OTR support has been disabled automatically because it"
+ ewarn "requires the plugins USE flag."
+ fi
+ myconf+=( --otr=0 )
+ fi
+
+ # setup ssl use flags
+ if use gnutls ; then
+ myconf+=( --ssl=gnutls )
+ einfo "Using gnutls for SSL support"
+ else
+ ewarn "Only gnutls is officially supported by upstream."
+ if use nss ; then
+ myconf+=( --ssl=nss )
+ einfo "Using nss for SSL support"
+ else
+ myconf+=( --ssl=openssl )
+ einfo "Using openssl for SSL support"
+ fi
+ fi
+
+ # set event handler
+ if use libevent ; then
+ myconf+=( --events=libevent )
+ else
+ myconf+=( --events=glib )
+ fi
+
+ # not autotools-based
+ ./configure \
+ --prefix=/usr \
+ --datadir=/usr/share/bitlbee \
+ --etcdir=/etc/bitlbee \
+ --libdir=/usr/$(get_libdir) \
+ --pcdir=/usr/$(get_libdir)/pkgconfig \
+ --plugindir=/usr/$(get_libdir)/bitlbee \
+ --externaljsonparser=1 \
+ --systemdsystemunitdir=$(systemd_get_systemunitdir) \
+ --doc=1 \
+ --strip=0 \
+ --verbose=1 \
+ "${myconf[@]}" || die
+
+ sed -i \
+ -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
+ Makefile.settings || die
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" LD="$(tc-getLD)"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install install-etc install-doc install-dev install-systemd
+
+ keepdir /var/lib/bitlbee
+ fperms 700 /var/lib/bitlbee
+ fowners bitlbee:bitlbee /var/lib/bitlbee
+
+ dodoc doc/{AUTHORS,CHANGES,CREDITS,FAQ,README}
+
+ if use xinetd ; then
+ insinto /etc/xinetd.d
+ newins doc/bitlbee.xinetd bitlbee
+ fi
+
+ newinitd "${FILESDIR}"/bitlbee.initd-r2 bitlbee
+ newconfd "${FILESDIR}"/bitlbee.confd-r2 bitlbee
+
+ exeinto /usr/share/bitlbee
+ doexe utils/{convert_purple.py,bitlbee-ctl.pl}
+}
diff --git a/net-im/bitlbee/bitlbee-9999.ebuild b/net-im/bitlbee/bitlbee-9999.ebuild
index fc8360cb0399..0a8cc973ae18 100644
--- a/net-im/bitlbee/bitlbee-9999.ebuild
+++ b/net-im/bitlbee/bitlbee-9999.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} == "9999" ]]; then
inherit git-r3
else
SRC_URI="https://get.bitlbee.org/src/${P}.tar.gz"
- KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
+ KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~x86"
fi
DESCRIPTION="irc to IM gateway that support multiple IM protocols"
@@ -36,6 +36,7 @@ COMMON_DEPEND="
acct-group/bitlbee
acct-user/bitlbee
dev-libs/glib:2
+ dev-libs/json-parser:=
purple? ( net-im/pidgin )
libevent? ( dev-libs/libevent:= )
otr? ( >=net-libs/libotr-4 )
@@ -61,7 +62,8 @@ BDEPEND="${PYTHON_DEPS}
"
PATCHES=(
- "${FILESDIR}"/${PN}-3.5-systemd-user.patch
+ "${FILESDIR}/${PN}-3.5-systemd-user.patch"
+ "${FILESDIR}/${P}-system-json-parser.patch"
)
src_configure() {
@@ -111,8 +113,10 @@ src_configure() {
--prefix=/usr \
--datadir=/usr/share/bitlbee \
--etcdir=/etc/bitlbee \
- --plugindir=/usr/$(get_libdir)/bitlbee \
+ --libdir=/usr/$(get_libdir) \
--pcdir=/usr/$(get_libdir)/pkgconfig \
+ --plugindir=/usr/$(get_libdir)/bitlbee \
+ --externaljsonparser=1 \
--systemdsystemunitdir=$(systemd_get_systemunitdir) \
--doc=1 \
--strip=0 \
diff --git a/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch
new file mode 100644
index 000000000000..30ecff9747ee
--- /dev/null
+++ b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch
@@ -0,0 +1,31 @@
+Based on upstream [1] commits:
+- 161dff8321df ("Fix error type-punned pointer warning")
+- d7b67db02aaa ("Fix error type-punned pointer warning")
+
+[1] https://github.com/json-parser/json-parser
+
+Upstream-PR: https://github.com/bitlbee/bitlbee/pull/162
+
+diff --git a/lib/json.c b/lib/json.c
+index 24288f94..2150cbaf 100644
+--- a/lib/json.c
++++ b/lib/json.c
+@@ -139,7 +139,7 @@ static int new_value
+ return 0;
+ }
+
+- value->_reserved.object_mem = (*(char **) &value->u.object.values) + values_size;
++ value->_reserved.object_mem = (void *) (((char *) value->u.object.values) + values_size);
+
+ value->u.object.length = 0;
+ break;
+@@ -406,7 +406,8 @@ json_value * json_parse_ex(json_settings * settings,
+ case json_object:
+
+ if (state.first_pass) {
+- (*(json_char **) &top->u.object.values) += string_length + 1;
++ json_char **chars = (json_char **) &top->u.object.values;
++ chars[0] += string_length + 1;
+ } else {
+ top->u.object.values [top->u.object.length].name
+ = (json_char *) top->_reserved.object_mem;
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
new file mode 100644
index 000000000000..02d57e02d6d2
--- /dev/null
+++ b/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch
@@ -0,0 +1,82 @@
+This is adapted patch from upstream PR 151. Original PR defines
+--external-json-parser which breaks configuration, see [1]. It was changed to
+--externaljsonparser and $external_json_parser to $externaljsonparser.
+
+[1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
+
+Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
+
+diff --git a/configure b/configure
+index 4640c806..77b1213b 100755
+--- a/configure
++++ b/configure
+@@ -47,6 +47,7 @@ plugins=1
+ otr=0
+
+ events=glib
++externaljsonparser=auto
+ ssl=auto
+
+ pam=0
+@@ -148,6 +149,7 @@ Option Description Default
+ --events=... Event handler (glib, libevent) $events
+ --ssl=... SSL library to use (gnutls, nss, openssl, auto)
+ $ssl
++--externaljsonparser=0/1/auto Use External JSON parser $externaljsonparser
+
+
+ --target=... Cross compilation target same as host
+@@ -398,6 +400,20 @@ else
+ fi
+ echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
+
++if [ "$externaljsonparser" = "auto" ]; then
++ if pkg-config --exists json-parser; then
++ externaljsonparser=1
++ else
++ externaljsonparser=0
++ fi
++fi
++echo "EXTERNAL_JSON_PARSER=$externaljsonparser" >> Makefile.settings
++if [ "$externaljsonparser" = "1" ]; then
++ echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings
++ echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings
++fi
++
++
+ detect_gnutls()
+ {
+ if $PKG_CONFIG --exists gnutls; then
+@@ -979,6 +995,12 @@ else
+ echo ' systemd disabled.'
+ fi
+
++if [ "$externaljsonparser" = "1" ]; then
++ echo ' Using system JSON parser.'
++else
++ echo ' Using bundled JSON parser.'
++fi
++
+ echo ' Using event handler: '$events
+ echo ' Using SSL library: '$ssl
+ #echo ' Building with these storage backends: '$STORAGES
+diff --git a/lib/Makefile b/lib/Makefile
+index fc46aedc..ad95d9cb 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -12,7 +12,11 @@ _SRCDIR_ := $(_SRCDIR_)lib/
+ endif
+
+ # [SH] Program variables
+-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
++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
++
++ifneq ($(EXTERNAL_JSON_PARSER),1)
++objects += json.o
++endif
+
+ LFLAGS += -r
+
+--
+2.35.1
+
diff --git a/net-im/bitlbee/files/bitlbee-9999-system-json-parser.patch b/net-im/bitlbee/files/bitlbee-9999-system-json-parser.patch
new file mode 100644
index 000000000000..07f2878525ec
--- /dev/null
+++ b/net-im/bitlbee/files/bitlbee-9999-system-json-parser.patch
@@ -0,0 +1,83 @@
+This is adapted patch from upstream PR 151. Original PR defines
+--external-json-parser which breaks configuration, see [1]. It was changed to
+--externaljsonparser and $external_json_parser to $externaljsonparser.
+
+[1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
+
+Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
+
+diff --git a/configure b/configure
+index 4640c806..77b1213b 100755
+--- a/configure
++++ b/configure
+@@ -47,6 +47,7 @@ plugins=1
+ otr=0
+
+ events=glib
++externaljsonparser=auto
+ ssl=auto
+
+ pam=0
+@@ -148,6 +149,7 @@ Option Description Default
+ --events=... Event handler (glib, libevent) $events
+ --ssl=... SSL library to use (gnutls, nss, openssl, auto)
+ $ssl
++--externaljsonparser=0/1/auto Use External JSON parser $externaljsonparser
+
+
+ --target=... Cross compilation target same as host
+@@ -398,6 +400,20 @@ else
+ fi
+ echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
+
++if [ "$externaljsonparser" = "auto" ]; then
++ if pkg-config --exists json-parser; then
++ externaljsonparser=1
++ else
++ externaljsonparser=0
++ fi
++fi
++echo "EXTERNAL_JSON_PARSER=$externaljsonparser" >> Makefile.settings
++if [ "$externaljsonparser" = "1" ]; then
++ echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings
++ echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> Makefile.settings
++fi
++
++
+ detect_gnutls()
+ {
+ if $PKG_CONFIG --exists gnutls; then
+@@ -979,6 +995,12 @@ else
+ echo ' systemd disabled.'
+ fi
+
++if [ "$externaljsonparser" = "1" ]; then
++ echo ' Using system JSON parser.'
++else
++ echo ' Using bundled JSON parser.'
++fi
++
+ echo ' Using python: '$PYTHON
+ echo ' Using event handler: '$events
+ echo ' Using SSL library: '$ssl
+ #echo ' Building with these storage backends: '$STORAGES
+diff --git a/lib/Makefile b/lib/Makefile
+index fc46aedc..ad95d9cb 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -12,7 +12,11 @@ _SRCDIR_ := $(_SRCDIR_)lib/
+ endif
+
+ # [SH] Program variables
+-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
++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
++
++ifneq ($(EXTERNAL_JSON_PARSER),1)
++objects += json.o
++endif
+
+ LFLAGS += -r
+
+--
+2.35.1
+