2023-05-12 09:47:43 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
trait libsodium
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
protected function build(): void
|
2023-05-12 09:47:43 +00:00
|
|
|
{
|
|
|
|
|
shell()->cd($this->source_dir)
|
2025-05-15 15:29:12 +07:00
|
|
|
->setEnv([
|
|
|
|
|
'CFLAGS' => $this->getLibExtraCFlags(),
|
|
|
|
|
'LDFLAGS' => $this->getLibExtraLdFlags(),
|
|
|
|
|
'LIBS' => $this->getLibExtraLibs(),
|
|
|
|
|
])
|
|
|
|
|
->execWithEnv('./configure --with-pic --enable-static --disable-shared --prefix=')
|
|
|
|
|
->execWithEnv('make clean')
|
|
|
|
|
->execWithEnv("make -j{$this->builder->concurrency}")
|
|
|
|
|
->execWithEnv('make install DESTDIR=' . BUILD_ROOT_PATH);
|
2024-07-09 15:05:53 +08:00
|
|
|
|
|
|
|
|
$this->patchPkgconfPrefix(['libsodium.pc'], PKGCONF_PATCH_PREFIX);
|
2023-05-12 09:47:43 +00:00
|
|
|
}
|
|
|
|
|
}
|