Skip to content

Commit dd14161

Browse files
committed
php-openswoole: update to 25.2.0, 22.1.2, 4.12.1; patch for php85
incorporates work from macports#30146
1 parent 664889b commit dd14161

File tree

2 files changed

+78
-19
lines changed

2 files changed

+78
-19
lines changed

php/php-openswoole/Portfile

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,29 @@ categories-append net devel
88
maintainers {ryandesign @ryandesign} openmaintainer
99
license Apache-2
1010

11-
php.branches 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4
11+
php.branches 7.4 8.0 8.1 8.2 8.3 8.4 8.5
1212
php.pecl yes
1313

14-
if {[vercmp ${php.branch} >= 7.4]} {
15-
version 22.0.0
14+
if {[vercmp ${php.branch} >= 8.2]} {
15+
version 25.2.0
1616
revision 1
17-
checksums rmd160 9c9c2da1afd86be905ccc9b692450cf0af4f43c0 \
18-
sha256 bf1ebf241bd4a52b5b39102a37da8cfa4b3dfcbd2be4104adf408873dac89034 \
19-
size 1244040
20-
} elseif {[vercmp ${php.branch} >= 7.2]} {
17+
checksums rmd160 745e2859737fb01da2adb32ca032c2fd63a4e3ed \
18+
sha256 bcc1fed4877b6646cb8f79b092ba03d5e495800465a3fff83c065c58d4312d40 \
19+
size 1239054
20+
patchfiles-append patch-php85-php_shutdown_function_entry.diff
21+
} elseif {[vercmp ${php.branch} >= 8.1]} {
22+
version 22.1.2
23+
revision 0
24+
checksums rmd160 554eb7fa11c1927e57f7bdb5ca4eb820fbf9f548 \
25+
sha256 ec9d08e9484bf95a0080738342a84f09b9c5b8222f4a03c4736caacb7668cb46 \
26+
size 1252932
27+
} elseif {[vercmp ${php.branch} >= 8.0]} {
28+
version 4.12.1
29+
revision 0
30+
checksums rmd160 dc66de146301258d9364b42ea486a1d1bf0523f2 \
31+
sha256 64559632340aa67b09d6386b204750b7b58fb791e4e6ea8e8b610952935260b5 \
32+
size 1637580
33+
} else {
2134
version 4.10.0
2235
revision 2
2336
checksums rmd160 074542644edb0ff9815a7179d4d3ad0172c0d1cd \
@@ -26,34 +39,50 @@ if {[vercmp ${php.branch} >= 7.4]} {
2639
patchfiles arm.patch
2740
}
2841

29-
description an event-driven asynchronous & concurrent & coroutine networking engine with high performance for PHP
42+
description High Performance Programmatic Server for PHP with Async IO, Coroutines and Fibers
3043

31-
long_description ${name} is ${description}.
44+
long_description OpenSwoole is a high-performance network framework for PHP. \
45+
It enables PHP developers to write high-performance, scalable, \
46+
concurrent TCP, UDP, Unix Socket, HTTP, and WebSocket services \
47+
without requiring in-depth knowledge about non-blocking I/O \
48+
programming and low-level Linux kernel. OpenSwoole is a fork \
49+
of Swoole with additional features and improvements.
3250

3351
if {${name} ne ${subport}} {
52+
conflicts ${php}-swoole
53+
3454
PortGroup legacysupport 1.1
3555
# strndup
3656
legacysupport.newest_darwin_requires_legacy \
3757
10
38-
# https://github.com/swoole/swoole-src/issues/3896
39-
# CLOCK_REALTIME
40-
legacysupport.newest_darwin_requires_legacy \
41-
15
42-
43-
conflicts ${php}-swoole
4458

4559
compiler.cxx_standard 2011
4660
compiler.thread_local_storage yes
4761

48-
depends_lib-append port:brotli \
62+
depends_lib-append port:${php}-sockets \
4963
port:hiredis \
5064
port:nghttp2 \
5165
path:lib/libssl.dylib:openssl \
5266
port:zlib
5367

54-
configure.args --enable-async-redis \
55-
--enable-http2 \
68+
compiler.blacklist-append \
69+
*gcc-4.0 *gcc-4.2
70+
71+
configure.args --enable-http2 \
5672
--enable-openssl \
57-
--enable-swoole \
73+
--enable-sockets \
74+
--enable-mysqlnd \
5875
--with-openssl-dir=${prefix}
76+
77+
# brotli and c-ares support only in versions >= 22.0.0
78+
if {[vercmp ${version} >= 22.0.0]} {
79+
depends_lib-append \
80+
port:brotli \
81+
port:c-ares
82+
83+
configure.args-append \
84+
--enable-cares
85+
}
86+
87+
use_parallel_build yes
5988
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- ext-src/php_swoole.cc.orig
2+
+++ ext-src/php_swoole.cc
3+
@@ -161,12 +161,27 @@ static void php_swoole_init_globals(zen
4+
void php_swoole_register_shutdown_function(const char *function) {
5+
php_shutdown_function_entry shutdown_function_entry;
6+
zval function_name;
7+
ZVAL_STRING(&function_name, function);
8+
+#if PHP_VERSION_ID >= 80500
9+
+ // PHP 8.5: shutdown function structure changed - removed fci field
10+
+ shutdown_function_entry.params = NULL;
11+
+ shutdown_function_entry.param_count = 0;
12+
+
13+
+ if (zend_fcall_info_init(&function_name, 0, NULL,
14+
+ &shutdown_function_entry.fci_cache, NULL, NULL) != SUCCESS) {
15+
+ zval_ptr_dtor(&function_name);
16+
+ return;
17+
+ }
18+
+
19+
+ register_user_shutdown_function(Z_STRVAL(function_name), Z_STRLEN(function_name), &shutdown_function_entry);
20+
+ zval_ptr_dtor(&function_name);
21+
+#else
22+
zend_fcall_info_init(
23+
&function_name, 0, &shutdown_function_entry.fci, &shutdown_function_entry.fci_cache, NULL, NULL);
24+
register_user_shutdown_function(Z_STRVAL(function_name), Z_STRLEN(function_name), &shutdown_function_entry);
25+
+#endif
26+
}
27+
28+
void php_swoole_set_global_option(HashTable *vht) {
29+
zval *ztmp;
30+

0 commit comments

Comments
 (0)