From 819fa0571222b4d007620c1b1c646616a16e2c3f Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Sun, 14 May 2017 20:39:16 +0200 Subject: [PATCH] fixes ipv6 for python (tested with ipv4/ipv6 + http/https). Closes #218 --- recipes/python/__init__.py | 2 ++ recipes/python/ipv6.patch | 63 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 recipes/python/ipv6.patch diff --git a/recipes/python/__init__.py b/recipes/python/__init__.py index 5825d28..22b1432 100644 --- a/recipes/python/__init__.py +++ b/recipes/python/__init__.py @@ -31,6 +31,7 @@ class PythonRecipe(Recipe): self.apply_patch("xcompile.patch") self.apply_patch("setuppath.patch") self.append_file("ModulesSetup.mobile", "Modules/Setup.local") + self.apply_patch("ipv6.patch") if "openssl.build_all" in self.ctx.state: self.append_file("ModulesSetup.openssl", "Modules/Setup.local") @@ -50,6 +51,7 @@ class PythonRecipe(Recipe): "--prefix=/python", "--with-system-ffi", "--without-doc-strings", + "--enable-ipv6", _env=build_env) self._patch_pyconfig() diff --git a/recipes/python/ipv6.patch b/recipes/python/ipv6.patch new file mode 100644 index 0000000..57cd582 --- /dev/null +++ b/recipes/python/ipv6.patch @@ -0,0 +1,63 @@ +--- Python-2.7.1.orig/configure.in 2017-05-14 19:54:10.000000000 +0200 ++++ Python-2.7.1/configure.in 2017-05-14 19:56:01.000000000 +0200 +@@ -3111,17 +3111,17 @@ + + AC_MSG_RESULT($ac_cv_buggy_getaddrinfo) + +-if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes +-then +- if test $ipv6 = yes +- then +- echo 'Fatal: You must get working getaddrinfo() function.' +- echo ' or you can specify "--disable-ipv6"'. +- exit 1 +- fi +-else +- AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.]) +-fi ++# if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes ++# then ++# if test $ipv6 = yes ++# then ++# echo 'Fatal: You must get working getaddrinfo() function.' ++# echo ' or you can specify "--disable-ipv6"'. ++# exit 1 ++# fi ++# else ++# AC_DEFINE(HAVE_GETADDRINFO, 1, [Define if you have the getaddrinfo function.]) ++# fi + + AC_CHECK_FUNCS(getnameinfo) + +--- Python-2.7.1.orig/configure 2017-05-14 20:22:04.000000000 +0200 ++++ Python-2.7.1/configure 2017-05-14 20:22:03.000000000 +0200 +@@ -10802,19 +10802,19 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_buggy_getaddrinfo" >&5 + $as_echo "$ac_cv_buggy_getaddrinfo" >&6; } + +-if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes +-then +- if test $ipv6 = yes +- then +- echo 'Fatal: You must get working getaddrinfo() function.' +- echo ' or you can specify "--disable-ipv6"'. +- exit 1 +- fi +-else ++# if test $have_getaddrinfo = no -o "$ac_cv_buggy_getaddrinfo" = yes ++# then ++# if test $ipv6 = yes ++# then ++# echo 'Fatal: You must get working getaddrinfo() function.' ++# echo ' or you can specify "--disable-ipv6"'. ++# exit 1 ++# fi ++# else + + $as_echo "#define HAVE_GETADDRINFO 1" >>confdefs.h + +-fi ++# fi + + for ac_func in getnameinfo + do :