From 285542f5778a4e4c39f8d804ab1587ad80bf4c08 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 26 Jun 2024 19:57:21 +0800 Subject: [PATCH 1/3] Add full gd support (libjpeg, libpng, libwebp, libavif, freetype), and related patches --- config/ext.json | 1941 +++++++++--------- config/lib.json | 1337 ++++++------ src/SPC/builder/windows/SystemUtil.php | 1 + src/SPC/builder/windows/library/freetype.php | 36 + src/SPC/builder/windows/library/libavif.php | 38 + src/SPC/builder/windows/library/libjpeg.php | 41 + src/SPC/builder/windows/library/libpng.php | 40 + src/SPC/builder/windows/library/libwebp.php | 46 + src/SPC/store/SourcePatcher.php | 17 + src/globals/extra/gd_config.w32 | 94 + src/globals/test-extensions.php | 8 +- 11 files changed, 1965 insertions(+), 1634 deletions(-) create mode 100644 src/SPC/builder/windows/library/freetype.php create mode 100644 src/SPC/builder/windows/library/libavif.php create mode 100644 src/SPC/builder/windows/library/libjpeg.php create mode 100644 src/SPC/builder/windows/library/libpng.php create mode 100644 src/SPC/builder/windows/library/libwebp.php create mode 100644 src/globals/extra/gd_config.w32 diff --git a/config/ext.json b/config/ext.json index 502058fdb..a3ec80410 100644 --- a/config/ext.json +++ b/config/ext.json @@ -1,971 +1,970 @@ -{ - "amqp": { - "support": { - "BSD": "wip" - }, - "type": "external", - "arg-type": "custom", - "source": "amqp", - "lib-depends": [ - "librabbitmq" - ], - "ext-depends-windows": [ - "openssl" - ] - }, - "apcu": { - "type": "external", - "source": "apcu" - }, - "bcmath": { - "type": "builtin" - }, - "bz2": { - "support": { - "Windows": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "bzip2" - ] - }, - "calendar": { - "type": "builtin" - }, - "ctype": { - "type": "builtin" - }, - "curl": { - "notes": true, - "type": "builtin", - "arg-type": "with", - "lib-depends": [ - "curl" - ], - "ext-depends-windows": [ - "zlib", - "openssl" - ] - }, - "dba": { - "type": "builtin", - "arg-type": "custom", - "lib-suggests": [ - "qdbm" - ] - }, - "dom": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "custom", - "arg-type-windows": "with", - "lib-depends": [ - "libxml2", - "zlib" - ], - "ext-depends-windows": [ - "xml" - ] - }, - "ds": { - "type": "external", - "source": "ext-ds" - }, - "enchant": { - "support": { - "Windows": "wip", - "BSD": "wip", - "Darwin": "wip", - "Linux": "wip" - }, - "type": "wip" - }, - "event": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "external", - "source": "ext-event", - "arg-type": "custom", - "lib-depends": [ - "libevent" - ], - "ext-depends": [ - "openssl" - ], - "ext-suggests": [ - "sockets" - ] - }, - "exif": { - "type": "builtin" - }, - "ffi": { - "support": { - "Linux": "no", - "BSD": "wip" - }, - "notes": true, - "arg-type": "custom", - "type": "builtin", - "lib-depends-unix": [ - "libffi" - ], - "lib-depends-windows": [ - "libffi-win" - ] - }, - "fileinfo": { - "type": "builtin" - }, - "filter": { - "type": "builtin" - }, - "ftp": { - "type": "builtin", - "lib-suggests": [ - "openssl" - ] - }, - "gd": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "builtin", - "arg-type": "custom", - "arg-type-windows": "with", - "lib-depends": [ - "zlib", - "libpng" - ], - "ext-depends": [ - "zlib" - ], - "lib-suggests": [ - "libavif", - "libwebp", - "libjpeg", - "freetype" - ] - }, - "gettext": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "gettext" - ] - }, - "glfw": { - "support": { - "Windows": "wip", - "BSD": "no", - "Linux": "no" - }, - "notes": true, - "type": "external", - "arg-type": "custom", - "source": "ext-glfw", - "lib-depends": [ - "glfw" - ], - "lib-depends-windows": [] - }, - "gmp": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "gmp" - ] - }, - "iconv": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "arg-type-windows": "with", - "lib-depends-unix": [ - "libiconv" - ], - "lib-depends-windows": [ - "libiconv-win" - ] - }, - "igbinary": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "igbinary" - }, - "imagick": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-imagick", - "arg-type": "custom", - "lib-depends": [ - "imagemagick" - ] - }, - "imap": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "builtin", - "arg-type": "custom", - "lib-depends": [ - "imap" - ], - "ext-suggests": [ - "openssl" - ] - }, - "inotify": { - "support": { - "Windows": "no", - "BSD": "wip", - "Darwin": "no" - }, - "type": "external", - "source": "inotify" - }, - "intl": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "type": "builtin", - "lib-depends": [ - "icu" - ] - }, - "ldap": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "ldap" - ], - "lib-suggests": [ - "gmp", - "libsodium" - ], - "ext-suggests": [ - "openssl" - ] - }, - "libxml": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "none", - "ext-depends": [ - "xml" - ] - }, - "mbregex": { - "type": "builtin", - "arg-type": "custom", - "ext-depends": [ - "mbstring" - ], - "lib-depends": [ - "onig" - ] - }, - "mbstring": { - "type": "builtin", - "arg-type": "custom" - }, - "mcrypt": { - "type": "wip", - "support": { - "Windows": "no", - "BSD": "no", - "Darwin": "no", - "Linux": "no" - }, - "notes": true - }, - "memcache": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-memcache", - "arg-type": "custom", - "lib-depends": [ - "zlib" - ], - "ext-depends": [ - "session" - ] - }, - "memcached": { - "support": { - "Windows": "wip", - "BSD": "wip", - "Linux": "no" - }, - "type": "external", - "source": "memcached", - "arg-type": "custom", - "cpp-extension": true, - "lib-depends": [ - "libmemcached" - ], - "ext-depends": [ - "session", - "zlib" - ] - }, - "mongodb": { - "support": { - "BSD": "wip", - "Windows": "wip" - }, - "type": "external", - "source": "mongodb", - "arg-type": "custom", - "lib-suggests": [ - "icu", - "openssl", - "zstd", - "zlib" - ] - }, - "mysqli": { - "type": "builtin", - "arg-type": "with", - "ext-depends": [ - "mysqlnd" - ] - }, - "mysqlnd": { - "type": "builtin", - "arg-type-windows": "with", - "lib-depends": [ - "zlib" - ] - }, - "oci8": { - "type": "wip", - "support": { - "Windows": "wip", - "BSD": "no", - "Darwin": "no", - "Linux": "no" - }, - "notes": true - }, - "opcache": { - "type": "builtin", - "arg-type": "custom" - }, - "openssl": { - "notes": true, - "type": "builtin", - "arg-type": "custom", - "arg-type-windows": "with", - "lib-depends": [ - "openssl", - "zlib" - ], - "ext-depends": [ - "zlib" - ] - }, - "parallel": { - "support": { - "BSD": "wip" - }, - "notes": true, - "type": "external", - "source": "parallel", - "arg-type-windows": "with", - "lib-depends-windows": [ - "pthreads4w" - ] - }, - "password-argon2": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "libargon2" - ] - }, - "pcntl": { - "support": { - "Windows": "no" - }, - "type": "builtin", - "unix-only": true - }, - "pdo": { - "type": "builtin" - }, - "pdo_mysql": { - "type": "builtin", - "arg-type": "with", - "ext-depends": [ - "pdo", - "mysqlnd" - ] - }, - "pdo_pgsql": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "ext-depends": [ - "pdo", - "pgsql" - ], - "lib-depends": [ - "postgresql" - ] - }, - "pdo_sqlite": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with", - "ext-depends": [ - "pdo", - "sqlite3" - ], - "lib-depends": [ - "sqlite" - ] - }, - "pdo_sqlsrv": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "pdo_sqlsrv", - "arg-type": "with", - "ext-depends": [ - "pdo", - "sqlsrv" - ] - }, - "pgsql": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "postgresql" - ] - }, - "phar": { - "type": "builtin", - "ext-depends": [ - "zlib" - ] - }, - "posix": { - "support": { - "Windows": "no" - }, - "type": "builtin", - "unix-only": true - }, - "protobuf": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "protobuf" - }, - "rar": { - "support": { - "Windows": "wip", - "BSD": "wip", - "Darwin": "partial" - }, - "notes": true, - "type": "external", - "source": "rar", - "cpp-extension": true - }, - "readline": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "readline" - ] - }, - "redis": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "redis", - "arg-type": "custom", - "ext-suggests": [ - "session", - "igbinary" - ], - "lib-suggests": [ - "zstd", - "liblz4" - ] - }, - "session": { - "type": "builtin" - }, - "shmop": { - "type": "builtin" - }, - "simdjson": { - "type": "external", - "source": "ext-simdjson", - "cpp-extension": true - }, - "simplexml": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "custom", - "lib-depends": [ - "libxml2" - ], - "ext-depends-windows": [ - "xml" - ] - }, - "snappy": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-snappy", - "cpp-extension": true, - "arg-type": "custom", - "lib-depends": [ - "snappy" - ], - "ext-suggest": [ - "apcu" - ] - }, - "soap": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "custom", - "lib-depends": [ - "libxml2" - ], - "ext-depends-windows": [ - "xml" - ] - }, - "sockets": { - "type": "builtin" - }, - "sodium": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with", - "lib-depends": [ - "libsodium" - ] - }, - "sqlite3": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "arg-type-windows": "with", - "lib-depends": [ - "sqlite" - ] - }, - "sqlsrv": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "sqlsrv", - "lib-depends": [ - "unixodbc" - ], - "ext-depends-linux": [ - "pcntl" - ], - "cpp-extension": true - }, - "ssh2": { - "support": { - "BSD": "wip" - }, - "type": "external", - "source": "ext-ssh2", - "arg-type": "with-prefix", - "arg-type-windows": "with", - "lib-depends": [ - "libssh2" - ], - "ext-depends-windows": [ - "openssl", - "zlib" - ] - }, - "swoole": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "notes": true, - "type": "external", - "source": "swoole", - "arg-type": "custom", - "cpp-extension": true, - "unix-only": true, - "lib-depends": [ - "libcares", - "brotli", - "nghttp2", - "zlib" - ], - "ext-depends": [ - "openssl", - "curl" - ], - "ext-suggests": [ - "swoole-hook-pgsql", - "swoole-hook-mysql", - "swoole-hook-sqlite" - ] - }, - "swoole-hook-mysql": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "notes": true, - "type": "addon", - "arg-type": "custom", - "ext-depends": [ - "mysqlnd", - "pdo", - "pdo_mysql" - ], - "ext-suggests": [ - "mysqli" - ] - }, - "swoole-hook-pgsql": { - "support": { - "Windows": "no", - "BSD": "wip", - "Darwin": "partial" - }, - "notes": true, - "type": "addon", - "arg-type": "custom", - "ext-depends": [ - "pgsql", - "pdo" - ] - }, - "swoole-hook-sqlite": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "notes": true, - "type": "addon", - "arg-type": "custom", - "ext-depends": [ - "sqlite3", - "pdo" - ] - }, - "swow": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "external", - "source": "swow", - "arg-type": "custom", - "lib-suggests": [ - "openssl", - "curl" - ], - "ext-suggests": [ - "openssl", - "curl" - ] - }, - "sysvmsg": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "type": "builtin", - "unix-only": true - }, - "sysvsem": { - "support": { - "Windows": "no", - "BSD": "wip" - }, - "type": "builtin", - "unix-only": true - }, - "sysvshm": { - "support": { - "BSD": "wip" - }, - "type": "builtin" - }, - "tidy": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "tidy" - ] - }, - "tokenizer": { - "type": "builtin" - }, - "uuid": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-uuid", - "arg-type": "with-prefix", - "lib-depends": [ - "libuuid" - ] - }, - "uv": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-uv", - "arg-type": "with-prefix", - "lib-depends": [ - "libuv" - ], - "ext-depends": [ - "sockets" - ] - }, - "xdebug": { - "type": "builtin", - "support": { - "Windows": "wip", - "BSD": "no", - "Darwin": "no", - "Linux": "no" - }, - "notes": true - }, - "xhprof": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "notes": true, - "type": "external", - "source": "xhprof", - "ext-depends": [ - "ctype" - ] - }, - "xlswriter": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "xlswriter", - "arg-type": "custom", - "ext-depends": [ - "zlib", - "zip" - ], - "lib-suggests": [ - "openssl" - ] - }, - "xml": { - "support": { - "BSD": "wip" - }, - "notes": true, - "type": "builtin", - "arg-type": "custom", - "arg-type-windows": "with", - "lib-depends": [ - "libxml2" - ], - "ext-depends-windows": [ - "iconv" - ] - }, - "xmlreader": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "custom", - "lib-depends": [ - "libxml2" - ], - "ext-depends-windows": [ - "xml", - "dom" - ] - }, - "xmlwriter": { - "support": { - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "custom", - "lib-depends": [ - "libxml2" - ], - "ext-depends-windows": [ - "xml" - ] - }, - "xsl": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "lib-depends": [ - "libxslt" - ], - "ext-depends": [ - "xml", - "dom" - ] - }, - "yac": { - "support": { - "BSD": "wip" - }, - "type": "external", - "source": "yac", - "arg-type-unix": "custom", - "ext-depends-unix": [ - "igbinary" - ] - }, - "yaml": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "yaml", - "arg-type": "with-prefix", - "lib-depends": [ - "libyaml" - ] - }, - "zip": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "builtin", - "arg-type": "with-prefix", - "arg-type-windows": "enable", - "lib-depends": [ - "libzip" - ] - }, - "zlib": { - "type": "builtin", - "arg-type": "custom", - "arg-type-windows": "enable", - "lib-depends": [ - "zlib" - ] - }, - "zstd": { - "support": { - "Windows": "wip", - "BSD": "wip" - }, - "type": "external", - "source": "ext-zstd", - "arg-type": "custom", - "lib-depends": [ - "zstd" - ] - } -} +{ + "amqp": { + "support": { + "BSD": "wip" + }, + "type": "external", + "arg-type": "custom", + "source": "amqp", + "lib-depends": [ + "librabbitmq" + ], + "ext-depends-windows": [ + "openssl" + ] + }, + "apcu": { + "type": "external", + "source": "apcu" + }, + "bcmath": { + "type": "builtin" + }, + "bz2": { + "support": { + "Windows": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "bzip2" + ] + }, + "calendar": { + "type": "builtin" + }, + "ctype": { + "type": "builtin" + }, + "curl": { + "notes": true, + "type": "builtin", + "arg-type": "with", + "lib-depends": [ + "curl" + ], + "ext-depends-windows": [ + "zlib", + "openssl" + ] + }, + "dba": { + "type": "builtin", + "arg-type": "custom", + "lib-suggests": [ + "qdbm" + ] + }, + "dom": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "custom", + "arg-type-windows": "with", + "lib-depends": [ + "libxml2", + "zlib" + ], + "ext-depends-windows": [ + "xml" + ] + }, + "ds": { + "type": "external", + "source": "ext-ds" + }, + "enchant": { + "support": { + "Windows": "wip", + "BSD": "wip", + "Darwin": "wip", + "Linux": "wip" + }, + "type": "wip" + }, + "event": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "external", + "source": "ext-event", + "arg-type": "custom", + "lib-depends": [ + "libevent" + ], + "ext-depends": [ + "openssl" + ], + "ext-suggests": [ + "sockets" + ] + }, + "exif": { + "type": "builtin" + }, + "ffi": { + "support": { + "Linux": "no", + "BSD": "wip" + }, + "notes": true, + "arg-type": "custom", + "type": "builtin", + "lib-depends-unix": [ + "libffi" + ], + "lib-depends-windows": [ + "libffi-win" + ] + }, + "fileinfo": { + "type": "builtin" + }, + "filter": { + "type": "builtin" + }, + "ftp": { + "type": "builtin", + "lib-suggests": [ + "openssl" + ] + }, + "gd": { + "support": { + "BSD": "wip" + }, + "notes": true, + "type": "builtin", + "arg-type": "custom", + "arg-type-windows": "with", + "lib-depends": [ + "zlib", + "libpng" + ], + "ext-depends": [ + "zlib" + ], + "lib-suggests": [ + "libavif", + "libwebp", + "libjpeg", + "freetype" + ] + }, + "gettext": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "gettext" + ] + }, + "glfw": { + "support": { + "Windows": "wip", + "BSD": "no", + "Linux": "no" + }, + "notes": true, + "type": "external", + "arg-type": "custom", + "source": "ext-glfw", + "lib-depends": [ + "glfw" + ], + "lib-depends-windows": [] + }, + "gmp": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "gmp" + ] + }, + "iconv": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "arg-type-windows": "with", + "lib-depends-unix": [ + "libiconv" + ], + "lib-depends-windows": [ + "libiconv-win" + ] + }, + "igbinary": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "igbinary" + }, + "imagick": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-imagick", + "arg-type": "custom", + "lib-depends": [ + "imagemagick" + ] + }, + "imap": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "builtin", + "arg-type": "custom", + "lib-depends": [ + "imap" + ], + "ext-suggests": [ + "openssl" + ] + }, + "inotify": { + "support": { + "Windows": "no", + "BSD": "wip", + "Darwin": "no" + }, + "type": "external", + "source": "inotify" + }, + "intl": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "type": "builtin", + "lib-depends": [ + "icu" + ] + }, + "ldap": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "ldap" + ], + "lib-suggests": [ + "gmp", + "libsodium" + ], + "ext-suggests": [ + "openssl" + ] + }, + "libxml": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "none", + "ext-depends": [ + "xml" + ] + }, + "mbregex": { + "type": "builtin", + "arg-type": "custom", + "ext-depends": [ + "mbstring" + ], + "lib-depends": [ + "onig" + ] + }, + "mbstring": { + "type": "builtin", + "arg-type": "custom" + }, + "mcrypt": { + "type": "wip", + "support": { + "Windows": "no", + "BSD": "no", + "Darwin": "no", + "Linux": "no" + }, + "notes": true + }, + "memcache": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-memcache", + "arg-type": "custom", + "lib-depends": [ + "zlib" + ], + "ext-depends": [ + "session" + ] + }, + "memcached": { + "support": { + "Windows": "wip", + "BSD": "wip", + "Linux": "no" + }, + "type": "external", + "source": "memcached", + "arg-type": "custom", + "cpp-extension": true, + "lib-depends": [ + "libmemcached" + ], + "ext-depends": [ + "session", + "zlib" + ] + }, + "mongodb": { + "support": { + "BSD": "wip", + "Windows": "wip" + }, + "type": "external", + "source": "mongodb", + "arg-type": "custom", + "lib-suggests": [ + "icu", + "openssl", + "zstd", + "zlib" + ] + }, + "mysqli": { + "type": "builtin", + "arg-type": "with", + "ext-depends": [ + "mysqlnd" + ] + }, + "mysqlnd": { + "type": "builtin", + "arg-type-windows": "with", + "lib-depends": [ + "zlib" + ] + }, + "oci8": { + "type": "wip", + "support": { + "Windows": "wip", + "BSD": "no", + "Darwin": "no", + "Linux": "no" + }, + "notes": true + }, + "opcache": { + "type": "builtin", + "arg-type": "custom" + }, + "openssl": { + "notes": true, + "type": "builtin", + "arg-type": "custom", + "arg-type-windows": "with", + "lib-depends": [ + "openssl", + "zlib" + ], + "ext-depends": [ + "zlib" + ] + }, + "parallel": { + "support": { + "BSD": "wip" + }, + "notes": true, + "type": "external", + "source": "parallel", + "arg-type-windows": "with", + "lib-depends-windows": [ + "pthreads4w" + ] + }, + "password-argon2": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "libargon2" + ] + }, + "pcntl": { + "support": { + "Windows": "no" + }, + "type": "builtin", + "unix-only": true + }, + "pdo": { + "type": "builtin" + }, + "pdo_mysql": { + "type": "builtin", + "arg-type": "with", + "ext-depends": [ + "pdo", + "mysqlnd" + ] + }, + "pdo_pgsql": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "ext-depends": [ + "pdo", + "pgsql" + ], + "lib-depends": [ + "postgresql" + ] + }, + "pdo_sqlite": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with", + "ext-depends": [ + "pdo", + "sqlite3" + ], + "lib-depends": [ + "sqlite" + ] + }, + "pdo_sqlsrv": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "pdo_sqlsrv", + "arg-type": "with", + "ext-depends": [ + "pdo", + "sqlsrv" + ] + }, + "pgsql": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "postgresql" + ] + }, + "phar": { + "type": "builtin", + "ext-depends": [ + "zlib" + ] + }, + "posix": { + "support": { + "Windows": "no" + }, + "type": "builtin", + "unix-only": true + }, + "protobuf": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "protobuf" + }, + "rar": { + "support": { + "Windows": "wip", + "BSD": "wip", + "Darwin": "partial" + }, + "notes": true, + "type": "external", + "source": "rar", + "cpp-extension": true + }, + "readline": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "readline" + ] + }, + "redis": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "redis", + "arg-type": "custom", + "ext-suggests": [ + "session", + "igbinary" + ], + "lib-suggests": [ + "zstd", + "liblz4" + ] + }, + "session": { + "type": "builtin" + }, + "shmop": { + "type": "builtin" + }, + "simdjson": { + "type": "external", + "source": "ext-simdjson", + "cpp-extension": true + }, + "simplexml": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "custom", + "lib-depends": [ + "libxml2" + ], + "ext-depends-windows": [ + "xml" + ] + }, + "snappy": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-snappy", + "cpp-extension": true, + "arg-type": "custom", + "lib-depends": [ + "snappy" + ], + "ext-suggest": [ + "apcu" + ] + }, + "soap": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "custom", + "lib-depends": [ + "libxml2" + ], + "ext-depends-windows": [ + "xml" + ] + }, + "sockets": { + "type": "builtin" + }, + "sodium": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with", + "lib-depends": [ + "libsodium" + ] + }, + "sqlite3": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "arg-type-windows": "with", + "lib-depends": [ + "sqlite" + ] + }, + "sqlsrv": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "sqlsrv", + "lib-depends": [ + "unixodbc" + ], + "ext-depends-linux": [ + "pcntl" + ], + "cpp-extension": true + }, + "ssh2": { + "support": { + "BSD": "wip" + }, + "type": "external", + "source": "ext-ssh2", + "arg-type": "with-prefix", + "arg-type-windows": "with", + "lib-depends": [ + "libssh2" + ], + "ext-depends-windows": [ + "openssl", + "zlib" + ] + }, + "swoole": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "notes": true, + "type": "external", + "source": "swoole", + "arg-type": "custom", + "cpp-extension": true, + "unix-only": true, + "lib-depends": [ + "libcares", + "brotli", + "nghttp2", + "zlib" + ], + "ext-depends": [ + "openssl", + "curl" + ], + "ext-suggests": [ + "swoole-hook-pgsql", + "swoole-hook-mysql", + "swoole-hook-sqlite" + ] + }, + "swoole-hook-mysql": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "notes": true, + "type": "addon", + "arg-type": "custom", + "ext-depends": [ + "mysqlnd", + "pdo", + "pdo_mysql" + ], + "ext-suggests": [ + "mysqli" + ] + }, + "swoole-hook-pgsql": { + "support": { + "Windows": "no", + "BSD": "wip", + "Darwin": "partial" + }, + "notes": true, + "type": "addon", + "arg-type": "custom", + "ext-depends": [ + "pgsql", + "pdo" + ] + }, + "swoole-hook-sqlite": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "notes": true, + "type": "addon", + "arg-type": "custom", + "ext-depends": [ + "sqlite3", + "pdo" + ] + }, + "swow": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "external", + "source": "swow", + "arg-type": "custom", + "lib-suggests": [ + "openssl", + "curl" + ], + "ext-suggests": [ + "openssl", + "curl" + ] + }, + "sysvmsg": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "type": "builtin", + "unix-only": true + }, + "sysvsem": { + "support": { + "Windows": "no", + "BSD": "wip" + }, + "type": "builtin", + "unix-only": true + }, + "sysvshm": { + "support": { + "BSD": "wip" + }, + "type": "builtin" + }, + "tidy": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "tidy" + ] + }, + "tokenizer": { + "type": "builtin" + }, + "uuid": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-uuid", + "arg-type": "with-prefix", + "lib-depends": [ + "libuuid" + ] + }, + "uv": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-uv", + "arg-type": "with-prefix", + "lib-depends": [ + "libuv" + ], + "ext-depends": [ + "sockets" + ] + }, + "xdebug": { + "type": "builtin", + "support": { + "Windows": "wip", + "BSD": "no", + "Darwin": "no", + "Linux": "no" + }, + "notes": true + }, + "xhprof": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "notes": true, + "type": "external", + "source": "xhprof", + "ext-depends": [ + "ctype" + ] + }, + "xlswriter": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "xlswriter", + "arg-type": "custom", + "ext-depends": [ + "zlib", + "zip" + ], + "lib-suggests": [ + "openssl" + ] + }, + "xml": { + "support": { + "BSD": "wip" + }, + "notes": true, + "type": "builtin", + "arg-type": "custom", + "arg-type-windows": "with", + "lib-depends": [ + "libxml2" + ], + "ext-depends-windows": [ + "iconv" + ] + }, + "xmlreader": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "custom", + "lib-depends": [ + "libxml2" + ], + "ext-depends-windows": [ + "xml", + "dom" + ] + }, + "xmlwriter": { + "support": { + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "custom", + "lib-depends": [ + "libxml2" + ], + "ext-depends-windows": [ + "xml" + ] + }, + "xsl": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "lib-depends": [ + "libxslt" + ], + "ext-depends": [ + "xml", + "dom" + ] + }, + "yac": { + "support": { + "BSD": "wip" + }, + "type": "external", + "source": "yac", + "arg-type-unix": "custom", + "ext-depends-unix": [ + "igbinary" + ] + }, + "yaml": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "yaml", + "arg-type": "with-prefix", + "lib-depends": [ + "libyaml" + ] + }, + "zip": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "builtin", + "arg-type": "with-prefix", + "arg-type-windows": "enable", + "lib-depends": [ + "libzip" + ] + }, + "zlib": { + "type": "builtin", + "arg-type": "custom", + "arg-type-windows": "enable", + "lib-depends": [ + "zlib" + ] + }, + "zstd": { + "support": { + "Windows": "wip", + "BSD": "wip" + }, + "type": "external", + "source": "ext-zstd", + "arg-type": "custom", + "lib-depends": [ + "zstd" + ] + } +} diff --git a/config/lib.json b/config/lib.json index d2364a3a4..d57ba0dfa 100644 --- a/config/lib.json +++ b/config/lib.json @@ -1,659 +1,678 @@ -{ - "brotli": { - "source": "brotli", - "static-libs-unix": [ - "libbrotlidec.a", - "libbrotlienc.a", - "libbrotlicommon.a" - ], - "static-libs-windows": [ - "brotlicommon.lib", - "brotlienc.lib", - "brotlidec.lib" - ], - "headers": [ - "brotli" - ] - }, - "bzip2": { - "source": "bzip2", - "static-libs-unix": [ - "libbz2.a" - ], - "static-libs-windows": [ - [ - "libbz2.lib", - "libbz2_a.lib" - ] - ], - "headers": [ - "bzlib.h" - ] - }, - "curl": { - "source": "curl", - "static-libs-unix": [ - "libcurl.a" - ], - "static-libs-windows": [ - "libcurl_a.lib" - ], - "headers": [ - "curl" - ], - "lib-depends-unix": [ - "openssl", - "zlib" - ], - "lib-depends-windows": [ - "openssl", - "zlib", - "libssh2", - "nghttp2" - ], - "lib-suggests-unix": [ - "libssh2", - "brotli", - "nghttp2", - "zstd" - ], - "lib-suggests-windows": [ - "brotli", - "zstd" - ], - "frameworks": [ - "CoreFoundation", - "CoreServices", - "SystemConfiguration" - ] - }, - "freetype": { - "source": "freetype", - "static-libs-unix": [ - "libfreetype.a" - ], - "headers-unix": [ - "freetype2/freetype/freetype.h", - "freetype2/ft2build.h" - ], - "lib-depends": [ - "zlib" - ], - "lib-suggests": [ - "libpng", - "bzip2", - "brotli" - ] - }, - "gettext": { - "source": "gettext", - "static-libs-unix": [ - "libintl.a" - ], - "lib-depends": [ - "libiconv" - ], - "lib-suggests": [ - "ncurses", - "libxml2" - ], - "frameworks": [ - "CoreFoundation" - ] - }, - "glfw": { - "source": "ext-glfw", - "static-libs-unix": [ - "libglfw3.a" - ], - "frameworks": [ - "CoreVideo", - "OpenGL", - "Cocoa", - "IOKit" - ] - }, - "gmp": { - "source": "gmp", - "static-libs-unix": [ - "libgmp.a" - ], - "static-libs-windows": [ - "libgmp.lib" - ], - "headers": [ - "gmp.h" - ] - }, - "icu": { - "source": "icu", - "cpp-library": true, - "static-libs-unix": [ - "libicui18n.a", - "libicuio.a", - "libicuuc.a", - "libicudata.a" - ] - }, - "imagemagick": { - "source": "imagemagick", - "static-libs-unix": [ - "libMagick++-7.Q16HDRI.a", - "libMagickWand-7.Q16HDRI.a", - "libMagickCore-7.Q16HDRI.a" - ], - "lib-depends": [ - "zlib", - "libpng", - "libjpeg", - "libwebp", - "freetype", - "libtiff" - ], - "lib-suggests": [ - "zstd", - "xz", - "bzip2", - "libzip", - "libxml2" - ] - }, - "imap": { - "source": "imap", - "static-libs-unix": [ - "libc-client.a" - ], - "lib-suggests": [ - "openssl" - ] - }, - "ldap": { - "source": "ldap", - "static-libs-unix": [ - "liblber.a", - "libldap.a" - ], - "lib-depends": [ - "openssl", - "zlib", - "gmp", - "libsodium" - ] - }, - "libargon2": { - "source": "libargon2", - "static-libs-unix": [ - "libargon2.a" - ] - }, - "libavif": { - "source": "libavif", - "static-libs-unix": [ - "libavif.a" - ] - }, - "libcares": { - "source": "libcares", - "static-libs-unix": [ - "libcares.a" - ], - "headers-unix": [ - "ares.h", - "ares_dns.h", - "ares_nameser.h", - "ares_rules.h" - ] - }, - "libevent": { - "source": "libevent", - "static-libs-unix": [ - "libevent.a", - "libevent_core.a", - "libevent_extra.a", - "libevent_openssl.a" - ], - "lib-depends": [ - "openssl" - ] - }, - "libffi": { - "source": "libffi", - "static-libs-unix": [ - "libffi.a" - ], - "static-libs-windows": [ - "libffi.lib" - ], - "headers-unix": [ - "ffi.h", - "ffitarget.h" - ], - "headers-windows": [ - "ffi.h", - "fficonfig.h", - "ffitarget.h" - ] - }, - "libffi-win": { - "source": "libffi-win", - "static-libs-windows": [ - "libffi.lib" - ], - "headers-windows": [ - "ffi.h", - "ffitarget.h", - "fficonfig.h" - ] - }, - "libiconv": { - "source": "libiconv", - "static-libs-unix": [ - "libiconv.a", - "libcharset.a" - ], - "headers": [ - "iconv.h", - "libcharset.h", - "localcharset.h" - ] - }, - "libiconv-win": { - "source": "libiconv-win", - "static-libs-windows": [ - "libiconv.lib", - "libiconv_a.lib" - ] - }, - "libjpeg": { - "source": "libjpeg", - "static-libs-unix": [ - "libjpeg.a", - "libturbojpeg.a" - ] - }, - "liblz4": { - "source": "liblz4", - "static-libs-unix": [ - "liblz4.a" - ] - }, - "libmemcached": { - "source": "libmemcached", - "static-libs-unix": [ - "libmemcached.a", - "libmemcachedutil.a" - ] - }, - "libpng": { - "source": "libpng", - "static-libs-unix": [ - "libpng16.a" - ], - "static-libs-windows": [ - "libpng16_static.lib" - ], - "headers-unix": [ - "png.h", - "pngconf.h", - "pnglibconf.h" - ], - "headers-windows": [ - "png.h", - "pngconf.h" - ], - "lib-depends": [ - "zlib" - ] - }, - "librabbitmq": { - "source": "librabbitmq", - "static-libs-unix": [ - "librabbitmq.a" - ], - "static-libs-windows": [ - "rabbitmq.4.lib" - ], - "lib-depends": [ - "openssl" - ] - }, - "libsodium": { - "source": "libsodium", - "static-libs-unix": [ - "libsodium.a" - ] - }, - "libssh2": { - "source": "libssh2", - "static-libs-unix": [ - "libssh2.a" - ], - "static-libs-windows": [ - "libssh2.lib" - ], - "headers": [ - "libssh2.h", - "libssh2_publickey.h", - "libssh2_sftp.h" - ], - "lib-depends": [ - "openssl" - ], - "lib-suggests": [ - "zlib" - ] - }, - "libtiff": { - "source": "libtiff", - "static-libs-unix": [ - "libtiff.a" - ] - }, - "libuuid": { - "source": "libuuid", - "static-libs-unix": [ - "libuuid.a" - ], - "headers": [ - "uuid/uuid.h" - ] - }, - "libuv": { - "source": "libuv", - "static-libs-unix": [ - "libuv.a" - ] - }, - "libwebp": { - "source": "libwebp", - "static-libs-unix": [ - "libwebp.a", - "libwebpdecoder.a", - "libwebpdemux.a", - "libwebpmux.a", - "libsharpyuv.a" - ] - }, - "libxml2": { - "source": "libxml2", - "static-libs-unix": [ - "libxml2.a" - ], - "static-libs-windows": [ - "libxml2s.lib", - "libxml2_a.lib" - ], - "headers": [ - "libxml2" - ], - "lib-depends-unix": [ - "libiconv" - ], - "lib-suggests-unix": [ - "xz", - "icu", - "zlib" - ], - "lib-depends-windows": [ - "libiconv-win" - ], - "lib-suggests-windows": [ - "zlib" - ] - }, - "libxslt": { - "source": "libxslt", - "static-libs-unix": [ - "libxslt.a", - "libexslt.a" - ], - "lib-depends": [ - "libxml2" - ] - }, - "libyaml": { - "source": "libyaml", - "static-libs-unix": [ - "libyaml.a" - ], - "static-libs-windows": [ - "yaml.lib" - ], - "headers": [ - "yaml.h" - ] - }, - "libzip": { - "source": "libzip", - "static-libs-unix": [ - "libzip.a" - ], - "static-libs-windows": [ - [ - "zip.lib", - "libzip_a.lib" - ] - ], - "headers": [ - "zip.h", - "zipconf.h" - ], - "lib-depends": [ - "zlib" - ], - "lib-suggests": [ - "bzip2", - "xz", - "zstd", - "openssl" - ] - }, - "ncurses": { - "source": "ncurses", - "static-libs-unix": [ - "libncurses.a" - ] - }, - "nghttp2": { - "source": "nghttp2", - "static-libs-unix": [ - "libnghttp2.a" - ], - "static-libs-windows": [ - "nghttp2.lib" - ], - "headers": [ - "nghttp2" - ], - "lib-depends": [ - "zlib", - "openssl" - ], - "lib-suggests": [ - "libxml2" - ] - }, - "onig": { - "source": "onig", - "static-libs-unix": [ - "libonig.a" - ], - "static-libs-windows": [ - "onig.lib", - "onig_a.lib" - ], - "headers": [ - "oniggnu.h", - "oniguruma.h" - ] - }, - "openssl": { - "source": "openssl", - "static-libs-unix": [ - "libssl.a", - "libcrypto.a" - ], - "static-libs-windows": [ - "libssl.lib", - "libcrypto.lib" - ], - "headers": [ - "openssl" - ], - "lib-depends": [ - "zlib" - ] - }, - "pkg-config": { - "source": "pkg-config" - }, - "postgresql": { - "source": "postgresql", - "static-libs-unix": [ - "libpq.a", - "libpgport.a", - "libpgcommon.a" - ], - "lib-depends": [ - "libiconv", - "libxml2", - "openssl", - "zlib", - "readline" - ], - "lib-suggests": [ - "icu", - "libxslt", - "ldap", - "zstd" - ] - }, - "pthreads4w": { - "source": "pthreads4w", - "static-libs-windows": [ - "libpthreadVC3.lib" - ] - }, - "qdbm": { - "source": "qdbm", - "static-libs-unix": [ - "libqdbm.a" - ], - "static-libs-windows": [ - "qdbm_a.lib" - ], - "headers-windows": [ - "depot.h" - ] - }, - "readline": { - "source": "readline", - "static-libs-unix": [ - "libreadline.a" - ], - "lib-depends": [ - "ncurses" - ] - }, - "snappy": { - "source": "snappy", - "static-libs-unix": [ - "libsnappy.a" - ], - "headers-unix": [ - "snappy.h", - "snappy-c.h", - "snappy-sinksource.h", - "snappy-stubs-public.h" - ], - "lib-depends": [ - "zlib" - ] - }, - "sqlite": { - "source": "sqlite", - "static-libs-unix": [ - "libsqlite3.a" - ], - "static-libs-windows": [ - "libsqlite3_a.lib" - ], - "headers": [ - "sqlite3.h", - "sqlite3ext.h" - ] - }, - "tidy": { - "source": "tidy", - "static-libs-unix": [ - "libtidy.a" - ] - }, - "unixodbc": { - "source": "unixodbc", - "static-libs-unix": [ - "libodbc.a", - "libodbccr.a", - "libodbcinst.a" - ], - "lib-depends": [ - "libiconv" - ] - }, - "xz": { - "source": "xz", - "static-libs-unix": [ - "liblzma.a" - ], - "static-libs-windows": [ - [ - "liblzma.lib", - "liblzma_a.lib" - ] - ], - "headers-unix": [ - "lzma" - ], - "headers-windows": [ - "lzma", - "lzma.h" - ], - "lib-depends": [ - "libiconv" - ] - }, - "zlib": { - "source": "zlib", - "static-libs-unix": [ - "libz.a" - ], - "static-libs-windows": [ - "zlib_a.lib" - ], - "headers": [ - "zlib.h", - "zconf.h" - ] - }, - "zstd": { - "source": "zstd", - "static-libs-unix": [ - "libzstd.a" - ], - "static-libs-windows": [ - [ - "zstd.lib", - "zstd_static.lib" - ] - ], - "headers-unix": [ - "zdict.h", - "zstd.h", - "zstd_errors.h" - ], - "headers-windows": [ - "zstd.h", - "zstd_errors.h" - ] - } -} +{ + "brotli": { + "source": "brotli", + "static-libs-unix": [ + "libbrotlidec.a", + "libbrotlienc.a", + "libbrotlicommon.a" + ], + "static-libs-windows": [ + "brotlicommon.lib", + "brotlienc.lib", + "brotlidec.lib" + ], + "headers": [ + "brotli" + ] + }, + "bzip2": { + "source": "bzip2", + "static-libs-unix": [ + "libbz2.a" + ], + "static-libs-windows": [ + [ + "libbz2.lib", + "libbz2_a.lib" + ] + ], + "headers": [ + "bzlib.h" + ] + }, + "curl": { + "source": "curl", + "static-libs-unix": [ + "libcurl.a" + ], + "static-libs-windows": [ + "libcurl_a.lib" + ], + "headers": [ + "curl" + ], + "lib-depends-unix": [ + "openssl", + "zlib" + ], + "lib-depends-windows": [ + "openssl", + "zlib", + "libssh2", + "nghttp2" + ], + "lib-suggests-unix": [ + "libssh2", + "brotli", + "nghttp2", + "zstd" + ], + "lib-suggests-windows": [ + "brotli", + "zstd" + ], + "frameworks": [ + "CoreFoundation", + "CoreServices", + "SystemConfiguration" + ] + }, + "freetype": { + "source": "freetype", + "static-libs-unix": [ + "libfreetype.a" + ], + "static-libs-windows": [ + "libfreetype_a.lib" + ], + "headers-unix": [ + "freetype2/freetype/freetype.h", + "freetype2/ft2build.h" + ], + "lib-depends": [ + "zlib" + ], + "lib-suggests": [ + "libpng", + "bzip2", + "brotli" + ] + }, + "gettext": { + "source": "gettext", + "static-libs-unix": [ + "libintl.a" + ], + "lib-depends": [ + "libiconv" + ], + "lib-suggests": [ + "ncurses", + "libxml2" + ], + "frameworks": [ + "CoreFoundation" + ] + }, + "glfw": { + "source": "ext-glfw", + "static-libs-unix": [ + "libglfw3.a" + ], + "frameworks": [ + "CoreVideo", + "OpenGL", + "Cocoa", + "IOKit" + ] + }, + "gmp": { + "source": "gmp", + "static-libs-unix": [ + "libgmp.a" + ], + "static-libs-windows": [ + "libgmp.lib" + ], + "headers": [ + "gmp.h" + ] + }, + "icu": { + "source": "icu", + "cpp-library": true, + "static-libs-unix": [ + "libicui18n.a", + "libicuio.a", + "libicuuc.a", + "libicudata.a" + ] + }, + "imagemagick": { + "source": "imagemagick", + "static-libs-unix": [ + "libMagick++-7.Q16HDRI.a", + "libMagickWand-7.Q16HDRI.a", + "libMagickCore-7.Q16HDRI.a" + ], + "lib-depends": [ + "zlib", + "libpng", + "libjpeg", + "libwebp", + "freetype", + "libtiff" + ], + "lib-suggests": [ + "zstd", + "xz", + "bzip2", + "libzip", + "libxml2" + ] + }, + "imap": { + "source": "imap", + "static-libs-unix": [ + "libc-client.a" + ], + "lib-suggests": [ + "openssl" + ] + }, + "ldap": { + "source": "ldap", + "static-libs-unix": [ + "liblber.a", + "libldap.a" + ], + "lib-depends": [ + "openssl", + "zlib", + "gmp", + "libsodium" + ] + }, + "libargon2": { + "source": "libargon2", + "static-libs-unix": [ + "libargon2.a" + ] + }, + "libavif": { + "source": "libavif", + "static-libs-unix": [ + "libavif.a" + ], + "static-libs-windows": [ + "avif.lib" + ] + }, + "libcares": { + "source": "libcares", + "static-libs-unix": [ + "libcares.a" + ], + "headers-unix": [ + "ares.h", + "ares_dns.h", + "ares_nameser.h", + "ares_rules.h" + ] + }, + "libevent": { + "source": "libevent", + "static-libs-unix": [ + "libevent.a", + "libevent_core.a", + "libevent_extra.a", + "libevent_openssl.a" + ], + "lib-depends": [ + "openssl" + ] + }, + "libffi": { + "source": "libffi", + "static-libs-unix": [ + "libffi.a" + ], + "static-libs-windows": [ + "libffi.lib" + ], + "headers-unix": [ + "ffi.h", + "ffitarget.h" + ], + "headers-windows": [ + "ffi.h", + "fficonfig.h", + "ffitarget.h" + ] + }, + "libffi-win": { + "source": "libffi-win", + "static-libs-windows": [ + "libffi.lib" + ], + "headers-windows": [ + "ffi.h", + "ffitarget.h", + "fficonfig.h" + ] + }, + "libiconv": { + "source": "libiconv", + "static-libs-unix": [ + "libiconv.a", + "libcharset.a" + ], + "headers": [ + "iconv.h", + "libcharset.h", + "localcharset.h" + ] + }, + "libiconv-win": { + "source": "libiconv-win", + "static-libs-windows": [ + "libiconv.lib", + "libiconv_a.lib" + ] + }, + "libjpeg": { + "source": "libjpeg", + "static-libs-unix": [ + "libjpeg.a", + "libturbojpeg.a" + ], + "static-libs-windows": [ + "libjpeg_a.lib" + ], + "lib-suggests-windows": [ + "zlib" + ] + }, + "liblz4": { + "source": "liblz4", + "static-libs-unix": [ + "liblz4.a" + ] + }, + "libmemcached": { + "source": "libmemcached", + "static-libs-unix": [ + "libmemcached.a", + "libmemcachedutil.a" + ] + }, + "libpng": { + "source": "libpng", + "static-libs-unix": [ + "libpng16.a" + ], + "static-libs-windows": [ + "libpng16_static.lib", + "libpng_a.lib" + ], + "headers-unix": [ + "png.h", + "pngconf.h", + "pnglibconf.h" + ], + "headers-windows": [ + "png.h", + "pngconf.h" + ], + "lib-depends": [ + "zlib" + ] + }, + "librabbitmq": { + "source": "librabbitmq", + "static-libs-unix": [ + "librabbitmq.a" + ], + "static-libs-windows": [ + "rabbitmq.4.lib" + ], + "lib-depends": [ + "openssl" + ] + }, + "libsodium": { + "source": "libsodium", + "static-libs-unix": [ + "libsodium.a" + ] + }, + "libssh2": { + "source": "libssh2", + "static-libs-unix": [ + "libssh2.a" + ], + "static-libs-windows": [ + "libssh2.lib" + ], + "headers": [ + "libssh2.h", + "libssh2_publickey.h", + "libssh2_sftp.h" + ], + "lib-depends": [ + "openssl" + ], + "lib-suggests": [ + "zlib" + ] + }, + "libtiff": { + "source": "libtiff", + "static-libs-unix": [ + "libtiff.a" + ] + }, + "libuuid": { + "source": "libuuid", + "static-libs-unix": [ + "libuuid.a" + ], + "headers": [ + "uuid/uuid.h" + ] + }, + "libuv": { + "source": "libuv", + "static-libs-unix": [ + "libuv.a" + ] + }, + "libwebp": { + "source": "libwebp", + "static-libs-unix": [ + "libwebp.a", + "libwebpdecoder.a", + "libwebpdemux.a", + "libwebpmux.a", + "libsharpyuv.a" + ], + "static-libs-windows": [ + "libwebp.lib", + "libwebpdecoder.lib", + "libwebpdemux.lib", + "libsharpyuv.lib" + ] + }, + "libxml2": { + "source": "libxml2", + "static-libs-unix": [ + "libxml2.a" + ], + "static-libs-windows": [ + "libxml2s.lib", + "libxml2_a.lib" + ], + "headers": [ + "libxml2" + ], + "lib-depends-unix": [ + "libiconv" + ], + "lib-suggests-unix": [ + "xz", + "icu", + "zlib" + ], + "lib-depends-windows": [ + "libiconv-win" + ], + "lib-suggests-windows": [ + "zlib" + ] + }, + "libxslt": { + "source": "libxslt", + "static-libs-unix": [ + "libxslt.a", + "libexslt.a" + ], + "lib-depends": [ + "libxml2" + ] + }, + "libyaml": { + "source": "libyaml", + "static-libs-unix": [ + "libyaml.a" + ], + "static-libs-windows": [ + "yaml.lib" + ], + "headers": [ + "yaml.h" + ] + }, + "libzip": { + "source": "libzip", + "static-libs-unix": [ + "libzip.a" + ], + "static-libs-windows": [ + [ + "zip.lib", + "libzip_a.lib" + ] + ], + "headers": [ + "zip.h", + "zipconf.h" + ], + "lib-depends": [ + "zlib" + ], + "lib-suggests": [ + "bzip2", + "xz", + "zstd", + "openssl" + ] + }, + "ncurses": { + "source": "ncurses", + "static-libs-unix": [ + "libncurses.a" + ] + }, + "nghttp2": { + "source": "nghttp2", + "static-libs-unix": [ + "libnghttp2.a" + ], + "static-libs-windows": [ + "nghttp2.lib" + ], + "headers": [ + "nghttp2" + ], + "lib-depends": [ + "zlib", + "openssl" + ], + "lib-suggests": [ + "libxml2" + ] + }, + "onig": { + "source": "onig", + "static-libs-unix": [ + "libonig.a" + ], + "static-libs-windows": [ + "onig.lib", + "onig_a.lib" + ], + "headers": [ + "oniggnu.h", + "oniguruma.h" + ] + }, + "openssl": { + "source": "openssl", + "static-libs-unix": [ + "libssl.a", + "libcrypto.a" + ], + "static-libs-windows": [ + "libssl.lib", + "libcrypto.lib" + ], + "headers": [ + "openssl" + ], + "lib-depends": [ + "zlib" + ] + }, + "pkg-config": { + "source": "pkg-config" + }, + "postgresql": { + "source": "postgresql", + "static-libs-unix": [ + "libpq.a", + "libpgport.a", + "libpgcommon.a" + ], + "lib-depends": [ + "libiconv", + "libxml2", + "openssl", + "zlib", + "readline" + ], + "lib-suggests": [ + "icu", + "libxslt", + "ldap", + "zstd" + ] + }, + "pthreads4w": { + "source": "pthreads4w", + "static-libs-windows": [ + "libpthreadVC3.lib" + ] + }, + "qdbm": { + "source": "qdbm", + "static-libs-unix": [ + "libqdbm.a" + ], + "static-libs-windows": [ + "qdbm_a.lib" + ], + "headers-windows": [ + "depot.h" + ] + }, + "readline": { + "source": "readline", + "static-libs-unix": [ + "libreadline.a" + ], + "lib-depends": [ + "ncurses" + ] + }, + "snappy": { + "source": "snappy", + "static-libs-unix": [ + "libsnappy.a" + ], + "headers-unix": [ + "snappy.h", + "snappy-c.h", + "snappy-sinksource.h", + "snappy-stubs-public.h" + ], + "lib-depends": [ + "zlib" + ] + }, + "sqlite": { + "source": "sqlite", + "static-libs-unix": [ + "libsqlite3.a" + ], + "static-libs-windows": [ + "libsqlite3_a.lib" + ], + "headers": [ + "sqlite3.h", + "sqlite3ext.h" + ] + }, + "tidy": { + "source": "tidy", + "static-libs-unix": [ + "libtidy.a" + ] + }, + "unixodbc": { + "source": "unixodbc", + "static-libs-unix": [ + "libodbc.a", + "libodbccr.a", + "libodbcinst.a" + ], + "lib-depends": [ + "libiconv" + ] + }, + "xz": { + "source": "xz", + "static-libs-unix": [ + "liblzma.a" + ], + "static-libs-windows": [ + [ + "liblzma.lib", + "liblzma_a.lib" + ] + ], + "headers-unix": [ + "lzma" + ], + "headers-windows": [ + "lzma", + "lzma.h" + ], + "lib-depends": [ + "libiconv" + ] + }, + "zlib": { + "source": "zlib", + "static-libs-unix": [ + "libz.a" + ], + "static-libs-windows": [ + "zlib_a.lib" + ], + "headers": [ + "zlib.h", + "zconf.h" + ] + }, + "zstd": { + "source": "zstd", + "static-libs-unix": [ + "libzstd.a" + ], + "static-libs-windows": [ + [ + "zstd.lib", + "zstd_static.lib" + ] + ], + "headers-unix": [ + "zdict.h", + "zstd.h", + "zstd_errors.h" + ], + "headers-windows": [ + "zstd.h", + "zstd_errors.h" + ] + } +} diff --git a/src/SPC/builder/windows/SystemUtil.php b/src/SPC/builder/windows/SystemUtil.php index 668e60b12..e1794f940 100644 --- a/src/SPC/builder/windows/SystemUtil.php +++ b/src/SPC/builder/windows/SystemUtil.php @@ -90,6 +90,7 @@ public static function makeCmakeToolchainFile(?string $cflags = null, ?string $l $buildroot = str_replace('\\', '\\\\', BUILD_ROOT_PATH); $toolchain = <<source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + // freetype.lib to libfreetype_a.lib + copy(BUILD_LIB_PATH . '\freetype.lib', BUILD_LIB_PATH . '\libfreetype_a.lib'); + } +} diff --git a/src/SPC/builder/windows/library/libavif.php b/src/SPC/builder/windows/library/libavif.php new file mode 100644 index 000000000..6c66fb242 --- /dev/null +++ b/src/SPC/builder/windows/library/libavif.php @@ -0,0 +1,38 @@ +source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DAVIF_BUILD_APPS=OFF ' . + '-DAVIF_BUILD_TESTS=OFF ' . + '-DAVID_ENABLE_GTEST=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + + } +} diff --git a/src/SPC/builder/windows/library/libjpeg.php b/src/SPC/builder/windows/library/libjpeg.php new file mode 100644 index 000000000..d7ac718cd --- /dev/null +++ b/src/SPC/builder/windows/library/libjpeg.php @@ -0,0 +1,41 @@ +builder->getLib('zlib') ? 'ON' : 'OFF'; + // reset cmake + FileSystem::resetDir($this->source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DENABLE_SHARED=OFF ' . + '-DENABLE_STATIC=ON ' . + '-DBUILD_TESTING=OFF ' . + '-DWITH_JAVA=OFF ' . + '-DWITH_CRT_DLL=OFF ' . + "-DENABLE_ZLIB_COMPRESSION={$zlib} " . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + copy(BUILD_LIB_PATH . '\jpeg-static.lib', BUILD_LIB_PATH . '\libjpeg_a.lib'); + } +} diff --git a/src/SPC/builder/windows/library/libpng.php b/src/SPC/builder/windows/library/libpng.php new file mode 100644 index 000000000..a722fa79e --- /dev/null +++ b/src/SPC/builder/windows/library/libpng.php @@ -0,0 +1,40 @@ +source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DSKIP_INSTALL_PROGRAM=ON ' . + '-DSKIP_INSTALL_FILES=ON ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DPNG_STATIC=ON ' . + '-DPNG_SHARED=OFF ' . + '-DPNG_TESTS=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + copy(BUILD_LIB_PATH . '\libpng16_static.lib', BUILD_LIB_PATH . '\libpng_a.lib'); + } +} diff --git a/src/SPC/builder/windows/library/libwebp.php b/src/SPC/builder/windows/library/libwebp.php new file mode 100644 index 000000000..24f2b3e7d --- /dev/null +++ b/src/SPC/builder/windows/library/libwebp.php @@ -0,0 +1,46 @@ +source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DWEBP_LINK_STATIC=ON ' . + '-DWEBP_BUILD_ANIM_UTILS=OFF ' . + '-DWEBP_BUILD_CWEBP=OFF ' . + '-DWEBP_BUILD_DWEBP=OFF ' . + '-DWEBP_BUILD_GIF2WEBP=OFF ' . + '-DWEBP_BUILD_IMG2WEBP=OFF ' . + '-DWEBP_BUILD_VWEBP=OFF ' . + '-DWEBP_BUILD_WEBPINFO=OFF ' . + '-DWEBP_BUILD_LIBWEBPMUX=OFF ' . + '-DWEBP_BUILD_WEBPMUX=OFF ' . + '-DWEBP_BUILD_EXTRAS=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + + } +} diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index 6750f899c..5b0bf13a4 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -19,6 +19,7 @@ public static function init(): void FileSystem::addSourceExtractHook('openssl', [SourcePatcher::class, 'patchOpenssl11Darwin']); FileSystem::addSourceExtractHook('swoole', [SourcePatcher::class, 'patchSwoole']); FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchPhpLibxml212']); + FileSystem::addSourceExtractHook('php-src', [SourcePatcher::class, 'patchGDWin32']); } /** @@ -359,6 +360,22 @@ public static function patchPhpLibxml212(): bool return false; } + public static function patchGDWin32(): bool + { + $file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h'); + if (preg_match('/PHP_VERSION_ID (\d+)/', $file, $match) !== 0) { + $ver_id = intval($match[1]); + if ($ver_id < 80200) { + // see: https://github.com/php/php-src/commit/243966177e39eb71822935042c3f13fa6c5b9eed + FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gd/libgd/gdft.c', '#ifndef MSWIN32', '#ifndef _WIN32'); + } + } + // custom config.w32, because official config.w32 is hard-coded many things + $origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config.w32'); + file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32.bak', file_get_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32')); + return file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32', $origin) !== false; + } + /** * Add additional `static-php-cli.version` ini value for PHP source. * diff --git a/src/globals/extra/gd_config.w32 b/src/globals/extra/gd_config.w32 new file mode 100644 index 000000000..528de3194 --- /dev/null +++ b/src/globals/extra/gd_config.w32 @@ -0,0 +1,94 @@ +// vim:ft=javascript + +ARG_WITH("gd", "Bundled GD support", "yes"); + +if (PHP_GD != "no") { + // check for gd.h (required) + if (!CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd")) { + ERROR("gd not enabled; libraries and headers not found"); + } + + // zlib ext support (required) + if (!CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD)) { + ERROR("gd not enabled; zlib not enabled"); + } + + // libjpeg lib support + if (CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("jpeglib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include")) { + AC_DEFINE("HAVE_LIBJPEG", 1, "JPEG support"); + AC_DEFINE("HAVE_GD_JPG", 1, "JPEG support"); + } + + // libpng16 lib support + if (CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16")) { + AC_DEFINE("HAVE_LIBPNG", 1, "PNG support"); + AC_DEFINE("HAVE_GD_PNG", 1, "PNG support"); + } + + // freetype lib support + if (CHECK_LIB("libfreetype_a.lib;libfreetype.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype")) { + AC_DEFINE("HAVE_LIBFREETYPE", 1, "FreeType support"); + AC_DEFINE("HAVE_GD_FREETYPE", 1, "FreeType support"); + } + + // xpm lib support + if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")) { + AC_DEFINE("HAVE_LIBXPM", 1, "XPM support"); + AC_DEFINE("HAVE_GD_XPM", 1, "XPM support"); + } + + // iconv lib support + if ((CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && + CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD)) { + AC_DEFINE("HAVE_LIBICONV", 1, "Iconv support"); + } + + // libwebp lib support + if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) && + CHECK_LIB("libsharpyuv.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") && + CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) { + AC_DEFINE("HAVE_LIBWEBP", 1, "WebP support"); + AC_DEFINE("HAVE_GD_WEBP", 1, "WebP support"); + } + + // libavif lib support + if (CHECK_LIB("avif_a.lib", "gd", PHP_GD) && + CHECK_LIB("aom_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) { + ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF"); + } else if (CHECK_LIB("avif.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) { + ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF"); + } + + CHECK_LIB("User32.lib", "gd", PHP_GD); + CHECK_LIB("Gdi32.lib", "gd", PHP_GD); + + EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd"); + ADD_SOURCES("ext/gd/libgd", "gd.c \ + gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ + gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \ + gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \ + gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \ + gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \ + gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd"); + + AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); + AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD"); + AC_DEFINE('HAVE_GD_BMP', 1, "BMP support"); + AC_DEFINE('HAVE_GD_TGA', 1, "TGA support"); + ADD_FLAG("CFLAGS_GD", " \ +/D PHP_GD_EXPORTS=1 \ +/D HAVE_GD_GET_INTERPOLATION \ + "); + if (ICC_TOOLSET) { + ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt"); + } + + PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd"); +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 69260524d..d49365bac 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -19,14 +19,14 @@ // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'imagick,gmp', - 'Windows' => 'mbstring,pdo_sqlite,mbregex', + 'Linux', 'Darwin' => 'sockets', + 'Windows' => 'mbstring,pdo_sqlite,mbregex,gd', }; // If you want to test lib-suggests feature with extension, add them below (comma separated, example `libwebp,libavif`). $with_libs = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'libtiff', - 'Windows' => '', + 'Linux', 'Darwin' => '', + 'Windows' => 'libjpeg,libwebp,libavif,freetype', }; // Please change your test base combination. We recommend testing with `common`. From f9582e378ae2b5b2d445725a5ae7b3750ccc008e Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 26 Jun 2024 20:01:46 +0800 Subject: [PATCH 2/3] cs fix --- src/SPC/builder/windows/library/libavif.php | 1 - src/SPC/builder/windows/library/libwebp.php | 1 - 2 files changed, 2 deletions(-) diff --git a/src/SPC/builder/windows/library/libavif.php b/src/SPC/builder/windows/library/libavif.php index 6c66fb242..0b8390741 100644 --- a/src/SPC/builder/windows/library/libavif.php +++ b/src/SPC/builder/windows/library/libavif.php @@ -33,6 +33,5 @@ protected function build(): void $this->builder->makeSimpleWrapper('cmake'), "--build build --config Release --target install -j{$this->builder->concurrency}" ); - } } diff --git a/src/SPC/builder/windows/library/libwebp.php b/src/SPC/builder/windows/library/libwebp.php index 24f2b3e7d..c09b76d62 100644 --- a/src/SPC/builder/windows/library/libwebp.php +++ b/src/SPC/builder/windows/library/libwebp.php @@ -41,6 +41,5 @@ protected function build(): void $this->builder->makeSimpleWrapper('cmake'), "--build build --config Release --target install -j{$this->builder->concurrency}" ); - } } From dd3fe662e7d34a97d685ced9d83fb8911b43a3e6 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Wed, 26 Jun 2024 20:16:45 +0800 Subject: [PATCH 3/3] Fix PHP 8.0 gd build --- src/SPC/store/SourcePatcher.php | 9 +- src/globals/extra/gd_config_80.w32 | 86 +++++++++++++++++++ .../extra/{gd_config.w32 => gd_config_81.w32} | 0 3 files changed, 91 insertions(+), 4 deletions(-) create mode 100644 src/globals/extra/gd_config_80.w32 rename src/globals/extra/{gd_config.w32 => gd_config_81.w32} (100%) diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index 5b0bf13a4..962386193 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -369,11 +369,12 @@ public static function patchGDWin32(): bool // see: https://github.com/php/php-src/commit/243966177e39eb71822935042c3f13fa6c5b9eed FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gd/libgd/gdft.c', '#ifndef MSWIN32', '#ifndef _WIN32'); } + // custom config.w32, because official config.w32 is hard-coded many things + $origin = $ver_id >= 80100 ? file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_81.w32') : file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_80.w32'); + file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32.bak', file_get_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32')); + return file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32', $origin) !== false; } - // custom config.w32, because official config.w32 is hard-coded many things - $origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config.w32'); - file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32.bak', file_get_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32')); - return file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32', $origin) !== false; + return false; } /** diff --git a/src/globals/extra/gd_config_80.w32 b/src/globals/extra/gd_config_80.w32 new file mode 100644 index 000000000..ea7582b86 --- /dev/null +++ b/src/globals/extra/gd_config_80.w32 @@ -0,0 +1,86 @@ +// vim:ft=javascript + +ARG_WITH("gd", "Bundled GD support", "yes"); + +if (PHP_GD != "no") { + // check for gd.h (required) + if (!CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd")) { + ERROR("gd not enabled; libraries and headers not found"); + } + + // zlib ext support (required) + if (!CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD)) { + ERROR("gd not enabled; zlib not enabled"); + } + + // libjpeg lib support + if (CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("jpeglib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include")) { + AC_DEFINE("HAVE_LIBJPEG", 1, "JPEG support"); + AC_DEFINE("HAVE_GD_JPG", 1, "JPEG support"); + } + + // libpng16 lib support + if (CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16")) { + AC_DEFINE("HAVE_LIBPNG", 1, "PNG support"); + AC_DEFINE("HAVE_GD_PNG", 1, "PNG support"); + } + + // freetype lib support + if (CHECK_LIB("libfreetype_a.lib;libfreetype.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype")) { + AC_DEFINE("HAVE_LIBFREETYPE", 1, "FreeType support"); + AC_DEFINE("HAVE_GD_FREETYPE", 1, "FreeType support"); + } + + // xpm lib support + if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")) { + AC_DEFINE("HAVE_LIBXPM", 1, "XPM support"); + AC_DEFINE("HAVE_GD_XPM", 1, "XPM support"); + } + + // iconv lib support + if ((CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && + CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD)) { + AC_DEFINE("HAVE_LIBICONV", 1, "Iconv support"); + } + + // libwebp lib support + if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) && + CHECK_LIB("libsharpyuv.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") && + CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) { + AC_DEFINE("HAVE_LIBWEBP", 1, "WebP support"); + AC_DEFINE("HAVE_GD_WEBP", 1, "WebP support"); + } + + // libavif lib is not supported on php <= 8.0 + + CHECK_LIB("User32.lib", "gd", PHP_GD); + CHECK_LIB("Gdi32.lib", "gd", PHP_GD); + + EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd"); + ADD_SOURCES("ext/gd/libgd", "gd.c \ + gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ + gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \ + gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \ + gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \ + gd_filter.c gd_pixelate.c gd_rotate.c gd_color_match.c gd_webp.c \ + gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd"); + + AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); + AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD"); + AC_DEFINE('HAVE_GD_BMP', 1, "BMP support"); + AC_DEFINE('HAVE_GD_TGA', 1, "TGA support"); + ADD_FLAG("CFLAGS_GD", " \ +/D PHP_GD_EXPORTS=1 \ +/D HAVE_GD_GET_INTERPOLATION \ + "); + if (ICC_TOOLSET) { + ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt"); + } + + PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd"); +} diff --git a/src/globals/extra/gd_config.w32 b/src/globals/extra/gd_config_81.w32 similarity index 100% rename from src/globals/extra/gd_config.w32 rename to src/globals/extra/gd_config_81.w32