-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: iconv & dns when build php package #22735
Comments
Hi, commands producing custom php LEGACY 8.1.31 packagegit clone https://github.com/termux/termux-packages.git
cd termux-packages
git apply -v << 'EOF'
--- a/packages/php/build.sh
+++ b/packages/php/build.sh
@@ -4,9 +4,9 @@ TERMUX_PKG_LICENSE="PHP-3.01"
TERMUX_PKG_LICENSE_FILE=LICENSE
TERMUX_PKG_MAINTAINER="@termux"
# Please revbump php-* extensions along with "minor" bump (e.g. 8.1.x to 8.2.0)
-TERMUX_PKG_VERSION="8.4.1"
+TERMUX_PKG_VERSION="8.1.31"
TERMUX_PKG_SRCURL=https://github.com/php/php-src/archive/php-${TERMUX_PKG_VERSION}.tar.gz
-TERMUX_PKG_SHA256=490df36775b2edbefb586ecb38cb4cd781fb05ac01794a345fc1269cca10792b
+TERMUX_PKG_SHA256=35f13315fd7cb2aebb1514b487baf3c84ebd6dfbd98a3e533d22a1bbc17495e7
TERMUX_PKG_AUTO_UPDATE=false
# Build native php for phar to build (see pear-Makefile.frag.patch):
TERMUX_PKG_HOSTBUILD=true
@@ -98,7 +98,7 @@ termux_step_pre_configure() {
export PATH=$PATH:$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/
export NATIVE_PHP_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/sapi/cli/php
- export NATIVE_MINILUA_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/ext/opcache/jit/ir/minilua
+ export NATIVE_MINILUA_EXECUTABLE=$TERMUX_PKG_HOSTBUILD_DIR/ext/opcache/minilua
if [ "$TERMUX_ARCH" = "aarch64" ]; then
CFLAGS+=" -march=armv8-a+crc"
CXXFLAGS+=" -march=armv8-a+crc"
--- /dev/null
+++ b/packages/php/c++17.patch
@@ -0,0 +1,20 @@
+--- a/ext/intl/config.m4
++++ b/ext/intl/config.m4
+@@ -80,7 +80,16 @@ if test "$PHP_INTL" != "no"; then
+ breakiterator/codepointiterator_methods.cpp"
+
+ PHP_REQUIRE_CXX()
+- PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
++
++ AC_MSG_CHECKING([if intl requires -std=gnu++17])
++ AS_IF([test "$PKG_CONFIG icu-uc --atleast-version=74"],[
++ AC_MSG_RESULT([yes])
++ PHP_CXX_COMPILE_STDCXX(17, mandatory, PHP_INTL_STDCXX)
++ ],[
++ AC_MSG_RESULT([no])
++ PHP_CXX_COMPILE_STDCXX(11, mandatory, PHP_INTL_STDCXX)
++ ])
++
+ PHP_INTL_CXX_FLAGS="$INTL_COMMON_FLAGS $PHP_INTL_STDCXX $ICU_CXXFLAGS"
+ case $host_alias in
+ *cygwin*) PHP_INTL_CXX_FLAGS="$PHP_INTL_CXX_FLAGS -D_POSIX_C_SOURCE=200809L"
--- a/packages/php/ext-opcache-config.m4.patch
+++ b/packages/php/ext-opcache-config.m4.patch
@@ -1,12 +1,12 @@
---- ./ext/opcache/config.m4.orig 2024-11-27 23:24:00.473417043 +0700
-+++ ./ext/opcache/config.m4 2024-11-27 23:34:36.000000000 +0700
-@@ -342,7 +342,8 @@
- [$ext_shared],,
- [-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 $JIT_CFLAGS],,
- [yes])
--
-+ OPCACHE_SHARED_LIBADD=-lpcre2-8
-+ PHP_SUBST(OPCACHE_SHARED_LIBADD)
- PHP_ADD_EXTENSION_DEP(opcache, date)
+diff -uNr php-8.1.0/ext/opcache/config.m4 php-8.1.0.mod/ext/opcache/config.m4
+--- php-8.1.0/ext/opcache/config.m4 2021-11-24 00:26:11.000000000 +0530
++++ php-8.1.0.mod/ext/opcache/config.m4 2021-11-26 11:37:50.343462890 +0530
+@@ -328,6 +328,8 @@
+ shared_alloc_posix.c \
+ $ZEND_JIT_SRC,
+ shared,,"-Wno-implicit-fallthrough -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1",,yes)
++ OPCACHE_SHARED_LIBADD=-lpcre2-8
++ PHP_SUBST(OPCACHE_SHARED_LIBADD)
+
PHP_ADD_EXTENSION_DEP(opcache, pcre)
--- a/packages/php/ext-opcache-jit-Makefile.frag.patch
+++ b/packages/php/ext-opcache-jit-Makefile.frag.patch
@@ -1,11 +1,12 @@
---- ./ext/opcache/jit/Makefile.frag.orig 2024-11-27 23:45:28.237709258 +0700
-+++ ./ext/opcache/jit/Makefile.frag 2024-11-27 23:47:10.000000000 +0700
-@@ -2,7 +2,7 @@
- $(BUILD_CC) $(srcdir)/jit/ir/dynasm/minilua.c -lm -o $@
+diff -uNr php-8.1.0/ext/opcache/jit/Makefile.frag php-8.1.0.mod/ext/opcache/jit/Makefile.frag
+--- php-8.1.0/ext/opcache/jit/Makefile.frag 2021-11-24 00:26:11.000000000 +0530
++++ php-8.1.0.mod/ext/opcache/jit/Makefile.frag 2021-11-26 11:15:42.403462811 +0530
+@@ -3,7 +3,7 @@
+ $(BUILD_CC) $(srcdir)/jit/dynasm/minilua.c -lm -o $@
- $(builddir)/jit/ir/ir_emit_$(DASM_ARCH).h: $(srcdir)/jit/ir/ir_$(DASM_ARCH).dasc $(srcdir)/jit/ir/dynasm/*.lua $(builddir)/jit/ir/minilua
-- $(builddir)/jit/ir/minilua $(srcdir)/jit/ir/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/ir/ir_$(DASM_ARCH).dasc
-+ $(NATIVE_MINILUA_EXECUTABLE) $(srcdir)/jit/ir/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/ir/ir_$(DASM_ARCH).dasc
+ $(builddir)/jit/zend_jit_$(DASM_ARCH).c: $(srcdir)/jit/zend_jit_$(DASM_ARCH).dasc $(srcdir)/jit/dynasm/*.lua $(builddir)/minilua
+- $(builddir)/minilua $(srcdir)/jit/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/zend_jit_$(DASM_ARCH).dasc
++ $(NATIVE_MINILUA_EXECUTABLE) $(srcdir)/jit/dynasm/dynasm.lua $(DASM_FLAGS) -o $@ $(srcdir)/jit/zend_jit_$(DASM_ARCH).dasc
- $(builddir)/jit/ir/ir_emit.lo: \
- $(srcdir)/jit/ir/ir_emit.c $(builddir)/jit/ir/ir_emit_$(DASM_ARCH).h
+ $(builddir)/jit/zend_jit.lo: \
+ $(builddir)/jit/zend_jit_$(DASM_ARCH).c \
--- a/packages/php/ext-standard-php_fopen_wrapper.c.patch
+++ b/packages/php/ext-standard-php_fopen_wrapper.c.patch
@@ -6,7 +6,7 @@ diff -u -r ../php-5.6.16/ext/standard/php_fopen_wrapper.c ./ext/standard/php_fop
@@ -312,7 +312,7 @@
}
- #ifdef HAVE_UNISTD_H
+ #if HAVE_UNISTD_H
- dtablesize = getdtablesize();
+ dtablesize = sysconf(_SC_OPEN_MAX);
#else
--- a/packages/php/sapi-apache2handler-config.m4.patch
+++ b/packages/php/sapi-apache2handler-config.m4.patch
@@ -1,15 +1,16 @@
---- ./sapi/apache2handler/config.m4.orig 2024-11-28 01:42:03.021591885 +0700
-+++ ./sapi/apache2handler/config.m4 2024-11-28 03:33:05.000000000 +0700
-@@ -69,18 +69,9 @@
- [AC_MSG_ERROR([Please note that Apache version >= 2.4 is required])])
+diff -uNr php-8.0.0.orig/sapi/apache2handler/config.m4 php-8.0.0/sapi/apache2handler/config.m4
+--- php-8.0.0.orig/sapi/apache2handler/config.m4 2020-11-24 22:34:03.000000000 +0530
++++ php-8.0.0/sapi/apache2handler/config.m4 2020-12-06 22:10:55.658675537 +0530
+@@ -64,18 +64,9 @@
+ fi
- APXS_LIBEXECDIR='$(INSTALL_ROOT)'$($APXS -q LIBEXECDIR)
-- if test -z $($APXS -q SYSCONFDIR); then
+ APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
+- if test -z `$APXS -q SYSCONFDIR`; then
INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
$APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
-i -n php"
- else
-- APXS_SYSCONFDIR='$(INSTALL_ROOT)'$($APXS -q SYSCONFDIR)
+- APXS_SYSCONFDIR='$(INSTALL_ROOT)'`$APXS -q SYSCONFDIR`
- INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
- \$(mkinstalldirs) '$APXS_SYSCONFDIR' && \
- $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
@@ -18,14 +19,13 @@
- fi
LIBPHP_CFLAGS="-shared"
- PHP_SUBST([LIBPHP_CFLAGS])
-@@ -108,7 +99,8 @@
- INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
- ],
- [INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"])
--
+ PHP_SUBST(LIBPHP_CFLAGS)
+@@ -103,6 +94,8 @@
+ INSTALL_IT="$INSTALL_IT $SAPI_SHARED"
+ ;;
+ *)
+ EXTRA_LDFLAGS="`$APR_CONFIG --ldflags --link-ld --libs`"&
+ EXTRA_LDFLAGS="`$APU_CONFIG --ldflags --link-ld --libs` $EXTRA_LDFLAGS"
- PHP_SELECT_SAPI([apache2handler],
- [$php_sapi_apache2handler_type],
- [mod_php.c sapi_apache2.c apache_config.c php_functions.c],
+ PHP_SELECT_SAPI(apache2handler, shared, mod_php.c sapi_apache2.c apache_config.c php_functions.c, $APACHE_CFLAGS)
+ INSTALL_IT="$INSTALL_IT $SAPI_LIBTOOL"
+ ;;
EOF
scripts/run-docker.sh ./build-package.sh -I -f php Result: ls output
While using this version of |
It is not feasible to check compatibility with every older versions of php or any programs. If this issue can not be reproduced with current php package in termux, the issue should be closed. |
Well it sounded like the original poster maybe has a specific need for php 8.1.31, but did not otherwise explain in detail what the problem is or the goal of what they are trying to do, so I hoped they would respond and explain maybe, what the full reproduction steps for their problem are, encouraged by the revelation that php does successfully build, when the appropriate settings and patches are applied, regardless of the exact php version. For example, if they are trying to run php software, it is true that some php software is very large and can unfortunately become stuck depending on older php versions without an easy and convenient way to port it to php 8.4.1 (a "problem X", exemplified by the large commercial project SuiteCRM which is stuck on, at the newest, php 8.3 for the time being and usually requires a php version 1-2 years out of date), however, if the software is smaller or receives a lot of polished updates from its upstream developer very quickly, it might be relatively straightforward to find another solution by identifying the needed software updates, and applying them, to enable compatibility with the existing php 8.4.1 package in Termux (a "problem Y", exemplified by the popular community project phpMyAdmin, which has already received upstream patches in its development branch that enable compatibility with php 8.4.1) Summarized, it is not yet certain whether the original poster has a "problem X" , or a "problem Y", in the context of running software written in php on Termux, since they have not yet explained what exact software they are trying to use the php package to run. |
Problem description
When I build the PHP 8.1.31 package, I encounter the error 'iconv does not support errno'. If I add '--without-iconv' to php/build.sh, I continue to face errors related to DNS
What steps will reproduce the bug?
./build-package -I php
What is the expected behavior?
No response
System information
The text was updated successfully, but these errors were encountered: