mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
add edant/watcher, to make spc-packages easier
This commit is contained in:
parent
b265d6dd56
commit
962de5b25f
@ -854,5 +854,14 @@
|
||||
"zstd.h",
|
||||
"zstd_errors.h"
|
||||
]
|
||||
},
|
||||
"watcher": {
|
||||
"source": "watcher",
|
||||
"static-libs-unix": [
|
||||
"libwatcher-c.a"
|
||||
],
|
||||
"headers": [
|
||||
"wtr/watcher-c.h"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -1070,5 +1070,14 @@
|
||||
"type": "file",
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"watcher": {
|
||||
"type": "ghtar",
|
||||
"repo": "e-dant/watcher",
|
||||
"prefer-stable": true,
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "license"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
12
src/SPC/builder/freebsd/library/watcher.php
Normal file
12
src/SPC/builder/freebsd/library/watcher.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\freebsd\library;
|
||||
|
||||
class watcher extends BSDLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\watcher;
|
||||
|
||||
public const NAME = 'watcher';
|
||||
}
|
||||
12
src/SPC/builder/linux/library/watcher.php
Normal file
12
src/SPC/builder/linux/library/watcher.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\linux\library;
|
||||
|
||||
class watcher extends LinuxLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\watcher;
|
||||
|
||||
public const NAME = 'watcher';
|
||||
}
|
||||
12
src/SPC/builder/macos/library/watcher.php
Normal file
12
src/SPC/builder/macos/library/watcher.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class watcher extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\watcher;
|
||||
|
||||
public const NAME = 'watcher';
|
||||
}
|
||||
28
src/SPC/builder/unix/library/watcher.php
Normal file
28
src/SPC/builder/unix/library/watcher.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
trait watcher
|
||||
{
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
shell()->cd($this->source_dir . '/watcher-c')
|
||||
->initializeEnv($this)
|
||||
->exec(getenv('CC') . ' -c -o libwatcher-c.o ./src/watcher-c.cpp -I ./include -I ../include -std=c++17 -Wall -Wextra -fPIC')
|
||||
->exec(getenv('AR') . ' rcs libwatcher-c.a libwatcher-c.o');
|
||||
|
||||
copy($this->source_dir . '/watcher-c/libwatcher-c.a', BUILD_LIB_PATH . '/libwatcher-c.a');
|
||||
FileSystem::createDir(BUILD_INCLUDE_PATH . '/wtr');
|
||||
copy($this->source_dir . '/watcher-c/include/wtr/watcher-c.h', BUILD_INCLUDE_PATH . '/wtr/watcher-c.h');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user