Index: head/devel/pecl-swoole/Makefile =================================================================== --- head/devel/pecl-swoole/Makefile (revision 433491) +++ head/devel/pecl-swoole/Makefile (revision 433492) @@ -1,33 +1,34 @@ # Created by: vanilla@ # $FreeBSD$ PORTNAME= swoole PORTVERSION= 1.9.5 +PORTREVISION= 1 CATEGORIES= devel net MASTER_SITES= http://pecl.php.net/get/ PKGNAMEPREFIX= pecl- DIST_SUBDIR= PECL MAINTAINER= vanilla@FreeBSD.org COMMENT= Asynchronous & concurrent & distributed networking framework LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE USES= execinfo php:ext ssl tar:tgz CFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib USE_PHP= pcre OPTIONS_DEFINE= HTTP2 REDIS RING_BUFFER SOCKETS HTTP2_LIB_DEPENDS= libnghttp2.so:www/libnghttp2 HTTP2_CONFIGURE_ON= --enable-http2 --enable-openssl REDIS_LIB_DEPENDS= libhiredis.so:databases/hiredis REDIS_CONFIGURE_ON= --enable-async-redis RING_BUFFER_DESC= Use ring buffer pool RING_BUFFER_CONFIGURE_ON= --enable-ringbuffer SOCKETS_USE= PHP=sockets:build SOCKETS_DESC= Use native php sockets extension SOCKETS_CONFIGURE_ON= --enable-sockets .include Index: head/devel/pecl-swoole/files/patch-config.m4 =================================================================== --- head/devel/pecl-swoole/files/patch-config.m4 (revision 433491) +++ head/devel/pecl-swoole/files/patch-config.m4 (revision 433492) @@ -1,11 +1,25 @@ ---- config.m4.orig 2017-02-05 15:08:47 UTC +--- config.m4.orig 2017-01-24 02:05:48 UTC +++ config.m4 -@@ -178,7 +178,7 @@ if test "$PHP_SWOOLE" != "no"; then +@@ -85,7 +85,13 @@ AC_DEFUN([AC_SWOOLE_CPU_AFFINITY], + AC_MSG_CHECKING([for cpu affinity]) + AC_TRY_COMPILE( + [ ++ #ifdef __FreeBSD__ ++ #include ++ #include ++ typedef cpuset_t cpu_set_t; ++ #else + #include ++ #endif + ], [ + cpu_set_t cpu_set; + CPU_ZERO(&cpu_set); +@@ -178,7 +184,7 @@ if test "$PHP_SWOOLE" != "no"; then AC_CHECK_LIB(c, poll, AC_DEFINE(HAVE_POLL, 1, [have poll])) AC_CHECK_LIB(c, sendfile, AC_DEFINE(HAVE_SENDFILE, 1, [have sendfile])) AC_CHECK_LIB(c, kqueue, AC_DEFINE(HAVE_KQUEUE, 1, [have kqueue])) - AC_CHECK_LIB(c, backtrace, AC_DEFINE(HAVE_EXECINFO, 1, [have execinfo])) + AC_CHECK_LIB(execinfo, backtrace, AC_DEFINE(HAVE_EXECINFO, 1, [have execinfo])) AC_CHECK_LIB(c, daemon, AC_DEFINE(HAVE_DAEMON, 1, [have daemon])) AC_CHECK_LIB(c, mkostemp, AC_DEFINE(HAVE_MKOSTEMP, 1, [have mkostemp])) AC_CHECK_LIB(c, inotify_init, AC_DEFINE(HAVE_INOTIFY, 1, [have inotify])) Index: head/devel/pecl-swoole/files/patch-include_swoole.h =================================================================== --- head/devel/pecl-swoole/files/patch-include_swoole.h (nonexistent) +++ head/devel/pecl-swoole/files/patch-include_swoole.h (revision 433492) @@ -0,0 +1,20 @@ +--- include/swoole.h.orig 2017-01-24 02:05:48 UTC ++++ include/swoole.h +@@ -40,7 +40,17 @@ extern "C" { + #include + #include + #include ++ ++#if defined(HAVE_CPU_AFFINITY) ++#ifdef __FreeBSD__ ++#include ++#include ++#include ++typedef cpuset_t cpu_set_t; ++#else + #include ++#endif ++#endif + + #include + #include Property changes on: head/devel/pecl-swoole/files/patch-include_swoole.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/pecl-swoole/files/patch-src_network_Server.c =================================================================== --- head/devel/pecl-swoole/files/patch-src_network_Server.c (nonexistent) +++ head/devel/pecl-swoole/files/patch-src_network_Server.c (revision 433492) @@ -0,0 +1,16 @@ +--- src/network/Server.c.orig 2017-02-06 09:30:50 UTC ++++ src/network/Server.c +@@ -522,7 +522,13 @@ int swServer_worker_init(swServer *serv, + { + CPU_SET(SwooleWG.id % SW_CPU_NUM, &cpu_set); + } ++ ++#ifdef __FreeBSD__ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, ++ sizeof(cpu_set), &cpu_set) < 0) ++#else + if (sched_setaffinity(getpid(), sizeof(cpu_set), &cpu_set) < 0) ++#endif + { + swSysError("sched_setaffinity() failed."); + } Property changes on: head/devel/pecl-swoole/files/patch-src_network_Server.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/pecl-swoole/files/patch-swoole__process.c =================================================================== --- head/devel/pecl-swoole/files/patch-swoole__process.c (nonexistent) +++ head/devel/pecl-swoole/files/patch-swoole__process.c (revision 433492) @@ -0,0 +1,15 @@ +--- swoole_process.c.orig 2017-02-06 09:32:48 UTC ++++ swoole_process.c +@@ -963,7 +963,12 @@ static PHP_METHOD(swoole_process, setaff + CPU_SET(Z_LVAL_P(value), &cpu_set); + SW_HASHTABLE_FOREACH_END(); + ++#ifdef __FreeBSD__ ++ if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, ++ sizeof(cpu_set), &cpu_set) < 0) ++#else + if (sched_setaffinity(getpid(), sizeof(cpu_set), &cpu_set) < 0) ++#endif + { + swoole_php_sys_error(E_WARNING, "sched_setaffinity() failed."); + RETURN_FALSE; Property changes on: head/devel/pecl-swoole/files/patch-swoole__process.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property