php7-pecl-http: fix build if libidn and libidn2 are both available
authorMichael Heimpold <redacted>
Wed, 18 Apr 2018 20:29:19 +0000 (22:29 +0200)
committerMichael Heimpold <redacted>
Wed, 18 Apr 2018 20:32:20 +0000 (22:32 +0200)
We now select libidn2 as dependency, but libidn -if available-
is also linked against.

Signed-off-by: Michael Heimpold <redacted>
lang/php7-pecl-http/Makefile
lang/php7-pecl-http/patches/300-fix-73.patch [new file with mode: 0644]

index 15d47a891c129fe7f5d054e11704759b3413d726..17eb4a947d5c1911c18bc551f6406d5f3d8ac011 100644 (file)
@@ -9,7 +9,7 @@ PECL_NAME:=pecl_http
 PECL_LONGNAME:=Extended HTTP Support
 
 PKG_VERSION:=3.1.0
-PKG_RELEASE:=4
+PKG_RELEASE:=5
 PKG_HASH:=e3de67b156e7d5f6c2e5eb1e2b5f0acceb7004f1260d68c9f8b2c0f9629aabf0
 
 PKG_NAME:=php7-pecl-http
@@ -53,5 +53,5 @@ CONFIGURE_ARGS+= \
        --with-http-libevent-dir="$(STAGING_DIR)/usr" \
        --with-http-libidn-dir="$(STAGING_DIR)/usr"
 
-$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+icu +libcurl +librt +libevent2 +libidn +php7-mod-hash +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
+$(eval $(call PECLPackage,http,$(PECL_LONGNAME),+icu +libcurl +librt +libevent2 +PACKAGE_libidn:libidn +libidn2 +php7-mod-hash +php7-mod-iconv +php7-mod-session +php7-pecl-raphf +php7-pecl-propro,30))
 $(eval $(call BuildPackage,$(PKG_NAME)))
diff --git a/lang/php7-pecl-http/patches/300-fix-73.patch b/lang/php7-pecl-http/patches/300-fix-73.patch
new file mode 100644 (file)
index 0000000..1779223
--- /dev/null
@@ -0,0 +1,55 @@
+From 8158548a80733b3af9539356b47527d960a13287 Mon Sep 17 00:00:00 2001
+From: Michael Wallner <mike@php.net>
+Date: Thu, 1 Feb 2018 14:36:09 +0100
+Subject: [PATCH] fix #73
+
+include idna.h prior idn2.h to ensure INDA_H is defined and libidn2 does
+not try to define the idna compat layer
+---
+ src/php_http.c     | 6 +++---
+ src/php_http_url.c | 6 +++---
+ 2 files changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/src/php_http.c b/src/php_http.c
+index 207c248..bc9166a 100644
+--- a/src/php_http.c
++++ b/src/php_http.c
+@@ -31,12 +31,12 @@
+ #if PHP_HTTP_HAVE_LIBICU
+ #     include <unicode/uversion.h>
+ #endif
+-#if PHP_HTTP_HAVE_LIBIDN2
+-#     include <idn2.h>
+-#endif
+ #if PHP_HTTP_HAVE_LIBIDN
+ #     include <idna.h>
+ #endif
++#if PHP_HTTP_HAVE_LIBIDN2
++#     include <idn2.h>
++#endif
+ #if PHP_HTTP_HAVE_LIBIDNKIT2 || PHP_HTTP_HAVE_LIBIDNKIT
+ #include "idn/version.h"
+ #endif
+diff --git a/src/php_http_url.c b/src/php_http_url.c
+index 029e6a8..361e61c 100644
+--- a/src/php_http_url.c
++++ b/src/php_http_url.c
+@@ -12,12 +12,12 @@
+ #include "php_http_api.h"
+-#if PHP_HTTP_HAVE_LIBIDN2
+-#     include <idn2.h>
+-#endif
+ #if PHP_HTTP_HAVE_LIBIDN
+ #     include <idna.h>
+ #endif
++#if PHP_HTTP_HAVE_LIBIDN2
++#     include <idn2.h>
++#endif
+ #if PHP_HTTP_HAVE_LIBICU
+ #     include <unicode/uidna.h>
+ #endif
+-- 
+2.7.4
+
git clone https://git.99rst.org/PROJECT