diff --git a/config/lib.json b/config/lib.json index bfe6ec6c9..18f712446 100644 --- a/config/lib.json +++ b/config/lib.json @@ -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": [ @@ -454,11 +469,5 @@ "zstd.h", "zstd_errors.h" ] - }, - "libsodium": { - "source": "libsodium", - "static-libs-unix": [ - "libsodium.a" - ] } } \ No newline at end of file diff --git a/config/source.json b/config/source.json index d74fd4963..a5ede6209 100644 --- a/config/source.json +++ b/config/source.json @@ -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", @@ -411,13 +427,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" - } } } \ No newline at end of file diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index b8d8757de..8aee51ce7 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -139,7 +139,7 @@ public function buildPHP(int $build_target = BUILD_TARGET_NONE, bool $with_clean ) ); } - if ($this->getExt('swoole')) { + if ($this->getExt('swoole') || $this->getExt('intl')) { $extra_libs .= ' -lstdc++'; } if ($this->getExt('imagick')) { diff --git a/src/SPC/builder/linux/library/icu.php b/src/SPC/builder/linux/library/icu.php new file mode 100644 index 000000000..c6ef6c375 --- /dev/null +++ b/src/SPC/builder/linux/library/icu.php @@ -0,0 +1,34 @@ +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'); + } +} diff --git a/src/SPC/builder/macos/MacOSBuilder.php b/src/SPC/builder/macos/MacOSBuilder.php index cb7f9f562..65b1a7f6b 100644 --- a/src/SPC/builder/macos/MacOSBuilder.php +++ b/src/SPC/builder/macos/MacOSBuilder.php @@ -123,7 +123,7 @@ public function getFrameworks(bool $asString = false): array|string */ 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 { diff --git a/src/SPC/builder/macos/library/icu.php b/src/SPC/builder/macos/library/icu.php new file mode 100644 index 000000000..dd7967a17 --- /dev/null +++ b/src/SPC/builder/macos/library/icu.php @@ -0,0 +1,20 @@ +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'); + } +} diff --git a/src/globals/tests/intl.php b/src/globals/tests/intl.php new file mode 100644 index 000000000..32ccd5680 --- /dev/null +++ b/src/globals/tests/intl.php @@ -0,0 +1,5 @@ +