2023-04-29 18:59:47 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
2023-08-20 19:51:45 +08:00
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
use SPC\exception\WrongUsageException;
|
|
|
|
|
|
2023-04-29 18:59:47 +08:00
|
|
|
trait libwebp
|
|
|
|
|
{
|
2023-08-20 19:51:45 +08:00
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
* @throws WrongUsageException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
2023-04-29 18:59:47 +08:00
|
|
|
{
|
|
|
|
|
[,,$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);
|
2023-05-10 02:04:08 +08:00
|
|
|
$this->cleanLaFiles();
|
2023-04-29 18:59:47 +08:00
|
|
|
}
|
|
|
|
|
}
|