mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-19 05:14:52 +08:00
* add qdbm for dba * add windows support for dba-qdbm * fix test scripts * fix test scripts
34 lines
970 B
PHP
34 lines
970 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
use SPC\builder\macos\library\MacOSLibraryBase;
|
|
use SPC\exception\FileSystemException;
|
|
use SPC\exception\RuntimeException;
|
|
use SPC\store\FileSystem;
|
|
|
|
trait qdbm
|
|
{
|
|
/**
|
|
* @throws FileSystemException
|
|
* @throws RuntimeException
|
|
*/
|
|
protected function build(): void
|
|
{
|
|
shell()->cd($this->source_dir)
|
|
->exec(
|
|
'./configure ' .
|
|
'--enable-static --disable-shared ' .
|
|
'--prefix='
|
|
)
|
|
->exec('make clean');
|
|
FileSystem::replaceFileRegex($this->source_dir . '/Makefile', '/MYLIBS = libqdbm.a.*/m', 'MYLIBS = libqdbm.a');
|
|
shell()->cd($this->source_dir)
|
|
->exec("make -j{$this->builder->concurrency}" . ($this instanceof MacOSLibraryBase ? ' mac' : ''))
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
$this->patchPkgconfPrefix(['qdbm.pc']);
|
|
}
|
|
}
|