mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
add freetype support for gd
This commit is contained in:
parent
9ce92e39d5
commit
3daafa0b0e
@ -75,11 +75,11 @@
|
||||
"libwebp",
|
||||
"libjpeg",
|
||||
"xpm",
|
||||
"libfreetype"
|
||||
"freetype"
|
||||
],
|
||||
"lib-depends-windows": [
|
||||
"libiconv",
|
||||
"libfreetype",
|
||||
"freetype",
|
||||
"libjpeg",
|
||||
"zlib",
|
||||
"libpng",
|
||||
|
||||
@ -215,6 +215,16 @@
|
||||
"libmcrypt.a"
|
||||
]
|
||||
},
|
||||
"freetype": {
|
||||
"source": "freetype",
|
||||
"static-libs-unix": [
|
||||
"libfreetype.a"
|
||||
],
|
||||
"headers-unix": [
|
||||
"freetype2/freetype/freetype.h",
|
||||
"freetype2/ft2build.h"
|
||||
]
|
||||
},
|
||||
"nghttp2": {
|
||||
"source": "nghttp2",
|
||||
"static-libs-unix": [
|
||||
|
||||
@ -35,6 +35,15 @@
|
||||
"path": "LICENSE"
|
||||
}
|
||||
},
|
||||
"freetype": {
|
||||
"type": "filelist",
|
||||
"url": "https://download.savannah.gnu.org/releases/freetype/",
|
||||
"regex": "/href=\"(?<file>freetype-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||
"license": {
|
||||
"type": "file",
|
||||
"path": "LICENSE.TXT"
|
||||
}
|
||||
},
|
||||
"gmp": {
|
||||
"type": "filelist",
|
||||
"url": "https://gmplib.org/download/gmp/",
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user