31 lines
948 B
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace SPC\builder\unix\library;
use SPC\exception\RuntimeException;
trait attr
{
/**
* @throws RuntimeException
*/
protected function build(): void
{
shell()->cd($this->source_dir)
2025-03-10 11:42:44 +01:00
->setEnv([
2025-03-11 05:39:38 +01:00
'CFLAGS' => trim('-I' . BUILD_INCLUDE_PATH . ' ' . $this->getLibExtraCFlags()),
'LDFLAGS' => trim('-L' . BUILD_LIB_PATH . ' ' . $this->getLibExtraLdFlags()),
2025-03-10 11:42:44 +01:00
'LIBS' => $this->getLibExtraLibs(),
])
->execWithEnv('libtoolize --force --copy')
->execWithEnv('./autogen.sh')
->execWithEnv('./configure --prefix= --enable-static --disable-shared --with-pic --disable-nls')
->execWithEnv("make -j {$this->builder->concurrency}")
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
$this->patchPkgconfPrefix(['libattr.pc'], PKGCONF_PATCH_PREFIX);
}
}