mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
Add tidy
This commit is contained in:
parent
d163c3dff6
commit
a5f8402703
12
config/pkg/lib/tidy.yml
Normal file
12
config/pkg/lib/tidy.yml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
tidy:
|
||||||
|
type: library
|
||||||
|
artifact:
|
||||||
|
source:
|
||||||
|
type: ghtar
|
||||||
|
repo: htacg/tidy-html5
|
||||||
|
prefer-stable: true
|
||||||
|
metadata:
|
||||||
|
license-files: [README/LICENSE.md]
|
||||||
|
license: W3C
|
||||||
|
static-libs@unix:
|
||||||
|
- libtidy.a
|
||||||
31
src/Package/Library/tidy.php
Normal file
31
src/Package/Library/tidy.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Package\Library;
|
||||||
|
|
||||||
|
use StaticPHP\Attribute\Package\BuildFor;
|
||||||
|
use StaticPHP\Attribute\Package\Library;
|
||||||
|
use StaticPHP\Package\LibraryPackage;
|
||||||
|
use StaticPHP\Runtime\Executor\UnixCMakeExecutor;
|
||||||
|
|
||||||
|
#[Library('tidy')]
|
||||||
|
class tidy
|
||||||
|
{
|
||||||
|
#[BuildFor('Darwin')]
|
||||||
|
#[BuildFor('Linux')]
|
||||||
|
public function buildUnix(LibraryPackage $lib): void
|
||||||
|
{
|
||||||
|
$cmake = UnixCMakeExecutor::create($lib)
|
||||||
|
->setBuildDir("{$lib->getSourceDir()}/build-dir")
|
||||||
|
->addConfigureArgs(
|
||||||
|
'-DSUPPORT_CONSOLE_APP=OFF',
|
||||||
|
'-DBUILD_SHARED_LIB=OFF'
|
||||||
|
);
|
||||||
|
if (version_compare(get_cmake_version(), '4.0.0', '>=')) {
|
||||||
|
$cmake->addConfigureArgs('-DCMAKE_POLICY_VERSION_MINIMUM=3.5');
|
||||||
|
}
|
||||||
|
$cmake->build();
|
||||||
|
$lib->patchPkgconfPrefix(['tidy.pc']);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user