2024-07-06 21:56:42 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\extension;
|
|
|
|
|
|
|
|
|
|
use SPC\builder\Extension;
|
2025-05-30 21:21:50 +07:00
|
|
|
use SPC\store\FileSystem;
|
2024-07-06 21:56:42 +08:00
|
|
|
use SPC\util\CustomExt;
|
|
|
|
|
|
|
|
|
|
#[CustomExt('spx')]
|
|
|
|
|
class spx extends Extension
|
|
|
|
|
{
|
2025-03-27 11:12:19 +07:00
|
|
|
public function getUnixConfigureArg(bool $shared = false): string
|
2024-07-06 21:56:42 +08:00
|
|
|
{
|
2025-05-25 11:48:52 +07:00
|
|
|
$arg = '--enable-spx' . ($shared ? '=shared' : '');
|
2025-05-25 18:03:07 +07:00
|
|
|
if ($this->builder->getLib('zlib') !== null) {
|
2024-07-06 21:56:42 +08:00
|
|
|
$arg .= ' --with-zlib-dir=' . BUILD_ROOT_PATH;
|
|
|
|
|
}
|
|
|
|
|
return $arg;
|
|
|
|
|
}
|
2025-05-30 21:21:50 +07:00
|
|
|
|
|
|
|
|
public function patchBeforeConfigure(): bool
|
|
|
|
|
{
|
|
|
|
|
FileSystem::replaceFileStr(
|
|
|
|
|
$this->source_dir . '/Makefile.frag',
|
|
|
|
|
'@cp -r assets/web-ui/*',
|
|
|
|
|
'@cp -r ' . $this->source_dir . '/assets/web-ui/*',
|
|
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
2024-07-06 21:56:42 +08:00
|
|
|
}
|