mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
add freetype support for gd
This commit is contained in:
parent
9ce92e39d5
commit
3daafa0b0e
@ -75,11 +75,11 @@
|
|||||||
"libwebp",
|
"libwebp",
|
||||||
"libjpeg",
|
"libjpeg",
|
||||||
"xpm",
|
"xpm",
|
||||||
"libfreetype"
|
"freetype"
|
||||||
],
|
],
|
||||||
"lib-depends-windows": [
|
"lib-depends-windows": [
|
||||||
"libiconv",
|
"libiconv",
|
||||||
"libfreetype",
|
"freetype",
|
||||||
"libjpeg",
|
"libjpeg",
|
||||||
"zlib",
|
"zlib",
|
||||||
"libpng",
|
"libpng",
|
||||||
|
|||||||
@ -215,6 +215,16 @@
|
|||||||
"libmcrypt.a"
|
"libmcrypt.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"freetype": {
|
||||||
|
"source": "freetype",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libfreetype.a"
|
||||||
|
],
|
||||||
|
"headers-unix": [
|
||||||
|
"freetype2/freetype/freetype.h",
|
||||||
|
"freetype2/ft2build.h"
|
||||||
|
]
|
||||||
|
},
|
||||||
"nghttp2": {
|
"nghttp2": {
|
||||||
"source": "nghttp2",
|
"source": "nghttp2",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@ -35,6 +35,15 @@
|
|||||||
"path": "LICENSE"
|
"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": {
|
"gmp": {
|
||||||
"type": "filelist",
|
"type": "filelist",
|
||||||
"url": "https://gmplib.org/download/gmp/",
|
"url": "https://gmplib.org/download/gmp/",
|
||||||
|
|||||||
@ -216,6 +216,11 @@ class Extension
|
|||||||
'CURL_LIBS="' . $this->getLibFilesString() . '" ';
|
'CURL_LIBS="' . $this->getLibFilesString() . '" ';
|
||||||
break;
|
break;
|
||||||
case 'gd':
|
case 'gd':
|
||||||
|
if ($this->builder->getLib('freetype')) {
|
||||||
|
$arg .= ' --with-freetype ' .
|
||||||
|
'FREETYPE2_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '/freetype2" ' .
|
||||||
|
'FREETYPE2_LIBS="' . $this->getLibFilesString() . '" ';
|
||||||
|
}
|
||||||
$arg .= ' ' .
|
$arg .= ' ' .
|
||||||
'PNG_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '" ' .
|
'PNG_CFLAGS=-I"' . BUILD_INCLUDE_PATH . '" ' .
|
||||||
'PNG_LIBS="' . $this->getLibFilesString() . '" ';
|
'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