2025-06-04 21:50:28 +07:00
|
|
|
<?php
|
2025-06-04 21:42:44 +07:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
|
|
|
|
|
trait nghttp3
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
|
|
|
|
shell()->cd($this->source_dir)
|
|
|
|
|
->setEnv([
|
|
|
|
|
'CFLAGS' => $this->getLibExtraCFlags(),
|
|
|
|
|
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
2025-06-05 09:50:14 +07:00
|
|
|
'LIBS' => $this->getLibExtraLibs(),
|
2025-06-04 21:42:44 +07:00
|
|
|
])
|
|
|
|
|
->execWithEnv(
|
|
|
|
|
'./configure ' .
|
|
|
|
|
'--enable-static ' .
|
|
|
|
|
'--disable-shared ' .
|
2025-06-05 09:44:03 +07:00
|
|
|
'--with-pic ' .
|
2025-06-04 21:42:44 +07:00
|
|
|
'--enable-lib-only ' .
|
|
|
|
|
'--prefix='
|
|
|
|
|
)
|
|
|
|
|
->execWithEnv('make clean')
|
|
|
|
|
->execWithEnv("make -j{$this->builder->concurrency}")
|
|
|
|
|
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
$this->patchPkgconfPrefix(['libnghttp3.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|