no idea why our source has that uncommented

This commit is contained in:
henderkes 2025-10-21 14:23:55 +02:00
parent 2e13be2a7a
commit 4e393886aa

View File

@ -9,22 +9,22 @@ use SPC\util\executor\UnixAutoconfExecutor;
trait libedit trait libedit
{ {
protected function build(): void public function patchBeforeBuild(): bool
{ {
$make = UnixAutoconfExecutor::create($this) FileSystem::replaceFileStr(
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L']) $this->source_dir . '/src/sys.h',
->configure(); '//#define strl',
'#define strl'
foreach (['strlcpy', 'strlcat', 'fgetln'] as $symbol) {
$usymbol = strtoupper($symbol);
FileSystem::replaceFileLineContainsString(
$this->source_dir . '/config.h',
"/* #undef HAVE_{$usymbol} */",
"/* #undef HAVE_{$usymbol} */\n#define {$symbol} libedit_{$symbol}"
); );
return true;
} }
$make->make(); protected function build(): void
{
UnixAutoconfExecutor::create($this)
->appendEnv(['CFLAGS' => '-D__STDC_ISO_10646__=201103L'])
->configure()
->make();
$this->patchPkgconfPrefix(['libedit.pc']); $this->patchPkgconfPrefix(['libedit.pc']);
} }
} }