summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Bishop2023-08-07 17:36:35 -0400
committerAaron Bishop2023-08-07 17:37:20 -0400
commit2b906e7d95229fc134dda209e3cb37dbbf0f44ba (patch)
tree85f4e442ede3640fd15cb803211ddade762330a4
parent8d6b2f4c292922e2c3544eab0a444fab1be8f166 (diff)
downloadaur-2b906e7d95229fc134dda209e3cb37dbbf0f44ba.tar.gz
Fix build with newer versions of cURL
Don't rely on header guard names. Simply make a define since the header is always included. Don't parse curl.h with perl if the cpp program (provided by gcc) is installed
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD10
-rw-r--r--curl-7.71.0.patch24
-rw-r--r--makefile.patch97
4 files changed, 105 insertions, 32 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 8ebb1402f98c..d7dee3737a6a 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = perl-www-curl
pkgdesc = Perl/CPAN Module WWW::Curl
pkgver = 4.17
- pkgrel = 15
+ pkgrel = 16
url = https://search.cpan.org/dist/WWW-Curl/
arch = x86_64
license = GPL
@@ -9,8 +9,8 @@ pkgbase = perl-www-curl
depends = curl
options = !emptydirs
source = https://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT/WWW-Curl-4.17.tar.gz
- source = curl-7.71.0.patch
+ source = makefile.patch
sha256sums = 52ffab110e32348d775f241c973eb56f96b08eedbc110d77d257cdb0a24ab7ba
- sha256sums = da51d5f2a2993dd33f5a7baf358a61086440abb50e4dd3ca1f4939ea262d3cc2
+ sha256sums = bc09838143537eeeed6de4af4eb0764320205450e638a4d899ecdae0320994da
pkgname = perl-www-curl
diff --git a/PKGBUILD b/PKGBUILD
index cb5bbbb2fc0f..6884dbf8ffe5 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,22 +4,22 @@
pkgname=perl-www-curl
pkgver=4.17
-pkgrel=15
+pkgrel=16
pkgdesc="Perl/CPAN Module WWW::Curl"
arch=('x86_64')
url="https://search.cpan.org/dist/WWW-Curl/"
license=("GPL" "PerlArtistic")
depends=("curl")
options=('!emptydirs')
-source=("https://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT/WWW-Curl-${pkgver}.tar.gz"
- 'curl-7.71.0.patch')
+source=("$pkgname-$pkgver.tar.gz::https://search.cpan.org/CPAN/authors/id/S/SZ/SZBALINT/WWW-Curl-${pkgver}.tar.gz"
+ 'makefile.patch')
sha256sums=('52ffab110e32348d775f241c973eb56f96b08eedbc110d77d257cdb0a24ab7ba'
- 'da51d5f2a2993dd33f5a7baf358a61086440abb50e4dd3ca1f4939ea262d3cc2')
+ 'bc09838143537eeeed6de4af4eb0764320205450e638a4d899ecdae0320994da')
prepare() {
cd WWW-Curl-${pkgver}
- patch -Np1 -i ../curl-7.71.0.patch
+ patch -Np1 -i ../makefile.patch
}
build() {
diff --git a/curl-7.71.0.patch b/curl-7.71.0.patch
deleted file mode 100644
index 7ab21ef659ee..000000000000
--- a/curl-7.71.0.patch
+++ /dev/null
@@ -1,24 +0,0 @@
---- a/Curl.xs 2014-02-21 11:08:30.000000000 -0500
-+++ b/Curl.xs 2020-06-25 09:36:37.868826340 -0400
-@@ -18,6 +18,10 @@
- #include <curl/easy.h>
- #include <curl/multi.h>
-
-+#if defined(CURLINC_MULTI_H) && !defined(__CURL_MULTI_H)
-+# define __CURL_MULTI_H
-+#endif
-+
- #define header_callback_func writeheader_callback_func
-
- /* Do a favor for older perl versions */
---- a/Makefile.PL 2014-02-21 11:08:09.000000000 -0500
-+++ b/Makefile.PL 2020-06-25 09:24:50.549812170 -0400
-@@ -127,7 +127,7 @@
- close H;
-
- for my $e (sort @syms) {
-- if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {
-+ if($e =~ /(OBSOLETE|^CURL_EXTERN|^CURL_WIN32\z|^CURLOPT\z|^CURL_STRICTER\z|^CURL_DID_MEMORY_FUNC_TYPEDEFS\z|_LAST\z|_LASTENTRY\z)/) {
- next;
- }
- my ($group) = $e =~ m/^([^_]+_)/;
diff --git a/makefile.patch b/makefile.patch
new file mode 100644
index 000000000000..9924c50a34b5
--- /dev/null
+++ b/makefile.patch
@@ -0,0 +1,97 @@
+diff -ruN a/Curl.xs b/Curl.xs
+--- a/Curl.xs 2014-02-21 11:08:30.000000000 -0500
++++ b/Curl.xs 2023-08-07 17:23:35.057912554 -0400
+@@ -18,6 +18,8 @@
+ #include <curl/easy.h>
+ #include <curl/multi.h>
+
++#define USE_CURL_MULTI
++
+ #define header_callback_func writeheader_callback_func
+
+ /* Do a favor for older perl versions */
+@@ -70,7 +72,7 @@
+
+
+ typedef struct {
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ struct CURLM *curlm;
+ #else
+ struct void *curlm;
+@@ -234,7 +236,7 @@
+ {
+ perl_curl_multi *self;
+ Newz(1, self, 1, perl_curl_multi);
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ self->curlm=curl_multi_init();
+ #else
+ croak("curl version too old to support curl_multi_init()");
+@@ -245,7 +247,7 @@
+ /* delete the multi */
+ static void perl_curl_multi_delete(perl_curl_multi *self)
+ {
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ if (self->curlm)
+ curl_multi_cleanup(self->curlm);
+ Safefree(self);
+@@ -1065,7 +1067,7 @@
+ WWW::Curl::Multi curlm
+ WWW::Curl::Easy curl
+ CODE:
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ curl_multi_add_handle(curlm->curlm, curl->curl);
+ #endif
+
+@@ -1074,7 +1076,7 @@
+ WWW::Curl::Multi curlm
+ WWW::Curl::Easy curl
+ CODE:
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ curl_multi_remove_handle(curlm->curlm, curl->curl);
+ #endif
+
+@@ -1149,7 +1151,7 @@
+ PREINIT:
+ int remaining;
+ CODE:
+-#ifdef __CURL_MULTI_H
++#ifdef USE_CURL_MULTI
+ while(CURLM_CALL_MULTI_PERFORM ==
+ curl_multi_perform(self->curlm, &remaining));
+ RETVAL = remaining;
+diff -ruN a/Makefile.PL b/Makefile.PL
+--- a/Makefile.PL 2014-02-21 11:08:09.000000000 -0500
++++ b/Makefile.PL 2023-08-07 17:04:20.515875026 -0400
+@@ -104,6 +104,13 @@
+ unless ($has_cpp) {
+ warn "No working cpp ($!). Parsing curl.h in Perl";
+ open(H_IN, "<", $curl_h) or die("Can't open curl.h at path $curl_h, because: ".$!);
++ open (H, "<", $curl_h) or die ("Cannot open $curl_h: ".$!);
++ while(<H>) {
++ if (/^#define (CURL[A-Za-z0-9_]*)/) {
++ push @syms, $1;
++ }
++ }
++ close H;
+ }
+ while ( <H_IN> ) {
+ if ( /enum\s+(\S+\s+)?{/ .. /}/ ) {
+@@ -118,13 +125,6 @@
+ }
+ }
+ close H_IN;
+- open (H, "<", $curl_h) or die ("Cannot open $curl_h: ".$!);
+- while(<H>) {
+- if (/^#define (CURL[A-Za-z0-9_]*)/) {
+- push @syms, $1;
+- }
+- }
+- close H;
+
+ for my $e (sort @syms) {
+ if($e =~ /(OBSOLETE|^CURL_EXTERN|_LAST\z|_LASTENTRY\z)/) {