add libuv dependency for swow, but still not working

This commit is contained in:
crazywhalecc 2023-03-19 14:04:42 +08:00
parent f06736315d
commit e4b37b9f9a
No known key found for this signature in database
GPG Key ID: 1F4BDD59391F2680
5 changed files with 51 additions and 0 deletions

View File

@ -298,6 +298,9 @@
"swow": {
"type": "external",
"source": "swow",
"lib-depends": [
"libuv"
],
"lib-suggests": [
"openssl",
"curl"

View File

@ -254,6 +254,15 @@
"cunit"
]
},
"libuv": {
"source": "libuv",
"static-libs-unix": [
"libuv.a"
],
"headers": [
"uv.h"
]
},
"onig": {
"source": "onig",
"static-libs-unix": [

View File

@ -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"

View File

@ -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')) {

View File

@ -0,0 +1,29 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
/**
* is a template library class for unix
*/
class libuv extends MacOSLibraryBase
{
public const NAME = 'libuv';
protected function build()
{
[,,$destdir] = SEPARATED_PATH;
f_passthru(
$this->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
);
}
}