mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
add uuid/libuuid for linux and macos (#363)
This commit is contained in:
parent
9664709f21
commit
f5d1df5407
@ -513,6 +513,14 @@
|
|||||||
"tokenizer": {
|
"tokenizer": {
|
||||||
"type": "builtin"
|
"type": "builtin"
|
||||||
},
|
},
|
||||||
|
"uuid": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-uuid",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libuuid"
|
||||||
|
]
|
||||||
|
},
|
||||||
"uv": {
|
"uv": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-uv",
|
"source": "ext-uv",
|
||||||
|
|||||||
@ -337,6 +337,12 @@
|
|||||||
"libtiff.a"
|
"libtiff.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"libuuid": {
|
||||||
|
"source": "libuuid",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libuuid.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libuv": {
|
"libuv": {
|
||||||
"source": "libuv",
|
"source": "libuv",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@ -100,6 +100,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-uuid": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/uuid",
|
||||||
|
"path": "php-src/ext/uuid",
|
||||||
|
"filename": "uuid.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-uv": {
|
"ext-uv": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/uv",
|
"url": "https://pecl.php.net/get/uv",
|
||||||
@ -334,6 +344,15 @@
|
|||||||
"path": "LICENSE.md"
|
"path": "LICENSE.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libuuid": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/cloudbase/libuuid.git",
|
||||||
|
"rev": "master",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libuv": {
|
"libuv": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"repo": "libuv/libuv",
|
"repo": "libuv/libuv",
|
||||||
|
|||||||
@ -25,7 +25,7 @@ use Symfony\Component\Console\Command\ListCommand;
|
|||||||
*/
|
*/
|
||||||
final class ConsoleApplication extends Application
|
final class ConsoleApplication extends Application
|
||||||
{
|
{
|
||||||
public const VERSION = '2.1.2';
|
public const VERSION = '2.1.3';
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
|||||||
12
src/SPC/builder/linux/library/libuuid.php
Normal file
12
src/SPC/builder/linux/library/libuuid.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class libuuid extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libuuid;
|
||||||
|
|
||||||
|
public const NAME = 'libuuid';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/libuuid.php
Normal file
12
src/SPC/builder/macos/library/libuuid.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class libuuid extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libuuid;
|
||||||
|
|
||||||
|
public const NAME = 'libuuid';
|
||||||
|
}
|
||||||
31
src/SPC/builder/unix/library/libuuid.php
Normal file
31
src/SPC/builder/unix/library/libuuid.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\exception\FileSystemException;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
|
||||||
|
trait libuuid
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec('chmod +x configure')
|
||||||
|
->exec('chmod +x install-sh')
|
||||||
|
->exec(
|
||||||
|
'./configure ' .
|
||||||
|
'--enable-static --disable-shared ' .
|
||||||
|
'--prefix='
|
||||||
|
)
|
||||||
|
->exec('make clean')
|
||||||
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
$this->patchPkgconfPrefix(['uuid.pc']);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -13,13 +13,13 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
|
||||||
$extensions = match (PHP_OS_FAMILY) {
|
$extensions = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'imagick,zstd,bz2,zip,xml,dom',
|
'Linux', 'Darwin' => 'uuid',
|
||||||
'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi',
|
'Windows' => 'mbstring,pdo_sqlite,mbregex,ffi',
|
||||||
};
|
};
|
||||||
|
|
||||||
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
// If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`).
|
||||||
$with_libs = match (PHP_OS_FAMILY) {
|
$with_libs = match (PHP_OS_FAMILY) {
|
||||||
'Linux', 'Darwin' => 'xz',
|
'Linux', 'Darwin' => '',
|
||||||
'Windows' => '',
|
'Windows' => '',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user