diff --git a/.github/workflows/readme-release.yml b/.github/workflows/readme-release.yml index 1e413d14..087cbcd1 100644 --- a/.github/workflows/readme-release.yml +++ b/.github/workflows/readme-release.yml @@ -153,7 +153,9 @@ jobs: RELEASE_NOTES='First version' else printf 'Generating release notes for commits between %s and %s\n' "$VERSIONTAG_PREVIOUS" "$VERSIONTAG_THIS" - RELEASE_NOTES="$(git log --format='- %s' --no-merges --reverse "refs/tags/$VERSIONTAG_PREVIOUS...refs/tags/$VERSIONTAG_THIS" -- ./install-php-extensions ./Dockerfile | grep -vE '^- \[minor\]')" + if ! RELEASE_NOTES="$(git log --format='- %s' --no-merges --reverse "refs/tags/$VERSIONTAG_PREVIOUS...refs/tags/$VERSIONTAG_THIS" -- ./install-php-extensions ./Dockerfile | grep -vE '^- \[minor\]')"; then + RELEASE_NOTES= + fi fi printf 'Release notes:\n%s\n' "$RELEASE_NOTES" printf 'RELEASE_NAME=v%s\n' "$VERSIONTAG_THIS" >> "$GITHUB_ENV" @@ -170,19 +172,53 @@ jobs: username: mlocati password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build docker image + name: Login to GitHub Container Registry if: env.VERSIONTAG_THIS != '' - run: > - docker build - --tag "mlocati/php-extension-installer:$VERSIONTAG_THIS" - --tag "mlocati/php-extension-installer:${VERSIONTAG_THIS%.*}" - --tag "mlocati/php-extension-installer:${VERSIONTAG_THIS%%.*}" - --tag mlocati/php-extension-installer:latest - . - - - name: Push docker image to Docker Hub + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Set up docker buildx if: env.VERSIONTAG_THIS != '' - run: docker push --all-tags mlocati/php-extension-installer + uses: docker/setup-buildx-action@v2 + with: + install: true + - + name: Define versions + if: env.VERSIONTAG_THIS != '' + id: define-versions + run: | + printf 'mayor-minor-patch=%s\n' "$VERSIONTAG_THIS" >>"$GITHUB_OUTPUT" + printf 'mayor-minor=%s\n' "${VERSIONTAG_THIS%.*}" >>"$GITHUB_OUTPUT" + printf 'mayor=%s\n' "${VERSIONTAG_THIS%%.*}" >>"$GITHUB_OUTPUT" + - + name: Build and push docker image + if: env.VERSIONTAG_THIS != '' + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor-minor-patch }} + ghcr.io/mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor-minor-patch }} + mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor-minor }} + ghcr.io/mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor-minor }} + mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor }} + ghcr.io/mlocati/php-extension-installer:${{ steps.define-versions.outputs.mayor }} + mlocati/php-extension-installer:latest + ghcr.io/mlocati/php-extension-installer:latest + # Build for all platforms also supported by php images (https://hub.docker.com/_/php/tags) + platforms: | + linux/386 + linux/amd64 + linux/arm/v5 + linux/arm/v7 + linux/arm64/v8 + linux/mips64le + linux/ppc64le + linux/s390x - name: Create release if: env.VERSIONTAG_THIS != '' diff --git a/.github/workflows/update-ghcr-badge.yml b/.github/workflows/update-ghcr-badge.yml new file mode 100644 index 00000000..cb1aca35 --- /dev/null +++ b/.github/workflows/update-ghcr-badge.yml @@ -0,0 +1,57 @@ +name: Update GitHub Registry badge + +on: + schedule: + - cron: "0 12 * * *" + workflow_dispatch: + +jobs: + update-ghcr-badge: + name: Update GitHub Registry badge + runs-on: windows-latest + steps: + - + name: Checkout + uses: actions/checkout@v4 + with: + ref: assets + - + name: Build badge + id: build-badge + run: | + $response = Invoke-WebRequest -Uri https://github.com/mlocati/docker-php-extension-installer/pkgs/container/php-extension-installer -ErrorAction Stop + $html = $response.Content -replace '\s+', ' ' + if (-not($html -match 'Total downloads.*?> *(?\d+\w*)')) { + throw 'Unable to find the total downloads count' + } + $count = $Matches.count + Write-Host -Object "Current downloads count: $count" + $response = Invoke-WebRequest -Uri https://img.shields.io/badge/GitHub_Registry_pulls-$count-066da5 -ErrorAction Stop + $newBadge = $response.Content.Trim() + Write-Host -Object "Badge source: $newBadge" + $badgePath = 'resources/ghcr-badge.svg' + $badgeUpdated = $true + if (Test-Path -LiteralPath $badgePath -PathType Leaf) { + $oldBadge = (Get-Content -LiteralPath $badgePath -Encoding utf8 -Raw).Trim() + if ($oldBadge -eq $newBadge) { + Write-Host -Object 'Badge is already up-to-date' + $badgeUpdated = $false + } else { + Write-Host -Object 'Badge is updated' + } + } else { + Write-Host -Object 'Badge is new' + } + if ($badgeUpdated) { + Set-Content -LiteralPath $badgePath -Value $newBadge -NoNewline -Encoding utf8 -ErrorAction Stop + 'updated=yes' | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8 + } + - + name: Commit + if: steps.build-badge.outputs.updated == 'yes' + run: | + git add resources/ghcr-badge.svg + git config user.name GitHub + git config user.email noreply@github.com + git commit -m 'Update GitHub Registry badge' + git push diff --git a/README.md b/README.md index bfd356f4..afb631a1 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![Downloaded GitHub Releases](https://img.shields.io/github/downloads/mlocati/docker-php-extension-installer/total?label=Downloaded%20releases)](https://github.com/mlocati/docker-php-extension-installer/releases) -[![Docker Hub pulls](https://img.shields.io/docker/pulls/mlocati/php-extension-installer)](https://hub.docker.com/r/mlocati/php-extension-installer) +[![Docker Hub pulls](https://img.shields.io/docker/pulls/mlocati/php-extension-installer?label=Docker%20Hub%20pulls)](https://hub.docker.com/r/mlocati/php-extension-installer) +[![GitHub Registry pulls](https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/refs/heads/assets/resources/ghcr-badge.svg)](https://github.com/mlocati/docker-php-extension-installer/pkgs/container/php-extension-installer) [![Test recent](https://github.com/mlocati/docker-php-extension-installer/actions/workflows/test-recent-extensions.yml/badge.svg)](https://github.com/mlocati/docker-php-extension-installer/actions/workflows/test-recent-extensions.yml) # Easy installation of PHP extensions in official PHP Docker images @@ -54,26 +55,45 @@ RUN ( curl -sSLf https://github.com/mlocati/docker-php-extension-installer/relea ### Copying the script from a Docker image -```Dockerfile -FROM php:7.2-cli - -COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ - -RUN install-php-extensions gd xdebug -``` +- using GitHub Container Registry + + ```Dockerfile + FROM php:8.4-cli + + COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ + + RUN install-php-extensions gd xdebug + ``` +- using Docker Hub + + ```Dockerfile + FROM php:8.4-cli + + COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ + + RUN install-php-extensions gd xdebug + ``` -**Warning**: by using this method you may use an outdated version of the `mlocati/php-extension-installer` image. -You may want to run `docker pull mlocati/php-extension-installer` in order to use an up-to-date version. +**Warning**: by using this method you may use an outdated version of the Docker image image. +You may want to run `docker pull ghcr.io/mlocati/php-extension-installer` or `docker pull mlocati/php-extension-installer` in order to use an up-to-date version. ### Using the script of a Docker image -```Dockerfile -RUN --mount=type=bind,from=mlocati/php-extension-installer:latest,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \ +- using GitHub Container Registry + + ```Dockerfile + RUN --mount=type=bind,from=ghcr.io/mlocati/php-extension-installer:latest,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \ install-php-extensions gd xdebug -``` + ``` +- using Docker Hub + + ```Dockerfile + RUN --mount=type=bind,from=mlocati/php-extension-installer:latest,source=/usr/bin/install-php-extensions,target=/usr/local/bin/install-php-extensions \ + install-php-extensions gd xdebug + ``` -**Warning**: by using this method you may use an outdated version of the `mlocati/php-extension-installer` image. -You may want to run `docker pull mlocati/php-extension-installer` in order to use an up-to-date version. +**Warning**: by using this method you may use an outdated version of the Docker image image. +You may want to run `docker pull ghcr.io/mlocati/php-extension-installer` or `docker pull mlocati/php-extension-installer` in order to use an up-to-date version. ## Installing specific versions of an extension @@ -208,13 +228,14 @@ install-php-extensions @fix_letsencrypt | bcmath | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | bitset | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | blackfire | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| brotli | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | bz2 | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | calendar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | cassandra[*](#special-requirements-for-cassandra) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | cmark | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | | | | csv | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | dba | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| ddtrace[*](#special-requirements-for-ddtrace) | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | +| ddtrace[*](#special-requirements-for-ddtrace) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | decimal | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | ds | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | ecma_intl[*](#special-requirements-for-ecma_intl) | | ✓ | ✓ | | | | | | | | | | @@ -235,9 +256,9 @@ install-php-extensions @fix_letsencrypt | gmp | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | gnupg | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | grpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| http | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| http | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | igbinary | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| imagick | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| imagick | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | imap | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | inotify | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | interbase | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | @@ -324,7 +345,7 @@ install-php-extensions @fix_letsencrypt | sysvsem | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | sysvshm | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | tensor | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | -| tideways | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| tideways | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | tidy | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | timezonedb | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | uopz | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | @@ -335,24 +356,24 @@ install-php-extensions @fix_letsencrypt | vld | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | wddx | | | | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | wikidiff2[*](#special-requirements-for-wikidiff2) | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | -| xdebug | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xdebug | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | xdiff | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | xhprof | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | xlswriter | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | -| xmldiff | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | +| xmldiff | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | xmlrpc | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | xpass[*](#special-requirements-for-xpass) | ✓ | ✓ | ✓ | ✓ | ✓ | | | | | | | | | xsl | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | yac | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | yaml | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | yar | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -| zephir_parser | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | +| zephir_parser | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | | | zip | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | zmq | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | zookeeper | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | zstd | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | -*Number of supported extensions: 150* +*Number of supported extensions: 151* PS: the pre-installed PHP extensions are excluded from this list. diff --git a/data/supported-extensions b/data/supported-extensions index 2b9b136c..1e5d9c6d 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -5,13 +5,14 @@ ast 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 bcmath 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 bitset 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 blackfire 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 +brotli 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 bz2 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 calendar 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 cassandra 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 cmark 7.0 7.1 7.2 7.3 7.4 csv 7.3 7.4 8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8.4 yaml 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 yar 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 -zephir_parser 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 +zephir_parser 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 zip 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 zmq 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 zookeeper 5.5 5.6 7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 diff --git a/install-php-extensions b/install-php-extensions index 4a21965c..7975f9e2 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -273,6 +273,15 @@ EOT # Nothing processPHPModuleArgument() { processPHPModuleArgument_arg="$1" + case "$processPHPModuleArgument_arg" in + imagick) + if test $PHP_MAJMIN_VERSION -ge 804; then + processPHPModuleArgument_arg=imagick/imagick@65e27f2bc02e7e8f1bf64e26e359e42a1331fca1 + elif test $PHP_MAJMIN_VERSION -ge 803; then + processPHPModuleArgument_arg=imagick/imagick@28f27044e435a2b203e32675e942eb8de620ee58 + fi + ;; + esac # Convert GitHub short form to long url, # for example: from # php-memcached-dev/php-memcached@8f106564e6bb005ca6100b12ccc89000daafa9d8 @@ -787,8 +796,11 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile enchant2-dev" else # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + if ! isLibenchant1Installed; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent glib aspell-libs libhunspell" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile glib-dev aspell-dev hunspell-dev" + COMPILE_LIBS="$COMPILE_LIBS libenchant1" + fi fi else buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent enchant" @@ -801,9 +813,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant-2-2" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libenchant-2-dev" else - # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev" + if ! isLibenchant1Installed; then + # The system provides libenchant2, supported since PHP 8.0: we need to build libenchant1 on our own + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent aspell-en libhunspell-1.7-0" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libglib2.0-dev libaspell-dev libhunspell-dev" + COMPILE_LIBS="$COMPILE_LIBS libenchant1" + fi fi else buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libenchant1c2a" @@ -1419,6 +1434,12 @@ buildRequiredPackageLists() { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile sqlite-dev" fi fi + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi ;; swoole@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libcurl3-gnutls libpq5" @@ -1434,6 +1455,11 @@ buildRequiredPackageLists() { fi fi fi + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent liburing2" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile liburing-dev" + fi ;; sybase_ct@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" @@ -1696,7 +1722,7 @@ expandPackagesToBeInstalled() { resetIFS ;; debian) - expandPackagesToBeInstalled_log="$(DEBIAN_FRONTEND=noninteractive apt-get install -sy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $@ 2>&1 || printf '\nE: apt-get failed\n')" + expandPackagesToBeInstalled_log="$(apt-get install -sy --no-install-recommends $@ 2>&1 || printf '\nE: apt-get failed\n')" if test -n "$(printf '%s' "$expandPackagesToBeInstalled_log" | grep -E '^E:')"; then printf 'FAILED TO LIST THE WHOLE PACKAGE LIST FOR\n' >&2 printf '%s ' "$@" >&2 @@ -1965,7 +1991,7 @@ markPreinstalledPackagesAsUsed() { apk add $PACKAGES_PERSISTENT_PRE ;; debian) - DEBIAN_FRONTEND=noninteractive apt-mark manual $PACKAGES_PERSISTENT_PRE + apt-mark manual $PACKAGES_PERSISTENT_PRE ;; esac } @@ -1991,7 +2017,7 @@ installRequiredPackages() { done ;; debian) - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE + apt-get install -qqy --no-install-recommends $PACKAGES_PERSISTENT_NEW $PACKAGES_VOLATILE ;; esac } @@ -2173,12 +2199,12 @@ installMicrosoftSqlServerODBC() { fi printf -- '- installing the APT package\n' if test $PHP_MAJMIN_VERSION -le 703; then - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql17 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql17 elif test $DISTRO_VERSION_NUMBER -ge 9 && test $DISTRO_VERSION_NUMBER -le 12; then # On Debian 9 to 12 we have both msodbcsql17 and msodbcsql18: let's install just one - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS msodbcsql18 + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends msodbcsql18 else - DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' + ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends '^msodbcsql[0-9]+$' fi ;; esac @@ -2442,6 +2468,23 @@ installLibXCrypt() { cd - >/dev/null } +isLibenchant1Installed() { + if test -f /usr/lib/libenchant.so || test -f /usr/local/lib/libenchant.so; then + return 0 + fi + return 1 +} + +installLibenchant1() { + printf 'Installing libenchant1\n' + installLibenchant1_src="$(getPackageSource https://github.com/rrthomas/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" + cd -- "$installLibenchant1_src" + ./configure + make -j$(getProcessorCount) + make install + cd - >/dev/null +} + # Install Composer installComposer() { installComposer_version="$(getWantedPHPModuleVersion @composer)" @@ -2640,6 +2683,9 @@ compileLibs() { if stringInList libxcrypt "$COMPILE_LIBS"; then installLibXCrypt fi + if stringInList libenchant1 "$COMPILE_LIBS"; then + installLibenchant1 + fi } # Install a bundled PHP module given its handle @@ -2681,32 +2727,6 @@ EOF fi docker-php-ext-configure dba --with-db4 ;; - enchant) - installBundledModule_tmp=0 - if test $PHP_MAJMIN_VERSION -lt 800; then - case "$DISTRO" in - alpine) - if test $DISTRO_MAJMIN_VERSION -ge 312; then - installBundledModule_tmp=1 - fi - ;; - debian) - if test $DISTRO_VERSION_NUMBER -ge 11; then - installBundledModule_tmp=1 - fi - ;; - esac - fi - if test $installBundledModule_tmp -eq 1 && ! test -f /usr/lib/libenchant.so && ! test -f /usr/local/lib/libenchant.so; then - # We need to install libenchant1 from source - installBundledModule_src="$(getPackageSource https://github.com/AbiWord/enchant/releases/download/enchant-1-6-1/enchant-1.6.1.tar.gz)" - cd -- "$installBundledModule_src" - ./configure - make -j$(getProcessorCount) - make install - cd - >/dev/null - fi - ;; ftp) if test $PHP_MAJMIN_VERSION -ge 804; then docker-php-ext-configure ftp --with-ftp-ssl=/usr @@ -2762,7 +2782,7 @@ EOF debian@9) installBundledModule_tmp="$(pwd)" cd /tmp - apt-get download $IPE_APTGET_INSTALLOPTIONS libc-client2007e-dev + apt-get download libc-client2007e-dev dpkg -i --ignore-depends=libssl-dev libc-client2007e-dev* rm libc-client2007e-dev* cd "$installBundledModule_tmp" @@ -2984,7 +3004,7 @@ installRemoteModule() { installRemoteModule_distro=linux ;; esac - installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION;') + installRemoteModule_tmp2=$(php -r 'echo PHP_MAJOR_VERSION . PHP_MINOR_VERSION . (ZEND_THREAD_SAFE ? "-zts" : "");') installRemoteModule_tmp="$(mktemp -p /tmp/src -d)" cd "$installRemoteModule_tmp" curl -sSLf --user-agent Docker https://blackfire.io/api/v1/releases/probe/php/$installRemoteModule_distro/$installRemoteModule_tmp1/$installRemoteModule_tmp2 | tar xz @@ -3873,6 +3893,13 @@ installRemoteModule() { fi fi ;; + smbclient) + if test -z "$installRemoteModule_version"; then + if test $PHP_MAJMIN_VERSION -le 506; then + installRemoteModule_version=1.1.1 + fi + fi + ;; snappy) if test -z "$installRemoteModule_path"; then if test -z "$installRemoteModule_version"; then @@ -4055,18 +4082,28 @@ installRemoteModule() { installRemoteModule_zts=no fi installRemoteModule_sqlite=yes + installRemoteModule_iouring=no case "$DISTRO" in alpine) if test $DISTRO_MAJMIN_VERSION -lt 317; then # we need sqlite3 >= 3.7.7 installRemoteModule_sqlite=no fi + # iouring support in swoole 6 requires liburing 2.5+: available since Alpine 3.19 + # but with Alpine 3.19 we have a "invalid use of incomplete type 'const struct statx'" error + if test $DISTRO_MAJMIN_VERSION -ge 320; then + installRemoteModule_iouring=yes + fi ;; debian) if test $DISTRO_MAJMIN_VERSION -lt 1200; then # we need sqlite3 >= 3.7.7 installRemoteModule_sqlite=no fi + if test $DISTRO_VERSION_NUMBER -ge 13; then + # iouring support in swoole 6 requires liburing 2.5+: available since Debian Trixie (13) + installRemoteModule_iouring=yes + fi ;; esac if test $(compareVersions "$installRemoteModule_version" 6.0.0) -ge 0; then @@ -4093,7 +4130,7 @@ installRemoteModule() { # enable swoole thread support (need php zts support)? addConfigureOption enable-swoole-thread $installRemoteModule_zts # enable iouring for file async support? - addConfigureOption enable-iouring yes + addConfigureOption enable-iouring $installRemoteModule_iouring elif test $(compareVersions "$installRemoteModule_version" 5.1.0) -ge 0; then # enable sockets supports? addConfigureOption enable-sockets $installRemoteModule_sockets @@ -4801,23 +4838,18 @@ removeStringFromList() { } # Invoke apt-get update -# -# Set: -# IPE_APTGET_INSTALLOPTIONS invokeAptGetUpdate() { if test -n "${IPE_APTGETUPDATE_ALREADY:-}"; then - DEBIAN_FRONTEND=noninteractive apt-get update -q + apt-get update -q return fi - IPE_APTGET_INSTALLOPTIONS='' - invokeAptGetUpdate_fixdistro='' + IPE_APTGETUPDATE_ALREADY=y if grep -q 'VERSION="8 (jessie)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=jessie elif grep -q 'VERSION="9 (stretch)"' /etc/os-release; then invokeAptGetUpdate_fixdistro=stretch else - IPE_APTGETUPDATE_ALREADY=y - DEBIAN_FRONTEND=noninteractive apt-get update -q + invokeAptGetUpdate return fi # See https://www.debian.org/distrib/archive.en.html for a list of mirrors @@ -4832,19 +4864,18 @@ invokeAptGetUpdate() { sed -ri "s;^(\s*deb\s+)http://security.debian.org/debian-security;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list sed -ri "s;^(\s*deb\s+)http://security.debian.org;\1$IPE_DEB_ARCHIVE_SECURITY;" /etc/apt/sources.list invokeAptGetUpdate_tmp="$(mktemp)" - DEBIAN_FRONTEND=noninteractive apt-get update -q 2>"$invokeAptGetUpdate_tmp" + apt-get update -q 2>"$invokeAptGetUpdate_tmp" if test -s "$invokeAptGetUpdate_tmp"; then cat "$invokeAptGetUpdate_tmp" >&2 if grep -qE ' KEYEXPIRED [0-9]' "$invokeAptGetUpdate_tmp"; then - IPE_APTGET_INSTALLOPTIONS='-o APT::Get::AllowUnauthenticated=true' echo '############' >&2 echo '# WARNING! #' >&2 echo '############' >&2 echo 'apt packages will be installed without checking authenticity!' >&2 + printf 'APT::Get::AllowUnauthenticated "true";\n' >>/etc/apt/apt.conf.d/99unauthenticated fi fi rm "$invokeAptGetUpdate_tmp" - IPE_APTGETUPDATE_ALREADY=y } # Fix the Let's Encrypt CA certificates on old distros @@ -4875,7 +4906,7 @@ fixLetsEncrypt() { invokeAptGetUpdate fi printf -- '- installing newer ca-certificates package\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends ${IPE_APTGET_INSTALLOPTIONS:-} ca-certificates + apt-get install -qqy --no-install-recommends ca-certificates fi ;; *) @@ -4920,11 +4951,11 @@ cleanup() { debian) if test -n "$PACKAGES_VOLATILE"; then printf '### REMOVING UNNEEDED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get remove --purge -y $PACKAGES_VOLATILE + apt-get remove --purge -y $PACKAGES_VOLATILE fi if test -n "$PACKAGES_PREVIOUS"; then printf '### RESTORING PREVIOUSLY INSTALLED PACKAGES ###\n' - DEBIAN_FRONTEND=noninteractive apt-get install -qqy --no-install-recommends --no-upgrade $IPE_APTGET_INSTALLOPTIONS $PACKAGES_PREVIOUS + apt-get install -qqy --no-install-recommends --no-upgrade $PACKAGES_PREVIOUS fi ;; esac @@ -4949,6 +4980,8 @@ cleanup() { esac } +DEBIAN_FRONTEND=noninteractive +export DEBIAN_FRONTEND resetIFS mkdir -p /tmp/src mkdir -p /tmp/pickle.tmp diff --git a/scripts/ci-test-extensions b/scripts/ci-test-extensions index e443cc32..bc6eb57b 100755 --- a/scripts/ci-test-extensions +++ b/scripts/ci-test-extensions @@ -23,7 +23,7 @@ set -o nounset # $2: the PHP version shouldProcessPhpVersionForDistro() { case "$2@$1" in - 8.1@alpine3.12 | 8.3@buster) + 8.0@alpine3.12 | 8.1@alpine3.12 | 8.3@buster) return 1 ;; *) @@ -160,9 +160,6 @@ getDockerImageName() { return fi case "$2" in - 8.4) - getDockerImageName_version="$2-rc" - ;; *) getDockerImageName_version="$2" ;; diff --git a/scripts/tests/brotli b/scripts/tests/brotli new file mode 100755 index 00000000..0a9cd047 --- /dev/null +++ b/scripts/tests/brotli @@ -0,0 +1,22 @@ +#!/usr/bin/env php + brotli_uncompress() failure!\n"); + exit(1); +} +echo "brotli_compress() -> brotli_uncompress() works\n"; + +return 0;