2025-10-08 08:16:54 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
2025-10-21 13:54:34 +02:00
|
|
|
use SPC\store\FileSystem;
|
2025-10-08 08:16:54 +02:00
|
|
|
use SPC\util\executor\UnixAutoconfExecutor;
|
|
|
|
|
|
|
|
|
|
trait libedit
|
|
|
|
|
{
|
2025-10-21 14:23:55 +02:00
|
|
|
public function patchBeforeBuild(): bool
|
|
|
|
|
{
|
2025-10-21 14:26:44 +02:00
|
|
|
FileSystem::replaceFileRegex(
|
2025-10-21 14:23:55 +02:00
|
|
|
$this->source_dir . '/src/sys.h',
|
2025-10-21 14:26:44 +02:00
|
|
|
'|//#define\s+strl|',
|
2025-10-21 14:23:55 +02:00
|
|
|
'#define strl'
|
|
|
|
|
);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-08 08:16:54 +02:00
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2025-10-21 14:23:55 +02:00
|
|
|
UnixAutoconfExecutor::create($this)
|
2025-10-08 09:26:20 +02:00
|
|
|
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
|
2025-10-21 14:23:55 +02:00
|
|
|
->configure()
|
|
|
|
|
->make();
|
2025-10-08 08:16:54 +02:00
|
|
|
$this->patchPkgconfPrefix(['libedit.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|