[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/

2022-08-22 Thread Sam James
commit: 54bb9f516d5608cbf3bb445af98fa8876ce938e9
Author: Petr Vaněk  atlas  cz>
AuthorDate: Mon Aug 22 14:52:33 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Aug 23 04:51:19 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54bb9f51

net-im/bitlbee: remove system-json-parser patch from live

This feature is now integrated in upstream.

Signed-off-by: Petr Vaněk  atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/26925
Signed-off-by: Sam James  gentoo.org>

 net-im/bitlbee/bitlbee-.ebuild |  3 +-
 .../files/bitlbee--system-json-parser.patch| 99 --
 2 files changed, 1 insertion(+), 101 deletions(-)

diff --git a/net-im/bitlbee/bitlbee-.ebuild 
b/net-im/bitlbee/bitlbee-.ebuild
index 8d4f88ddc3d1..079feaea767b 100644
--- a/net-im/bitlbee/bitlbee-.ebuild
+++ b/net-im/bitlbee/bitlbee-.ebuild
@@ -62,7 +62,6 @@ BDEPEND="${PYTHON_DEPS}
 
 PATCHES=(
"${FILESDIR}/${PN}-3.5-systemd-user.patch"
-   "${FILESDIR}/${P}-system-json-parser.patch"
 )
 
 src_configure() {
@@ -115,7 +114,7 @@ src_configure() {
--libdir=/usr/$(get_libdir) \
--pcdir=/usr/$(get_libdir)/pkgconfig \
--plugindir=/usr/$(get_libdir)/bitlbee \
-   --externaljsonparser=1 \
+   --external_json_parser=1 \
--systemdsystemunitdir=$(systemd_get_systemunitdir) \
--doc=1 \
--strip=0 \

diff --git a/net-im/bitlbee/files/bitlbee--system-json-parser.patch 
b/net-im/bitlbee/files/bitlbee--system-json-parser.patch
deleted file mode 100644
index d0020307cfa3..
--- a/net-im/bitlbee/files/bitlbee--system-json-parser.patch
+++ /dev/null
@@ -1,99 +0,0 @@
-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.
-Additionally, LDFLAGS_CHECK variable was introduced in order to make
-tests working, see [2] and #865667.
-
-[1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
-[2] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1219254239
-
-Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
-
-diff --git a/configure b/configure
-index 2291e9a4..3ba40933 100755
 a/configure
-+++ b/configure
-@@ -47,6 +47,7 @@ plugins=1
- otr=0
- 
- events=glib
-+externaljsonparser=auto
- ssl=auto
- 
- pam=0
-@@ -154,6 +155,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 targetsame as host
-@@ -404,6 +406,21 @@ 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
-+echo "LDFLAGS_CHECK+=$(pkg-config --libs json-parser)" >> 
Makefile.settings
-+fi
-+
-+
- detect_gnutls()
- {
-   if $PKG_CONFIG --exists gnutls; then
-@@ -993,6 +1010,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
-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
- 
-diff --git a/tests/Makefile b/tests/Makefile
-index 76122a2f..2235bf1d 100644
 a/tests/Makefile
-+++ b/tests/Makefile
-@@ -20,7 +20,7 @@ test_objs = check.o check_util.o check_nick.o check_md5.o 
check_arc.o check_irc.
- 
- check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o 
../lib/lib.o
-  

[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/

2022-08-22 Thread Sam James
commit: 9234f9e1d6a7a7c9b4bd9f4fd11c33b1bd33bee1
Author: Petr Vaněk  atlas  cz>
AuthorDate: Thu Aug 18 09:25:51 2022 +
Commit: Sam James  gentoo  org>
CommitDate: Tue Aug 23 04:50:22 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9234f9e1

net-im/bitlbee: fix tests in 3.6-r3 and live

It was necessary to adapt system-json-parser patches more with
LDFLAGS_CHECK variable which is used when ./tests/check binary is
linked.

Fixes: 90a3d5fff1c0 ("net-im/bitlbee: Use system json-parser")
Fixes: 2f4aeedeec9c ("net-im/bitlbee: sync live")
Closes: https://bugs.gentoo.org/865667
Signed-off-by: Petr Vaněk  atlas.cz>
Signed-off-by: Sam James  gentoo.org>

 .../files/bitlbee-3.6-system-json-parser.patch | 23 ---
 .../files/bitlbee--system-json-parser.patch| 26 +-
 2 files changed, 41 insertions(+), 8 deletions(-)

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
index 02d57e02d6d2..0a9c197d763d 100644
--- a/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch
+++ b/net-im/bitlbee/files/bitlbee-3.6-system-json-parser.patch
@@ -1,13 +1,16 @@
 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.
+Additionally, LDFLAGS_CHECK variable was introduced in order to make
+tests working, see [2] and #865667.
 
 [1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
+[2] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1219254239
 
 Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
 
 diff --git a/configure b/configure
-index 4640c806..77b1213b 100755
+index fd8d363a..39495515 100755
 --- a/configure
 +++ b/configure
 @@ -47,6 +47,7 @@ plugins=1
@@ -26,7 +29,7 @@ index 4640c806..77b1213b 100755
  
  
  --target=...  Cross compilation targetsame as host
-@@ -398,6 +400,20 @@ else
+@@ -398,6 +400,21 @@ else
  fi
  echo 'EVENT_HANDLER=events_'$events'.o' >> Makefile.settings
  
@@ -41,13 +44,14 @@ index 4640c806..77b1213b 100755
 +if [ "$externaljsonparser" = "1" ]; then
 +echo "CFLAGS+=$(pkg-config --cflags json-parser)" >> Makefile.settings
 +echo "LDFLAGS_BITLBEE+=$(pkg-config --libs json-parser)" >> 
Makefile.settings
++echo "LDFLAGS_CHECK+=$(pkg-config --libs json-parser)" >> 
Makefile.settings
 +fi
 +
 +
  detect_gnutls()
  {
if $PKG_CONFIG --exists gnutls; then
-@@ -979,6 +995,12 @@ else
+@@ -979,6 +996,12 @@ else
echo '  systemd disabled.'
  fi
  
@@ -77,6 +81,19 @@ index fc46aedc..ad95d9cb 100644
  
  LFLAGS += -r
  
+diff --git a/tests/Makefile b/tests/Makefile
+index 76122a2f..2235bf1d 100644
+--- a/tests/Makefile
 b/tests/Makefile
+@@ -20,7 +20,7 @@ test_objs = check.o check_util.o check_nick.o check_md5.o 
check_arc.o check_irc.
+ 
+ check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o 
../lib/lib.o
+   @echo '*' Linking $@
+-  $(VERBOSE) $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)
++  $(VERBOSE) $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(LDFLAGS_CHECK) $(EFLAGS)
+ 
+ %.o: $(_SRCDIR_)%.c
+   @echo '*' Compiling $<
 -- 
 2.35.1
 

diff --git a/net-im/bitlbee/files/bitlbee--system-json-parser.patch 
b/net-im/bitlbee/files/bitlbee--system-json-parser.patch
index 07f2878525ec..d0020307cfa3 100644
--- a/net-im/bitlbee/files/bitlbee--system-json-parser.patch
+++ b/net-im/bitlbee/files/bitlbee--system-json-parser.patch
@@ -1,13 +1,16 @@
 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.
+Additionally, LDFLAGS_CHECK variable was introduced in order to make
+tests working, see [2] and #865667.
 
 [1] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1201181905
+[2] https://github.com/bitlbee/bitlbee/pull/151#issuecomment-1219254239
 
 Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
 
 diff --git a/configure b/configure
-index 4640c806..77b1213b 100755
+index 2291e9a4..3ba40933 100755
 --- a/configure
 +++ b/configure
 @@ -47,6 +47,7 @@ plugins=1
@@ -18,7 +21,7 @@ index 4640c806..77b1213b 100755
  ssl=auto
  
  pam=0
-@@ -148,6 +149,7 @@ Option Description 
Default
+@@ -154,6 +155,7 @@ Option Description 
Default
  --events=...  Event handler (glib, libevent)  $events
  --ssl=... SSL library to use (gnutls, nss, openssl, auto)
$ssl
@@ -26,7 +29,7 @@ index 4640c806..77b1213b 100755
  
  
  --target=...  Cross compilation targetsame as host
-@@ -398,6 +400,20 @@ else
+@@ -404,6 +406,21 @@ else
  fi
  echo 'EVENT_HANDLER=events_'$e

[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/

2022-08-18 Thread Joonas Niilola
commit: ad699292711447f8983a44382c61c0dd00967145
Author: Petr Vaněk  atlas  cz>
AuthorDate: Fri Jul 29 12:42:10 2022 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Thu Aug 18 07:06:18 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad699292

net-im/bitlbee: fix strict-aliasing issue in bundled library

The patch is based on fixes from upstream. LICENSE is extended with
BSD-2, the license of bundled library.

Upstream-PR: https://github.com/bitlbee/bitlbee/pull/162
Closes: https://bugs.gentoo.org/861371
Signed-off-by: Petr Vaněk  atlas.cz>
Signed-off-by: Joonas Niilola  gentoo.org>

 net-im/bitlbee/bitlbee-3.6-r1.ebuild   |  3 ++-
 .../files/bitlbee-3.6-strict-aliasing.patch| 31 ++
 2 files changed, 33 insertions(+), 1 deletion(-)

diff --git a/net-im/bitlbee/bitlbee-3.6-r1.ebuild 
b/net-im/bitlbee/bitlbee-3.6-r1.ebuild
index c54da3fb2392..73fbb3f13b6c 100644
--- a/net-im/bitlbee/bitlbee-3.6-r1.ebuild
+++ b/net-im/bitlbee/bitlbee-3.6-r1.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() {

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 ..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;



[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/

2022-08-18 Thread Joonas Niilola
commit: 90a3d5fff1c032b3b2de6133c6eb9c7711daccb9
Author: Petr Vaněk  atlas  cz>
AuthorDate: Mon Aug  1 14:10:01 2022 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Thu Aug 18 07:06:18 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90a3d5ff

net-im/bitlbee: Use system json-parser

- Applied patch allows us to use system json-parser, it is based on
  upstream PR, see the link below
- Dropped arm64, ppc, ppc64 and x86 keywords because newly introduced
  dev-libs/json-parser dependency has currently only ~amd64 keyword
- EAPI 7 -> 8

Upstream-PR: https://github.com/bitlbee/bitlbee/pull/151
Bug: https://bugs.gentoo.org/861371
Signed-off-by: Petr Vaněk  atlas.cz>
Signed-off-by: Joonas Niilola  gentoo.org>

 net-im/bitlbee/bitlbee-3.6-r3.ebuild   | 157 +
 .../files/bitlbee-3.6-system-json-parser.patch |  82 +++
 2 files changed, 239 insertions(+)

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 ..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} == "" ]]; 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 || di

[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/

2022-08-18 Thread Joonas Niilola
commit: 2f4aeedeec9c18047dbda18f31325ac3aeb6a617
Author: Petr Vaněk  atlas  cz>
AuthorDate: Mon Aug  1 20:35:08 2022 +
Commit: Joonas Niilola  gentoo  org>
CommitDate: Thu Aug 18 07:06:18 2022 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f4aeede

net-im/bitlbee: sync live

Signed-off-by: Petr Vaněk  atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/26703
Signed-off-by: Joonas Niilola  gentoo.org>

 net-im/bitlbee/bitlbee-.ebuild |  9 ++-
 .../files/bitlbee--system-json-parser.patch| 83 ++
 2 files changed, 89 insertions(+), 3 deletions(-)

diff --git a/net-im/bitlbee/bitlbee-.ebuild 
b/net-im/bitlbee/bitlbee-.ebuild
index d811ebc6f0c2..0a8cc973ae18 100644
--- a/net-im/bitlbee/bitlbee-.ebuild
+++ b/net-im/bitlbee/bitlbee-.ebuild
@@ -12,7 +12,7 @@ if [[ ${PV} == "" ]]; 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() {
@@ -112,8 +114,9 @@ src_configure() {
--datadir=/usr/share/bitlbee \
--etcdir=/etc/bitlbee \
--libdir=/usr/$(get_libdir) \
-   --plugindir=/usr/$(get_libdir)/bitlbee \
--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--system-json-parser.patch 
b/net-im/bitlbee/files/bitlbee--system-json-parser.patch
new file mode 100644
index ..07f2878525ec
--- /dev/null
+++ b/net-im/bitlbee/files/bitlbee--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 targetsame 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

[gentoo-commits] repo/gentoo:master commit in: net-im/bitlbee/files/, net-im/bitlbee/

2016-09-04 Thread Tim Harder
commit: 130dc998a483dad52f3bb6de991cb900de1c40db
Author: Tim Harder  gentoo  org>
AuthorDate: Mon Sep  5 03:15:05 2016 +
Commit: Tim Harder  gentoo  org>
CommitDate: Mon Sep  5 03:21:29 2016 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=130dc998

net-im/bitlbee: revision bump for various updates

* update to EAPI 6
* fix systemd unit to use bitlbee user (bug #472406)
* update SSL handling, make it non-optional (bug #582658 by Alex Xu)
* drop skype support, use libpurple and x11-plugins/pidgin-skypeweb
  instead (https://wiki.bitlbee.org/HowtoSkypeWeb)

 net-im/bitlbee/bitlbee-3.4.2-r1.ebuild | 158 +
 net-im/bitlbee/bitlbee-.ebuild | 121 ++--
 .../bitlbee/files/bitlbee-3.4.2-systemd-user.patch |  10 ++
 3 files changed, 213 insertions(+), 76 deletions(-)

diff --git a/net-im/bitlbee/bitlbee-3.4.2-r1.ebuild 
b/net-im/bitlbee/bitlbee-3.4.2-r1.ebuild
new file mode 100644
index ..8e5f4f7
--- /dev/null
+++ b/net-im/bitlbee/bitlbee-3.4.2-r1.ebuild
@@ -0,0 +1,158 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+inherit user systemd
+
+if [[ ${PV} == "" ]]; then
+   EGIT_REPO_URI="https://github.com/bitlbee/bitlbee.git";
+   inherit git-r3
+else
+   SRC_URI="http://get.bitlbee.org/src/${P}.tar.gz";
+   KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-fbsd"
+fi
+
+DESCRIPTION="irc to IM gateway that support multiple IM protocols"
+HOMEPAGE="http://www.bitlbee.org/";
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE_PROTOCOLS="msn oscar purple twitter +xmpp yahoo"
+IUSE="debug +gnutls ipv6 libevent libressl nss otr +plugins selinux test xinetd
+   ${IUSE_PROTOCOLS}"
+
+REQUIRED_USE="
+   || ( purple xmpp msn oscar yahoo )
+   xmpp? ( !nss )
+"
+
+COMMON_DEPEND="
+   >=dev-libs/glib-2.16
+   purple? ( net-im/pidgin )
+   libevent? ( dev-libs/libevent:= )
+   otr? ( >=net-libs/libotr-4 )
+   gnutls? ( net-libs/gnutls:= )
+   !gnutls? (
+   nss? ( dev-libs/nss )
+   !nss? (
+   libressl? ( dev-libs/libressl:= )
+   !libressl? ( dev-libs/openssl:0= )
+   )
+   )
+"
+DEPEND="${COMMON_DEPEND}
+   virtual/pkgconfig
+   selinux? ( sec-policy/selinux-bitlbee )
+   test? ( dev-libs/check )"
+
+RDEPEND="${COMMON_DEPEND}
+   virtual/logger
+   xinetd? ( sys-apps/xinetd )"
+
+pkg_setup() {
+   enewgroup bitlbee
+   enewuser bitlbee -1 -1 /var/lib/bitlbee bitlbee
+}
+
+src_prepare() {
+   [[ ${PV} != "" ]] && eapply "${FILESDIR}"/${P}-systemd-user.patch
+   eapply_user
+}
+
+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 \
+   --plugindir=/usr/$(get_libdir)/bitlbee \
+   --systemdsystemunitdir=$(systemd_get_systemunitdir) \
+   --doc=1 \
+   --strip=0 \
+   "${myconf[@]}" || die
+
+   sed -i \
+   -e "/^EFLAGS/s:=:&${LDFLAGS} :" \
+   Makefile.settings || die
+}
+
+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.xinet