mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 05:45:35 +08:00
43 lines
1.2 KiB
PHP
43 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
use SPC\exception\FileSystemException;
|
|
use SPC\exception\RuntimeException;
|
|
use SPC\exception\WrongUsageException;
|
|
|
|
trait libwebp
|
|
{
|
|
/**
|
|
* @throws FileSystemException
|
|
* @throws RuntimeException
|
|
* @throws WrongUsageException
|
|
*/
|
|
protected function build(): void
|
|
{
|
|
[,,$destdir] = SEPARATED_PATH;
|
|
|
|
shell()->cd($this->source_dir)
|
|
->exec('./autogen.sh')
|
|
->exec(
|
|
"{$this->builder->configure_env} ./configure " .
|
|
'--enable-static ' .
|
|
'--disable-shared ' .
|
|
'--prefix= ' .
|
|
'--enable-libwebpdecoder ' .
|
|
'--enable-libwebpextras ' .
|
|
'--disable-tiff ' .
|
|
'--disable-gl ' .
|
|
'--disable-sdl ' .
|
|
'--disable-wic'
|
|
)
|
|
->exec('make clean')
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
->exec('make install DESTDIR=' . $destdir);
|
|
$this->patchPkgconfPrefix(['libsharpyuv.pc', 'libwebp.pc', 'libwebpdecoder.pc', 'libwebpdemux.pc', 'libwebpmux.pc'], PKGCONF_PATCH_PREFIX);
|
|
$this->cleanLaFiles();
|
|
}
|
|
}
|