From e9884d0d9ae42170c76ccbc614fdf2f6081e2f8a Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Thu, 10 Mar 2022 04:18:53 +0530 Subject: [PATCH] Add support for installing libraries for pecl extensions --- src/scripts/extensions/add_extensions.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scripts/extensions/add_extensions.sh b/src/scripts/extensions/add_extensions.sh index a7ecfe2b..afa276df 100644 --- a/src/scripts/extensions/add_extensions.sh +++ b/src/scripts/extensions/add_extensions.sh @@ -165,6 +165,7 @@ add_pecl_extension() { local extension=$1 local pecl_version=$2 local prefix=$3 + local message="Installed and enabled" enable_extension "$extension" "$prefix" if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then pecl_version=$(get_pecl_version "$extension" "$pecl_version") @@ -173,9 +174,14 @@ add_pecl_extension() { if [ "${ext_version/-/}" = "$pecl_version" ]; then add_log "${tick:?}" "$extension" "Enabled" else + IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)" + if (( ${#libraries[@]} )); then + add_libs "${libraries[@]}" >/dev/null 2>&1 + message="$message with libraries ${libraries[*]}" + fi disable_extension_helper "$extension" >/dev/null 2>&1 pecl_install "$extension-$pecl_version" - add_extension_log "$extension-$pecl_version" "Installed and enabled" + add_extension_log "$extension-$pecl_version" "$message" fi }