31 lines
656 B
PHP
Raw Normal View History

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