dev-perl/WWW-Curl: fix build failure against curl-7.50.2 and upper, bug #593280
authorSergei Trofimovich <slyfox@gentoo.org>
Sat, 17 Sep 2016 17:01:25 +0000 (18:01 +0100)
committerSergei Trofimovich <slyfox@gentoo.org>
Sat, 17 Sep 2016 17:01:35 +0000 (18:01 +0100)
Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/593280

Package-Manager: portage-2.3.0

dev-perl/WWW-Curl/WWW-Curl-4.150.0-r1.ebuild
dev-perl/WWW-Curl/WWW-Curl-4.170.0.ebuild
dev-perl/WWW-Curl/files/WWW-Curl-4.150.0-curl-7.50.2.patch [new file with mode: 0644]

index 8a2818fa127ed0a120b9c3a85b5de28e5344d48f..e600e514153c0d5be28e7e273624c2964d5f7af1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -19,3 +19,5 @@ RDEPEND="net-misc/curl"
 DEPEND="${RDEPEND}"
 
 SRC_TEST=online
+
+PATCHES=("${FILESDIR}"/${PN}-4.150.0-curl-7.50.2.patch)
index fc0c8aae0e6a91dcc2c171dfd4f8700d983789a5..aacac26bc3cd141ebce024c54f656c6696eb33e0 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
@@ -19,3 +19,5 @@ RDEPEND="net-misc/curl"
 DEPEND="${RDEPEND}"
 
 SRC_TEST=online
+
+PATCHES=("${FILESDIR}"/${PN}-4.150.0-curl-7.50.2.patch)
diff --git a/dev-perl/WWW-Curl/files/WWW-Curl-4.150.0-curl-7.50.2.patch b/dev-perl/WWW-Curl/files/WWW-Curl-4.150.0-curl-7.50.2.patch
new file mode 100644 (file)
index 0000000..2fecfce
--- /dev/null
@@ -0,0 +1,40 @@
+curl-7.50.2 introduced a #define without integer value:
+
+    #ifdef CURL_NO_OLDIES
+    #define CURL_STRICTER
+    #endif
+
+Heuristics in 'Makefile.PL' assumes all defines in form of
+    #define CURL_<something> <an-expression>
+and generates a symbol lookup table in 'curlopt-constants.c'
+as:
+
+  static int
+  constant(const char *name)
+  {
+    errno = 0;
+
+    if (strncmp(name, "CURL_", 5) == 0) {
+        name += 5;
+        switch (*name) {
+        ...
+        case 'S':
+            if (strEQ(name, "STRICTER")) return CURL_STRICTER;
+Which is not valid C:
+  curlopt-constants.c:128:49: error: ‘CURL_STRICTER’ undeclared (first use in this function)
+             if (strEQ(name, "STRICTER")) return CURL_STRICTER;
+                                                 ^~~~~~~~~~~~~
+diff --git a/Makefile.PL b/Makefile.PL
+index f9170bb..fc1a55a 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -122,2 +122,9 @@ if (!defined($curl_h)) {
+     while(<H>) {
++        # Skip defines without values like:
++        #    #define CURL_STRICTER
++        if (/^#define (CURL[A-Za-z0-9_]*)$/) {
++            chomp;
++            warn "Skipping '$_': does not define a symbol";
++            next;
++        }
+         if (/^#define (CURL[A-Za-z0-9_]*)/) {