Skip to content

Instantly share code, notes, and snippets.

@multiSnow
Created August 10, 2017 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save multiSnow/1be9d7345e042a77bb3c0e984f60e7b2 to your computer and use it in GitHub Desktop.
Save multiSnow/1be9d7345e042a77bb3c0e984f60e7b2 to your computer and use it in GitHub Desktop.
gnunet-idn2.patch
--- a/configure.ac
+++ b/configure.ac
@@ -665,9 +665,9 @@ LIBS=$SAVE_LIBS
# libidn
-AC_MSG_CHECKING([if Libidn can be used])
-AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
- [Support IDN (needs GNU Libidn)]),
+AC_MSG_CHECKING([if Libidn2 can be used])
+AC_ARG_WITH(libidn2, AC_HELP_STRING([--with-libidn2=[DIR]],
+ [Support IDN (needs GNU Libidn2)]),
libidn=$withval, libidn=yes)
if test "$libidn" != "no"; then
if test "$libidn" != "yes"; then
@@ -676,12 +676,12 @@ if test "$libidn" != "no"; then
fi
fi
libidn=no
-AC_CHECK_HEADER(idna.h,
- AC_CHECK_LIB(idn, stringprep_check_version,
- [libidn=yes LIBS="${LIBS} -lidn"], []), [])
+AC_CHECK_HEADER(idn2.h,
+ AC_CHECK_LIB(idn2, idn2_check_version,
+ [libidn=yes LIBS="${LIBS} -lidn2"], []), [])
if test "$libidn" != "yes"; then
AC_MSG_FAILURE([GNUnet requires libidn.
-libidn-1.13 should be sufficient, newer versions work too.])
+libidn2 should be sufficient, newer versions work too.])
fi
AC_MSG_RESULT($libidn)
--- a/src/dns/Makefile.am
+++ b/src/dns/Makefile.am
@@ -81,7 +81,7 @@ libgnunetdnsparser_la_SOURCES = \
dnsparser.c
libgnunetdnsparser_la_LIBADD = \
$(top_builddir)/src/util/libgnunetutil.la $(XLIB) \
- -lidn
+ -lidn2
libgnunetdnsparser_la_LDFLAGS = \
$(GN_LIB_LDFLAGS) \
-version-info 1:0:1
diff --git a/src/dns/dnsparser.c b/src/dns/dnsparser.c
index 36b4c36f1..81447fd9c 100644
--- a/src/dns/dnsparser.c
+++ b/src/dns/dnsparser.c
@@ -25,7 +25,7 @@
* @author Christian Grothoff
*/
#include "platform.h"
-#include <idna.h>
+#include <idn2.h>
#if WINDOWS
#include <idn-free.h>
#endif
Copy link

ghost commented Oct 25, 2018

Hi!

I discovered your patch about a year ago. Today we merged something comparable into gnunet master: https://n0.is/b/2018/libidn2-in-gnunet/

The commits, crediting you:

https://gnunet.org/git/gnunet.git/commit/?id=0a97ba60f4f09558b0c2a4b8d2c09e6ff7bfd112
https://gnunet.org/git/gnunet.git/commit/?id=b64879a11e2062b78e984b8e5c22dc26ba224668

In the future, feel free to send proposals directly to us to discuss changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment