commit:     ccc5cdc89ecf3ad501acfa34650e63b3329e18da
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Apr  9 13:08:47 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Apr  9 13:50:55 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ccc5cdc8

dev-lang/php: fix a failing test and a musl compatibility issue

Closes: https://bugs.gentoo.org/927461
Closes: https://bugs.gentoo.org/928072
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/files/fix-musl-llvm.patch | 37 ++++++++++++++++++++++++++++++++++
 dev-lang/php/php-8.1.27-r2.ebuild      |  5 +++--
 dev-lang/php/php-8.2.17.ebuild         |  7 +++++++
 dev-lang/php/php-8.3.4.ebuild          |  7 +++++++
 4 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/dev-lang/php/files/fix-musl-llvm.patch 
b/dev-lang/php/files/fix-musl-llvm.patch
new file mode 100644
index 000000000000..bf299837829c
--- /dev/null
+++ b/dev-lang/php/files/fix-musl-llvm.patch
@@ -0,0 +1,37 @@
+From 684f0d9e5946e92008404b3d5a131edc4f34f7da Mon Sep 17 00:00:00 2001
+From: Arnaud Le Blanc <arnaud...@gmail.com>
+Date: Thu, 4 Apr 2024 16:10:28 +0200
+Subject: [PATCH] Fix stream_cookie_seeker signature under musl
+
+---
+ main/streams/cast.c | 10 +++-------
+ 1 file changed, 3 insertions(+), 7 deletions(-)
+
+diff --git a/main/streams/cast.c b/main/streams/cast.c
+index 3bad65fbac1f5..8d9f4a9d2d54b 100644
+--- a/main/streams/cast.c
++++ b/main/streams/cast.c
+@@ -104,6 +104,9 @@ static ssize_t stream_cookie_writer(void *cookie, const 
char *buffer, size_t siz
+ 
+ # ifdef COOKIE_SEEKER_USES_OFF64_T
+ static int stream_cookie_seeker(void *cookie, off64_t *position, int whence)
++# else
++static int stream_cookie_seeker(void *cookie, off_t *position, int whence)
++# endif
+ {
+ 
+       *position = php_stream_seek((php_stream *)cookie, 
(zend_off_t)*position, whence);
+@@ -113,13 +116,6 @@ static int stream_cookie_seeker(void *cookie, off64_t 
*position, int whence)
+       }
+       return 0;
+ }
+-# else
+-static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
+-{
+-
+-      return php_stream_seek((php_stream *)cookie, position, whence);
+-}
+-# endif
+ 
+ static int stream_cookie_closer(void *cookie)
+ {

diff --git a/dev-lang/php/php-8.1.27-r2.ebuild 
b/dev-lang/php/php-8.1.27-r2.ebuild
index 38bbbc21e31c..f434f0df4366 100644
--- a/dev-lang/php/php-8.1.27-r2.ebuild
+++ b/dev-lang/php/php-8.1.27-r2.ebuild
@@ -150,6 +150,7 @@ PATCHES=(
        "${FILESDIR}/php-capstone-optional.patch"
        "${FILESDIR}/php-8.1.27-gcc14-libxml.patch"
        "${FILESDIR}/php-8.1.27-implicit-decls.patch"
+       "${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions that are expected to be undefined.
@@ -250,8 +251,8 @@ src_prepare() {
           ext/curl/tests/bug77535.phpt \
           ext/curl/tests/curl_error_basic.phpt \
           ext/session/tests/bug74514.phpt \
-          ext/session/tests/bug74936.phpt || die
-
+          ext/session/tests/bug74936.phpt \
+          ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {

diff --git a/dev-lang/php/php-8.2.17.ebuild b/dev-lang/php/php-8.2.17.ebuild
index f27df005dc4f..abe657f95e1d 100644
--- a/dev-lang/php/php-8.2.17.ebuild
+++ b/dev-lang/php/php-8.2.17.ebuild
@@ -151,6 +151,7 @@ PATCHES=(
        "${FILESDIR}/php-capstone-optional.patch"
        "${FILESDIR}/php-8.2.8-openssl-tests.patch"
        "${FILESDIR}/php-8.1.27-implicit-decls.patch"
+       "${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions (bug 923335)
@@ -322,6 +323,12 @@ src_prepare() {
 
        # https://github.com/php/php-src/issues/12801
        rm ext/pcre/tests/gh11374.phpt || die
+
+       # This is a memory usage test with hard-coded limits. Whenever the
+       # limits are surpassed... they get increased... but in the meantime,
+       # the tests fail. This is not really a test that end users should
+       # be running pre-install, in my opinion. Bug 927461.
+       rm ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {

diff --git a/dev-lang/php/php-8.3.4.ebuild b/dev-lang/php/php-8.3.4.ebuild
index f4f263225218..7242d6432c71 100644
--- a/dev-lang/php/php-8.3.4.ebuild
+++ b/dev-lang/php/php-8.3.4.ebuild
@@ -146,6 +146,7 @@ PHP_MV="$(ver_cut 1)"
 
 PATCHES=(
        "${FILESDIR}/php-iodbc-header-location.patch"
+       "${FILESDIR}/fix-musl-llvm.patch"
 )
 
 # ARM/Windows functions (bug 923335)
@@ -267,6 +268,12 @@ src_prepare() {
        #   https://github.com/php/php-src/pull/13017
        #
        rm ext/dom/tests/DOMNode_isEqualNode.phpt || die
+
+       # This is a memory usage test with hard-coded limits. Whenever the
+       # limits are surpassed... they get increased... but in the meantime,
+       # the tests fail. This is not really a test that end users should
+       # be running pre-install, in my opinion. Bug 927461.
+       rm ext/fileinfo/tests/bug78987.phpt || die
 }
 
 src_configure() {

Reply via email to