Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,14 @@
"tokenizer": {
"type": "builtin"
},
"uv": {
"type": "external",
"source": "ext-uv",
"arg-type": "with-prefix",
"lib-depends": [
"libuv"
]
},
"xlswriter": {
"type": "external",
"source": "xlswriter",
Expand Down
6 changes: 6 additions & 0 deletions config/lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@
"zlib"
]
},
"libuv": {
"source": "libuv",
"static-libs-unix": [
"libuv.a"
]
},
"libwebp": {
"source": "libwebp",
"static-libs-unix": [
Expand Down
24 changes: 24 additions & 0 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@
"path": "LICENSE"
}
},
"ext-uv": {
"type": "url",
"url": "https://pecl.php.net/get/uv",
"path": "php-src/ext/uv",
"filename": "uv.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"ext-zstd": {
"type": "git",
"path": "php-src/ext/zstd",
Expand Down Expand Up @@ -279,6 +289,20 @@
"path": "COPYING"
}
},
"libuv": {
"type": "ghtar",
"repo": "libuv/libuv",
"license": [
{
"type": "file",
"path": "LICENSE"
},
{
"type": "file",
"path": "LICENSE-extra"
}
]
},
"libwebp": {
"type": "url",
"url": "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz",
Expand Down
12 changes: 12 additions & 0 deletions src/SPC/builder/linux/library/libuv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\linux\library;

class libuv extends LinuxLibraryBase
{
use \SPC\builder\unix\library\libuv;

public const NAME = 'libuv';
}
12 changes: 12 additions & 0 deletions src/SPC/builder/macos/library/libuv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SPC\builder\macos\library;

class libuv extends MacOSLibraryBase
{
use \SPC\builder\unix\library\libuv;

public const NAME = 'libuv';
}
29 changes: 29 additions & 0 deletions src/SPC/builder/unix/library/libuv.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace SPC\builder\unix\library;

use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\store\FileSystem;

trait libuv
{
/**
* @throws FileSystemException
* @throws RuntimeException
*/
protected function build(): void
{
// CMake needs a clean build directory
FileSystem::resetDir($this->source_dir . '/build');
// Start build
shell()->cd($this->source_dir . '/build')
->exec("cmake {$this->builder->makeCmakeArgs()} -DLIBUV_BUILD_SHARED=OFF ..")
->exec("cmake --build . -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
// patch pkgconfig
$this->patchPkgconfPrefix(['libuv-static.pc']);
}
}
4 changes: 2 additions & 2 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
$additional_libs = 'libwebp,libavif,libjpeg,freetype';

# If you want to test additional extensions, add them below. (comma start)
$extensions .= ',igbinary';
$extensions .= ',uv';

# If you want to test additional features for extensions, add libs below. (comma start like extensions)
$additional_libs .= ',liblz4';
$additional_libs .= '';

if (!isset($argv[1])) {
exit("Please use 'extensions', 'cmd' or 'libs' as output type");
Expand Down