Compare commits

...

9 Commits

Author SHA1 Message Date
crazywhalecc
b2f3ffcc00
fix xml and intl depend order 2023-06-02 23:00:48 +08:00
crazywhalecc
aa9ec6e50e
add xlswriter support 2023-06-02 21:40:17 +08:00
crazywhalecc
dcb3d91610
update ext-support.md 2023-06-02 21:39:32 +08:00
crazywhalecc
9e71a98eda
fix enable-zts option error on build:libs command 2023-06-02 21:19:17 +08:00
Jerry Ma
f2ef783b13
Merge pull request #67 from mpociot/intl-support
Add intl/ICU support
2023-06-02 21:12:53 +08:00
crazywhalecc
874e104570
sort config and change icu libs order 2023-06-02 20:27:25 +08:00
crazywhalecc
1398086c38
add icu configure options for linux 2023-06-02 20:26:19 +08:00
Marcel Pociot
db1586e2ec Remove empty headers array 2023-06-02 11:52:27 +02:00
Marcel Pociot
1158931d91 Add intl/ICU support 2023-06-02 11:47:11 +02:00
11 changed files with 192 additions and 79 deletions

View File

@ -367,6 +367,15 @@
"tokenizer": {
"type": "builtin"
},
"xlswriter": {
"type": "external",
"source": "xlswriter",
"arg-type": "custom",
"ext-depends": [
"zlib",
"zip"
]
},
"xml": {
"type": "builtin",
"arg-type": "custom",

View File

@ -96,6 +96,15 @@
"gmp.h"
]
},
"icu": {
"source": "icu",
"static-libs-unix": [
"libicui18n.a",
"libicuio.a",
"libicuuc.a",
"libicudata.a"
]
},
"imagemagick": {
"source": "imagemagick",
"static-libs-unix": [
@ -200,6 +209,12 @@
"zlib"
]
},
"libsodium": {
"source": "libsodium",
"static-libs-unix": [
"libsodium.a"
]
},
"libssh2": {
"source": "libssh2",
"static-libs-unix": [
@ -249,7 +264,8 @@
],
"lib-suggests": [
"xz",
"zlib"
"zlib",
"icu"
],
"lib-suggests-windows": [
"icu",
@ -454,11 +470,5 @@
"zstd.h",
"zstd_errors.h"
]
},
"libsodium": {
"source": "libsodium",
"static-libs-unix": [
"libsodium.a"
]
}
}

View File

@ -99,6 +99,14 @@
"text": "Since version 6, GMP is distributed under the dual licenses, GNU LGPL v3 and GNU GPL v2. These licenses make the library free to use, share, and improve, and allow you to pass on the result. The GNU licenses give freedoms, but also set firm restrictions on the use with non-free programs."
}
},
"icu": {
"type": "url",
"url": "https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"imagemagick": {
"type": "ghtar",
"repo": "ImageMagick/ImageMagick",
@ -186,6 +194,14 @@
"path": "COPYING"
}
},
"libsodium": {
"type": "url",
"url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"libssh2": {
"type": "ghrel",
"repo": "libssh2/libssh2",
@ -375,6 +391,16 @@
"path": "LICENSE"
}
},
"xlswriter": {
"type": "url",
"url": "http://pecl.php.net/get/xlswriter",
"path": "php-src/ext/xlswriter",
"filename": "xlswriter.tgz",
"license": {
"type": "file",
"path": "LICENSE"
}
},
"xz": {
"type": "filelist",
"url": "https://tukaani.org/xz/",
@ -411,13 +437,5 @@
"type": "file",
"path": "LICENSE"
}
},
"libsodium": {
"type": "url",
"url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz",
"license": {
"type": "file",
"path": "LICENSE"
}
}
}

View File

