2025-03-05 11:35:03 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
|
|
|
|
|
trait attr
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2025-06-09 11:12:34 +08:00
|
|
|
shell()->cd($this->source_dir)->initializeEnv($this)
|
2025-06-09 10:24:06 +08:00
|
|
|
->appendEnv(['CFLAGS' => "-I{$this->getIncludeDir()}", 'LDFLAGS' => "-L{$this->getLibDir()}"])
|
|
|
|
|
->exec('libtoolize --force --copy')
|
|
|
|
|
->exec('./autogen.sh || autoreconf -if')
|
|
|
|
|
->exec('./configure --prefix= --enable-static --disable-shared --with-pic --disable-nls')
|
|
|
|
|
->exec("make -j {$this->builder->concurrency}")
|
2025-03-05 11:35:03 +01:00
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
|
|
|
|
|
$this->patchPkgconfPrefix(['libattr.pc'], PKGCONF_PATCH_PREFIX);
|
|
|
|
|
}
|
|
|
|
|
}
|