2024-03-01 19:19:47 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace SPC\builder\unix\library;
|
|
|
|
|
|
|
|
|
|
use SPC\exception\FileSystemException;
|
|
|
|
|
use SPC\exception\RuntimeException;
|
|
|
|
|
|
|
|
|
|
trait libtiff
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* @throws FileSystemException
|
|
|
|
|
* @throws RuntimeException
|
|
|
|
|
*/
|
|
|
|
|
protected function build(): void
|
|
|
|
|
{
|
2024-06-25 06:38:38 +02:00
|
|
|
$shell = shell()->cd($this->source_dir)
|
2024-03-01 19:19:47 +08:00
|
|
|
->exec(
|
|
|
|
|
'./configure ' .
|
|
|
|
|
'--enable-static --disable-shared ' .
|
|
|
|
|
'--disable-cxx ' .
|
|
|
|
|
'--prefix='
|
2024-06-25 06:38:38 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// TODO: Remove this check when https://gitlab.com/libtiff/libtiff/-/merge_requests/635 will be merged and released
|
|
|
|
|
if (file_exists($this->source_dir . '/html')) {
|
|
|
|
|
$shell->exec('make clean');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$shell
|
2024-03-01 19:19:47 +08:00
|
|
|
->exec("make -j{$this->builder->concurrency}")
|
|
|
|
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
|
|
|
|
$this->patchPkgconfPrefix(['libtiff-4.pc']);
|
|
|
|
|
}
|
|
|
|
|
}
|