mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-20 03:44:18 +08:00
Merge branch 'server-demo' into 'master'
Promote php, python, openssh, nginx See merge request redox-os/cookbook!637
This commit is contained in:
commit
a293894717
@ -1,4 +1,3 @@
|
||||
#TODO promote
|
||||
[source]
|
||||
tar = "https://www.php.net/distributions/php-8.4.12.tar.xz"
|
||||
patches = [
|
||||
@ -32,6 +31,7 @@ dependencies = [
|
||||
"sqlite3",
|
||||
"xz",
|
||||
"zlib",
|
||||
"zstd",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
@ -40,14 +40,14 @@ export SUFFIX="84"
|
||||
export CURL_LIBS="-lcurl -lnghttp2 -lssl -lcrypto"
|
||||
COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
--program-suffix=${SUFFIX}
|
||||
--sysconfdir=/etc
|
||||
--sysconfdir=/etc/php/$SUFFIX
|
||||
--with-config-file-path=/etc/php/$SUFFIX
|
||||
--with-config-file-scan-dir=/etc/php/$SUFFIX/conf.d
|
||||
--with-iconv="${COOKBOOK_SYSROOT}/usr"
|
||||
--disable-opcache
|
||||
--enable-bcmath
|
||||
--enable-calendar
|
||||
# --enable-fpm # need times function
|
||||
--enable-fpm # need times function
|
||||
--enable-gd
|
||||
--enable-intl
|
||||
--enable-mbstring
|
||||
@ -70,9 +70,11 @@ COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
INSTALL_ROOT="${COOKBOOK_STAGE}" \
|
||||
datarootdir=/usr/share localstatedir=/var
|
||||
|
||||
for bin in "php-cgi" "php-config" "php" "phpdbg" "phpize"; do
|
||||
mv ${COOKBOOK_STAGE}/usr/sbin/* ${COOKBOOK_STAGE}/usr/bin/
|
||||
for bin in "php-cgi" "php-config" "php" "phpdbg" "phpize" "php-fpm"; do
|
||||
ln -s "$bin$SUFFIX" ${COOKBOOK_STAGE}/usr/bin/$bin
|
||||
done
|
||||
rm ${COOKBOOK_STAGE}/usr/bin/phar$SUFFIX
|
||||
mkdir -p ${COOKBOOK_STAGE}/etc/php/$SUFFIX/conf.d
|
||||
cp ${COOKBOOK_SOURCE}/php.ini* ${COOKBOOK_STAGE}/etc/php/$SUFFIX/
|
||||
"""
|
||||
89
recipes/dev/php84/redox.patch
Normal file
89
recipes/dev/php84/redox.patch
Normal file
@ -0,0 +1,89 @@
|
||||
diff -ruwN source/configure source-new/configure
|
||||
--- source/configure 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/configure 2025-09-26 16:31:28.871157195 +0700
|
||||
@@ -25863,7 +25863,7 @@
|
||||
then :
|
||||
ac_cv_lib_curl_curl_easy_perform=yes
|
||||
else case e in #(
|
||||
- e) ac_cv_lib_curl_curl_easy_perform=no ;;
|
||||
+ e) ac_cv_lib_curl_curl_easy_perform=yes ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
@@ -37356,7 +37356,7 @@
|
||||
then :
|
||||
php_cv_lib_gd_works=yes
|
||||
else case e in #(
|
||||
- e) php_cv_lib_gd_works=no ;;
|
||||
+ e) php_cv_lib_gd_works=yes ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
@@ -40056,7 +40056,7 @@
|
||||
LIBS_SAVED=$LIBS
|
||||
CFLAGS="$CFLAGS $GMP_CFLAGS"
|
||||
LIBS="$LIBS $GMP_LIBS"
|
||||
- gmp_check=no
|
||||
+ gmp_check=yes
|
||||
ac_fn_c_check_header_compile "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_gmp_h" = xyes
|
||||
then :
|
||||
diff -ruwN source/ext/phar/Makefile.frag source-new/ext/phar/Makefile.frag
|
||||
--- source/ext/phar/Makefile.frag 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/ext/phar/Makefile.frag 2025-09-26 16:31:29.029526842 +0700
|
||||
@@ -30,7 +30,7 @@
|
||||
-@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc
|
||||
|
||||
TEST_PHP_EXECUTABLE = $(shell $(PHP_EXECUTABLE) -v 2>&1)
|
||||
-TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -c 'Exec format error')
|
||||
+TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -E -c 'Exec format error|required file not found')
|
||||
|
||||
$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH)
|
||||
-@(echo "Generating phar.php"; \
|
||||
diff -ruwN source/ext/posix/posix.c source-new/ext/posix/posix.c
|
||||
--- source/ext/posix/posix.c 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/ext/posix/posix.c 2025-09-26 16:31:29.085983450 +0700
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
ZEND_PARSE_PARAMETERS_NONE();
|
||||
|
||||
- if ((ticks = times(&t)) == -1) {
|
||||
+ {
|
||||
POSIX_G(last_error) = errno;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
diff -ruwN source/sapi/fpm/fpm/fpm_status.c source-new/sapi/fpm/fpm/fpm_status.c
|
||||
--- source/sapi/fpm/fpm/fpm_status.c 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/sapi/fpm/fpm/fpm_status.c 2025-09-27 01:07:38.657514932 +0700
|
||||
@@ -104,11 +104,15 @@
|
||||
}
|
||||
proc_p = &procs[i];
|
||||
/* prevent NaN */
|
||||
+#ifdef HAVE_TIMES
|
||||
if (procs[i].cpu_duration.tv_sec == 0 && procs[i].cpu_duration.tv_usec == 0) {
|
||||
cpu = 0.;
|
||||
} else {
|
||||
cpu = (procs[i].last_request_cpu.tms_utime + procs[i].last_request_cpu.tms_stime + procs[i].last_request_cpu.tms_cutime + procs[i].last_request_cpu.tms_cstime) / fpm_scoreboard_get_tick() / (procs[i].cpu_duration.tv_sec + procs[i].cpu_duration.tv_usec / 1000000.) * 100.;
|
||||
}
|
||||
+#else
|
||||
+ cpu = 0.;
|
||||
+#endif
|
||||
|
||||
array_init(&fpm_proc_stat);
|
||||
add_assoc_long(&fpm_proc_stat, "pid", procs[i].pid);
|
||||
@@ -590,11 +594,15 @@
|
||||
}
|
||||
|
||||
/* prevent NaN */
|
||||
+#ifdef HAVE_TIMES
|
||||
if (proc->cpu_duration.tv_sec == 0 && proc->cpu_duration.tv_usec == 0) {
|
||||
cpu = 0.;
|
||||
} else {
|
||||
cpu = (proc->last_request_cpu.tms_utime + proc->last_request_cpu.tms_stime + proc->last_request_cpu.tms_cutime + proc->last_request_cpu.tms_cstime) / fpm_scoreboard_get_tick() / (proc->cpu_duration.tv_sec + proc->cpu_duration.tv_usec / 1000000.) * 100.;
|
||||
}
|
||||
+#else
|
||||
+ cpu = 0.;
|
||||
+#endif
|
||||
|
||||
if (proc->request_stage == FPM_REQUEST_ACCEPTING) {
|
||||
duration = proc->duration;
|
||||
@ -1,4 +1,3 @@
|
||||
#TODO works without pip
|
||||
[source]
|
||||
tar = "https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tar.xz"
|
||||
patches = [
|
||||
@ -17,13 +16,18 @@ dependencies = [
|
||||
"readline",
|
||||
"sqlite3",
|
||||
"zlib",
|
||||
"xz"
|
||||
"xz",
|
||||
"zstd",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
export PYTHONDONTWRITEBYTECODE=1
|
||||
ARCH="${TARGET%%-*}"
|
||||
|
||||
# Packages are considerably larger because of this issue
|
||||
# https://gitlab.redox-os.org/redox-os/relibc/-/issues/227
|
||||
export MODULE_BUILDTYPE=static
|
||||
|
||||
COOKBOOK_CONFIGURE_FLAGS=(
|
||||
--prefix=/usr
|
||||
--enable-shared
|
||||
@ -32,6 +36,7 @@ COOKBOOK_CONFIGURE_FLAGS=(
|
||||
--build=$ARCH
|
||||
--with-build-python
|
||||
--with-ensurepip=install
|
||||
--disable-test-modules
|
||||
ac_cv_file__dev_ptmx=no
|
||||
ac_cv_file__dev_ptc=no
|
||||
)
|
||||
@ -1,4 +1,4 @@
|
||||
#TODO Compiling, got some C issues on init
|
||||
#TODO FastCGI not working
|
||||
[source]
|
||||
tar = "https://nginx.org/download/nginx-1.28.0.tar.gz"
|
||||
patches = [
|
||||
@ -56,5 +56,9 @@ unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP
|
||||
|
||||
cookbook_configure
|
||||
|
||||
mkdir -p "$COOKBOOK_STAGE"/var/lib/nginx/{body,proxy,fastcgi,uwsgi,scgi}
|
||||
mkdir -p "$COOKBOOK_STAGE"/var/lib/nginx/{body,proxy,fastcgi,uwsgi,scgi} \
|
||||
"$COOKBOOK_STAGE"/var/log/nginx/
|
||||
#TODO: pkgar don't track empty directories
|
||||
touch "$COOKBOOK_STAGE"/var/lib/nginx/{body,proxy,fastcgi,uwsgi,scgi}/.tmp \
|
||||
"$COOKBOOK_STAGE"/var/log/nginx/.tmp
|
||||
"""
|
||||
@ -1,7 +1,7 @@
|
||||
diff --color -ruwN source/auto/feature source-new/auto/feature
|
||||
diff -ruwN source/auto/feature source-new/auto/feature
|
||||
--- source/auto/feature 2025-04-23 18:48:54.000000000 +0700
|
||||
+++ source-new/auto/feature 2025-09-16 02:23:35.565899342 +0700
|
||||
@@ -53,7 +57,7 @@
|
||||
+++ source-new/auto/feature 2025-09-16 02:44:58.617532926 +0700
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
yes)
|
||||
# /bin/sh is used to intercept "Killed" or "Abort trap" messages
|
||||
@ -10,7 +10,7 @@ diff --color -ruwN source/auto/feature source-new/auto/feature
|
||||
echo " found"
|
||||
ngx_found=yes
|
||||
|
||||
@@ -61,9 +65,9 @@
|
||||
@@ -61,9 +61,9 @@
|
||||
have=$ngx_have_feature . auto/have
|
||||
fi
|
||||
|
||||
@ -23,9 +23,9 @@ diff --color -ruwN source/auto/feature source-new/auto/feature
|
||||
;;
|
||||
|
||||
value)
|
||||
diff --color -ruwN source/auto/types/sizeof source-new/auto/types/sizeof
|
||||
diff -ruwN source/auto/types/sizeof source-new/auto/types/sizeof
|
||||
--- source/auto/types/sizeof 2025-04-23 18:48:54.000000000 +0700
|
||||
+++ source-new/auto/types/sizeof 2025-09-16 02:38:57.979145501 +0700
|
||||
+++ source-new/auto/types/sizeof 2025-09-16 02:44:58.618532943 +0700
|
||||
@@ -33,7 +33,7 @@
|
||||
END
|
||||
|
||||
@ -35,9 +35,9 @@ diff --color -ruwN source/auto/types/sizeof source-new/auto/types/sizeof
|
||||
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
|
||||
|
||||
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
|
||||
diff --color -ruwN source/auto/types/typedef source-new/auto/types/typedef
|
||||
diff -ruwN source/auto/types/typedef source-new/auto/types/typedef
|
||||
--- source/auto/types/typedef 2025-04-23 18:48:54.000000000 +0700
|
||||
+++ source-new/auto/types/typedef 2025-09-16 02:38:54.927091443 +0700
|
||||
+++ source-new/auto/types/typedef 2025-09-16 02:44:58.618532943 +0700
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
END
|
||||
@ -47,9 +47,9 @@ diff --color -ruwN source/auto/types/typedef source-new/auto/types/typedef
|
||||
-o $NGX_AUTOTEST $NGX_AUTOTEST.c $NGX_LD_OPT $ngx_feature_libs"
|
||||
|
||||
eval "$ngx_test >> $NGX_AUTOCONF_ERR 2>&1"
|
||||
diff --color -ruwN source/src/os/unix/ngx_process.c source-new/src/os/unix/ngx_process.c
|
||||
diff -ruwN source/src/os/unix/ngx_process.c source-new/src/os/unix/ngx_process.c
|
||||
--- source/src/os/unix/ngx_process.c 2025-04-23 18:48:54.000000000 +0700
|
||||
+++ source-new/src/os/unix/ngx_process.c 2025-09-16 02:40:44.363029726 +0700
|
||||
+++ source-new/src/os/unix/ngx_process.c 2025-09-16 02:44:58.618532943 +0700
|
||||
@@ -143,6 +143,7 @@
|
||||
}
|
||||
|
||||
@ -66,3 +66,20 @@ diff --color -ruwN source/src/os/unix/ngx_process.c source-new/src/os/unix/ngx_p
|
||||
|
||||
if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) {
|
||||
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
|
||||
diff -ruwN source/src/os/unix/ngx_process_cycle.c source-new/src/os/unix/ngx_process_cycle.c
|
||||
--- source/src/os/unix/ngx_process_cycle.c 2025-04-23 18:48:54.000000000 +0700
|
||||
+++ source-new/src/os/unix/ngx_process_cycle.c 2025-09-27 02:17:21.509383985 +0700
|
||||
@@ -804,11 +804,13 @@
|
||||
exit(2);
|
||||
}
|
||||
|
||||
+ /*
|
||||
if (initgroups(ccf->username, ccf->group) == -1) {
|
||||
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
|
||||
"initgroups(%s, %d) failed",
|
||||
ccf->username, ccf->group);
|
||||
}
|
||||
+ */
|
||||
|
||||
#if (NGX_HAVE_PR_SET_KEEPCAPS && NGX_HAVE_CAPABILITIES)
|
||||
if (ccf->transparent && ccf->user) {
|
||||
@ -3,6 +3,7 @@ git = "https://gitlab.redox-os.org/redox-os/website"
|
||||
[build]
|
||||
template = "custom"
|
||||
script = """
|
||||
rsync -a "${COOKBOOK_SOURCE}/" ./
|
||||
./hugo.sh
|
||||
mkdir -pv "${COOKBOOK_STAGE}"/usr/share/website
|
||||
cp -rv "${COOKBOOK_BUILD}"/build/public/* "${COOKBOOK_STAGE}"/usr/share/website
|
||||
|
||||
@ -41,7 +41,7 @@ rsync -a bin/redox_${GOARCH}/* "${COOKBOOK_STAGE}"/usr/lib/golang/bin/
|
||||
rsync -a lib/* "${COOKBOOK_STAGE}"/usr/lib/golang/lib/
|
||||
rsync -a misc/* "${COOKBOOK_STAGE}"/usr/lib/golang/misc/
|
||||
rsync -a pkg/include/* "${COOKBOOK_STAGE}"/usr/lib/golang/pkg/include/
|
||||
rsync -a pkg/tool/redox_${GOARCH}/* "${COOKBOOK_STAGE}"/usr/lib/golang/pkg/tool/
|
||||
rsync -a pkg/tool/redox_${GOARCH} "${COOKBOOK_STAGE}"/usr/lib/golang/pkg/tool/
|
||||
rsync -a src/* "${COOKBOOK_STAGE}"/usr/lib/golang/src/
|
||||
cat go.env > "${COOKBOOK_STAGE}"/usr/lib/golang/go.env
|
||||
ln -s "../lib/golang/bin/go" "${COOKBOOK_STAGE}"/usr/bin/go
|
||||
|
||||
@ -1,54 +0,0 @@
|
||||
diff --color -ruwN source/configure source-new/configure
|
||||
--- source/configure 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/configure 2025-09-16 07:50:56.962975667 +0700
|
||||
@@ -25863,7 +25863,7 @@
|
||||
then :
|
||||
ac_cv_lib_curl_curl_easy_perform=yes
|
||||
else case e in #(
|
||||
- e) ac_cv_lib_curl_curl_easy_perform=no ;;
|
||||
+ e) ac_cv_lib_curl_curl_easy_perform=yes ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
@@ -37356,7 +37356,7 @@
|
||||
then :
|
||||
php_cv_lib_gd_works=yes
|
||||
else case e in #(
|
||||
- e) php_cv_lib_gd_works=no ;;
|
||||
+ e) php_cv_lib_gd_works=yes ;;
|
||||
esac
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.beam \
|
||||
@@ -40056,7 +40056,7 @@
|
||||
LIBS_SAVED=$LIBS
|
||||
CFLAGS="$CFLAGS $GMP_CFLAGS"
|
||||
LIBS="$LIBS $GMP_LIBS"
|
||||
- gmp_check=no
|
||||
+ gmp_check=yes
|
||||
ac_fn_c_check_header_compile "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_gmp_h" = xyes
|
||||
then :
|
||||
diff --color -ruwN source/ext/phar/Makefile.frag source-new/ext/phar/Makefile.frag
|
||||
--- source/ext/phar/Makefile.frag 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/ext/phar/Makefile.frag 2025-09-18 07:37:43.264765180 +0700
|
||||
@@ -30,7 +30,7 @@
|
||||
-@test -f $(builddir)/phar/phar.inc || cp $(srcdir)/phar/phar.inc $(builddir)/phar/phar.inc
|
||||
|
||||
TEST_PHP_EXECUTABLE = $(shell $(PHP_EXECUTABLE) -v 2>&1)
|
||||
-TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -c 'Exec format error')
|
||||
+TEST_PHP_EXECUTABLE_RES = $(shell echo "$(TEST_PHP_EXECUTABLE)" | grep -E -c 'Exec format error|required file not found')
|
||||
|
||||
$(builddir)/phar.php: $(srcdir)/build_precommand.php $(srcdir)/phar/*.inc $(srcdir)/phar/*.php $(SAPI_CLI_PATH)
|
||||
-@(echo "Generating phar.php"; \
|
||||
diff --color -ruwN source/ext/posix/posix.c source-new/ext/posix/posix.c
|
||||
--- source/ext/posix/posix.c 2025-08-26 20:36:28.000000000 +0700
|
||||
+++ source-new/ext/posix/posix.c 2025-09-16 07:50:56.989976200 +0700
|
||||
@@ -375,7 +375,7 @@
|
||||
|
||||
ZEND_PARSE_PARAMETERS_NONE();
|
||||
|
||||
- if ((ticks = times(&t)) == -1) {
|
||||
+ {
|
||||
POSIX_G(last_error) = errno;
|
||||
RETURN_FALSE;
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
[source]
|
||||
git = "https://github.com/kkos/oniguruma"
|
||||
rev = "f95747b462de672b6f8dbdeb478245ddf061ca53"
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
autotools_recursive_regenerate
|
||||
|
||||
Loading…
Reference in New Issue
Block a user