diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..6a441788 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ +## What does this PR do? + + + +## Checklist before merging + +> If your PR involves the changes mentioned below and completed the action, please tick the corresponding option. +> If a modification is not involved, please skip it directly. + +- [ ] If it's a extension or dependency update, make sure adding related extensions in `src/global/test-extensions.php`. +- [ ] If you changed the behavior of static-php-cli, add docs in [static-php/static-php-cli-docs](https://github.com/static-php/static-php-cli-docs) . +- [ ] If you updated `config/xxxx.json` content, run `bin/spc dev:sort-config xxx`. diff --git a/.github/workflows/build-linux-arm.yml b/.github/workflows/build-linux-arm.yml index d36321e4..1a062727 100644 --- a/.github/workflows/build-linux-arm.yml +++ b/.github/workflows/build-linux-arm.yml @@ -15,6 +15,7 @@ on: default: '8.2' type: choice options: + - '8.3' - '8.2' - '8.1' - '8.0' @@ -51,7 +52,7 @@ jobs: uses: actions/cache@v3 with: path: downloads - key: php-${{ inputs.version }}-dependencies + key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }} # With or without debug - if: inputs.debug == true @@ -67,7 +68,7 @@ jobs: # If there's no dependencies cache, fetch sources, with or without debug - if: steps.cache-download.outputs.cache-hit != 'true' - run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }} + run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} # Run build command - run: SPC_USE_ARCH=${{ inputs.operating-system }} ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }} diff --git a/.github/workflows/build-linux-x86_64.yml b/.github/workflows/build-linux-x86_64.yml index 90705f33..91803677 100644 --- a/.github/workflows/build-linux-x86_64.yml +++ b/.github/workflows/build-linux-x86_64.yml @@ -9,6 +9,7 @@ on: default: '8.2' type: choice options: + - '8.3' - '8.2' - '8.1' - '8.0' @@ -56,7 +57,7 @@ jobs: uses: actions/cache@v3 with: path: downloads - key: php-${{ inputs.version }}-dependencies + key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }} # With or without debug - if: inputs.debug == true @@ -72,7 +73,7 @@ jobs: # If there's no dependencies cache, fetch sources, with or without debug - if: steps.cache-download.outputs.cache-hit != 'true' - run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }} + run: CACHE_API_EXEC=yes ./bin/spc-alpine-docker download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} # Run build command - run: ./bin/spc-alpine-docker build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }} diff --git a/.github/workflows/build-macos-x86_64.yml b/.github/workflows/build-macos-x86_64.yml index 6727fcbd..a942a39f 100644 --- a/.github/workflows/build-macos-x86_64.yml +++ b/.github/workflows/build-macos-x86_64.yml @@ -9,6 +9,7 @@ on: default: '8.2' type: choice options: + - '8.3' - '8.2' - '8.1' - '8.0' @@ -61,7 +62,7 @@ jobs: uses: actions/cache@v3 with: path: downloads - key: php-${{ inputs.version }}-dependencies + key: php-${{ inputs.version }}-dependencies-${{ inputs.extensions }} # With or without debug - if: inputs.debug == true @@ -77,7 +78,7 @@ jobs: # If there's no dependencies cache, fetch sources, with or without debug - if: steps.cache-download.outputs.cache-hit != 'true' - run: ./bin/spc download --with-php=${{ inputs.version }} --all ${{ env.SPC_BUILD_DEBUG }} + run: ./bin/spc download --with-php=${{ inputs.version }} --for-extensions=${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} # Run build command - run: ./bin/spc build ${{ inputs.extensions }} ${{ env.SPC_BUILD_DEBUG }} ${{ env.SPC_BUILD_CLI }} ${{ env.SPC_BUILD_MICRO }} ${{ env.SPC_BUILD_FPM }} diff --git a/.github/workflows/download-cache.yml b/.github/workflows/download-cache.yml index 86b4322e..1d0a5f52 100644 --- a/.github/workflows/download-cache.yml +++ b/.github/workflows/download-cache.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: [ "8.0", "8.1", "8.2" ] + php-version: [ "8.0", "8.1", "8.2", "8.3" ] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index d7223f64..9b9e64a8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,98 +1,146 @@ name: Tests on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] permissions: - contents: read + contents: read jobs: - php-cs-fixer: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 + php-cs-fixer: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: "Checkout" + uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - extensions: curl, openssl, mbstring - ini-values: memory_limit=-1 - tools: pecl, composer, php-cs-fixer + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + extensions: curl, openssl, mbstring + ini-values: memory_limit=-1 + tools: pecl, composer, php-cs-fixer - - name: Run PHP-CS-Fixer fix - run: php-cs-fixer fix --dry-run --diff --ansi + - name: Run PHP-CS-Fixer fix + run: php-cs-fixer fix --dry-run --diff --ansi - phpstan: - runs-on: ubuntu-latest - timeout-minutes: 10 - steps: - - name: Checkout - uses: actions/checkout@v4 + phpstan: + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: "Checkout" + uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.1' - extensions: curl, openssl, mbstring - ini-values: memory_limit=-1 - tools: composer + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: '8.1' + extensions: curl, openssl, mbstring + ini-values: memory_limit=-1 + tools: composer - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-phpstan- + - name: "Cache Composer packages" + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-phpstan-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-phpstan- - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: "Install Dependencies" + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Run phpstan - run: vendor/bin/phpstan analyse + - name: "Run phpstan" + run: vendor/bin/phpstan analyse - phpunit: - name: PHPUnit (PHP ${{ matrix.php }}) - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - matrix: - include: - - php: '8.1' - - php: '8.2' - fail-fast: false + phpunit: + name: "PHPUnit (PHP ${{ matrix.php }})" + runs-on: ubuntu-latest + timeout-minutes: 10 + strategy: + matrix: + include: + - php: '8.1' + - php: '8.2' + - php: '8.3' - steps: - - name: Checkout - uses: actions/checkout@v4 + steps: + - name: "Checkout" + uses: actions/checkout@v4 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: "${{ matrix.php }}" - tools: pecl, composer - extensions: curl, openssl, mbstring - ini-values: memory_limit=-1 + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: "${{ matrix.php }}" + tools: pecl, composer + extensions: curl, openssl, mbstring + ini-values: memory_limit=-1 - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v3 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- + - name: "Cache Composer packages" + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- - - name: Install Dependencies - run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + - name: "Install Dependencies" + run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist - - name: Run PHPUnit tests - run: | - vendor/bin/phpunit tests/ --no-coverage + - name: "Run PHPUnit Tests" + run: | + vendor/bin/phpunit tests/ --no-coverage + + build: + name: "Build PHP Test (PHP ${{ matrix.php }} ${{ matrix.os }})" + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + matrix: + php: + - "8.0" + - "8.1" + - "8.2" + - "8.3" + os: + - ubuntu-latest + - macos-latest + fail-fast: false + steps: + - name: "Checkout" + uses: actions/checkout@v4 + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: 8.2 + tools: pecl, composer + extensions: curl, openssl, mbstring + ini-values: memory_limit=-1 + + - name: "Cache Composer packages" + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-php- + + - name: "Install Dependencies" + run: composer update -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: "Run Build Tests (doctor)" + run: bin/spc doctor --auto-fix + + - name: "Run Build Tests (download)" + run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php)" --with-php=${{ matrix.php }} --debug + + - name: "Run Build Tests (build)" + run: bin/spc build "$(php src/globals/test-extensions.php)" --build-cli --build-micro --build-fpm --debug diff --git a/README-zh.md b/README-zh.md index 33cb1d64..da571330 100755 --- a/README-zh.md +++ b/README-zh.md @@ -28,9 +28,11 @@ Build single static PHP binary, with PHP project together, with popular extensio ## 自托管直接下载 -如果你不想自行编译 PHP,可以从本项目现有的示例 Action 下载 Artifact,也可以从自托管的服务器下载:[进入](https://dl.static-php.dev/static-php-cli/common/) +如果你不想自行编译 PHP,可以从本项目现有的示例 Action 下载 Artifact,也可以从自托管的服务器下载。 -> 自托管的服务器默认包含的扩展有:`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` +- [扩展组合 - common](https://dl.static-php.dev/static-php-cli/common/):common 组合包含了约 [30+](https://dl.static-php.dev/static-php-cli/common/README.txt) 个常用扩展,体积为 22MB 左右。 +- [扩展组合 - bulk](https://dl.static-php.dev/static-php-cli/bulk/):bulk 组合包含了 [50+](https://dl.static-php.dev/static-php-cli/bulk/README.txt) 个扩展,体积为 70MB 左右。 +- [扩展组合 - minimal](https://dl.static-php.dev/static-php-cli/minimal/):minimal 组合包含了 [5](https://dl.static-php.dev/static-php-cli/minimal/README.txt) 个扩展,体积为 6MB 左右。 ## 使用 static-php-cli 构建 PHP @@ -130,7 +132,7 @@ chmod +x bin/spc ./bin/spc build "bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl" --build-cli --build-micro ``` -你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.3 ~ 8.2: +你也可以使用参数 `--with-php=x.y` 来指定下载的 PHP 版本,目前支持 7.3 ~ 8.3: ```bash # 优先考虑使用 >= 8.0 的 PHP 版本,因为 phpmicro 不支持在 PHP7 中构建 diff --git a/README.md b/README.md index c89abc91..faedaf13 100755 --- a/README.md +++ b/README.md @@ -24,16 +24,21 @@ You can also use the micro binary file to combine php binary and php source code [![](https://img.shields.io/badge/Extension%20Counter-65+-yellow.svg?style=flat-square)]() [![](https://img.shields.io/github/search/crazywhalecc/static-php-cli/TODO?label=TODO%20Counter&style=flat-square)]() -## Docs +## Documentation The current README contains basic usage. For all the features of static-php-cli, see . ## Direct Download -If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from [self-hosted server](https://dl.static-php.dev/static-php-cli/common/). +If you don't want to compile yourself, you can download example pre-compiled artifact from [Actions](https://github.com/static-php/static-php-cli-hosted/actions/workflows/build-php-common.yml), or from self-hosted server. -> self-hosted server contains 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` +Below are several precompiled static-php binaries with different extension combinations, +which can be downloaded directly according to your needs. + +- [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` 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` 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 @@ -65,6 +70,8 @@ Please first select the extension you want to compile based on the extension lis > If an extension you need is missing, you can submit an issue. +Here is the current planned roadmap for extension support: [#152](https://github.com/crazywhalecc/static-php-cli/issues/152) . + ### GitHub Actions Build Use GitHub Action to easily build a statically compiled PHP, @@ -88,13 +95,12 @@ Currently, the platforms supported by `spc` binary are Linux and macOS. Here's how to download from GitHub Actions: -1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml). -2. Select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform. -3. Unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`. +1. Enter [GitHub Actions](https://github.com/crazywhalecc/static-php-cli/actions/workflows/release-build.yml) or [self-hosted nightly builds](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/). +2. If you download from GHA, select the latest build task, select `Artifacts`, and download the binary file of the corresponding platform. +3. If you download from GHA, unzip the `.zip` file. After decompressing, add execution permissions to it: `chmod +x ./spc`. +4. If you download from self-hosted server, download `spc-$os-$arch` file and just use it (don't forget `chmod +x`). -You can also download binaries from a self-hosted server: [enter](https://dl.static-php.dev/static-php-cli/spc-bin/nightly/). - -> SPC single-file binary is built by phpmicro and box. +> SPC single-file binary is built by phpmicro and box, and it doesn't need to install PHP. Just treat `spc` as a standalone executable. ### Manual build (using source code) @@ -134,7 +140,7 @@ Basic usage for building php and micro with some extensions: > If you are using the packaged `spc` binary, you need to replace `bin/spc` with `./spc` in the following commands. ```bash -# Check system tool dependencies, fix them automatically +# Check system tool dependencies, fix them if possible ./bin/spc doctor # fetch all libraries ./bin/spc download --all @@ -144,7 +150,7 @@ Basic usage for building php and micro with some extensions: ./bin/spc build bcmath,openssl,tokenizer,sqlite3,pdo_sqlite,ftp,curl --build-cli --build-micro ``` -You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.2: +You can also use the parameter `--with-php=x.y` to specify the downloaded PHP version, currently supports 7.4 ~ 8.3: ```bash # Using PHP >= 8.0 is recommended, because PHP7 cannot use phpmicro @@ -166,7 +172,7 @@ If anything goes wrong, use `--debug` option to display full terminal output: ./bin/spc fetch --all --debug ``` -In addition, we build NTS by default. If you are going to build ZTS version, just add `--enable-zts` option. +In addition, we build NTS (non-thread-safe) by default. If you are going to build ZTS version, just add `--enable-zts` option. ```bash ./bin/spc build openssl,pcntl --build-all --enable-zts @@ -227,7 +233,7 @@ cat buildroot/bin/micro.sfx my-app.phar > my-app && chmod +x my-app bin/spc micro:combine my-app.phar -I "memory_limit=4G" -I "disable_functions=system" --output my-app-2 ``` -> In some cases, PHAR files may not run in a micro environment. +> In some cases, PHAR files may not run in a micro environment. Overall, micro is not production ready. ### Use fpm @@ -235,7 +241,7 @@ When using the parameter `--build-all` or `--build-fpm`, the final compilation result will output a file named `./php-fpm`, This file will be located in the path `buildroot/bin/`, simply copy it out for use. -In normal Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm. +In common Linux distributions and macOS systems, the package manager will automatically generate a default fpm configuration file after installing php-fpm. Because php-fpm must specify a configuration file before running, the php-fpm compiled by this project will not have any configuration files, so you need to write `php-fpm.conf` and `pool.conf` configuration files yourself. Specifying `php-fpm.conf` can use the command parameter `-y`, for example: `./php-fpm -y php-fpm.conf`. @@ -261,10 +267,6 @@ If you want to contribute documentation, please go to [static-php/static-php-cli Now there is a [static-php](https://github.com/static-php) organization, which is used to store the repo related to the project. -Part of the English document is written by me, and part is translated by Google, -and there may be inaccurate descriptions, strange or offensive expressions. -If you are a native English speaker, some corrections to the documentation are welcome. - ## Sponsor this project You can sponsor my project on [this page](https://github.com/crazywhalecc/crazywhalecc/blob/master/FUNDING.md). @@ -272,11 +274,13 @@ You can sponsor my project on [this page](https://github.com/crazywhalecc/crazyw ## Open-Source License This project itself is based on MIT License, -some newly added extensions and dependencies may originate from the following projects (including but not limited to), -and the headers of these code files will also be given additional instructions LICENSE and AUTHOR: +some newly added extensions and dependencies may originate from the the other projects, +and the headers of these code files will also be given additional instructions LICENSE and AUTHOR. -- [dixyes/lwmbs](https://github.com/dixyes/lwmbs) (Mulun Permissive License) -- [swoole/swoole-cli](https://github.com/swoole/swoole-cli) (Apache 2.0 LICENSE+SWOOLE-CLI LICENSE) +These are similar projects: + +- [dixyes/lwmbs](https://github.com/dixyes/lwmbs) +- [swoole/swoole-cli](https://github.com/swoole/swoole-cli) Due to the special nature of this project, many other open source projects such as curl and protobuf will be used during the project compilation process, @@ -285,8 +289,3 @@ and they all have their own open source licenses. Please use the `bin/spc dump-license` command to export the open source licenses used in the project after compilation, and comply with the corresponding project's LICENSE. -## Advanced - -The refactoring branch of this project is written modularly. -If you are interested in this project and want to join the development, -you can refer to the [Contribution Guide](https://static-php.dev) of the documentation to contribute code or documentation. diff --git a/bin/setup-runtime b/bin/setup-runtime index bd7144b7..b344bab5 100755 --- a/bin/setup-runtime +++ b/bin/setup-runtime @@ -25,7 +25,7 @@ __DIR__=$(cd "$(dirname "$0")" && pwd) __PROJECT__=$(cd "${__DIR__}"/../ && pwd) # set download dir -__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.10-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" +__PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" __COMPOSER_URL__="https://getcomposer.org/download/latest-stable/composer.phar" # use china mirror @@ -46,7 +46,7 @@ done case "$mirror" in china) - __PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.10-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" + __PHP_RUNTIME_URL__="https://dl.static-php.dev/static-php-cli/common/php-8.2.12-cli-${__OS_FIXED__}-${__ARCH__}.tar.gz" __COMPOSER_URL__="https://mirrors.aliyun.com/composer/composer.phar" ;; diff --git a/bin/spc-alpine-docker b/bin/spc-alpine-docker index e807a2df..87e52968 100755 --- a/bin/spc-alpine-docker +++ b/bin/spc-alpine-docker @@ -73,6 +73,7 @@ RUN apk update; \ git \ jq \ libgcc \ + libtool \ libstdc++ \ linux-headers \ m4 \ diff --git a/composer.lock b/composer.lock index 5f25211d..1be1f401 100644 --- a/composer.lock +++ b/composer.lock @@ -8,16 +8,16 @@ "packages": [ { "name": "illuminate/collections", - "version": "v10.30.1", + "version": "v10.33.0", "source": { "type": "git", "url": "https://github.com/illuminate/collections.git", - "reference": "bb8784ce913bd46f944b4bd67cd857f40d9cfe68" + "reference": "766a3b6c3e5c8011b037a147266dcf7f93b21223" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/collections/zipball/bb8784ce913bd46f944b4bd67cd857f40d9cfe68", - "reference": "bb8784ce913bd46f944b4bd67cd857f40d9cfe68", + "url": "https://api.github.com/repos/illuminate/collections/zipball/766a3b6c3e5c8011b037a147266dcf7f93b21223", + "reference": "766a3b6c3e5c8011b037a147266dcf7f93b21223", "shasum": "" }, "require": { @@ -59,11 +59,11 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2023-10-10T12:55:25+00:00" + "time": "2023-11-20T15:45:45+00:00" }, { "name": "illuminate/conditionable", - "version": "v10.30.1", + "version": "v10.33.0", "source": { "type": "git", "url": "https://github.com/illuminate/conditionable.git", @@ -109,7 +109,7 @@ }, { "name": "illuminate/contracts", - "version": "v10.30.1", + "version": "v10.33.0", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", @@ -157,7 +157,7 @@ }, { "name": "illuminate/macroable", - "version": "v10.30.1", + "version": "v10.33.0", "source": { "type": "git", "url": "https://github.com/illuminate/macroable.git", @@ -414,16 +414,16 @@ }, { "name": "symfony/console", - "version": "v6.3.4", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6" + "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/eca495f2ee845130855ddf1cf18460c38966c8b6", - "reference": "eca495f2ee845130855ddf1cf18460c38966c8b6", + "url": "https://api.github.com/repos/symfony/console/zipball/0d14a9f6d04d4ac38a8cea1171f4554e325dae92", + "reference": "0d14a9f6d04d4ac38a8cea1171f4554e325dae92", "shasum": "" }, "require": { @@ -484,7 +484,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.3.4" + "source": "https://github.com/symfony/console/tree/v6.3.8" }, "funding": [ { @@ -500,11 +500,11 @@ "type": "tidelift" } ], - "time": "2023-08-16T10:10:12+00:00" + "time": "2023-10-31T08:09:35+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", @@ -551,7 +551,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" }, "funding": [ { @@ -901,16 +901,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/b3313c2dbffaf71c8de2934e2ea56ed2291a3838", + "reference": "b3313c2dbffaf71c8de2934e2ea56ed2291a3838", "shasum": "" }, "require": { @@ -963,7 +963,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.0" }, "funding": [ { @@ -979,20 +979,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2023-07-30T20:28:31+00:00" }, { "name": "symfony/string", - "version": "v6.3.5", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339" + "reference": "13880a87790c76ef994c91e87efb96134522577a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/13d76d0fb049051ed12a04bef4f9de8715bea339", - "reference": "13d76d0fb049051ed12a04bef4f9de8715bea339", + "url": "https://api.github.com/repos/symfony/string/zipball/13880a87790c76ef994c91e87efb96134522577a", + "reference": "13880a87790c76ef994c91e87efb96134522577a", "shasum": "" }, "require": { @@ -1049,7 +1049,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.3.5" + "source": "https://github.com/symfony/string/tree/v6.3.8" }, "funding": [ { @@ -1065,7 +1065,7 @@ "type": "tidelift" } ], - "time": "2023-09-18T10:38:32+00:00" + "time": "2023-11-09T08:28:21+00:00" }, { "name": "zhamao/logger", @@ -1691,16 +1691,16 @@ }, { "name": "captainhook/captainhook", - "version": "5.18.2", + "version": "5.18.3", "source": { "type": "git", "url": "https://github.com/captainhookphp/captainhook.git", - "reference": "61c24442f71ea216e9e172861d48d7676439dd18" + "reference": "b7bc503a40ccfe80ea9638e4921b4697669d725f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/61c24442f71ea216e9e172861d48d7676439dd18", - "reference": "61c24442f71ea216e9e172861d48d7676439dd18", + "url": "https://api.github.com/repos/captainhookphp/captainhook/zipball/b7bc503a40ccfe80ea9638e4921b4697669d725f", + "reference": "b7bc503a40ccfe80ea9638e4921b4697669d725f", "shasum": "" }, "require": { @@ -1762,7 +1762,7 @@ ], "support": { "issues": "https://github.com/captainhookphp/captainhook/issues", - "source": "https://github.com/captainhookphp/captainhook/tree/5.18.2" + "source": "https://github.com/captainhookphp/captainhook/tree/5.18.3" }, "funding": [ { @@ -1770,7 +1770,7 @@ "type": "github" } ], - "time": "2023-10-16T15:13:42+00:00" + "time": "2023-11-05T13:56:19+00:00" }, { "name": "captainhook/plugin-composer", @@ -2318,50 +2318,50 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.37.1", + "version": "v3.40.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "c3fe76976081ab871aa654e872da588077e19679" + "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/c3fe76976081ab871aa654e872da588077e19679", - "reference": "c3fe76976081ab871aa654e872da588077e19679", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/27d2b3265b5d550ec411b4319967ae7cfddfb2e0", + "reference": "27d2b3265b5d550ec411b4319967ae7cfddfb2e0", "shasum": "" }, "require": { - "composer/semver": "^3.3", + "composer/semver": "^3.4", "composer/xdebug-handler": "^3.0.3", "ext-json": "*", "ext-tokenizer": "*", "php": "^7.4 || ^8.0", "sebastian/diff": "^4.0 || ^5.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.27", - "symfony/polyfill-php80": "^1.27", - "symfony/polyfill-php81": "^1.27", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "symfony/console": "^5.4 || ^6.0 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0", + "symfony/finder": "^5.4 || ^6.0 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.28", + "symfony/polyfill-php80": "^1.28", + "symfony/polyfill-php81": "^1.28", + "symfony/process": "^5.4 || ^6.0 || ^7.0", + "symfony/stopwatch": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { "facile-it/paraunit": "^1.3 || ^2.0", "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^2.0", + "keradus/cli-executor": "^2.1", "mikey179/vfsstream": "^1.6.11", - "php-coveralls/php-coveralls": "^2.5.3", + "php-coveralls/php-coveralls": "^2.7", "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.16", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4", + "phpspec/prophecy": "^1.17", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "symfony/phpunit-bridge": "^6.2.3", - "symfony/yaml": "^5.4 || ^6.0" + "phpunit/phpunit": "^9.6", + "symfony/phpunit-bridge": "^6.3.8 || ^7.0", + "symfony/yaml": "^5.4 || ^6.0 || ^7.0" }, "suggest": { "ext-dom": "For handling output formats in XML", @@ -2399,7 +2399,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.37.1" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.40.0" }, "funding": [ { @@ -2407,7 +2407,7 @@ "type": "github" } ], - "time": "2023-10-29T20:51:23+00:00" + "time": "2023-11-26T09:25:53+00:00" }, { "name": "humbug/box", @@ -2722,16 +2722,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v1.3.2", + "version": "v1.3.3", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c" + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/076fe2cf128bd54b4341cdc6d49b95b34e101e4c", - "reference": "076fe2cf128bd54b4341cdc6d49b95b34e101e4c", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/3dbf8a8e914634c48d389c1234552666b3d43754", + "reference": "3dbf8a8e914634c48d389c1234552666b3d43754", "shasum": "" }, "require": { @@ -2778,7 +2778,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2023-10-17T13:38:16+00:00" + "time": "2023-11-08T14:08:06+00:00" }, { "name": "myclabs/deep-copy", @@ -3477,16 +3477,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.24.2", + "version": "1.24.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "bcad8d995980440892759db0c32acae7c8e79442" + "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", - "reference": "bcad8d995980440892759db0c32acae7c8e79442", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6bd0c26f3786cd9b7c359675cb789e35a8e07496", + "reference": "6bd0c26f3786cd9b7c359675cb789e35a8e07496", "shasum": "" }, "require": { @@ -3518,22 +3518,22 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.4" }, - "time": "2023-09-26T12:28:12+00:00" + "time": "2023-11-26T18:29:22+00:00" }, { "name": "phpstan/phpstan", - "version": "1.10.40", + "version": "1.10.44", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d" + "reference": "bf84367c53a23f759513985c54ffe0d0c249825b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/93c84b5bf7669920d823631e39904d69b9c7dc5d", - "reference": "93c84b5bf7669920d823631e39904d69b9c7dc5d", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/bf84367c53a23f759513985c54ffe0d0c249825b", + "reference": "bf84367c53a23f759513985c54ffe0d0c249825b", "shasum": "" }, "require": { @@ -3582,20 +3582,20 @@ "type": "tidelift" } ], - "time": "2023-10-30T14:48:31+00:00" + "time": "2023-11-21T16:30:46+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "10.1.7", + "version": "10.1.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "355324ca4980b8916c18b9db29f3ef484078f26e" + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/355324ca4980b8916c18b9db29f3ef484078f26e", - "reference": "355324ca4980b8916c18b9db29f3ef484078f26e", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/a56a9ab2f680246adcf3db43f38ddf1765774735", + "reference": "a56a9ab2f680246adcf3db43f38ddf1765774735", "shasum": "" }, "require": { @@ -3652,7 +3652,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.7" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/10.1.9" }, "funding": [ { @@ -3660,7 +3660,7 @@ "type": "github" } ], - "time": "2023-10-04T15:34:17+00:00" + "time": "2023-11-23T12:23:20+00:00" }, { "name": "phpunit/php-file-iterator", @@ -5292,7 +5292,7 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.3.0", + "version": "v3.4.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", @@ -5348,7 +5348,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.3.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" }, "funding": [ { @@ -5685,16 +5685,16 @@ }, { "name": "symfony/var-dumper", - "version": "v6.3.6", + "version": "v6.3.8", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97" + "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/999ede244507c32b8e43aebaa10e9fce20de7c97", - "reference": "999ede244507c32b8e43aebaa10e9fce20de7c97", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/81acabba9046550e89634876ca64bfcd3c06aa0a", + "reference": "81acabba9046550e89634876ca64bfcd3c06aa0a", "shasum": "" }, "require": { @@ -5749,7 +5749,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v6.3.6" + "source": "https://github.com/symfony/var-dumper/tree/v6.3.8" }, "funding": [ { @@ -5765,7 +5765,7 @@ "type": "tidelift" } ], - "time": "2023-10-12T18:45:56+00:00" + "time": "2023-11-08T10:42:36+00:00" }, { "name": "thecodingmachine/safe", @@ -5908,16 +5908,16 @@ }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", "shasum": "" }, "require": { @@ -5946,7 +5946,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.2" }, "funding": [ { @@ -5954,7 +5954,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2023-11-20T00:12:19+00:00" }, { "name": "webmozart/assert", diff --git a/config/ext.json b/config/ext.json index 130e2cea..8a75b502 100644 --- a/config/ext.json +++ b/config/ext.json @@ -118,7 +118,7 @@ "iconv": { "type": "builtin", "arg-type": "with-prefix", - "lib-depends-windows": [ + "lib-depends": [ "libiconv" ] }, @@ -132,12 +132,12 @@ }, "imap": { "type": "builtin", - "arg-type": "with", + "arg-type": "custom", "lib-depends": [ "imap" ], "lib-suggests": [ - "kerberos" + "openssl" ] }, "inotify": { @@ -228,13 +228,15 @@ ] }, "opcache": { - "type": "builtin" + "type": "builtin", + "arg-type": "custom" }, "openssl": { "type": "builtin", "arg-type": "custom", "lib-depends": [ - "openssl" + "openssl", + "zlib" ], "ext-depends": [ "zlib" @@ -312,6 +314,11 @@ "aspell" ] }, + "rar": { + "type": "external", + "source": "rar", + "cpp-extension": true + }, "readline": { "type": "builtin", "arg-type": "with-prefix", @@ -436,7 +443,7 @@ }, "tidy": { "type": "builtin", - "arg-type": "with", + "arg-type": "with-prefix", "lib-depends": [ "tidy" ] diff --git a/config/lib.json b/config/lib.json index 2b9500fd..14d66130 100644 --- a/config/lib.json +++ b/config/lib.json @@ -141,14 +141,24 @@ "libxml2" ] }, + "imap": { + "source": "imap", + "static-libs-unix": [ + "libc-client.a" + ], + "lib-suggests": [ + "openssl" + ] + }, "ldap": { "source": "ldap", "static-libs-unix": [ "liblber.a", "libldap.a" ], - "lib-suggests": [ + "lib-depends": [ "openssl", + "zlib", "gmp", "libsodium" ] @@ -308,8 +318,7 @@ ], "lib-suggests-windows": [ "icu", - "xz", - "pthreads4w" + "xz" ] }, "libxslt": { @@ -447,18 +456,6 @@ "zstd" ] }, - "pthreads4w": { - "source": "pthreads4w", - "static-libs-windows": [ - "libpthreadVC3.lib" - ], - "headers-windows": [ - "_ptw32.h", - "pthread.h", - "sched.h", - "semaphore.h" - ] - }, "readline": { "source": "readline", "static-libs-unix": [ @@ -493,6 +490,12 @@ "sqlite3ext.h" ] }, + "tidy": { + "source": "tidy", + "static-libs-unix": [ + "libtidy.a" + ] + }, "xz": { "source": "xz", "static-libs-unix": [ diff --git a/config/source.json b/config/source.json index 12015a21..23b4ab1b 100644 --- a/config/source.json +++ b/config/source.json @@ -111,9 +111,9 @@ } }, "freetype": { - "type": "filelist", - "url": "https://download-mirror.savannah.gnu.org/releases/freetype/", - "regex": "/href=\"(?freetype-(?[^\"]+)\\.tar\\.xz)\"/", + "type": "git", + "rev": "VER-2-13-2", + "url": "https://github.com/freetype/freetype", "license": { "type": "file", "path": "LICENSE.TXT" @@ -144,6 +144,15 @@ "path": "LICENSE" } }, + "imap": { + "type": "git", + "url": "https://github.com/static-php/imap.git", + "rev": "master", + "license": { + "type": "file", + "path": "LICENSE" + } + }, "inotify": { "type": "url", "url": "https://pecl.php.net/get/inotify", @@ -217,7 +226,7 @@ }, "libmcrypt": { "type": "url", - "url": "https://nchc.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz", + "url": "https://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz", "license": { "type": "file", "path": "COPYING" @@ -234,7 +243,7 @@ }, "libpng": { "type": "git", - "url": "https://git.code.sf.net/p/libpng/code", + "url": "https://github.com/glennrp/libpng.git", "rev": "libpng16", "license": { "type": "file", @@ -303,7 +312,7 @@ }, "mcrypt": { "type": "url", - "url": "https://jaist.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz", + "url": "https://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz", "license": { "type": "file", "path": "COPYING" @@ -386,7 +395,7 @@ }, "postgresql": { "type": "url", - "url": "https://ftp.postgresql.org/pub/source/v15.1/postgresql-15.1.tar.gz", + "url": "https://ftp.postgresql.org/pub/source/v16.1/postgresql-16.1.tar.gz", "license": { "type": "file", "path": "COPYRIGHT" @@ -402,10 +411,11 @@ "path": "LICENSE" } }, - "pthreads4w": { + "rar": { "type": "git", - "rev": "master", - "url": "https://git.code.sf.net/p/pthreads4w/code", + "url": "https://github.com/static-php/php-rar.git", + "path": "php-src/ext/rar", + "rev": "issue-php82", "license": { "type": "file", "path": "LICENSE" @@ -468,6 +478,15 @@ "path": "LICENSE" } }, + "tidy": { + "type": "url", + "url": "https://github.com/htacg/tidy-html5/archive/refs/tags/5.8.0.tar.gz", + "filename": "tidy-html5.tgz", + "license": { + "type": "file", + "path": "README/LICENSE.md" + } + }, "xlswriter": { "type": "url", "url": "https://pecl.php.net/get/xlswriter", diff --git a/src/SPC/ConsoleApplication.php b/src/SPC/ConsoleApplication.php index 2de132e0..73b354be 100644 --- a/src/SPC/ConsoleApplication.php +++ b/src/SPC/ConsoleApplication.php @@ -23,7 +23,7 @@ use Symfony\Component\Console\Command\ListCommand; */ final class ConsoleApplication extends Application { - public const VERSION = '2.0.0-rc8'; + public const VERSION = '2.0.0-rc9'; public function __construct() { diff --git a/src/SPC/builder/BuilderBase.php b/src/SPC/builder/BuilderBase.php index 6e46886f..72db5961 100644 --- a/src/SPC/builder/BuilderBase.php +++ b/src/SPC/builder/BuilderBase.php @@ -69,7 +69,7 @@ abstract class BuilderBase foreach ($libraries as $library) { // if some libs are not supported (but in config "lib.json", throw exception) if (!isset($support_lib_list[$library])) { - throw new RuntimeException('library [' . $library . '] is in the lib.json list but not supported to compile, but in the future I will support it!'); + throw new WrongUsageException('library [' . $library . '] is in the lib.json list but not supported to compile, but in the future I will support it!'); } $lib = new ($support_lib_list[$library])($this); $this->addLib($lib); @@ -259,6 +259,19 @@ abstract class BuilderBase throw new RuntimeException('PHP version file format is malformed, please remove it and download again'); } + public function getPHPVersion(): string + { + if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) { + throw new WrongUsageException('PHP source files are not available, you need to download them first'); + } + $file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h'); + if (preg_match('/PHP_VERSION "(.*)"/', $file, $match) !== 0) { + return $match[1]; + } + + throw new RuntimeException('PHP version file format is malformed, please remove it and download again'); + } + /** * Get build type name string to display. * diff --git a/src/SPC/builder/extension/imagick.php b/src/SPC/builder/extension/imagick.php index ef965d58..d7721a24 100644 --- a/src/SPC/builder/extension/imagick.php +++ b/src/SPC/builder/extension/imagick.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace SPC\builder\extension; use SPC\builder\Extension; +use SPC\builder\linux\LinuxBuilder; use SPC\util\CustomExt; #[CustomExt('imagick')] @@ -14,7 +15,9 @@ class imagick extends Extension { // imagick may call omp_pause_all which requires -lgomp $extra_libs = $this->builder->getOption('extra-libs', ''); - $extra_libs .= ' -lgomp '; + if ($this->builder instanceof LinuxBuilder) { + $extra_libs .= ' -lgomp '; + } $this->builder->setOption('extra-libs', $extra_libs); return true; } diff --git a/src/SPC/builder/extension/imap.php b/src/SPC/builder/extension/imap.php new file mode 100644 index 00000000..389223ec --- /dev/null +++ b/src/SPC/builder/extension/imap.php @@ -0,0 +1,28 @@ +builder->getOption('enable-zts')) { + throw new WrongUsageException('ext-imap is not thread safe, do not build it with ZTS builds'); + } + $arg = '--with-imap=' . BUILD_ROOT_PATH; + if ($this->builder->getLib('openssl') !== null) { + $arg .= ' --with-imap-ssl=' . BUILD_ROOT_PATH; + } + return $arg; + } +} diff --git a/src/SPC/builder/extension/mongodb.php b/src/SPC/builder/extension/mongodb.php index 2096de05..e6f12d54 100644 --- a/src/SPC/builder/extension/mongodb.php +++ b/src/SPC/builder/extension/mongodb.php @@ -5,11 +5,20 @@ declare(strict_types=1); namespace SPC\builder\extension; use SPC\builder\Extension; +use SPC\store\FileSystem; use SPC\util\CustomExt; #[CustomExt('mongodb')] class mongodb extends Extension { + public function patchBeforeBuildconf(): bool + { + FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'if test -z "$PHP_CONFIG"; then', 'if false; then'); + FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION=`${PHP_CONFIG} --version`', 'PHP_MONGODB_PHP_VERSION=' . $this->builder->getPHPVersion()); + FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/mongodb/config.m4', 'PHP_MONGODB_PHP_VERSION_ID=`${PHP_CONFIG} --vernum`', 'PHP_MONGODB_PHP_VERSION_ID=' . $this->builder->getPHPVersionID()); + return true; + } + public function getUnixConfigureArg(): string { $arg = ' --enable-mongodb '; diff --git a/src/SPC/builder/extension/opcache.php b/src/SPC/builder/extension/opcache.php index f592303a..82efc853 100644 --- a/src/SPC/builder/extension/opcache.php +++ b/src/SPC/builder/extension/opcache.php @@ -5,11 +5,25 @@ declare(strict_types=1); namespace SPC\builder\extension; use SPC\builder\Extension; +use SPC\exception\RuntimeException; +use SPC\exception\WrongUsageException; use SPC\util\CustomExt; #[CustomExt('opcache')] class opcache extends Extension { + /** + * @throws WrongUsageException + * @throws RuntimeException + */ + public function getUnixConfigureArg(): string + { + if ($this->builder->getPHPVersionID() < 80000) { + throw new WrongUsageException('Statically compiled PHP with Zend Opcache only available for PHP >= 8.0 !'); + } + return '--enable-opcache'; + } + public function getDistName(): string { return 'Zend Opcache'; diff --git a/src/SPC/builder/extension/sodium.php b/src/SPC/builder/extension/sodium.php new file mode 100644 index 00000000..18059774 --- /dev/null +++ b/src/SPC/builder/extension/sodium.php @@ -0,0 +1,35 @@ +removeLineContainingString(); + } + + private function removeLineContainingString(): bool + { + $path = SOURCE_PATH . '/php-src/ext/sodium/config.m4'; + $search = '-Wno-logical-op'; + if (!file_exists($path)) { + return false; + } + $content = file_get_contents($path); + $lines = preg_split('/\r\n|\n/', $content); + $filteredLines = array_filter($lines, function ($line) use ($search) { + return strpos($line, $search) === false; + }); + $newContent = implode("\n", $filteredLines); + file_put_contents($path, $newContent); + return true; + } +} diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index 987a0cab..3dd570a1 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -16,8 +16,9 @@ class swoole extends Extension // pgsql hook is buggy for static php $arg .= ' --disable-swoole-pgsql'; $arg .= $this->builder->getLib('openssl') ? ' --enable-openssl' : ' --disable-openssl --without-openssl'; - $arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ''; - $arg .= $this->builder->getExt('curl') ? ' --enable-swoole-curl' : ' --disable-swoole-curl'; + $arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ' --disable-brotli'; + // swoole curl hook is buggy for php 8.0 + $arg .= $this->builder->getExt('curl') && $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl'; return $arg; } } diff --git a/src/SPC/builder/linux/library/imap.php b/src/SPC/builder/linux/library/imap.php new file mode 100644 index 00000000..60b02203 --- /dev/null +++ b/src/SPC/builder/linux/library/imap.php @@ -0,0 +1,63 @@ +source_dir . '/Makefile', '-DMAC_OSX_KLUDGE=1', ''); + FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', 'CC=cc', "CC={$cc}"); + /* FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto -lz', '-lcrypto'); + FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto', '-lcrypto -lz'); + FileSystem::replaceFileStr( + $this->source_dir . '/src/osdep/unix/ssl_unix.c', + "#include \n#include ", + "#include \n#include " + ); + // SourcePatcher::patchFile('1006_openssl1.1_autoverify.patch', $this->source_dir); + SourcePatcher::patchFile('2014_openssl1.1.1_sni.patch', $this->source_dir); */ + FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLINCLUDE=/usr/include/openssl', 'SSLINCLUDE=' . BUILD_INCLUDE_PATH); + FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLLIB=/usr/lib', 'SSLLIB=' . BUILD_LIB_PATH); + return true; + } + + /** + * @throws RuntimeException + */ + protected function build(): void + { + if ($this->builder->getLib('openssl')) { + $ssl_options = 'SPECIALAUTHENTICATORS=ssl SSLTYPE=unix.nopwd SSLINCLUDE=' . BUILD_INCLUDE_PATH . ' SSLLIB=' . BUILD_LIB_PATH; + } else { + $ssl_options = 'SSLTYPE=none'; + } + shell()->cd($this->source_dir) + ->exec('make clean') + ->exec('touch ip6') + ->exec( + "yes | make slx {$ssl_options}" + ); + try { + shell() + ->exec("cp -rf {$this->source_dir}/c-client/c-client.a " . BUILD_LIB_PATH . '/libc-client.a') + ->exec("cp -rf {$this->source_dir}/c-client/*.c " . BUILD_LIB_PATH . '/') + ->exec("cp -rf {$this->source_dir}/c-client/*.h " . BUILD_INCLUDE_PATH . '/') + ->exec("cp -rf {$this->source_dir}/src/osdep/unix/*.h " . BUILD_INCLUDE_PATH . '/'); + } catch (\Throwable) { + // last command throws an exception, no idea why since it works + } + } +} diff --git a/src/SPC/builder/linux/library/tidy.php b/src/SPC/builder/linux/library/tidy.php new file mode 100644 index 00000000..0cfcd27e --- /dev/null +++ b/src/SPC/builder/linux/library/tidy.php @@ -0,0 +1,12 @@ +source_dir); + // FileSystem::replaceFileStr($this->source_dir . '/Makefile', '-DMAC_OSX_KLUDGE=1', ''); + FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', 'CC=cc', "CC={$cc}"); + /* FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto -lz', '-lcrypto'); + FileSystem::replaceFileStr($this->source_dir . '/src/osdep/unix/Makefile', '-lcrypto', '-lcrypto -lz'); + FileSystem::replaceFileStr( + $this->source_dir . '/src/osdep/unix/ssl_unix.c', + "#include \n#include ", + "#include \n#include " + ); + // SourcePatcher::patchFile('1006_openssl1.1_autoverify.patch', $this->source_dir); + SourcePatcher::patchFile('2014_openssl1.1.1_sni.patch', $this->source_dir); */ + FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLINCLUDE=/usr/include/openssl', 'SSLINCLUDE=' . BUILD_INCLUDE_PATH); + FileSystem::replaceFileStr($this->source_dir . '/Makefile', 'SSLLIB=/usr/lib', 'SSLLIB=' . BUILD_LIB_PATH); + return true; + } + + /** + * @throws RuntimeException + */ + protected function build(): void + { + if ($this->builder->getLib('openssl')) { + $ssl_options = 'SPECIALAUTHENTICATORS=ssl SSLTYPE=unix.nopwd SSLINCLUDE=' . BUILD_INCLUDE_PATH . ' SSLLIB=' . BUILD_LIB_PATH; + } else { + $ssl_options = 'SSLTYPE=none'; + } + shell()->cd($this->source_dir) + ->exec('make clean') + ->exec('touch ip6') + ->exec( + "yes | EXTRACFLAGS='-Wimplicit-function-declaration -include $(xcrun --show-sdk-path)/usr/include/poll.h -include $(xcrun --show-sdk-path)/usr/include/time.h -include $(xcrun --show-sdk-path)/usr/include/utime.h' make osx {$ssl_options}" + ); + try { + shell() + ->exec("cp -rf {$this->source_dir}/c-client/c-client.a " . BUILD_LIB_PATH . '/libc-client.a') + ->exec("cp -rf {$this->source_dir}/c-client/*.c " . BUILD_LIB_PATH . '/') + ->exec("cp -rf {$this->source_dir}/c-client/*.h " . BUILD_INCLUDE_PATH . '/') + ->exec("cp -rf {$this->source_dir}/src/osdep/unix/*.h " . BUILD_INCLUDE_PATH . '/'); + } catch (\Throwable) { + // last command throws an exception, no idea why since it works + } + } +} diff --git a/src/SPC/builder/macos/library/tidy.php b/src/SPC/builder/macos/library/tidy.php new file mode 100644 index 00000000..733e7644 --- /dev/null +++ b/src/SPC/builder/macos/library/tidy.php @@ -0,0 +1,12 @@ +cd($this->source_dir) + ->exec('sh autogen.sh') ->exec( './configure ' . '--enable-static --disable-shared --without-harfbuzz --prefix= ' . diff --git a/src/SPC/builder/unix/library/imagemagick.php b/src/SPC/builder/unix/library/imagemagick.php index bd4d0424..a75969ac 100644 --- a/src/SPC/builder/unix/library/imagemagick.php +++ b/src/SPC/builder/unix/library/imagemagick.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace SPC\builder\unix\library; use SPC\builder\linux\library\LinuxLibraryBase; +use SPC\builder\macos\library\MacOSLibraryBase; use SPC\exception\FileSystemException; use SPC\exception\RuntimeException; use SPC\store\FileSystem; @@ -39,8 +40,12 @@ trait imagemagick } $ldflags = $this instanceof LinuxLibraryBase ? ('LDFLAGS="-static" ') : ''; + + // libxml iconv patch + $required_libs .= $this instanceof MacOSLibraryBase ? (' -liconv') : ''; shell()->cd($this->source_dir) ->exec( + 'PKG_CONFIG="$PKG_CONFIG --static" ' . $ldflags . "LIBS='{$required_libs}' " . './configure ' . diff --git a/src/SPC/builder/unix/library/ldap.php b/src/SPC/builder/unix/library/ldap.php index 9b4080df..a557eb8e 100644 --- a/src/SPC/builder/unix/library/ldap.php +++ b/src/SPC/builder/unix/library/ldap.php @@ -15,6 +15,8 @@ trait ldap $alt .= $this->builder->getLib('gmp') ? '--with-mp=gmp ' : ''; // libsodium support $alt .= $this->builder->getLib('libsodium') ? '--with-argon2=libsodium ' : ''; + f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config'); + f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig'); shell()->cd($this->source_dir) ->exec( $this->builder->makeAutoconfFlags(AUTOCONF_LDFLAGS | AUTOCONF_CPPFLAGS) . diff --git a/src/SPC/builder/unix/library/postgresql.php b/src/SPC/builder/unix/library/postgresql.php index 38be1bf2..2448f656 100644 --- a/src/SPC/builder/unix/library/postgresql.php +++ b/src/SPC/builder/unix/library/postgresql.php @@ -20,17 +20,22 @@ trait postgresql { $builddir = BUILD_ROOT_PATH; $envs = ''; - $packages = 'openssl zlib readline libxml-2.0 zlib'; + $packages = 'zlib openssl readline libxml-2.0'; $optional_packages = [ 'zstd' => 'libzstd', - 'ldap' => 'ldap', - 'libpam' => 'libpam', + // 'ldap' => 'ldap', 'libxslt' => 'libxslt', 'icu' => 'icu-i18n', ]; + + f_putenv('PKG_CONFIG=' . BUILD_ROOT_PATH . '/bin/pkg-config'); + f_putenv('PKG_CONFIG_PATH=' . BUILD_LIB_PATH . '/pkgconfig'); + foreach ($optional_packages as $lib => $pkg) { if ($this->getBuilder()->getLib($lib)) { $packages .= ' ' . $pkg; + $output = shell()->execWithResult("pkg-config --static {$pkg}"); + logger()->info(var_export($output[1], true)); } } @@ -59,8 +64,8 @@ trait postgresql # 有静态链接配置 参考文件: src/interfaces/libpq/Makefile shell()->cd($this->source_dir . '/build') ->exec('sed -i.backup "s/invokes exit\'; exit 1;/invokes exit\';/" ../src/interfaces/libpq/Makefile') - ->exec('sed -i.backup "293 s/^/#$/" ../src/Makefile.shlib') - ->exec('sed -i.backup "441 s/^/#$/" ../src/Makefile.shlib'); + ->exec('sed -i.backup "278 s/^/# /" ../src/Makefile.shlib') + ->exec('sed -i.backup "402 s/^/# /" ../src/Makefile.shlib'); // configure shell()->cd($this->source_dir . '/build') @@ -73,25 +78,24 @@ trait postgresql '--with-readline ' . '--with-libxml ' . ($this->builder->getLib('icu') ? '--with-icu ' : '--without-icu ') . - ($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') . - ($this->builder->getLib('libpam') ? '--with-pam ' : '--without-pam ') . + '--without-ldap ' . ($this->builder->getLib('libxslt') ? '--with-libxslt ' : '--without-libxslt ') . ($this->builder->getLib('zstd') ? '--with-zstd ' : '--without-zstd ') . '--without-lz4 ' . '--without-perl ' . '--without-python ' . + '--without-pam ' . '--without-bonjour ' . '--without-tcl ' ); + // ($this->builder->getLib('ldap') ? '--with-ldap ' : '--without-ldap ') . // build shell()->cd($this->source_dir . '/build') ->exec($envs . ' make -C src/bin/pg_config install') ->exec($envs . ' make -C src/include install') ->exec($envs . ' make -C src/common install') - ->exec($envs . ' make -C src/backend/port install') ->exec($envs . ' make -C src/port install') - ->exec($envs . ' make -C src/backend/libpq install') ->exec($envs . ' make -C src/interfaces/libpq install'); // remove dynamic libs diff --git a/src/SPC/builder/unix/library/tidy.php b/src/SPC/builder/unix/library/tidy.php new file mode 100644 index 00000000..6bb957c0 --- /dev/null +++ b/src/SPC/builder/unix/library/tidy.php @@ -0,0 +1,32 @@ +source_dir . '/build-dir'); + shell()->cd($this->source_dir . '/build-dir') + ->exec( + 'cmake ' . + "{$this->builder->makeCmakeArgs()} " . + '-DBUILD_SHARED_LIB=OFF ' . + '-DSUPPORT_CONSOLE_APP=OFF ' . + '..' + ) + ->exec("cmake --build . -j {$this->builder->concurrency}") + ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + $this->patchPkgconfPrefix(['tidy.pc']); + } +} diff --git a/src/SPC/command/BuildCliCommand.php b/src/SPC/command/BuildCliCommand.php index 72235847..5bd0bba3 100644 --- a/src/SPC/command/BuildCliCommand.php +++ b/src/SPC/command/BuildCliCommand.php @@ -16,7 +16,7 @@ use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use ZM\Logger\ConsoleColor; -#[AsCommand('build', 'build CLI binary')] +#[AsCommand('build', 'build PHP')] class BuildCliCommand extends BuildCommand { public function configure(): void @@ -33,6 +33,8 @@ class BuildCliCommand extends BuildCommand $this->addOption('disable-opcache-jit', null, null, 'disable opcache jit'); $this->addOption('with-hardcoded-ini', 'I', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Patch PHP source code, inject hardcoded INI'); $this->addOption('with-micro-fake-cli', null, null, 'Enable phpmicro fake cli'); + $this->addOption('with-suggested-libs', 'L', null, 'Build with suggested libs for selected exts and libs'); + $this->addOption('with-suggested-exts', 'E', null, 'Build with suggested extensions for selected exts'); } public function handle(): int @@ -42,12 +44,9 @@ class BuildCliCommand extends BuildCommand // transform string to array $extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions')))); - $rule = BUILD_TARGET_NONE; - $rule |= ($this->getOption('build-cli') ? BUILD_TARGET_CLI : BUILD_TARGET_NONE); - $rule |= ($this->getOption('build-micro') ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE); - $rule |= ($this->getOption('build-fpm') ? BUILD_TARGET_FPM : BUILD_TARGET_NONE); - $rule |= ($this->getOption('build-embed') ? BUILD_TARGET_EMBED : BUILD_TARGET_NONE); - $rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE); + // parse rule with options + $rule = $this->parseRules(); + if ($rule === BUILD_TARGET_NONE) { $this->output->writeln('Please add at least one build target!'); $this->output->writeln("\t--build-cli\tBuild php-cli SAPI"); @@ -62,16 +61,27 @@ class BuildCliCommand extends BuildCommand $builder = BuilderProvider::makeBuilderByInput($this->input); // calculate dependencies [$extensions, $libraries, $not_included] = DependencyUtil::getExtLibsByDeps($extensions, $libraries); - /* @phpstan-ignore-next-line */ - logger()->info('Build target: ' . ConsoleColor::yellow($builder->getBuildTypeName($rule))); - /* @phpstan-ignore-next-line */ - logger()->info('Enabled extensions: ' . ConsoleColor::yellow(implode(', ', $extensions))); - /* @phpstan-ignore-next-line */ - logger()->info('Required libraries: ' . ConsoleColor::yellow(implode(', ', $libraries))); - if (!empty($not_included)) { - logger()->warning('some extensions will be enabled due to dependencies: ' . implode(',', $not_included)); + + // print info + $indent_texts = [ + 'Build OS' => PHP_OS_FAMILY . ' (' . php_uname('m') . ')', + 'Build SAPI' => $builder->getBuildTypeName($rule), + 'Extensions (' . count($extensions) . ')' => implode(', ', $extensions), + 'Libraries (' . count($libraries) . ')' => implode(', ', $libraries), + 'Strip Binaries' => $builder->getOption('no-strip') ? 'no' : 'yes', + 'Enable ZTS' => $builder->getOption('enable-zts') ? 'yes' : 'no', + ]; + if (!empty($this->input->getOption('with-hardcoded-ini'))) { + $indent_texts['Hardcoded INI'] = $this->input->getOption('with-hardcoded-ini'); } + $this->printFormatInfo($indent_texts); + + if (!empty($not_included)) { + logger()->warning('Some extensions will be enabled due to dependencies: ' . implode(',', $not_included)); + } + logger()->info('Build will start after 2s ...'); sleep(2); + if ($this->input->getOption('with-clean')) { logger()->info('Cleaning source dir...'); FileSystem::removeDir(SOURCE_PATH); @@ -140,4 +150,41 @@ class BuildCliCommand extends BuildCommand return static::FAILURE; } } + + /** + * Parse build options to rule int. + */ + private function parseRules(): int + { + $rule = BUILD_TARGET_NONE; + $rule |= ($this->getOption('build-cli') ? BUILD_TARGET_CLI : BUILD_TARGET_NONE); + $rule |= ($this->getOption('build-micro') ? BUILD_TARGET_MICRO : BUILD_TARGET_NONE); + $rule |= ($this->getOption('build-fpm') ? BUILD_TARGET_FPM : BUILD_TARGET_NONE); + $rule |= ($this->getOption('build-embed') ? BUILD_TARGET_EMBED : BUILD_TARGET_NONE); + $rule |= ($this->getOption('build-all') ? BUILD_TARGET_ALL : BUILD_TARGET_NONE); + return $rule; + } + + private function printFormatInfo(array $indent_texts): void + { + // calculate space count for every line + $maxlen = 0; + foreach ($indent_texts as $k => $v) { + $maxlen = max(strlen($k), $maxlen); + } + foreach ($indent_texts as $k => $v) { + if (is_string($v)) { + /* @phpstan-ignore-next-line */ + logger()->info($k . ': ' . str_pad('', $maxlen - strlen($k)) . ConsoleColor::yellow($v)); + } elseif (is_array($v) && !is_assoc_array($v)) { + $first = array_shift($v); + /* @phpstan-ignore-next-line */ + logger()->info($k . ': ' . str_pad('', $maxlen - strlen($k)) . ConsoleColor::yellow($first)); + foreach ($v as $vs) { + /* @phpstan-ignore-next-line */ + logger()->info(str_pad('', $maxlen + 2) . ConsoleColor::yellow($vs)); + } + } + } + } } diff --git a/src/SPC/command/dev/AllExtCommand.php b/src/SPC/command/dev/AllExtCommand.php index 196de39f..399156c2 100644 --- a/src/SPC/command/dev/AllExtCommand.php +++ b/src/SPC/command/dev/AllExtCommand.php @@ -12,6 +12,7 @@ use SPC\store\Config; use SPC\util\DependencyUtil; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Style\SymfonyStyle; use function Laravel\Prompts\table; @@ -22,6 +23,13 @@ class AllExtCommand extends BaseCommand public function configure(): void { $this->addArgument('extensions', InputArgument::OPTIONAL, 'List of extensions that will be displayed, comma separated'); + $this->addOption( + 'columns', + null, + InputOption::VALUE_REQUIRED, + 'List of columns that will be displayed, comma separated (lib-depends, lib-suggests, ext-depends, ext-suggests, unix-only)', + 'lib-depends,lib-suggests,ext-depends,ext-suggests,unix-only' + ); } /** @@ -32,6 +40,16 @@ class AllExtCommand extends BaseCommand public function handle(): int { $extensions = array_map('trim', array_filter(explode(',', $this->getArgument('extensions') ?? ''))); + $columns = array_map('trim', array_filter(explode(',', $this->getOption('columns')))); + + foreach ($columns as $column) { + if (!in_array($column, ['lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests', 'unix-only', 'type'])) { + $this->output->writeln('Column name [' . $column . '] is not valid.'); + $this->output->writeln('Available column name: lib-depends, lib-suggests, ext-depends, ext-suggests, unix-only, type'); + return static::FAILURE; + } + } + array_unshift($columns, 'name'); $style = new SymfonyStyle($this->input, $this->output); $style->writeln($extensions ? 'Available extensions:' : 'Extensions:'); @@ -51,23 +69,26 @@ class AllExtCommand extends BaseCommand $lib_suggests = Config::getExt($extension, 'lib-suggests', []); $ext_suggests = Config::getExt($extension, 'ext-suggests', []); - $data[] = [ - $extension, - implode(', ', $libraries), - implode(', ', $lib_suggests), - implode(',', $not_included), - implode(', ', $ext_suggests), - Config::getExt($extension, 'unix-only', false) ? 'true' : 'false', - ]; + $row = []; + foreach ($columns as $column) { + $row[] = match ($column) { + 'name' => $extension, + 'type' => Config::getExt($extension, 'type'), + 'lib-depends' => implode(', ', $libraries), + 'lib-suggests' => implode(', ', $lib_suggests), + 'ext-depends' => implode(',', $not_included), + 'ext-suggests' => implode(', ', $ext_suggests), + 'unix-only' => Config::getExt($extension, 'unix-only', false) ? 'true' : 'false', + default => '', + }; + } + $data[] = $row; } if ($data === []) { $style->warning('Unknown extension selected: ' . implode(',', $extensions)); } else { - table( - ['Extension', 'lib-depends', 'lib-suggests', 'ext-depends', 'ext-suggests', 'unix-only'], - $data - ); + table($columns, $data); } return static::SUCCESS; diff --git a/src/SPC/doctor/item/LinuxToolCheckList.php b/src/SPC/doctor/item/LinuxToolCheckList.php index ee9394f3..01df03d6 100644 --- a/src/SPC/doctor/item/LinuxToolCheckList.php +++ b/src/SPC/doctor/item/LinuxToolCheckList.php @@ -21,6 +21,7 @@ class LinuxToolCheckList 'tar', 'unzip', 'gzip', 'bzip2', 'cmake', 'gcc', 'g++', 'patch', 'binutils-gold', + 'libtoolize', ]; public const TOOLS_DEBIAN = [ @@ -28,7 +29,7 @@ class LinuxToolCheckList 'git', 'autoconf', 'automake', 'tar', 'unzip', 'gzip', 'bzip2', 'cmake', 'patch', - 'xz', + 'xz', 'libtoolize', ]; public const TOOLS_RHEL = [ @@ -36,7 +37,7 @@ class LinuxToolCheckList 'git', 'autoconf', 'automake', 'tar', 'unzip', 'gzip', 'gcc', 'bzip2', 'cmake', 'patch', - 'xz', 'wget', // to get musl + 'xz', ]; /** @noinspection PhpUnused */ @@ -47,8 +48,7 @@ class LinuxToolCheckList $required = match ($distro['dist']) { 'alpine' => self::TOOLS_ALPINE, - 'almalinux' => self::TOOLS_RHEL, - 'rhel' => self::TOOLS_RHEL, + 'redhat' => self::TOOLS_RHEL, default => self::TOOLS_DEBIAN, }; $missing = []; @@ -61,8 +61,7 @@ class LinuxToolCheckList return match ($distro['dist']) { 'ubuntu', 'alpine', - 'rhel', - 'almalinux', + 'redhat', 'debian' => CheckResult::fail(implode(', ', $missing) . ' not installed on your system', 'install-linux-tools', [$distro, $missing]), default => CheckResult::fail(implode(', ', $missing) . ' not installed on your system'), }; @@ -74,11 +73,10 @@ class LinuxToolCheckList #[AsCheckItem('if necessary packages are installed', limit_os: 'Linux')] public function checkSystemOSPackages(): ?CheckResult { - $distro = SystemUtil::getOSRelease(); - if ($distro['dist'] === 'alpine') { + if (SystemUtil::isMuslDist()) { // check linux-headers installation if (!file_exists('/usr/include/linux/mman.h')) { - return CheckResult::fail('linux-headers not installed on your system', 'install-linux-tools', [$distro, ['linux-headers']]); + return CheckResult::fail('linux-headers not installed on your system', 'install-linux-tools', [SystemUtil::getOSRelease(), ['linux-headers']]); } } return CheckResult::ok(); @@ -94,8 +92,7 @@ class LinuxToolCheckList $install_cmd = match ($distro['dist']) { 'ubuntu', 'debian' => 'apt-get install -y', 'alpine' => 'apk add', - 'rhel' => 'dnf install -y', - 'almalinux' => 'dnf install -y', + 'redhat' => 'dnf install -y', default => throw new RuntimeException('Current linux distro does not have an auto-install script for musl packages yet.'), }; $prefix = ''; @@ -104,8 +101,10 @@ class LinuxToolCheckList logger()->warning('Current user is not root, using sudo for running command'); } try { - $is_rhel = in_array($distro['dist'], ['rhel', 'almalinux']); - $to_install = $is_rhel ? $missing : str_replace('xz', 'xz-utils', $missing); + $is_debian = in_array($distro['dist'], ['debian', 'ubuntu']); + $to_install = $is_debian ? str_replace('xz', 'xz-utils', $missing) : $missing; + // debian, alpine libtool -> libtoolize + $to_install = str_replace('libtoolize', 'libtool', $to_install); shell(true)->exec($prefix . $install_cmd . ' ' . implode(' ', $to_install)); } catch (RuntimeException) { return false; diff --git a/src/SPC/doctor/item/MacOSToolCheckList.php b/src/SPC/doctor/item/MacOSToolCheckList.php index df1e6ed4..9f43e8fb 100644 --- a/src/SPC/doctor/item/MacOSToolCheckList.php +++ b/src/SPC/doctor/item/MacOSToolCheckList.php @@ -25,6 +25,7 @@ class MacOSToolCheckList 'autoconf', 'automake', 'tar', + 'libtool', 'unzip', 'xz', 'gzip', diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index b0edc303..426f978a 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -134,6 +134,12 @@ class SourcePatcher $patch_file = ROOT_DIR . "/src/globals/patch/{$patch_name}"; $patch_str = str_replace('/', DIRECTORY_SEPARATOR, $patch_file); + // copy patch from phar + if (\Phar::running() !== '') { + file_put_contents(SOURCE_PATH . '/' . $patch_name, file_get_contents($patch_file)); + $patch_str = str_replace('/', DIRECTORY_SEPARATOR, SOURCE_PATH . '/' . $patch_name); + } + f_passthru( 'cd ' . $cwd . ' && ' . (PHP_OS_FAMILY === 'Windows' ? 'type' : 'cat') . ' ' . $patch_str . ' | patch -p1 ' . ($reverse ? '-R' : '') diff --git a/src/globals/patch/0001_imap_macos.patch b/src/globals/patch/0001_imap_macos.patch new file mode 100644 index 00000000..c977de6a --- /dev/null +++ b/src/globals/patch/0001_imap_macos.patch @@ -0,0 +1,220 @@ +From 5ab3bd7fa858eec0626a9dd0117ca3b050ef4660 Mon Sep 17 00:00:00 2001 +From: crazywhalecc +Date: Mon, 13 Nov 2023 00:00:52 +0800 +Subject: [PATCH] make macOS static compile happy + +--- + src/c-client/netmsg.c | 1 + + src/c-client/nntp.c | 1 + + src/osdep/amiga/dummy.c | 1 + + src/osdep/amiga/mbx.c | 1 + + src/osdep/amiga/mh.c | 1 + + src/osdep/amiga/mtx.c | 1 + + src/osdep/amiga/unix.c | 1 + + src/osdep/unix/dummy.c | 1 + + src/osdep/unix/mbx.c | 1 + + src/osdep/unix/mh.c | 1 + + src/osdep/unix/mmdf.c | 1 + + src/osdep/unix/mtx.c | 1 + + src/osdep/unix/mx.c | 1 + + src/osdep/unix/tcp_unix.c | 1 + + src/osdep/unix/tenex.c | 2 ++ + src/osdep/unix/unix.c | 1 + + 16 files changed, 17 insertions(+) + +diff --git a/src/c-client/netmsg.c b/src/c-client/netmsg.c +index 187e4eb..f316d0b 100644 +--- a/src/c-client/netmsg.c ++++ b/src/c-client/netmsg.c +@@ -29,6 +29,7 @@ + + #include + #include ++#include + extern int errno; /* just in case */ + #include "c-client.h" + #include "netmsg.h" +diff --git a/src/c-client/nntp.c b/src/c-client/nntp.c +index fe90edb..b2f7536 100644 +--- a/src/c-client/nntp.c ++++ b/src/c-client/nntp.c +@@ -29,6 +29,7 @@ + + #include + #include ++#include + #include "c-client.h" + #include "newsrc.h" + #include "netmsg.h" +diff --git a/src/osdep/amiga/dummy.c b/src/osdep/amiga/dummy.c +index b003a0b..2c65824 100644 +--- a/src/osdep/amiga/dummy.c ++++ b/src/osdep/amiga/dummy.c +@@ -35,6 +35,7 @@ extern int errno; /* just in case */ + #include "osdep.h" + #include + #include ++#include + #include "dummy.h" + #include "misc.h" + +diff --git a/src/osdep/amiga/mbx.c b/src/osdep/amiga/mbx.c +index 1ece5d8..2495965 100644 +--- a/src/osdep/amiga/mbx.c ++++ b/src/osdep/amiga/mbx.c +@@ -43,6 +43,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/amiga/mh.c b/src/osdep/amiga/mh.c +index 0226b7a..e7c907a 100644 +--- a/src/osdep/amiga/mh.c ++++ b/src/osdep/amiga/mh.c +@@ -36,6 +36,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/amiga/mtx.c b/src/osdep/amiga/mtx.c +index 8e6f76e..ca7b368 100644 +--- a/src/osdep/amiga/mtx.c ++++ b/src/osdep/amiga/mtx.c +@@ -43,6 +43,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/amiga/unix.c b/src/osdep/amiga/unix.c +index be3c437..c755fe7 100644 +--- a/src/osdep/amiga/unix.c ++++ b/src/osdep/amiga/unix.c +@@ -46,6 +46,7 @@ extern int errno; /* just in case */ + #include "osdep.h" + #include + #include ++#include + #include "unix.h" + #include "pseudo.h" + #include "fdstring.h" +diff --git a/src/osdep/unix/dummy.c b/src/osdep/unix/dummy.c +index b003a0b..2c65824 100644 +--- a/src/osdep/unix/dummy.c ++++ b/src/osdep/unix/dummy.c +@@ -35,6 +35,7 @@ extern int errno; /* just in case */ + #include "osdep.h" + #include + #include ++#include + #include "dummy.h" + #include "misc.h" + +diff --git a/src/osdep/unix/mbx.c b/src/osdep/unix/mbx.c +index 1ece5d8..2495965 100644 +--- a/src/osdep/unix/mbx.c ++++ b/src/osdep/unix/mbx.c +@@ -43,6 +43,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/unix/mh.c b/src/osdep/unix/mh.c +index 0226b7a..e7c907a 100644 +--- a/src/osdep/unix/mh.c ++++ b/src/osdep/unix/mh.c +@@ -36,6 +36,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/unix/mmdf.c b/src/osdep/unix/mmdf.c +index e962434..8cc9fae 100644 +--- a/src/osdep/unix/mmdf.c ++++ b/src/osdep/unix/mmdf.c +@@ -34,6 +34,7 @@ extern int errno; /* just in case */ + #include "osdep.h" + #include + #include ++#include + #include "pseudo.h" + #include "fdstring.h" + #include "misc.h" +diff --git a/src/osdep/unix/mtx.c b/src/osdep/unix/mtx.c +index 8e6f76e..ca7b368 100644 +--- a/src/osdep/unix/mtx.c ++++ b/src/osdep/unix/mtx.c +@@ -43,6 +43,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/unix/mx.c b/src/osdep/unix/mx.c +index 4549527..9d444c9 100644 +--- a/src/osdep/unix/mx.c ++++ b/src/osdep/unix/mx.c +@@ -36,6 +36,7 @@ extern int errno; /* just in case */ + #include + #include + #include ++#include + #include "misc.h" + #include "dummy.h" + #include "fdstring.h" +diff --git a/src/osdep/unix/tcp_unix.c b/src/osdep/unix/tcp_unix.c +index 5bad706..5d6cd03 100644 +--- a/src/osdep/unix/tcp_unix.c ++++ b/src/osdep/unix/tcp_unix.c +@@ -27,6 +27,7 @@ + */ + + #include "ip_unix.c" ++#include + + #undef write /* don't use redefined write() */ + +diff --git a/src/osdep/unix/tenex.c b/src/osdep/unix/tenex.c +index eee61fb..61760f0 100644 +--- a/src/osdep/unix/tenex.c ++++ b/src/osdep/unix/tenex.c +@@ -46,6 +46,8 @@ extern int errno; /* just in case */ + #include "mail.h" + #include "osdep.h" + #include ++#include ++#include + #include "misc.h" + #include "dummy.h" + +diff --git a/src/osdep/unix/unix.c b/src/osdep/unix/unix.c +index be3c437..c755fe7 100644 +--- a/src/osdep/unix/unix.c ++++ b/src/osdep/unix/unix.c +@@ -46,6 +46,7 @@ extern int errno; /* just in case */ + #include "osdep.h" + #include + #include ++#include + #include "unix.h" + #include "pseudo.h" + #include "fdstring.h" +-- +2.39.3 (Apple Git-145) + diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php new file mode 100644 index 00000000..a80c9a78 --- /dev/null +++ b/src/globals/test-extensions.php @@ -0,0 +1,8 @@ +