Ports: Update PHP to 8.1.4

This commit is contained in:
Jelle Raaijmakers 2022-03-29 22:48:04 +02:00 committed by Linus Groh
parent cf1baddb67
commit c637795888
9 changed files with 80 additions and 42 deletions

View file

@ -105,7 +105,6 @@ PORTS_MISSING_DESCRIPTIONS = {
'patch',
'pcre2',
'pfetch',
'php',
'pkgconf',
'pt2-clone',
'qt6-qtbase',

View file

@ -162,7 +162,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`pcre`](pcre/) | Perl-compatible Regular Expressions (PCRE) | 8.45 | https://www.pcre.org/ |
| [`pcre2`](pcre2/) | Perl-compatible Regular Expressions (PCRE2) | 10.39 | https://www.pcre.org/ |
| [`pfetch`](pfetch/) | pfetch | a906ff8 | https://github.com/dylanaraps/pfetch/ |
| [`php`](php/) | PHP | 8.1.1 | https://www.php.net/ |
| [`php`](php/) | PHP | 8.1.4 | https://www.php.net/ |
| [`pkgconf`](pkgconf/) | pkgconf | 1.8.0 | https://github.com/pkgconf/pkgconf |
| [`powdertoy`](powdertoy/) | The Powder Toy | 96.2.350 | https://powdertoy.co.uk/ |
| [`SDLPoP`](SDLPoP/) | Prince of Persia game | | https://github.com/NagyD/SDLPoP |

View file

@ -1,8 +1,8 @@
#!/usr/bin/env -S bash ../.port_include.sh
port=php
useconfigure="true"
version="8.1.1"
files="https://www.php.net/distributions/php-${version}.tar.xz php-${version}.tar.xz 33c09d76d0a8bbb5dd930d9dd32e6bfd44e9efcf867563759eb5492c3aff8856"
version="8.1.4"
files="https://www.php.net/distributions/php-${version}.tar.xz php-${version}.tar.xz 05a8c0ac30008154fb38a305560543fc172ba79fb957084a99b8d3b10d5bdb4b"
auth_type=sha256
depends=("libiconv" "libxml2" "openssl" "readline" "sqlite" "zlib")
configopts=(
@ -33,6 +33,8 @@ pre_configure() {
export SQLITE_LIBS="-lsqlite3 -lpthread"
export ZLIB_CFLAGS="y"
export ZLIB_LIBS="-lz"
run ./buildconf --force
}
post_configure() {

View file

@ -0,0 +1,29 @@
From b77421b9902a06c17e01c6c1dabffbc066a978e8 Mon Sep 17 00:00:00 2001
From: Jelle Raaijmakers <jelle@gmta.nl>
Date: Tue, 29 Mar 2022 22:41:26 +0200
Subject: [PATCH 1/2] Build: Disable `pharcmd`
We do not support running the PHP binary locally after its build, so do
not try to run phar locally.
---
configure.ac | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index b54abe32..d9a8d0b9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1567,8 +1567,8 @@ CFLAGS="\$(CFLAGS_CLEAN) $standard_libtool_flag"
CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
- pharcmd=pharcmd
- pharcmd_install=install-pharcmd
+ pharcmd=
+ pharcmd_install=
else
pharcmd=
pharcmd_install=
--
2.32.0

View file

@ -0,0 +1,29 @@
From 99607c7382d82b955015586c716ab4dc5f747235 Mon Sep 17 00:00:00 2001
From: Jelle Raaijmakers <jelle@gmta.nl>
Date: Tue, 29 Mar 2022 22:42:18 +0200
Subject: [PATCH 2/2] Build: Force `inet_aton` detection
For a reason unknown to me, the build system fails to find `inet_aton`
and tries to redefine it with its own implementation in
`flock_compat.c`.
---
configure.ac | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index d9a8d0b9..687c2d87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -365,8 +365,7 @@ if test "$ac_cv_func_dlopen" = "yes"; then
fi
AC_CHECK_LIB(m, sin)
-dnl Check for inet_aton in -lc, -lbind and -lresolv.
-PHP_CHECK_FUNC(inet_aton, resolv, bind)
+AC_DEFINE(HAVE_INET_ATON, 1, [ ])
dnl Then headers.
dnl ----------------------------------------------------------------------------
--
2.32.0

View file

@ -0,0 +1,17 @@
# Patches for php on SerenityOS
## `0001-Build-Disable-pharcmd.patch`
Build: Disable `pharcmd`
We do not support running the PHP binary locally after its build, so do
not try to run phar locally.
## `0002-Build-Force-inet_aton-detection.patch`
Build: Force `inet_aton` detection
For a reason unknown to me, the build system fails to find `inet_aton`
and tries to redefine it with its own implementation in
`flock_compat.c`.

View file

@ -1,11 +0,0 @@
--- php-8.1.1/configure 2021-12-15 03:00:45.000000000 +0100
+++ php-8.1.1-patched/configure 2022-01-07 23:44:20.361165350 +0100
@@ -14229,7 +14229,7 @@
then :
found=yes
else $as_nop
- found=no
+ found=yes
fi
fi

View file

@ -1,13 +0,0 @@
--- php-8.1.1/configure 2022-01-07 23:44:48.117187609 +0100
+++ php-8.1.1-patched/configure 2022-01-07 23:47:02.228957328 +0100
@@ -96803,8 +96803,8 @@
CXXFLAGS="$CXXFLAGS $standard_libtool_flag \$(PROF_FLAGS)"
if test "$PHP_PHAR" != "no" && test "$PHP_CLI" != "no"; then
- pharcmd=pharcmd
- pharcmd_install=install-pharcmd
+ pharcmd=
+ pharcmd_install=
else
pharcmd=
pharcmd_install=

View file

@ -1,14 +0,0 @@
--- php-8.1.1/ext/standard/php_fopen_wrapper.c 2021-12-15 03:00:45.000000000 +0100
+++ php-8.1.1-patched/ext/standard/php_fopen_wrapper.c 2022-01-07 23:45:58.357132436 +0100
@@ -317,11 +317,7 @@
return NULL;
}
-#if HAVE_UNISTD_H
- dtablesize = getdtablesize();
-#else
dtablesize = INT_MAX;
-#endif
if (fildes_ori < 0 || fildes_ori >= dtablesize) {
php_stream_wrapper_log_error(wrapper, options,