mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-09 18:05:36 +08:00
Compare commits
32 Commits
2.0-rc9
...
6b8df97282
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6b8df97282 | ||
|
|
584f96484c | ||
|
|
e1e5515694 | ||
|
|
d3ff6fd8c0 | ||
|
|
6bcda6a5a0 | ||
|
|
3828ba7c77 | ||
|
|
a632caed54 | ||
|
|
1e0265e673 | ||
|
|
a39cd9a238 | ||
|
|
2d437952f2 | ||
|
|
7e5b0d6f43 | ||
|
|
cf198e0f0a | ||
|
|
248918e458 | ||
|
|
c4cfc01b88 | ||
|
|
339c03adb2 | ||
|
|
48551cc602 | ||
|
|
e0550b4a45 | ||
|
|
93a55e87d5 | ||
|
|
e68f1ce3fe | ||
|
|
3573007485 | ||
|
|
b961c34d9a | ||
|
|
33e1759caa | ||
|
|
fbf5c958d0 | ||
|
|
672a4102cd | ||
|
|
52d61365b7 | ||
|
|
3604ea6d67 | ||
|
|
967292be5c | ||
|
|
4f5335bba4 | ||
|
|
0569c69634 | ||
|
|
1b734073b0 | ||
|
|
47d068e6d3 | ||
|
|
4537bfb247 |
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@@ -140,7 +140,7 @@ jobs:
|
|||||||
run: bin/spc doctor --auto-fix
|
run: bin/spc doctor --auto-fix
|
||||||
|
|
||||||
- name: "Run Build Tests (download)"
|
- name: "Run Build Tests (download)"
|
||||||
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php)" --with-php=${{ matrix.php }} --debug
|
run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php extensions)" --with-php=${{ matrix.php }} --debug
|
||||||
|
|
||||||
- name: "Run Build Tests (build)"
|
- name: "Run Build Tests (build)"
|
||||||
run: bin/spc build "$(php src/globals/test-extensions.php)" --build-cli --build-micro --build-fpm --debug
|
run: bin/spc build $(php src/globals/test-extensions.php cmd) --build-cli --build-micro --build-fpm --debug
|
||||||
|
|||||||
11
README.md
11
README.md
@@ -18,10 +18,9 @@ You can also use the micro binary file to combine php binary and php source code
|
|||||||
|
|
||||||
[]()
|
[]()
|
||||||
[]()
|
[]()
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/tests.yml)
|
||||||
[](https://github.com/crazywhalecc/static-php-cli/actions/workflows/build.yml)
|
|
||||||
|
|
||||||
[]()
|
[]([https://static-php.dev/](https://static-php.dev/en/guide/extensions.html))
|
||||||
[]()
|
[]()
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
@@ -36,9 +35,9 @@ If you don't want to compile yourself, you can download example pre-compiled art
|
|||||||
Below are several precompiled static-php binaries with different extension combinations,
|
Below are several precompiled static-php binaries with different extension combinations,
|
||||||
which can be downloaded directly according to your needs.
|
which can be downloaded directly according to your needs.
|
||||||
|
|
||||||
- [Extension-Combination - common](https://dl.static-php.dev/static-php-cli/common/): `common` combination contains about [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) commonly used extensions, and the size is about 22MB.
|
- [Extension-Combination - common](https://dl.static-php.dev/static-php-cli/common/): `common` contains about [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) commonly used extensions, and the size is about 22MB.
|
||||||
- [Extension-Combination - bulk](https://dl.static-php.dev/static-php-cli/bulk/): `bulk` combination contains [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) extensions and is about 70MB in size.
|
- [Extension-Combination - bulk](https://dl.static-php.dev/static-php-cli/bulk/): `bulk` contains [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) extensions and is about 70MB in size.
|
||||||
- [Extension-Combination - minimal](https://dl.static-php.dev/static-php-cli/minimal/): `minimal` combination contains [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) extensions and is about 6MB in size.
|
- [Extension-Combination - minimal](https://dl.static-php.dev/static-php-cli/minimal/): `minimal` contains [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) extensions and is about 6MB in size.
|
||||||
|
|
||||||
## Use static-php-cli to build PHP
|
## Use static-php-cli to build PHP
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd)
|
|||||||
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
__PROJECT__=$(cd "${__DIR__}"/../ && pwd)
|
||||||
|
|
||||||
# set download dir
|
# set download dir
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
__COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar"
|
||||||
|
|
||||||
# use china mirror
|
# use china mirror
|
||||||
@@ -46,7 +46,7 @@ done
|
|||||||
|
|
||||||
case "$mirror" in
|
case "$mirror" in
|
||||||
china)
|
china)
|
||||||
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/bulk/php-8.2.13-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz"
|
||||||
__COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar"
|
__COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,10 @@
|
|||||||
"libiconv"
|
"libiconv"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"igbinary": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "igbinary"
|
||||||
|
},
|
||||||
"imagick": {
|
"imagick": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-imagick",
|
"source": "ext-imagick",
|
||||||
@@ -242,6 +246,13 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"password-argon2": {
|
||||||
|
"type": "builtin",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libargon2"
|
||||||
|
]
|
||||||
|
},
|
||||||
"pcntl": {
|
"pcntl": {
|
||||||
"type": "builtin",
|
"type": "builtin",
|
||||||
"unix-only": true
|
"unix-only": true
|
||||||
@@ -324,7 +335,12 @@
|
|||||||
"source": "redis",
|
"source": "redis",
|
||||||
"arg-type": "custom",
|
"arg-type": "custom",
|
||||||
"ext-suggests": [
|
"ext-suggests": [
|
||||||
"session"
|
"session",
|
||||||
|
"igbinary"
|
||||||
|
],
|
||||||
|
"lib-suggests": [
|
||||||
|
"zstd",
|
||||||
|
"liblz4"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"session": {
|
"session": {
|
||||||
@@ -384,6 +400,17 @@
|
|||||||
"sqlite"
|
"sqlite"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"sqlsrv": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "sqlsrv",
|
||||||
|
"lib-depends": [
|
||||||
|
"unixodbc"
|
||||||
|
],
|
||||||
|
"cpp-extension": true,
|
||||||
|
"ext-depends-linux": [
|
||||||
|
"pcntl"
|
||||||
|
]
|
||||||
|
},
|
||||||
"ssh2": {
|
"ssh2": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "ext-ssh2",
|
"source": "ext-ssh2",
|
||||||
@@ -444,6 +471,14 @@
|
|||||||
"tokenizer": {
|
"tokenizer": {
|
||||||
"type": "builtin"
|
"type": "builtin"
|
||||||
},
|
},
|
||||||
|
"uv": {
|
||||||
|
"type": "external",
|
||||||
|
"source": "ext-uv",
|
||||||
|
"arg-type": "with-prefix",
|
||||||
|
"lib-depends": [
|
||||||
|
"libuv"
|
||||||
|
]
|
||||||
|
},
|
||||||
"xlswriter": {
|
"xlswriter": {
|
||||||
"type": "external",
|
"type": "external",
|
||||||
"source": "xlswriter",
|
"source": "xlswriter",
|
||||||
|
|||||||
@@ -163,6 +163,12 @@
|
|||||||
"libsodium"
|
"libsodium"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"libargon2": {
|
||||||
|
"source": "libargon2",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libargon2.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libavif": {
|
"libavif": {
|
||||||
"source": "libavif",
|
"source": "libavif",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -218,10 +224,10 @@
|
|||||||
"libturbojpeg.a"
|
"libturbojpeg.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libmcrypt": {
|
"liblz4": {
|
||||||
"source": "libmcrypt",
|
"source": "liblz4",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
"libmcrypt.a"
|
"liblz4.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"libmemcached": {
|
"libmemcached": {
|
||||||
@@ -278,6 +284,12 @@
|
|||||||
"zlib"
|
"zlib"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"libuv": {
|
||||||
|
"source": "libuv",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libuv.a"
|
||||||
|
]
|
||||||
|
},
|
||||||
"libwebp": {
|
"libwebp": {
|
||||||
"source": "libwebp",
|
"source": "libwebp",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -362,12 +374,6 @@
|
|||||||
"openssl"
|
"openssl"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mcrypt": {
|
|
||||||
"source": "mcrypt",
|
|
||||||
"static-libs-unix": [
|
|
||||||
"libmcrypt.a"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ncurses": {
|
"ncurses": {
|
||||||
"source": "ncurses",
|
"source": "ncurses",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
@@ -490,6 +496,17 @@
|
|||||||
"libtidy.a"
|
"libtidy.a"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"unixodbc": {
|
||||||
|
"source": "unixodbc",
|
||||||
|
"static-libs-unix": [
|
||||||
|
"libodbc.a",
|
||||||
|
"libodbccr.a",
|
||||||
|
"libodbcinst.a"
|
||||||
|
],
|
||||||
|
"lib-depends": [
|
||||||
|
"libiconv"
|
||||||
|
]
|
||||||
|
},
|
||||||
"xz": {
|
"xz": {
|
||||||
"source": "xz",
|
"source": "xz",
|
||||||
"static-libs-unix": [
|
"static-libs-unix": [
|
||||||
|
|||||||
@@ -100,6 +100,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"ext-uv": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/uv",
|
||||||
|
"path": "php-src/ext/uv",
|
||||||
|
"filename": "uv.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"ext-zstd": {
|
"ext-zstd": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"path": "php-src/ext/zstd",
|
"path": "php-src/ext/zstd",
|
||||||
@@ -136,6 +146,16 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"igbinary": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/igbinary",
|
||||||
|
"path": "php-src/ext/igbinary",
|
||||||
|
"filename": "igbinary.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"imagemagick": {
|
"imagemagick": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"repo": "ImageMagick/ImageMagick",
|
"repo": "ImageMagick/ImageMagick",
|
||||||
@@ -172,6 +192,15 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libargon2": {
|
||||||
|
"type": "git",
|
||||||
|
"rev": "master",
|
||||||
|
"url": "https://github.com/mpociot/phc-winner-argon2",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"libavif": {
|
"libavif": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"repo": "AOMediaCodec/libavif",
|
"repo": "AOMediaCodec/libavif",
|
||||||
@@ -215,12 +244,13 @@
|
|||||||
"path": "LICENSE.md"
|
"path": "LICENSE.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libmcrypt": {
|
"liblz4": {
|
||||||
"type": "url",
|
"type": "ghrel",
|
||||||
"url": "https://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz",
|
"repo": "lz4/lz4",
|
||||||
|
"match": "lz4-.+\\.tar\\.gz",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libmemcached": {
|
"libmemcached": {
|
||||||
@@ -242,8 +272,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libsodium": {
|
"libsodium": {
|
||||||
"type": "url",
|
"type": "ghrel",
|
||||||
"url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz",
|
"repo": "jedisct1/libsodium",
|
||||||
|
"match": "libsodium-\\d+(\\.\\d+)*\\.tar\\.gz",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
@@ -258,6 +289,20 @@
|
|||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"libuv": {
|
||||||
|
"type": "ghtar",
|
||||||
|
"repo": "libuv/libuv",
|
||||||
|
"license": [
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE-extra"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"libwebp": {
|
"libwebp": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz",
|
"url": "https://github.com/webmproject/libwebp/archive/refs/tags/v1.3.2.tar.gz",
|
||||||
@@ -301,14 +346,6 @@
|
|||||||
"path": "LICENSE"
|
"path": "LICENSE"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mcrypt": {
|
|
||||||
"type": "url",
|
|
||||||
"url": "https://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz",
|
|
||||||
"license": {
|
|
||||||
"type": "file",
|
|
||||||
"path": "COPYING"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"memcached": {
|
"memcached": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/memcached",
|
"url": "https://pecl.php.net/get/memcached",
|
||||||
@@ -376,9 +413,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"pkg-config": {
|
"pkg-config": {
|
||||||
"type": "filelist",
|
"type": "url",
|
||||||
"url": "https://pkgconfig.freedesktop.org/releases/",
|
"url": "https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz",
|
||||||
"regex": "/href=\"(?<file>pkg-config-(?<version>[^\"]+)\\.tar\\.gz)\"/",
|
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"path": "COPYING"
|
"path": "COPYING"
|
||||||
@@ -449,6 +485,16 @@
|
|||||||
"text": "The author disclaims copyright to this source code. In place of\na legal notice, here is a blessing:\n\n * May you do good and not evil.\n * May you find forgiveness for yourself and forgive others.\n * May you share freely, never taking more than you give."
|
"text": "The author disclaims copyright to this source code. In place of\na legal notice, here is a blessing:\n\n * May you do good and not evil.\n * May you find forgiveness for yourself and forgive others.\n * May you share freely, never taking more than you give."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"sqlsrv": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://pecl.php.net/get/sqlsrv",
|
||||||
|
"path": "php-src/ext/sqlsrv",
|
||||||
|
"filename": "sqlsrv.tgz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "LICENSE"
|
||||||
|
}
|
||||||
|
},
|
||||||
"swoole": {
|
"swoole": {
|
||||||
"type": "ghtar",
|
"type": "ghtar",
|
||||||
"path": "php-src/ext/swoole",
|
"path": "php-src/ext/swoole",
|
||||||
@@ -478,6 +524,14 @@
|
|||||||
"path": "README/LICENSE.md"
|
"path": "README/LICENSE.md"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"unixodbc": {
|
||||||
|
"type": "url",
|
||||||
|
"url": "https://www.unixodbc.org/unixODBC-2.3.12.tar.gz",
|
||||||
|
"license": {
|
||||||
|
"type": "file",
|
||||||
|
"path": "COPYING"
|
||||||
|
}
|
||||||
|
},
|
||||||
"xlswriter": {
|
"xlswriter": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://pecl.php.net/get/xlswriter",
|
"url": "https://pecl.php.net/get/xlswriter",
|
||||||
|
|||||||
21
src/SPC/builder/extension/password_argon2.php
Normal file
21
src/SPC/builder/extension/password_argon2.php
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\extension;
|
||||||
|
|
||||||
|
use SPC\builder\Extension;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
use SPC\util\CustomExt;
|
||||||
|
|
||||||
|
#[CustomExt('password-argon2')]
|
||||||
|
class password_argon2 extends Extension
|
||||||
|
{
|
||||||
|
public function runCliCheck(): void
|
||||||
|
{
|
||||||
|
[$ret] = shell()->execWithResult(BUILD_ROOT_PATH . '/bin/php -r "assert(defined(\'PASSWORD_ARGON2I\'));"');
|
||||||
|
if ($ret !== 0) {
|
||||||
|
throw new RuntimeException('extension ' . $this->getName() . ' failed sanity check');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -13,14 +13,14 @@ class redis extends Extension
|
|||||||
public function getUnixConfigureArg(): string
|
public function getUnixConfigureArg(): string
|
||||||
{
|
{
|
||||||
$arg = '--enable-redis';
|
$arg = '--enable-redis';
|
||||||
if (!$this->builder->getExt('session')) {
|
$arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session';
|
||||||
$arg .= ' --disable-redis-session';
|
$arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary';
|
||||||
} else {
|
|
||||||
$arg .= ' --enable-redis-session';
|
|
||||||
}
|
|
||||||
if ($this->builder->getLib('zstd')) {
|
if ($this->builder->getLib('zstd')) {
|
||||||
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
|
$arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"';
|
||||||
}
|
}
|
||||||
|
if ($this->builder->getLib('liblz4')) {
|
||||||
|
$arg .= ' --enable-redis-lz4 --with-liblz4="' . BUILD_ROOT_PATH . '"';
|
||||||
|
}
|
||||||
return $arg;
|
return $arg;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,6 +144,7 @@ class LinuxBuilder extends BuilderBase
|
|||||||
// prepare build php envs
|
// prepare build php envs
|
||||||
$envs_build_php = SystemUtil::makeEnvVarString([
|
$envs_build_php = SystemUtil::makeEnvVarString([
|
||||||
'CFLAGS' => $cflags,
|
'CFLAGS' => $cflags,
|
||||||
|
'CPPFLAGS' => '-I' . BUILD_INCLUDE_PATH,
|
||||||
'LIBS' => '-ldl -lpthread',
|
'LIBS' => '-ldl -lpthread',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|||||||
25
src/SPC/builder/linux/library/libargon2.php
Normal file
25
src/SPC/builder/linux/library/libargon2.php
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
use SPC\exception\WrongUsageException;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
|
||||||
|
class libargon2 extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libargon2;
|
||||||
|
|
||||||
|
public const NAME = 'libargon2';
|
||||||
|
|
||||||
|
public function patchBeforeBuild(): bool
|
||||||
|
{
|
||||||
|
// detect libsodium (The libargon2 conflicts with the libsodium library.)
|
||||||
|
if ($this->builder->getLib('libsodium') !== null) {
|
||||||
|
throw new WrongUsageException('libargon2 (required by password-argon2) conflicts with the libsodium library !');
|
||||||
|
}
|
||||||
|
FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'LIBRARY_REL ?= lib/x86_64-linux-gnu', 'LIBRARY_REL ?= lib');
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
12
src/SPC/builder/linux/library/liblz4.php
Normal file
12
src/SPC/builder/linux/library/liblz4.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class liblz4 extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\liblz4;
|
||||||
|
|
||||||
|
public const NAME = 'liblz4';
|
||||||
|
}
|
||||||
12
src/SPC/builder/linux/library/libuv.php
Normal file
12
src/SPC/builder/linux/library/libuv.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class libuv extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libuv;
|
||||||
|
|
||||||
|
public const NAME = 'libuv';
|
||||||
|
}
|
||||||
12
src/SPC/builder/linux/library/unixodbc.php
Normal file
12
src/SPC/builder/linux/library/unixodbc.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\linux\library;
|
||||||
|
|
||||||
|
class unixodbc extends LinuxLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\unixodbc;
|
||||||
|
|
||||||
|
public const NAME = 'unixodbc';
|
||||||
|
}
|
||||||
@@ -163,6 +163,7 @@ class MacOSBuilder extends BuilderBase
|
|||||||
'--enable-shared=no ' .
|
'--enable-shared=no ' .
|
||||||
'--enable-static=yes ' .
|
'--enable-static=yes ' .
|
||||||
"CFLAGS='{$this->arch_c_flags} -Werror=unknown-warning-option' " .
|
"CFLAGS='{$this->arch_c_flags} -Werror=unknown-warning-option' " .
|
||||||
|
"CPPFLAGS='-I" . BUILD_INCLUDE_PATH . "' " .
|
||||||
'--disable-all ' .
|
'--disable-all ' .
|
||||||
'--disable-cgi ' .
|
'--disable-cgi ' .
|
||||||
'--disable-phpdbg ' .
|
'--disable-phpdbg ' .
|
||||||
|
|||||||
12
src/SPC/builder/macos/library/libargon2.php
Normal file
12
src/SPC/builder/macos/library/libargon2.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class libargon2 extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libargon2;
|
||||||
|
|
||||||
|
public const NAME = 'libargon2';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/liblz4.php
Normal file
12
src/SPC/builder/macos/library/liblz4.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class liblz4 extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\liblz4;
|
||||||
|
|
||||||
|
public const NAME = 'liblz4';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/libuv.php
Normal file
12
src/SPC/builder/macos/library/libuv.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class libuv extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\libuv;
|
||||||
|
|
||||||
|
public const NAME = 'libuv';
|
||||||
|
}
|
||||||
12
src/SPC/builder/macos/library/unixodbc.php
Normal file
12
src/SPC/builder/macos/library/unixodbc.php
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\macos\library;
|
||||||
|
|
||||||
|
class unixodbc extends MacOSLibraryBase
|
||||||
|
{
|
||||||
|
use \SPC\builder\unix\library\unixodbc;
|
||||||
|
|
||||||
|
public const NAME = 'unixodbc';
|
||||||
|
}
|
||||||
26
src/SPC/builder/unix/library/libargon2.php
Normal file
26
src/SPC/builder/unix/library/libargon2.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
|
||||||
|
trait libargon2
|
||||||
|
{
|
||||||
|
protected function build()
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec("make PREFIX='' clean")
|
||||||
|
->exec("make -j{$this->builder->concurrency} PREFIX=''")
|
||||||
|
->exec("make install PREFIX='' DESTDIR=" . BUILD_ROOT_PATH);
|
||||||
|
|
||||||
|
$this->patchPkgconfPrefix(['libargon2.pc']);
|
||||||
|
|
||||||
|
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
|
||||||
|
if (str_starts_with($filename, 'libargon2') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
||||||
|
unlink(BUILD_ROOT_PATH . '/lib/' . $filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
26
src/SPC/builder/unix/library/liblz4.php
Normal file
26
src/SPC/builder/unix/library/liblz4.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
|
||||||
|
trait liblz4
|
||||||
|
{
|
||||||
|
protected function build()
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec("make PREFIX='' clean")
|
||||||
|
->exec("make -j{$this->builder->concurrency} PREFIX=''")
|
||||||
|
->exec("make install PREFIX='' DESTDIR=" . BUILD_ROOT_PATH);
|
||||||
|
|
||||||
|
$this->patchPkgconfPrefix(['liblz4.pc']);
|
||||||
|
|
||||||
|
foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) {
|
||||||
|
if (str_starts_with($filename, 'liblz4') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) {
|
||||||
|
unlink(BUILD_ROOT_PATH . '/lib/' . $filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
29
src/SPC/builder/unix/library/libuv.php
Normal file
29
src/SPC/builder/unix/library/libuv.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\exception\FileSystemException;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
use SPC\store\FileSystem;
|
||||||
|
|
||||||
|
trait libuv
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
// CMake needs a clean build directory
|
||||||
|
FileSystem::resetDir($this->source_dir . '/build');
|
||||||
|
// Start build
|
||||||
|
shell()->cd($this->source_dir . '/build')
|
||||||
|
->exec("cmake {$this->builder->makeCmakeArgs()} -DLIBUV_BUILD_SHARED=OFF ..")
|
||||||
|
->exec("cmake --build . -j {$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
// patch pkgconfig
|
||||||
|
$this->patchPkgconfPrefix(['libuv-static.pc']);
|
||||||
|
}
|
||||||
|
}
|
||||||
35
src/SPC/builder/unix/library/unixodbc.php
Normal file
35
src/SPC/builder/unix/library/unixodbc.php
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace SPC\builder\unix\library;
|
||||||
|
|
||||||
|
use SPC\exception\FileSystemException;
|
||||||
|
use SPC\exception\RuntimeException;
|
||||||
|
|
||||||
|
trait unixodbc
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @throws FileSystemException
|
||||||
|
* @throws RuntimeException
|
||||||
|
*/
|
||||||
|
protected function build(): void
|
||||||
|
{
|
||||||
|
shell()->cd($this->source_dir)
|
||||||
|
->exec(
|
||||||
|
'./configure ' .
|
||||||
|
'--enable-static --disable-shared ' .
|
||||||
|
'--disable-debug ' .
|
||||||
|
'--disable-dependency-tracking ' .
|
||||||
|
'--with-libiconv-prefix=' . BUILD_ROOT_PATH . ' ' .
|
||||||
|
'--with-included-ltdl ' .
|
||||||
|
'--enable-gui=no ' .
|
||||||
|
'--prefix='
|
||||||
|
)
|
||||||
|
->exec('make clean')
|
||||||
|
->exec("make -j{$this->builder->concurrency}")
|
||||||
|
->exec('make install DESTDIR=' . BUILD_ROOT_PATH);
|
||||||
|
$this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']);
|
||||||
|
$this->cleanLaFiles();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,7 +2,24 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
# If you want to test new extensions here, just modify it.
|
# Normal test, contains `common` extension.
|
||||||
$extensions = 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib';
|
$extensions = 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip';
|
||||||
|
|
||||||
echo $extensions;
|
# Normal test, contains gd extra libraries.
|
||||||
|
$additional_libs = 'libwebp,libavif,libjpeg,freetype';
|
||||||
|
|
||||||
|
# If you want to test additional extensions, add them below. (comma start)
|
||||||
|
$extensions .= ',uv';
|
||||||
|
|
||||||
|
# If you want to test additional features for extensions, add libs below. (comma start like extensions)
|
||||||
|
$additional_libs .= '';
|
||||||
|
|
||||||
|
if (!isset($argv[1])) {
|
||||||
|
exit("Please use 'extensions', 'cmd' or 'libs' as output type");
|
||||||
|
}
|
||||||
|
echo match ($argv[1]) {
|
||||||
|
'extensions' => $extensions,
|
||||||
|
'libs' => $additional_libs,
|
||||||
|
'cmd' => $extensions . ' --with-libs=' . $additional_libs,
|
||||||
|
default => '',
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user