33 lines
766 B
PHP
Raw Normal View History

2024-07-06 21:56:42 +08:00
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\store\FileSystem;
2024-07-06 21:56:42 +08:00
use SPC\util\CustomExt;
#[CustomExt('spx')]
class spx extends Extension
{
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;
}
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
}