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-oauth/, dev-php/pecl-oauth/files/
Date: Sun, 05 Mar 2017 01:45:01
Message-Id: 1488678246.10363c109a4155fb7702eaa88819f00586b243aa.grknight@gentoo
1 commit: 10363c109a4155fb7702eaa88819f00586b243aa
2 Author: Brian Evans <grknight <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 5 01:44:06 2017 +0000
4 Commit: Brian Evans <grknight <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 5 01:44:06 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10363c10
7
8 dev-php/pecl-oauth: Revbump to fix dependencies and add php7-1
9
10 Package-Manager: Portage-2.3.4, Repoman-2.3.2
11
12 dev-php/pecl-oauth/files/1.2.3-prce.h-check.patch | 26 ++++++++
13 dev-php/pecl-oauth/files/1.2.3-withcurl.patch | 71 ++++++++++++++++++++++
14 .../pecl-oauth/files/2.0.2-compare_segfault.patch | 48 +++++++++++++++
15 dev-php/pecl-oauth/pecl-oauth-1.2.3-r5.ebuild | 56 +++++++++++++++++
16 dev-php/pecl-oauth/pecl-oauth-2.0.2-r1.ebuild | 54 ++++++++++++++++
17 5 files changed, 255 insertions(+)
18
19 diff --git a/dev-php/pecl-oauth/files/1.2.3-prce.h-check.patch b/dev-php/pecl-oauth/files/1.2.3-prce.h-check.patch
20 new file mode 100644
21 index 00000000000..995ef51f28c
22 --- /dev/null
23 +++ b/dev-php/pecl-oauth/files/1.2.3-prce.h-check.patch
24 @@ -0,0 +1,26 @@
25 +From f12e2bd72b238da2dbf3bd0f882d977073cca282 Mon Sep 17 00:00:00 2001
26 +From: John Jawed <jawed@×××.net>
27 +Date: Thu, 24 Jul 2014 15:19:18 +0000
28 +Subject: [PATCH] Bug #67658 (configure does not detect missing pcre.h)
29 +
30 +git-svn-id: https://svn.php.net/repository/pecl/oauth/trunk@334377 c90b9560-bf6c-de11-be94-00142212c4b1
31 +---
32 + config.m4 | 2 ++
33 + 1 file changed, 2 insertions(+)
34 +
35 +diff --git a/config.m4 b/config.m4
36 +index 48e2608..53a5ea8 100644
37 +--- a/config.m4
38 ++++ b/config.m4
39 +@@ -14,6 +14,8 @@ if test "$PHP_OAUTH" != "no"; then
40 + PHP_NEW_EXTENSION(oauth, oauth.c provider.c, $ext_shared)
41 + CFLAGS="$CFLAGS -Wall -g"
42 +
43 ++ AC_CHECK_HEADERS(pcre.h)
44 ++
45 + AS_IF([test "x$with_curl" != "xno"],
46 + [
47 + AC_MSG_CHECKING(for cURL in default path)
48 +--
49 +2.1.4
50 +
51
52 diff --git a/dev-php/pecl-oauth/files/1.2.3-withcurl.patch b/dev-php/pecl-oauth/files/1.2.3-withcurl.patch
53 new file mode 100644
54 index 00000000000..5069ae92b14
55 --- /dev/null
56 +++ b/dev-php/pecl-oauth/files/1.2.3-withcurl.patch
57 @@ -0,0 +1,71 @@
58 +From 1b68ce035883f1ae186d82682fbbc5ea7d1834b3 Mon Sep 17 00:00:00 2001
59 +From: John Jawed <jawed@×××.net>
60 +Date: Fri, 18 Jan 2013 20:28:05 +0000
61 +Subject: [PATCH] Bug 64025 (patch via mattsch at gmail dot com)
62 +
63 +git-svn-id: https://svn.php.net/repository/pecl/oauth/trunk@329234 c90b9560-bf6c-de11-be94-00142212c4b1
64 +---
65 + config.m4 | 40 ++++++++++++++++++++++++++--------------
66 + 1 file changed, 26 insertions(+), 14 deletions(-)
67 +
68 +diff --git a/config.m4 b/config.m4
69 +index 832c577..48e2608 100644
70 +--- a/config.m4
71 ++++ b/config.m4
72 +@@ -5,27 +5,39 @@ dnl
73 + PHP_ARG_ENABLE(oauth, for oauth support,
74 + [ --enable-oauth Include oauth support])
75 +
76 ++AC_ARG_WITH([curl],
77 ++ AS_HELP_STRING([--without-curl], [Ignore presence of cURL and disable it]))
78 ++
79 + if test "$PHP_OAUTH" != "no"; then
80 + PHP_SUBST(OAUTH_SHARED_LIBADD)
81 +
82 + PHP_NEW_EXTENSION(oauth, oauth.c provider.c, $ext_shared)
83 + CFLAGS="$CFLAGS -Wall -g"
84 +
85 +- AC_MSG_CHECKING(for cURL in default path)
86 +- for i in /usr/local /usr; do
87 +- if test -r $i/include/curl/easy.h; then
88 +- CURL_DIR=$i
89 +- AC_MSG_RESULT(found in $i)
90 +- break
91 +- fi
92 +- done
93 ++ AS_IF([test "x$with_curl" != "xno"],
94 ++ [
95 ++ AC_MSG_CHECKING(for cURL in default path)
96 ++ have_curl=no
97 ++ for i in /usr/local /usr; do
98 ++ if test -r $i/include/curl/easy.h; then
99 ++ have_curl=yes
100 ++ CURL_DIR=$i
101 ++ AC_MSG_RESULT(found in $i)
102 ++ break
103 ++ fi
104 ++ done
105 ++ ],
106 ++ [have_curl=no])
107 +
108 +- if test -z "$CURL_DIR"; then
109 +- AC_MSG_RESULT(cURL not found, cURL support disabled)
110 +- else
111 +- PHP_ADD_LIBRARY(curl,,OAUTH_SHARED_LIBADD)
112 +- AC_DEFINE(OAUTH_USE_CURL, 1, [Whether cURL is present and should be used])
113 +- fi
114 ++ AS_IF([test "x$have_curl" = "xyes"],
115 ++ [
116 ++ PHP_ADD_LIBRARY(curl,,OAUTH_SHARED_LIBADD)
117 ++ AC_DEFINE(OAUTH_USE_CURL, 1, [Whether cURL is present and should be used])
118 ++ ],
119 ++ [AS_IF([test "x$with_curl" = "xyes"],
120 ++ [AC_MSG_ERROR([cURL requested but not found])
121 ++ ])
122 ++ ])
123 +
124 + PHP_ADD_EXTENSION_DEP(oauth, hash)
125 + fi
126 +--
127 +2.1.4
128 +
129
130 diff --git a/dev-php/pecl-oauth/files/2.0.2-compare_segfault.patch b/dev-php/pecl-oauth/files/2.0.2-compare_segfault.patch
131 new file mode 100644
132 index 00000000000..f0b8d7ae216
133 --- /dev/null
134 +++ b/dev-php/pecl-oauth/files/2.0.2-compare_segfault.patch
135 @@ -0,0 +1,48 @@
136 +From f1a5b6dea1982dab03c810edd321ca57907d41fe Mon Sep 17 00:00:00 2001
137 +From: Adam Saponara <as@×××.net>
138 +Date: Fri, 24 Feb 2017 17:20:51 -0500
139 +Subject: [PATCH] Fix bug #74163: Segfault in oauth_compare_value
140 +
141 +Credit to @russpos for finding this bug
142 +---
143 + oauth.c | 4 ++--
144 + tests/oauth_sbs.phpt | 4 ++++
145 + 2 files changed, 6 insertions(+), 2 deletions(-)
146 +
147 +diff --git a/oauth.c b/oauth.c
148 +index 62522bd..198e2cb 100644
149 +--- a/oauth.c
150 ++++ b/oauth.c
151 +@@ -374,8 +374,8 @@ static int oauth_strcmp(zval *first, zval *second)
152 + static int oauth_compare_value(const void *a, const void *b)
153 + {
154 + Bucket *f, *s;
155 +- f = *(Bucket **)a;
156 +- s = *(Bucket **)b;
157 ++ f = (Bucket *)a;
158 ++ s = (Bucket *)b;
159 +
160 + return oauth_strcmp(&f->val, &s->val);
161 + }
162 +diff --git a/tests/oauth_sbs.phpt b/tests/oauth_sbs.phpt
163 +index a49d2b4..4e9269e 100644
164 +--- a/tests/oauth_sbs.phpt
165 ++++ b/tests/oauth_sbs.phpt
166 +@@ -21,6 +21,8 @@ echo "-- putting oauth_signature inside by mistake --\n";
167 + echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/',array('oauth_signature'=>'hello world')),"\n";
168 + echo "-- merging url query and extra params --\n";
169 + echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script?arg1=1',array('arg2' => '2')),"\n";
170 ++echo "-- with array value --\n";
171 ++echo oauth_get_sbs('GET', 'http://127.0.0.1:12342/script',array('arg2' => [1, 2, 3])),"\n";
172 +
173 + ?>
174 + --EXPECTF--
175 +@@ -44,3 +46,5 @@ GET&http%3A%2F%2F127.0.0.1%3A12342%2F&test%3D
176 + GET&http%3A%2F%2F127.0.0.1%3A12342%2F&
177 + -- merging url query and extra params --
178 + GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg1%3D1%26arg2%3D2
179 ++-- with array value --
180 ++GET&http%3A%2F%2F127.0.0.1%3A12342%2Fscript&arg2%3D1%26arg2%3D2%26arg2%3D3
181 +--
182 +2.1.4
183 +
184
185 diff --git a/dev-php/pecl-oauth/pecl-oauth-1.2.3-r5.ebuild b/dev-php/pecl-oauth/pecl-oauth-1.2.3-r5.ebuild
186 new file mode 100644
187 index 00000000000..460f2c39256
188 --- /dev/null
189 +++ b/dev-php/pecl-oauth/pecl-oauth-1.2.3-r5.ebuild
190 @@ -0,0 +1,56 @@
191 +# Copyright 1999-2017 Gentoo Foundation
192 +# Distributed under the terms of the GNU General Public License v2
193 +
194 +EAPI="6"
195 +PHP_EXT_NAME="oauth"
196 +PHP_EXT_INI="yes"
197 +PHP_EXT_ZENDEXT="no"
198 +
199 +USE_PHP="php5-6 php7-0 php7-1"
200 +
201 +inherit php-ext-pecl-r3
202 +
203 +# Really only build for 5.6
204 +USE_PHP="php5-6"
205 +
206 +KEYWORDS="~amd64 ~x86"
207 +
208 +DESCRIPTION="OAuth is an authorization protocol built on top of HTTP"
209 +LICENSE="BSD"
210 +SLOT="0"
211 +IUSE="+curl examples"
212 +
213 +DEPEND="php_targets_php5-6? ( dev-lang/php:5.6[hash]
214 + dev-libs/libpcre:3= curl? ( net-misc/curl:0= ) )
215 +"
216 +RDEPEND="${DEPEND} php_targets_php7-0? ( ${CATEGORY}/${PN}:7[php_targets_php7-0(-)?] )
217 + php_targets_php7-1? ( ${CATEGORY}/${PN}:7[php_targets_php7-1(-)?] )"
218 +
219 +src_prepare() {
220 + if use php_targets_php5-6 ; then
221 + local PATCHES=(
222 + "${FILESDIR}/${PV}-withcurl.patch"
223 + "${FILESDIR}/${PV}-prce.h-check.patch"
224 + )
225 + php-ext-source-r3_src_prepare
226 + else
227 + eapply_user
228 + fi
229 +}
230 +
231 +src_configure() {
232 + if use php_targets_php5-6 ; then
233 + local PHP_EXT_ECONF_ARGS=(
234 + --enable-oauth
235 + $(use_with curl)
236 + )
237 +
238 + php-ext-source-r3_src_configure
239 + fi
240 +}
241 +
242 +src_install() {
243 + if use php_targets_php5-6 ; then
244 + php-ext-pecl-r3_src_install
245 + fi
246 +}
247
248 diff --git a/dev-php/pecl-oauth/pecl-oauth-2.0.2-r1.ebuild b/dev-php/pecl-oauth/pecl-oauth-2.0.2-r1.ebuild
249 new file mode 100644
250 index 00000000000..988ba351a82
251 --- /dev/null
252 +++ b/dev-php/pecl-oauth/pecl-oauth-2.0.2-r1.ebuild
253 @@ -0,0 +1,54 @@
254 +# Copyright 1999-2017 Gentoo Foundation
255 +# Distributed under the terms of the GNU General Public License v2
256 +
257 +EAPI="6"
258 +PHP_EXT_NAME="oauth"
259 +PHP_EXT_INI="yes"
260 +PHP_EXT_ZENDEXT="no"
261 +
262 +USE_PHP="php5-6 php7-0 php7-1"
263 +
264 +inherit php-ext-pecl-r3
265 +
266 +# Really only build for 7.0
267 +USE_PHP="php7-0 php7-1"
268 +
269 +KEYWORDS="~amd64 ~x86"
270 +
271 +DESCRIPTION="OAuth is an authorization protocol built on top of HTTP"
272 +LICENSE="BSD"
273 +SLOT="7"
274 +IUSE="+curl examples"
275 +
276 +DEPEND="php_targets_php7-0? ( dev-lang/php:7.0[hash]
277 + dev-libs/libpcre:3= curl? ( net-misc/curl:0= ) )
278 + php_targets_php7-1? ( dev-lang/php:7.1[hash]
279 + dev-libs/libpcre:3= curl? ( net-misc/curl:0= ) )
280 +"
281 +RDEPEND="${DEPEND} php_targets_php5-6? ( ${CATEGORY}/${PN}:0[php_targets_php5-6(-)?] )"
282 +
283 +src_prepare() {
284 + if use php_targets_php7-0 || use php_targets_php7-1 ; then
285 + local PATCHES=( "${FILESDIR}/${PV}-compare_segfault.patch" )
286 + php-ext-source-r3_src_prepare
287 + else
288 + eapply_user
289 + fi
290 +}
291 +
292 +src_configure() {
293 + if use php_targets_php7-0 || use php_targets_php7-1 ; then
294 + local PHP_EXT_ECONF_ARGS=(
295 + --enable-oauth
296 + $(use_with curl)
297 + )
298 +
299 + php-ext-source-r3_src_configure
300 + fi
301 +}
302 +
303 +src_install() {
304 + if use php_targets_php7-0 || use php_targets_php7-1 ; then
305 + php-ext-pecl-r3_src_install
306 + fi
307 +}