2023-05-31 10:03:40 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\store\FileSystem;
|
|
|
|
|
|
|
|
|
|
trait libargon2
|
|
|
|
|
{
|
|
|
|
|
protected function build()
|
|
|
|
|
{
|
2025-06-09 10:24:06 +08:00
|
|
|
shell()->cd($this->source_dir)->initLibBuildEnv($this)
|
2023-11-05 17:31:17 +08:00
|
|
|
->exec("make PREFIX='' clean")
|
2025-06-09 10:24:06 +08:00
|
|
|
->exec("make -j{$this->builder->concurrency} PREFIX=''")
|
|
|
|
|
->exec("make install PREFIX='' DESTDIR=" . BUILD_ROOT_PATH);
|
2023-05-31 10:03:40 +02:00
|
|
|
|
|
|
|
|
$this->patchPkgconfPrefix(['libargon2.pc']);
|
|
|
|
|
|
|
|
|
|
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
|
|
|
|
|
if (str_starts_with($filename, 'libargon2') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
|
|
|
|
unlink(BUILD_ROOT_PATH . '/lib/' . $filename);
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-07-08 13:27:03 +08:00
|
|
|
|
|
|
|
|
if (file_exists(BUILD_BIN_PATH . '/argon2')) {
|
|
|
|
|
unlink(BUILD_BIN_PATH . '/argon2');
|
|
|
|
|
}
|
2023-05-31 10:03:40 +02:00
|
|
|
}
|
|
|
|
|
}
|