summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Bauman <bman@gentoo.org>2018-04-29 20:14:35 -0400
committerAaron Bauman <bman@gentoo.org>2018-04-29 20:14:48 -0400
commitd8af50b8b4257360017447d012a08ca968a7c2a7 (patch)
tree7dc1c86f37e83dc89784f832b04bfdff13e0bf0b /dev-lang
parentRevert "eclass: mysql - Add net-libs/libnsl for bug 643038" (diff)
downloadgentoo-d8af50b8b4257360017447d012a08ca968a7c2a7.tar.gz
gentoo-d8af50b8b4257360017447d012a08ca968a7c2a7.tar.bz2
gentoo-d8af50b8b4257360017447d012a08ca968a7c2a7.zip
dev-lang/php: add LibreSSL compatibility patch
This patch fixes building with >=dev-libs/libressl-2.7.x. Patch taken from upstream bug https://bugs.php.net/bug.php?id=76174. Hopefully this will be included in future releases to properly detect LibreSSL versions due to API differences. Closes: https://bugs.gentoo.org/651308 Package-Manager: Portage-2.3.31, Repoman-2.3.9
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/php/files/libressl-compatibility.patch65
-rw-r--r--dev-lang/php/php-7.0.29.ebuild7
-rw-r--r--dev-lang/php/php-7.0.30.ebuild7
-rw-r--r--dev-lang/php/php-7.1.16.ebuild7
-rw-r--r--dev-lang/php/php-7.1.17.ebuild5
-rw-r--r--dev-lang/php/php-7.2.5.ebuild5
6 files changed, 93 insertions, 3 deletions
diff --git a/dev-lang/php/files/libressl-compatibility.patch b/dev-lang/php/files/libressl-compatibility.patch
new file mode 100644
index 000000000000..3b9c39dcc599
--- /dev/null
+++ b/dev-lang/php/files/libressl-compatibility.patch
@@ -0,0 +1,65 @@
+--- a/ext/openssl/openssl.c 2018-04-04 14:26:34.583000000 +0000
++++ b/ext/openssl/openssl.c 2018-04-04 14:20:16.907000000 +0000
+@@ -73,7 +73,7 @@
+ #ifdef HAVE_OPENSSL_MD2_H
+ #define OPENSSL_ALGO_MD2 4
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #define OPENSSL_ALGO_DSS1 5
+ #endif
+ #define OPENSSL_ALGO_SHA224 6
+@@ -560,7 +560,7 @@
+ #endif
+
+ /* {{{ OpenSSL compatibility functions and macros */
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ #define EVP_PKEY_get0_RSA(_pkey) _pkey->pkey.rsa
+ #define EVP_PKEY_get0_DH(_pkey) _pkey->pkey.dh
+ #define EVP_PKEY_get0_DSA(_pkey) _pkey->pkey.dsa
+@@ -677,7 +677,7 @@
+ return M_ASN1_STRING_data(asn1);
+ }
+
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+
+ static int X509_get_signature_nid(const X509 *x)
+ {
+@@ -1324,7 +1324,7 @@
+ mdtype = (EVP_MD *) EVP_md2();
+ break;
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ case OPENSSL_ALGO_DSS1:
+ mdtype = (EVP_MD *) EVP_dss1();
+ break;
+@@ -1450,7 +1450,7 @@
+ #ifdef HAVE_OPENSSL_MD2_H
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_MD2", OPENSSL_ALGO_MD2, CONST_CS|CONST_PERSISTENT);
+ #endif
+-#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER < 0x10100000L || (defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_DSS1", OPENSSL_ALGO_DSS1, CONST_CS|CONST_PERSISTENT);
+ #endif
+ REGISTER_LONG_CONSTANT("OPENSSL_ALGO_SHA224", OPENSSL_ALGO_SHA224, CONST_CS|CONST_PERSISTENT);
+@@ -3620,7 +3620,7 @@
+ RETURN_FALSE;
+ }
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ /* Due to changes in OpenSSL 1.1 related to locking when decoding CSR,
+ * the pub key is not changed after assigning. It means if we pass
+ * a private key, it will be returned including the private part.
+@@ -3631,7 +3631,7 @@
+ /* Retrieve the public key from the CSR */
+ tpubkey = X509_REQ_get_pubkey(csr);
+
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !(defined (LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x20700000L)
+ /* We need to free the CSR as it was duplicated */
+ X509_REQ_free(csr);
+ #endif
diff --git a/dev-lang/php/php-7.0.29.ebuild b/dev-lang/php/php-7.0.29.ebuild
index ab385d52c394..f0c6303f1cbb 100644
--- a/dev-lang/php/php-7.0.29.ebuild
+++ b/dev-lang/php/php-7.0.29.ebuild
@@ -163,7 +163,12 @@ REQUIRED_USE="
mysql? ( || ( mysqli pdo ) )
"
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch"
+ # hopefully upstream will include the same version check fixes in upcoming releases
+ # patch added 20180429
+ "${FILESDIR}/libressl-compatibility.patch"
+)
PHP_MV="$(get_major_version)"
diff --git a/dev-lang/php/php-7.0.30.ebuild b/dev-lang/php/php-7.0.30.ebuild
index ec866bd84bad..8de4204d1c02 100644
--- a/dev-lang/php/php-7.0.30.ebuild
+++ b/dev-lang/php/php-7.0.30.ebuild
@@ -163,7 +163,12 @@ REQUIRED_USE="
mysql? ( || ( mysqli pdo ) )
"
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch"
+ # hopefully upstream will include the same version check fixes in upcoming releases
+ # patch added 20180429
+ "${FILESDIR}/libressl-compatibility.patch"
+)
PHP_MV="$(get_major_version)"
diff --git a/dev-lang/php/php-7.1.16.ebuild b/dev-lang/php/php-7.1.16.ebuild
index 55fab7c4c96b..0075b8f5bd7c 100644
--- a/dev-lang/php/php-7.1.16.ebuild
+++ b/dev-lang/php/php-7.1.16.ebuild
@@ -145,7 +145,12 @@ REQUIRED_USE="
mysql? ( || ( mysqli pdo ) )
"
-PATCHES=( "${FILESDIR}/mbstring-oniguruma-6.8.patch" )
+PATCHES=(
+ "${FILESDIR}/mbstring-oniguruma-6.8.patch"
+ # hopefully upstream will include the same version check fixes in upcoming releases
+ # patch added 20180429
+ "${FILESDIR}/libressl-compatibility.patch"
+)
PHP_MV="$(get_major_version)"
diff --git a/dev-lang/php/php-7.1.17.ebuild b/dev-lang/php/php-7.1.17.ebuild
index 34ff2d2648dc..fcd553f31484 100644
--- a/dev-lang/php/php-7.1.17.ebuild
+++ b/dev-lang/php/php-7.1.17.ebuild
@@ -144,6 +144,11 @@ REQUIRED_USE="
session-mm? ( session !threads )
mysql? ( || ( mysqli pdo ) )
"
+PATCHES=(
+ # hopefully upstream will include the same version check fixes in upcoming releases
+ # patch added 20180429
+ "${FILESDIR}/libressl-compatibility.patch"
+)
PHP_MV="$(get_major_version)"
diff --git a/dev-lang/php/php-7.2.5.ebuild b/dev-lang/php/php-7.2.5.ebuild
index 5407f131e1a1..558d91754f32 100644
--- a/dev-lang/php/php-7.2.5.ebuild
+++ b/dev-lang/php/php-7.2.5.ebuild
@@ -149,6 +149,11 @@ REQUIRED_USE="
mysql? ( || ( mysqli pdo ) )
zip-encryption? ( zip )
"
+PATCHES=(
+ # hopefully upstream will include the same version check fixes in upcoming releases
+ # patch added 20180429
+ "${FILESDIR}/libressl-compatibility.patch"
+)
PHP_MV="$(get_major_version)"