commit:     7c4680a05d41067908b293ea9a3975a280491118
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 22 00:37:57 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 22 00:37:57 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7c4680a0

net-libs/loudmouth: add 1.5.4

Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-libs/loudmouth/Manifest                        |  1 +
 .../files/loudmouth-1.5.4-freeaddrinfo-musl.patch  | 40 +++++++++++++++
 net-libs/loudmouth/loudmouth-1.5.4.ebuild          | 57 ++++++++++++++++++++++
 3 files changed, 98 insertions(+)

diff --git a/net-libs/loudmouth/Manifest b/net-libs/loudmouth/Manifest
index e1ff682afffe..5a762f8d133f 100644
--- a/net-libs/loudmouth/Manifest
+++ b/net-libs/loudmouth/Manifest
@@ -1 +1,2 @@
 DIST loudmouth-1.5.3.tar.bz2 375974 BLAKE2B 
c9707fe18560104456a624a61437240a16bb6bbaf544cdf775f6d6c64fdbeb6eb8f7042eb13fcdeb36c89bb8d9522c2eba02c24987757c0f0ac8748d92a2b166
 SHA512 
ab6b16b4e644b69cdb7d8df1753d1bb5b43c2f1e76944e639339169b332e1b5c6a4246053c5b8a579ee9b53c845cef610b0040dfdffeb857180b6bab71adfcce
+DIST loudmouth-1.5.4.tar.bz2 361323 BLAKE2B 
1d8453625262e4f9dc8d603619b71cac073831462164a10a92a5118c212293ae4ad9a0ca276b07b7919a0aebce633b4afaabb015ecf4b33e7c641a4273edc64a
 SHA512 
49a08f0130b9ee56f07586d244504c81242723865a136b03e1049f32b1aa1e6c49e9b76b38f0cfb812ef4c66f73b7d83914a58e9a93e0496207e06c2b5efa9d8

diff --git a/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch 
b/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
new file mode 100644
index 000000000000..f75714a75058
--- /dev/null
+++ b/net-libs/loudmouth/files/loudmouth-1.5.4-freeaddrinfo-musl.patch
@@ -0,0 +1,40 @@
+https://github.com/mcabber/loudmouth/pull/46
+
+From f32119e1408c742da9a1862805d76d222937756d Mon Sep 17 00:00:00 2001
+From: psykose <al...@ayaya.dev>
+Date: Thu, 21 Apr 2022 18:23:32 +0000
+Subject: [PATCH] fix macro define for freeaddrinfo with asyncns
+
+previously, this define was only made in lm-asyncns-resolver.c, which
+does not propagate it to lm-resolver.c, where freeaddrinfo() is used.
+this means that when asyncns support is used, the standard libc
+freeaddrinfo() is called on an addrinfo acquired from
+asyncns_getaddrinfo, which is undefined behaviour, and leads to a
+segfault on musl libc.
+--- a/loudmouth/lm-asyncns-resolver.c
++++ b/loudmouth/lm-asyncns-resolver.c
+@@ -21,7 +21,6 @@
+ #include <string.h>
+ #ifdef HAVE_ASYNCNS
+ #include <asyncns.h>
+-#define freeaddrinfo(x) asyncns_freeaddrinfo(x)
+ 
+ /* Needed on Mac OS X */
+ #if HAVE_ARPA_NAMESER_COMPAT_H
+--- a/loudmouth/lm-asyncns-resolver.h
++++ b/loudmouth/lm-asyncns-resolver.h
+@@ -19,8 +19,14 @@
+ #ifndef __LM_ASYNCNS_RESOLVER_H__
+ #define __LM_ASYNCNS_RESOLVER_H__
+ 
++#include <config.h>
++
+ #include <glib-object.h>
+ 
++#ifdef HAVE_ASYNCNS
++#define freeaddrinfo(x) asyncns_freeaddrinfo(x)
++#endif
++
+ #include "lm-resolver.h"
+ 
+ G_BEGIN_DECLS

diff --git a/net-libs/loudmouth/loudmouth-1.5.4.ebuild 
b/net-libs/loudmouth/loudmouth-1.5.4.ebuild
new file mode 100644
index 000000000000..bd960d3f5dbc
--- /dev/null
+++ b/net-libs/loudmouth/loudmouth-1.5.4.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DESCRIPTION="Lightweight C Jabber library"
+HOMEPAGE="https://mcabber.com";
+SRC_URI="https://mcabber.com/files/${PN}/${P}.tar.bz2";
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~riscv ~sparc ~x86 
~ppc-macos"
+IUSE="asyncns ssl openssl test"
+RESTRICT="!test? ( test )"
+
+# Automagic libidn dependency
+RDEPEND=">=dev-libs/glib-2.16:2
+       net-dns/libidn:=
+       ssl? (
+               !openssl? ( >=net-libs/gnutls-1.4.0:0= )
+               openssl? ( dev-libs/openssl:0= )
+       )
+       asyncns? ( >=net-libs/libasyncns-0.3 )"
+DEPEND="${RDEPEND}
+       test? ( dev-libs/check )"
+BDEPEND="dev-util/glib-utils
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.5.4-freeaddrinfo-musl.patch
+)
+
+src_configure() {
+       local myconf
+
+       if use ssl; then
+               if ! use openssl; then
+                       myconf="${myconf} --with-ssl=gnutls"
+               else
+                       myconf="${myconf} --with-ssl=openssl"
+               fi
+       else
+               myconf="${myconf} --with-ssl=no"
+       fi
+
+       # --with-compile-warnings=yes to avoid default =error
+       econf \
+               $(use_with asyncns) \
+               --with-compile-warnings=yes \
+               ${myconf}
+}
+
+src_install() {
+       default
+
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to