1 |
commit: d8af50b8b4257360017447d012a08ca968a7c2a7 |
2 |
Author: Aaron Bauman <bman <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Apr 30 00:14:35 2018 +0000 |
4 |
Commit: Aaron Bauman <bman <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Apr 30 00:14:48 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8af50b8 |
7 |
|
8 |
dev-lang/php: add LibreSSL compatibility patch |
9 |
|
10 |
This patch fixes building with >=dev-libs/libressl-2.7.x. Patch taken |
11 |
from upstream bug https://bugs.php.net/bug.php?id=76174. Hopefully this |
12 |
will be included in future releases to properly detect LibreSSL |
13 |
versions due to API differences. |
14 |
|
15 |
Closes: https://bugs.gentoo.org/651308 |
16 |
Package-Manager: Portage-2.3.31, Repoman-2.3.9 |
17 |
|
18 |
dev-lang/php/files/libressl-compatibility.patch | 65 +++++++++++++++++++++++++ |
19 |
dev-lang/php/php-7.0.29.ebuild | 7 ++- |
20 |
dev-lang/php/php-7.0.30.ebuild | 7 ++- |
21 |
dev-lang/php/php-7.1.16.ebuild | 7 ++- |
22 |
dev-lang/php/php-7.1.17.ebuild | 5 ++ |
23 |
dev-lang/php/php-7.2.5.ebuild | 5 ++ |
24 |
6 files changed, 93 insertions(+), 3 deletions(-) |
25 |
|
26 |
diff --git a/dev-lang/php/files/libressl-compatibility.patch b/dev-lang/php/files/libressl-compatibility.patch |
27 |
new file mode 100644 |
28 |
index 00000000000..3b9c39dcc59 |
29 |
--- /dev/null |
30 |
+++ b/dev-lang/php/files/libressl-compatibility.patch |
31 |
@@ -0,0 +1,65 @@ |
32 |
+--- a/ext/openssl/openssl.c 2018-04-04 14:26:34.583000000 +0000 |
33 |
++++ b/ext/openssl/openssl.c 2018-04-04 14:20:16.907000000 +0000 |
34 |
+@@ -73,7 +73,7 @@ |
35 |
+ #ifdef HAVE_OPENSSL_MD2_H |
36 |
+ #define OPENSSL_ALGO_MD2 4 |
37 |
+ #endif |
38 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) |
39 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
40 |
+ #define OPENSSL_ALGO_DSS1 5 |
41 |
+ #endif |
42 |
+ #define OPENSSL_ALGO_SHA224 6 |
43 |
+@@ -560,7 +560,7 @@ |
44 |
+ #endif |
45 |
+ |
46 |
+ /* {{{ OpenSSL compatibility functions and macros */ |
47 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) |
48 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
49 |
+ #define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa |
50 |
+ #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh |
51 |
+ #define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa |
52 |
+@@ -677,7 +677,7 @@ |
53 |
+ return M_ASN1_STRING_data(asn1); |
54 |
+ } |
55 |
+ |
56 |
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER) |
57 |
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
58 |
+ |
59 |
+ static int X509_get_signature_nid(const X509 *x) |
60 |
+ { |
61 |
+@@ -1324,7 +1324,7 @@ |
62 |
+ mdtype = (EVP_MD *) EVP_md2(); |
63 |
+ break; |
64 |
+ #endif |
65 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) |
66 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
67 |
+ case OPENSSL_ALGO_DSS1: |
68 |
+ mdtype = (EVP_MD *) EVP_dss1(); |
69 |
+ break; |
70 |
+@@ -1450,7 +1450,7 @@ |
71 |
+ #ifdef HAVE_OPENSSL_MD2_H |
72 |
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT); |
73 |
+ #endif |
74 |
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) |
75 |
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
76 |
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT); |
77 |
+ #endif |
78 |
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT); |
79 |
+@@ -3620,7 +3620,7 @@ |
80 |
+ RETURN_FALSE; |
81 |
+ } |
82 |
+ |
83 |
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) |
84 |
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
85 |
+ /* Due to changes in OpenSSL 1.1 related to locking when decoding CSR, |
86 |
+ * the pub key is not changed after assigning. It means if we pass |
87 |
+ * a private key, it will be returned including the private part. |
88 |
+@@ -3631,7 +3631,7 @@ |
89 |
+ /* Retrieve the public key from the CSR */ |
90 |
+ tpubkey = X509_REQ_get_pubkey(csr); |
91 |
+ |
92 |
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER) |
93 |
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L) |
94 |
+ /* We need to free the CSR as it was duplicated */ |
95 |
+ X509_REQ_free(csr); |
96 |
+ #endif |
97 |
|
98 |
diff --git a/dev-lang/php/php-7.0.29.ebuild b/dev-lang/php/php-7.0.29.ebuild |
99 |
index ab385d52c39..f0c6303f1cb 100644 |
100 |
--- a/dev-lang/php/php-7.0.29.ebuild |
101 |
+++ b/dev-lang/php/php-7.0.29.ebuild |
102 |
@@ -163,7 +163,12 @@ REQUIRED_USE=" |
103 |
mysql? ( || ( mysqli pdo ) ) |
104 |
" |
105 |
|
106 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
107 |
+PATCHES=( |
108 |
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch" |
109 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
110 |
+ # patch added 20180429 |
111 |
+ "${FILESDIR}/libressl-compatibility.patch" |
112 |
+) |
113 |
|
114 |
PHP_MV="$(get_major_version)" |
115 |
|
116 |
|
117 |
diff --git a/dev-lang/php/php-7.0.30.ebuild b/dev-lang/php/php-7.0.30.ebuild |
118 |
index ec866bd84ba..8de4204d1c0 100644 |
119 |
--- a/dev-lang/php/php-7.0.30.ebuild |
120 |
+++ b/dev-lang/php/php-7.0.30.ebuild |
121 |
@@ -163,7 +163,12 @@ REQUIRED_USE=" |
122 |
mysql? ( || ( mysqli pdo ) ) |
123 |
" |
124 |
|
125 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
126 |
+PATCHES=( |
127 |
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch" |
128 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
129 |
+ # patch added 20180429 |
130 |
+ "${FILESDIR}/libressl-compatibility.patch" |
131 |
+) |
132 |
|
133 |
PHP_MV="$(get_major_version)" |
134 |
|
135 |
|
136 |
diff --git a/dev-lang/php/php-7.1.16.ebuild b/dev-lang/php/php-7.1.16.ebuild |
137 |
index 55fab7c4c96..0075b8f5bd7 100644 |
138 |
--- a/dev-lang/php/php-7.1.16.ebuild |
139 |
+++ b/dev-lang/php/php-7.1.16.ebuild |
140 |
@@ -145,7 +145,12 @@ REQUIRED_USE=" |
141 |
mysql? ( || ( mysqli pdo ) ) |
142 |
" |
143 |
|
144 |
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" ) |
145 |
+PATCHES=( |
146 |
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch" |
147 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
148 |
+ # patch added 20180429 |
149 |
+ "${FILESDIR}/libressl-compatibility.patch" |
150 |
+) |
151 |
|
152 |
PHP_MV="$(get_major_version)" |
153 |
|
154 |
|
155 |
diff --git a/dev-lang/php/php-7.1.17.ebuild b/dev-lang/php/php-7.1.17.ebuild |
156 |
index 34ff2d2648d..fcd553f3148 100644 |
157 |
--- a/dev-lang/php/php-7.1.17.ebuild |
158 |
+++ b/dev-lang/php/php-7.1.17.ebuild |
159 |
@@ -144,6 +144,11 @@ REQUIRED_USE=" |
160 |
session-mm? ( session !threads ) |
161 |
mysql? ( || ( mysqli pdo ) ) |
162 |
" |
163 |
+PATCHES=( |
164 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
165 |
+ # patch added 20180429 |
166 |
+ "${FILESDIR}/libressl-compatibility.patch" |
167 |
+) |
168 |
|
169 |
PHP_MV="$(get_major_version)" |
170 |
|
171 |
|
172 |
diff --git a/dev-lang/php/php-7.2.5.ebuild b/dev-lang/php/php-7.2.5.ebuild |
173 |
index 5407f131e1a..558d91754f3 100644 |
174 |
--- a/dev-lang/php/php-7.2.5.ebuild |
175 |
+++ b/dev-lang/php/php-7.2.5.ebuild |
176 |
@@ -149,6 +149,11 @@ REQUIRED_USE=" |
177 |
mysql? ( || ( mysqli pdo ) ) |
178 |
zip-encryption? ( zip ) |
179 |
" |
180 |
+PATCHES=( |
181 |
+ # hopefully upstream will include the same version check fixes in upcoming releases |
182 |
+ # patch added 20180429 |
183 |
+ "${FILESDIR}/libressl-compatibility.patch" |
184 |
+) |
185 |
|
186 |
PHP_MV="$(get_major_version)" |