mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-02 14:25:41 +08:00
add tidy support
This commit is contained in:
12
src/SPC/builder/macos/library/tidy.php
Normal file
12
src/SPC/builder/macos/library/tidy.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
class tidy extends MacOSLibraryBase
|
||||
{
|
||||
use \SPC\builder\unix\library\tidy;
|
||||
|
||||
public const NAME = 'tidy';
|
||||
}
|
||||
32
src/SPC/builder/unix/library/tidy.php
Normal file
32
src/SPC/builder/unix/library/tidy.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\unix\library;
|
||||
|
||||
use SPC\exception\FileSystemException;
|
||||
use SPC\exception\RuntimeException;
|
||||
use SPC\store\FileSystem;
|
||||
|
||||
trait tidy
|
||||
{
|
||||
/**
|
||||
* @throws RuntimeException
|
||||
* @throws FileSystemException
|
||||
*/
|
||||
protected function build(): void
|
||||
{
|
||||
FileSystem::resetDir($this->source_dir . '/build-dir');
|
||||
shell()->cd($this->source_dir . '/build-dir')
|
||||
->exec(
|
||||
'cmake ' .
|
||||
"{$this->builder->makeCmakeArgs()} " .
|
||||
'-DBUILD_SHARED_LIB=OFF ' .
|
||||
'-DSUPPORT_CONSOLE_APP=OFF ' .
|
||||
'..'
|
||||
)
|
||||
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||
$this->patchPkgconfPrefix(['tidy.pc']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user