mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-03 23:05:41 +08:00
add freetype support for gd
This commit is contained in:
@@ -216,6 +216,11 @@ class Extension
|
||||
'CURL_LIBS="' . $this->getLibFilesString() . '" ';
|
||||
break;
|
||||
case 'gd':
|
||||
if ($this->builder->getLib('freetype')) {
|
||||
$arg .= ' --with-freetype ' .
|
||||
'FREETYPE2_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '/freetype2" ' .
|
||||
'FREETYPE2_LIBS="' . $this->getLibFilesString() . '" ';
|
||||
}
|
||||
$arg .= ' ' .
|
||||
'PNG_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '" ' .
|
||||
'PNG_LIBS="' . $this->getLibFilesString() . '" ';
|
||||
|
||||
38
src/SPC/builder/macos/library/freetype.php
Normal file
38
src/SPC/builder/macos/library/freetype.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SPC\builder\macos\library;
|
||||
|
||||
/**
|
||||
* is a template library class for unix
|
||||
*/
|
||||
class freetype extends MacOSLibraryBase
|
||||
{
|
||||
public const NAME = 'freetype';
|
||||
|
||||
protected function build()
|
||||
{
|
||||
[,,$destdir] = SEPARATED_PATH;
|
||||
|
||||
$suggested = '';
|
||||
$suggested .= ($this->builder->getLib('libpng') instanceof MacOSLibraryBase) ? ('--with-png=' . BUILD_ROOT_PATH) : '--without-png';
|
||||
$suggested .= ' ';
|
||||
$suggested .= ($this->builder->getLib('bzip2') instanceof MacOSLibraryBase) ? ('--with-bzip2=' . BUILD_ROOT_PATH) : '--without-bzip2';
|
||||
$suggested .= ' ';
|
||||
$suggested .= ($this->builder->getLib('brotli') instanceof MacOSLibraryBase) ? ('--with-brotli=' . BUILD_ROOT_PATH) : '--without-brotli';
|
||||
$suggested .= ' ';
|
||||
|
||||
f_passthru(
|
||||
$this->builder->set_x . ' && ' .
|
||||
"cd {$this->source_dir} && " .
|
||||
"{$this->builder->configure_env} ./configure " .
|
||||
'--enable-static --disable-shared --without-harfbuzz ' .
|
||||
$suggested .
|
||||
'--prefix= && ' . // use prefix=/
|
||||
'make clean && ' .
|
||||
"make -j{$this->builder->concurrency} && " .
|
||||
'make install DESTDIR=' . $destdir
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user