diff --git a/config/ext.json b/config/ext.json index 2f572385..b2c7c250 100644 --- a/config/ext.json +++ b/config/ext.json @@ -298,6 +298,9 @@ "swow": { "type": "external", "source": "swow", + "lib-depends": [ + "libuv" + ], "lib-suggests": [ "openssl", "curl" diff --git a/config/lib.json b/config/lib.json index d7373c48..ed3bf9fc 100644 --- a/config/lib.json +++ b/config/lib.json @@ -254,6 +254,15 @@ "cunit" ] }, + "libuv": { + "source": "libuv", + "static-libs-unix": [ + "libuv.a" + ], + "headers": [ + "uv.h" + ] + }, "onig": { "source": "onig", "static-libs-unix": [ diff --git a/config/source.json b/config/source.json index f9d5ddd3..9383d2c1 100644 --- a/config/source.json +++ b/config/source.json @@ -150,6 +150,14 @@ "path": "COPYING" } }, + "libuv": { + "type": "ghtar", + "repo": "libuv/libuv", + "license": { + "type": "file", + "path": "LICENSE" + } + }, "onig": { "type": "ghrel", "repo": "kkos/oniguruma", @@ -209,6 +217,7 @@ "path": "php-src/ext/swow-src", "rev": "ci", "url": "https://github.com/swow/swow", + "patch": "patchSwow", "license": { "type": "file", "path": "LICENSE" diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index 9924bd68..98e15a07 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -270,6 +270,7 @@ class Extension case 'swow': $arg .= $this->builder->getLib('openssl') ? ' --enable-swow-ssl' : ' --disable-swow-ssl'; $arg .= $this->builder->getLib('curl') ? ' --enable-swow-curl' : ' --disable-swow-curl'; + $arg .= ' SWOW_UV_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '" '; break; case 'swoole': if ($this->builder->getLib('openssl')) { diff --git a/src/SPC/builder/macos/library/libuv.php b/src/SPC/builder/macos/library/libuv.php new file mode 100644 index 00000000..21adbb57 --- /dev/null +++ b/src/SPC/builder/macos/library/libuv.php @@ -0,0 +1,29 @@ +builder->set_x . ' && ' . + "cd {$this->source_dir} && " . + "{$this->builder->configure_env} ./configure " . + '--enable-static --disable-shared ' . + '--prefix= && ' . // use prefix=/ + 'make clean && ' . + "make -j{$this->builder->concurrency} && " . + 'make install DESTDIR=' . $destdir + ); + } +}