Skip to content

Commit

Permalink
Fix installing gd and vips at the same time (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlocati authored Aug 8, 2024
1 parent cfa74c5 commit 3e2b610
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 28 deletions.
61 changes: 44 additions & 17 deletions install-php-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -662,9 +662,11 @@ expandASpellDictionaries() {
# PACKAGES_PERSISTENT_PRE the list of packages required at runtume that are already installed
# PACKAGES_VOLATILE the list of packages required at compile time that must be installed
# PACKAGES_PREVIOUS the list of packages (with their version) that are installed right now (calculated only on Debian and only if PACKAGES_PERSISTENT_NEW or PACKAGES_VOLATILE are not empty)
# COMPILE_LIBS
buildRequiredPackageLists() {
buildRequiredPackageLists_persistent=''
buildRequiredPackageLists_volatile=''
COMPILE_LIBS=''
case "$DISTRO" in
alpine)
apk update
Expand Down Expand Up @@ -844,6 +846,18 @@ buildRequiredPackageLists() {
case "${IPE_GD_WITHOUTAVIF:-}" in
1 | y* | Y*) ;;
*)
if ! isLibaomInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libaom"
fi
if ! isLibdav1dInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
fi
if ! isLibyuvInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libyuv"
fi
if ! isLibavifInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libavif"
fi
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libstdc++"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
;;
Expand All @@ -869,6 +883,18 @@ buildRequiredPackageLists() {
case "${IPE_GD_WITHOUTAVIF:-}" in
1 | y* | Y*) ;;
*)
if ! isLibaomInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libaom"
fi
if ! isLibdav1dInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libdav1d"
fi
if ! isLibyuvInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libyuv"
fi
if ! isLibavifInstalled; then
COMPILE_LIBS="$COMPILE_LIBS libavif"
fi
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake nasm meson"
;;
esac
Expand Down Expand Up @@ -2472,6 +2498,22 @@ You may need to:
EOT
}

# Compile the libraries specified in the COMPILE_LIBS variable
compileLibs() {
if stringInList libaom "$COMPILE_LIBS"; then
installLibaom
fi
if stringInList libdav1d "$COMPILE_LIBS"; then
installLibdav1d
fi
if stringInList libyuv "$COMPILE_LIBS"; then
installLibyuv
fi
if stringInList libavif "$COMPILE_LIBS"; then
installLibavif
fi
}

# Install a bundled PHP module given its handle
#
# Arguments:
Expand Down Expand Up @@ -2568,23 +2610,6 @@ EOF
;;
esac
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
Expand Down Expand Up @@ -4829,6 +4854,8 @@ if test $USE_PICKLE -gt 1; then
buildPickle
fi

compileLibs

for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do
case "$PHP_MODULE_TO_INSTALL" in
@fix_letsencrypt)
Expand Down
32 changes: 21 additions & 11 deletions scripts/ci-test-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,20 @@ filterUnsupportedExensionsForDistro() {
;;
esac

for filterUnsupportedExensionsForDistro_extension in $EXTENSIONS_TO_BE_TESTED; do
if stringInList "!$IPETEST_DOCKER_DISTRO" "$(cat "$filterUnsupportedExensionsForDistro_reqs" | grep -E "^$filterUnsupportedExensionsForDistro_extension[ \t]")"; then
printf 'Note: extension "%s" is not supported for distro "%s"\n' "$filterUnsupportedExensionsForDistro_extension" "$IPETEST_DOCKER_DISTRO"
elif stringInList "!$filterUnsupportedExensionsForDistro_baseDistro" "$(cat "$filterUnsupportedExensionsForDistro_reqs" | grep -E "^$filterUnsupportedExensionsForDistro_extension[ \t]")"; then
printf 'Note: extension "%s" is not supported for distro "%s"\n' "$filterUnsupportedExensionsForDistro_extension" "$filterUnsupportedExensionsForDistro_baseDistro"
else
filterUnsupportedExensionsForDistro_filtered="$filterUnsupportedExensionsForDistro_filtered $filterUnsupportedExensionsForDistro_extension"
for filterUnsupportedExensionsForDistro_extensions in $EXTENSIONS_TO_BE_TESTED; do
filterUnsupportedExensionsForDistro_ok=1
IFS='+'
for filterUnsupportedExensionsForDistro_extension in $filterUnsupportedExensionsForDistro_extensions; do
if stringInList "!$IPETEST_DOCKER_DISTRO" "$(cat "$filterUnsupportedExensionsForDistro_reqs" | grep -E "^$filterUnsupportedExensionsForDistro_extension[ \t]")"; then
printf 'Note: extension "%s" is not supported for distro "%s"\n' "$filterUnsupportedExensionsForDistro_extension" "$IPETEST_DOCKER_DISTRO"
filterUnsupportedExensionsForDistro_ok=0
elif stringInList "!$filterUnsupportedExensionsForDistro_baseDistro" "$(cat "$filterUnsupportedExensionsForDistro_reqs" | grep -E "^$filterUnsupportedExensionsForDistro_extension[ \t]")"; then
printf 'Note: extension "%s" is not supported for distro "%s"\n' "$filterUnsupportedExensionsForDistro_extension" "$filterUnsupportedExensionsForDistro_baseDistro"
filterUnsupportedExensionsForDistro_ok=0
fi
done
if test $filterUnsupportedExensionsForDistro_ok -eq 1; then
filterUnsupportedExensionsForDistro_filtered="$filterUnsupportedExensionsForDistro_filtered $filterUnsupportedExensionsForDistro_extensions"
fi
done
resetIFS
Expand Down Expand Up @@ -164,10 +171,13 @@ getDockerImageName() {
getDockerImageName_reqs="$CI_BUILD_DIR/data/special-requirements"
if test -f "$getDockerImageName_reqs"; then
IFS=' '
for getDockerImageName_testExtension in $1; do
if test -n "$(cat "$getDockerImageName_reqs" | grep -E "^$getDockerImageName_testExtension[ \t]+zts[ \t]*$")"; then
getDockerImageName_suffix='zts'
fi
for getDockerImageName_testExtensions in $1; do
IFS='+'
for getDockerImageName_testExtension in $getDockerImageName_testExtensions; do
if test -n "$(cat "$getDockerImageName_reqs" | grep -E "^$getDockerImageName_testExtension[ \t]+zts[ \t]*$")"; then
getDockerImageName_suffix='zts'
fi
done
done
fi
getDockerImageName_imageName="$(printf 'php:%s-%s-%s' "$getDockerImageName_version" "$getDockerImageName_suffix" "$IPETEST_DOCKER_DISTRO")"
Expand Down

0 comments on commit 3e2b610

Please sign in to comment.