Use pre-compiled system libraries for GD AVIF support on Alpine 3.15+ (#653)

pull/657/head 1.5.45
Michele Locati 2022-11-02 22:36:19 +01:00 committed by GitHub
parent 343dc4b9df
commit 8f9e4f24d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 33 additions and 17 deletions

View File

@ -370,7 +370,7 @@ Here's the list of all the supported environment variables:
| | `IPE_KEEP_SYSPKG_CACHE=1` | By default the script will clear the apt/apk/pear cache in order to save disk space. You can disable it by setting this environment variable | | | `IPE_KEEP_SYSPKG_CACHE=1` | By default the script will clear the apt/apk/pear cache in order to save disk space. You can disable it by setting this environment variable |
| lzf | `IPE_LZF_BETTERCOMPRESSION=1` | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed | | lzf | `IPE_LZF_BETTERCOMPRESSION=1` | By default `install-php-extensions` compiles the `lzf` extension to prefer speed over size; you can use this environment variable to compile it preferring size over speed |
| event | `IPE_EVENT_NAMESPACE=`... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace | | event | `IPE_EVENT_NAMESPACE=`... | By default the `event` classes are defined in the root namespace. You can use this environment variable to specify a custom namespace |
| gd | `IPE_GD_WITHOUTAVIF=1` | Since PHP 8.1, gd supports the AVIF format. Enabling it requires compiling libaom/libdav1d/libyuv/libavif, which is time-consuming. You can disable AVIF support by setting this environment variable | | gd | `IPE_GD_WITHOUTAVIF=1` | Since PHP 8.1, gd supports the AVIF format. Enabling it requires compiling libaom/libdav1d/libyuv/libavif on Debian and Alpine 3.14-, which is time-consuming. You can disable AVIF support by setting this environment variable on Debian and Alpine 3.14- |
| oci8 & pdo_oci | `IPE_INSTANTCLIENT_BASIC=1` | The oci8 and pdo_oci PHP extensions require [Oracle Instant Client](https://www.oracle.com/database/technologies/instant-client.html). In order to save disk space, we install the Basic Lite version: if you want to install the Basic (non-lite) version simply set this environment variable | | oci8 & pdo_oci | `IPE_INSTANTCLIENT_BASIC=1` | The oci8 and pdo_oci PHP extensions require [Oracle Instant Client](https://www.oracle.com/database/technologies/instant-client.html). In order to save disk space, we install the Basic Lite version: if you want to install the Basic (non-lite) version simply set this environment variable |
| http, intl, mongodb | `IPE_ICU_EN_ONLY=1` | Some extensions require the ICU library, use this flag to install a smaller, but English-only, ICU library on Alpine 3.16 and later | | http, intl, mongodb | `IPE_ICU_EN_ONLY=1` | Some extensions require the ICU library, use this flag to install a smaller, but English-only, ICU library on Alpine 3.16 and later |
| pspell | `IPE_ASPELL_LANGUAGES='...'` | Configure the languages to be made available (for example: `IPE_ASPELL_LANGUAGES='en fr'`). If omitted, we'll assume `en` | | pspell | `IPE_ASPELL_LANGUAGES='...'` | Configure the languages to be made available (for example: `IPE_ASPELL_LANGUAGES='en fr'`). If omitted, we'll assume `en` |

View File

@ -744,7 +744,10 @@ buildRequiredPackageLists() {
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libwebp"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libwebp-dev"
if test $PHP_MAJMIN_VERSION -ge 801; then if test $PHP_MAJMIN_VERSION -ge 801; then
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then if test $DISTRO_MAJMIN_VERSION -ge 315; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libavif aom-libs libdav1d"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libavif-dev aom-dev dav1d-dev"
elif isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
else else
case "${IPE_GD_WITHOUTAVIF:-}" in case "${IPE_GD_WITHOUTAVIF:-}" in
@ -2217,24 +2220,37 @@ EOF
elif test $PHP_MAJMIN_VERSION -le 800; then elif test $PHP_MAJMIN_VERSION -le 800; then
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype
else else
case "${IPE_GD_WITHOUTAVIF:-}" in installBundledModule_tmp=0
1 | y* | Y*) ;; case "$DISTRO" in
*) alpine)
if ! isLibaomInstalled; then if test $DISTRO_MAJMIN_VERSION -ge 315; then
installLibaom installBundledModule_tmp=1
fi
if ! isLibdav1dInstalled; then
installLibdav1d
fi
if ! isLibyuvInstalled; then
installLibyuv
fi
if ! isLibavifInstalled; then
installLibavif
fi fi
;; ;;
esac esac
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then if test $installBundledModule_tmp -eq 0; then
case "${IPE_GD_WITHOUTAVIF:-}" in
1 | y* | Y*) ;;
*)
if ! isLibaomInstalled; then
installLibaom
fi
if ! isLibdav1dInstalled; then
installLibdav1d
fi
if ! isLibyuvInstalled; then
installLibyuv
fi
if ! isLibavifInstalled; then
installLibavif
fi
;;
esac
if isLibaomInstalled && isLibdav1dInstalled && isLibyuvInstalled && isLibavifInstalled; then
installBundledModule_tmp=1
fi
fi
if test $installBundledModule_tmp -eq 1; then
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype --with-avif
else else
docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype docker-php-ext-configure gd --enable-gd --with-webp --with-jpeg --with-xpm --with-freetype