@ -6,66 +6,66 @@
> - no with issue link: not supported yet due to issue
> - partial with issue link: supported but not perfect due to issue
| | Linux | macOS | Windows |
|------------|---------------------------------------------------------------------|----------------------------------------------------------------|---------|
| apcu | yes, untested | yes, untested | |
| bcmath | yes | yes | |
| bz2 | yes | yes | |
| calendar | yes | yes | |
| ctype | yes | yes | |
| curl | yes | yes | |
| dba | yes | yes | |
| dom | yes | yes | |
| enchant | | | |
| event | yes | yes | |
| exif | yes | yes | |
| ffi | | yes, [docs]() | |
| filter | yes | yes | |
| fileinfo | yes | yes | |
| ftp | yes | yes | |
| gd | yes | yes | |
| gettext | | | |
| gmp | yes | yes | |
| iconv | yes | yes | |
| imagick | yes | yes | |
| inotify | yes | yes | |
| intl | | | |
| mbstring | yes | yes | |
| mbregex | yes | yes | |
| mcrypt | | [no](https://github.com/crazywhalecc/static-php-cli/issues/32) | |
| mongodb | yes | yes | |
| mysqli | yes | yes | |
| mysqlnd | yes | yes | |
| openssl | yes | yes | |
| password-argon2 | | | |
| pcntl | yes | yes | |
| pdo | yes | yes | |
| pdo_mysql | yes | yes | |
| pdo_sqlite | yes | yes | |
| pdo_pgsql | | | |
| phar | yes | yes | |
| posix | yes | yes | |
| protobuf | yes | yes | |
| readline | yes, untested | yes, untested | |
| redis | yes | yes | |
| session | yes | yes | |
| shmop | yes | yes | |
| simplexml | yes | yes | |
| soap | yes | yes | |
| sockets | yes | yes | |
| sodium | yes | yes | |
| sqlite3 | yes | yes | |
| ssh2 | yes, untested | yes, untested | |
| swow | yes | yes | |
| swoole | [partial](https://github.com/crazywhalecc/static-php-cli/issues/51) | yes | |
| tokenizer | yes | yes | |
| xlswriter | | | |
| xml | yes | yes | |
| xmlreader | yes, untested | yes, untested | |
| xmlwriter | yes, untested | yes, untested | |
| zip | yes, untested | yes, untested | |
| zlib | yes | yes | |
| zstd | yes | yes | |
| | Linux | macOS | Windows |
|-----------------|---------------------------------------------------------------------|----------------------------------------------------------------|---------|
| apcu | yes, untested | yes, untested | |
| bcmath | yes | yes | |
| bz2 | yes | yes | |
| calendar | yes | yes | |
| ctype | yes | yes | |
| curl | yes | yes | |
| dba | yes | yes | |
| dom | yes | yes | |
| enchant | | | |
| event | yes | yes | |
| exif | yes | yes | |
| ffi | | yes, [docs]() | |
| filter | yes | yes | |
| fileinfo | yes | yes | |
| ftp | yes | yes | |
| gd | yes | yes | |
| gettext | | | |
| gmp | yes | yes | |
| iconv | yes | yes | |
| imagick | yes | yes | |
| inotify | yes | yes | |
| intl | [partial](https://github.com/crazywhalecc/static-php-cli/issues/66) | yes | |
| mbstring | yes | yes | |
| mbregex | yes | yes | |
| mcrypt | | [no](https://github.com/crazywhalecc/static-php-cli/issues/32) | |
| mongodb | yes | yes | |
| mysqli | yes | yes | |
| mysqlnd | yes | yes | |
| openssl | yes | yes | |
| password-argon2 | | | |
| pcntl | yes | yes | |
| pdo | yes | yes | |
| pdo_mysql | yes | yes | |
| pdo_sqlite | yes | yes | |
| pdo_pgsql | | | |
| phar | yes | yes | |
| posix | yes | yes | |
| protobuf | yes | yes | |
| readline | yes, untested | yes, untested | |
| redis | yes | yes | |
| session | yes | yes | |
| shmop | yes | yes | |
| simplexml | yes | yes | |
| soap | yes | yes | |
| sockets | yes | yes | |
| sodium | yes | yes | |
| sqlite3 | yes | yes | |
| ssh2 | yes, untested | yes, untested | |
| swow | yes | yes | |
| swoole | [partial](https://github.com/crazywhalecc/static-php-cli/issues/51) | yes | |
| tokenizer | yes | yes | |
| xlswriter | yes | yes | |
| xml | yes | yes | |
| xmlreader | yes, untested | yes, untested | |
| xmlwriter | yes, untested | yes, untested | |
| zip | yes, untested | yes, untested | |
| zlib | yes | yes | |
| zstd | yes | yes | |
## Additional Requirements

View File

@ -31,13 +31,13 @@ class BuilderProvider
cc: $input->getOption('cc'),
cxx: $input->getOption('cxx'),
arch: $input->getOption('arch'),
zts: $input->getOption('enable-zts'),
zts: $input->hasOption('enable-zts') ? $input->getOption('enable-zts') : false,
),
'Linux' => new LinuxBuilder(
cc: $input->getOption('cc'),
cxx: $input->getOption('cxx'),
arch: $input->getOption('arch'),
zts: $input->getOption('enable-zts'),
zts: $input->hasOption('enable-zts') ? $input->getOption('enable-zts') : false,
),
default => throw new WrongUsageException('Current OS "' . PHP_OS_FAMILY . '" is not supported yet'),
};

View File

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace SPC\builder\extension;
use SPC\builder\Extension;
use SPC\util\CustomExt;
#[CustomExt('xlswriter')]
class xlswriter extends Extension
{
public function getUnixConfigureArg(): string
{
return '--with-xlswriter --enable-reader';
}
}

View File

@ -139,7 +139,7 @@ class LinuxBuilder extends BuilderBase
)
);
}
if ($this->getExt('swoole')) {
if ($this->getExt('swoole') || $this->getExt('intl')) {
$extra_libs .= ' -lstdc++';
}
if ($this->getExt('imagick')) {

View File

@ -0,0 +1,34 @@
<?php
declare(strict_types=1);
namespace SPC\builder\linux\library;
class icu extends LinuxLibraryBase
{
public const NAME = 'icu';
protected function build()
{
$root = BUILD_ROOT_PATH;
$cppflag = 'CPPFLAGS="-DU_CHARSET_IS_UTF8=1 -DU_USING_ICU_NAMESPACE=1 -DU_STATIC_IMPLEMENTATION=1"';
shell()->cd($this->source_dir . '/source')
->exec(
"{$this->builder->configure_env} {$cppflag} ./runConfigureICU Linux " .
'--enable-static ' .
'--disable-shared ' .
'--with-data-packaging=static ' .
'--enable-release=yes ' .
'--enable-extras=yes ' .
'--enable-icuio=yes ' .
'--enable-dyload=no ' .
'--enable-tools=yes ' .
'--enable-tests=no ' .
'--enable-samples=no ' .
"--prefix={$root}"
)
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec('make install');
}
}

View File

@ -123,7 +123,7 @@ class MacOSBuilder extends BuilderBase
*/
public function buildPHP(int $build_target = BUILD_TARGET_NONE, bool $bloat = false): void
{
$extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') ? '-lc++ ' : '');
$extra_libs = $this->getFrameworks(true) . ' ' . ($this->getExt('swoole') || $this->getExt('intl') ? '-lc++ ' : '');
if (!$bloat) {
$extra_libs .= implode(' ', $this->getAllStaticLibFiles());
} else {

View File

@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace SPC\builder\macos\library;
class icu extends MacOSLibraryBase
{
public const NAME = 'icu';
protected function build()
{
$root = BUILD_ROOT_PATH;
shell()->cd($this->source_dir . '/source')
->exec("{$this->builder->configure_env} ./runConfigureICU MacOSX --enable-static --disable-shared --prefix={$root}")
->exec('make clean')
->exec("make -j{$this->builder->concurrency}")
->exec('make install');
}
}

View File

@ -0,0 +1,5 @@
<?php
declare(strict_types=1);
assert(class_exists(NumberFormatter::class));