Gentoo Archives: gentoo-commits

From: Brian Evans <grknight@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-php/pecl-http/files/, dev-php/pecl-http/
Date: Wed, 22 Sep 2021 14:51:31
Message-Id: 1632322123.f6d3bb9bff656134a7312c9a1442e576006a7503.grknight@gentoo
1 commit: f6d3bb9bff656134a7312c9a1442e576006a7503
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Wed Sep 22 14:48:43 2021 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Wed Sep 22 14:48:43 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6d3bb9b
7
8 dev-php/pecl-http: Revbump for 3.2.4-r1 to fix curl cookie issues
9
10 Signed-off-by: Brian Evans <grknight <AT> gentoo.org>
11
12 .../files/pecl-http-3.2.4-curl-cookies.patch | 11 ++++
13 dev-php/pecl-http/pecl-http-3.2.4-r1.ebuild | 75 ++++++++++++++++++++++
14 2 files changed, 86 insertions(+)
15
16 diff --git a/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch b/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch
17 new file mode 100644
18 index 00000000000..3c124b4624a
19 --- /dev/null
20 +++ b/dev-php/pecl-http/files/pecl-http-3.2.4-curl-cookies.patch
21 @@ -0,0 +1,11 @@
22 +--- a/src/php_http_client_curl.c 2021-01-13 10:34:34.000000000 -0500
23 ++++ b/src/php_http_client_curl.c 2021-09-22 10:38:58.854615743 -0400
24 +@@ -834,7 +834,7 @@
25 + } else {
26 + storage->cookiestore = NULL;
27 + }
28 +- if ( CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore)
29 ++ if ( CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEFILE, storage->cookiestore ? storage->cookiestore : "")
30 + || CURLE_OK != curl_easy_setopt(ch, CURLOPT_COOKIEJAR, storage->cookiestore)
31 + ) {
32 + return FAILURE;
33
34 diff --git a/dev-php/pecl-http/pecl-http-3.2.4-r1.ebuild b/dev-php/pecl-http/pecl-http-3.2.4-r1.ebuild
35 new file mode 100644
36 index 00000000000..94c0833cc07
37 --- /dev/null
38 +++ b/dev-php/pecl-http/pecl-http-3.2.4-r1.ebuild
39 @@ -0,0 +1,75 @@
40 +# Copyright 1999-2021 Gentoo Authors
41 +# Distributed under the terms of the GNU General Public License v2
42 +
43 +EAPI="7"
44 +
45 +PHP_EXT_NAME="http"
46 +PHP_EXT_PECL_PKG="pecl_http"
47 +PHP_EXT_INI="yes"
48 +PHP_EXT_ZENDEXT="no"
49 +PHP_INI_NAME="50-http"
50 +
51 +USE_PHP="php7-3 php7-4 php8-0"
52 +
53 +inherit php-ext-pecl-r3
54 +
55 +USE_PHP="php7-3 php7-4"
56 +
57 +KEYWORDS="~amd64 ~x86"
58 +
59 +DESCRIPTION="Extended HTTP Support for PHP"
60 +LICENSE="BSD-2 MIT"
61 +SLOT="7"
62 +IUSE="ssl curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl"
63 +
64 +# Patch gets cookies working with curl 7.77, but further interop work was done later
65 +# Just set min version for this short time to live branch
66 +COMMON_DEPEND="app-arch/brotli:=
67 + dev-libs/libevent
68 + dev-php/pecl-propro:7[php_targets_php7-3(-)?,php_targets_php7-4(-)?]
69 + >=dev-php/pecl-raphf-2.0.1:7[php_targets_php7-3(-)?,php_targets_php7-4(-)?]
70 + net-dns/libidn2
71 + sys-libs/zlib
72 + ssl? ( >=net-misc/curl-7.77[ssl,curl_ssl_gnutls(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=] )
73 + !ssl? ( >=net-misc/curl-7.77[-ssl] )
74 +"
75 +DEPEND="
76 + php_targets_php7-3? ( ${COMMON_DEPEND} dev-lang/php:7.3[hash(+),session(-),iconv(-)] )
77 + php_targets_php7-4? ( ${COMMON_DEPEND} dev-lang/php:7.4[session(-),iconv(-)] )"
78 +RDEPEND="${DEPEND}
79 + php_targets_php8-0? ( dev-php/pecl-http:8[php_targets_php8-0(-)] )"
80 +
81 +PHP_EXT_ECONF_ARGS=( --with-http --without-http-shared-deps --without-http-libidn-dir )
82 +
83 +PATCHES=( "${FILESDIR}/${P}-curl-cookies.patch" )
84 +
85 +src_prepare() {
86 + if use php_targets_php7-3 || use php_targets_php7-4 ; then
87 + php-ext-source-r3_src_prepare
88 + else
89 + default_src_prepare
90 + fi
91 +}
92 +
93 +src_install() {
94 + if use php_targets_php7-3 || use php_targets_php7-4 ; then
95 + php-ext-pecl-r3_src_install
96 + fi
97 +}
98 +
99 +src_test() {
100 + # Cannot use eclass function due to required modules
101 + # All tests SKIP otherwise
102 + for slot in $(php_get_slots); do
103 + php_init_slot_env "${slot}"
104 + # Link in required modules for testing
105 + ln -s "${EXT_DIR}/propro.so" "modules/propro.so" || die
106 + ln -s "${EXT_DIR}/raphf.so" "modules/raphf.so" || die
107 + sed -i \
108 + 's/PHP_TEST_SHARED_EXTENSIONS)/PHP_TEST_SHARED_EXTENSIONS) -d extension=propro.so -d extension=raphf.so/' \
109 + Makefile || die
110 + SKIP_ONLINE_TESTS=yes NO_INTERACTION="yes" emake test
111 + # Clean up testing links
112 + rm modules/propro.so modules/raphf.so || die
113 + done
114 +}