From 6298672ba9c14f8dfcb56dd635da9775097924a2 Mon Sep 17 00:00:00 2001
From: "W. Michael Petullo" <mike@flyn.org>
Date: Fri, 24 Mar 2017 19:19:25 -0400
Subject: [PATCH] loudmouth: patch to avoid libidn

Signed-off-by: W. Michael Petullo <mike@flyn.org>
---
 libs/loudmouth/Makefile                       |  3 +-
 .../patches/001-allow-disable-libidn.patch    | 39 +++++++++++++++++++
 2 files changed, 41 insertions(+), 1 deletion(-)
 create mode 100644 libs/loudmouth/patches/001-allow-disable-libidn.patch

diff --git a/libs/loudmouth/Makefile b/libs/loudmouth/Makefile
index f8ad4df6c..fcba2ac74 100644
--- a/libs/loudmouth/Makefile
+++ b/libs/loudmouth/Makefile
@@ -41,7 +41,8 @@ define Package/loudmouth/description
 endef
 
 CONFIGURE_ARGS += \
-	--with-ssl=openssl
+	--with-ssl=openssl \
+	--with-idn=no
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(1)/usr/include/
diff --git a/libs/loudmouth/patches/001-allow-disable-libidn.patch b/libs/loudmouth/patches/001-allow-disable-libidn.patch
new file mode 100644
index 000000000..88aac5bdc
--- /dev/null
+++ b/libs/loudmouth/patches/001-allow-disable-libidn.patch
@@ -0,0 +1,39 @@
+diff --git a/configure.ac b/configure.ac
+index 8435d9a..148453c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -109,9 +109,22 @@ else
+ fi
+ AC_SUBST([TEST_DIRS])
+ 
+-PKG_CHECK_MODULES(LIBIDN, libidn, have_idn=yes, have_idn=no)
+-if test "x$have_idn" = "xyes"; then
+-        AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
++dnl +--------------------------------------------------------+
++dnl | Checking for libidn support                            |-
++dnl +--------------------------------------------------------+
++AC_ARG_WITH(idn,
++            AS_HELP_STRING([--with-idn=@<:@auto|no@:>@],
++                           [Whether to use libidn [[default=auto]]]),
++            ac_idn=$withval,
++            ac_idn=auto)
++
++if test "x$ac_idn" = "xauto"; then
++  PKG_CHECK_MODULES(LIBIDN, libidn, enable_idn=yes, enable_idn=no)
++  if test "x$enable_idn" = "xyes"; then
++    AC_DEFINE(HAVE_IDN, 1, [Define if IDN support is included])
++  fi
++else
++  enable_idn=no
+ fi
+ 
+ dnl Gtk doc
+@@ -323,7 +336,7 @@ echo "
+ 
+         prefix:                   ${prefix}
+         compiler:                 ${CC}
+-        Have IDN support:         ${have_idn}
++        Enable IDN support:       ${enable_idn}
+         Enable SSL:               ${enable_ssl}
+         Asynchronous DNS:         ${enable_asyncns}
+         Linux TCP keepalives:     ${use_keepalives}