Extract default build env to unix shell

This commit is contained in:
crazywhalecc
2025-06-09 10:24:06 +08:00
parent 9babe7f1d2
commit 123cc92756
29 changed files with 166 additions and 196 deletions

View File

@@ -11,9 +11,8 @@ trait ncurses
protected function build(): void
{
$filelist = FileSystem::scanDirFiles(BUILD_BIN_PATH, relative: true);
shell()->cd($this->source_dir)
->setEnv(['CFLAGS' => $this->getLibExtraCFlags(), 'LDFLAGS' => $this->getLibExtraLdFlags(), 'LIBS' => $this->getLibExtraLibs()])
->execWithEnv(
shell()->cd($this->source_dir)->initLibBuildEnv($this)
->exec(
'./configure ' .
'--enable-static ' .
'--disable-shared ' .
@@ -33,9 +32,9 @@ trait ncurses
'--libdir=' . BUILD_ROOT_PATH . '/lib ' .
'--prefix=' . BUILD_ROOT_PATH
)
->execWithEnv('make clean')
->execWithEnv("make -j{$this->builder->concurrency}")
->execWithEnv('make install');
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec('make install');
$final = FileSystem::scanDirFiles(BUILD_BIN_PATH, relative: true);
// Remove the new files