mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Install libraries on each PECL install if specified
This commit is contained in:
parent
c19f6bbdcd
commit
412722b7c7
@ -157,9 +157,11 @@ get_pecl_version() {
|
|||||||
pecl_install() {
|
pecl_install() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
add_pecl >/dev/null 2>&1
|
add_pecl >/dev/null 2>&1
|
||||||
ncpu="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo '1')"
|
cpu_count="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo '1')"
|
||||||
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS) MAKEFLAGS='-j $ncpu'"
|
prefix_opts="$(parse_args "$extension" CONFIGURE_PREFIX_OPTS) MAKEFLAGS='-j $cpu_count'"
|
||||||
suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
suffix_opts="$(parse_args "$extension" CONFIGURE_OPTS) $(parse_args "$extension" CONFIGURE_SUFFIX_OPTS)"
|
||||||
|
IFS=' ' read -r -a libraries <<<"$(parse_args "$extension" LIBS) $(parse_args "$extension" "$(uname -s)"_LIBS)"
|
||||||
|
(( ${#libraries[@]} )) && add_libs "${libraries[@]}" >/dev/null 2>&1
|
||||||
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1
|
yes '' 2>/dev/null | sudo "$prefix_opts" pecl install -f -D "$(parse_pecl_configure_options "$suffix_opts")" "$extension" >/dev/null 2>&1
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,7 +170,6 @@ add_pecl_extension() {
|
|||||||
local extension=$1
|
local extension=$1
|
||||||
local pecl_version=$2
|
local pecl_version=$2
|
||||||
local prefix=$3
|
local prefix=$3
|
||||||
local message="Installed and enabled"
|
|
||||||
enable_extension "$extension" "$prefix"
|
enable_extension "$extension" "$prefix"
|
||||||
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then
|
if [[ $pecl_version =~ .*(alpha|beta|rc|snapshot|preview).* ]]; then
|
||||||
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
pecl_version=$(get_pecl_version "$extension" "$pecl_version")
|
||||||
@ -177,14 +178,9 @@ add_pecl_extension() {
|
|||||||
if [ "${ext_version/-/}" = "$pecl_version" ]; then
|
if [ "${ext_version/-/}" = "$pecl_version" ]; then
|
||||||
add_log "${tick:?}" "$extension" "Enabled"
|
add_log "${tick:?}" "$extension" "Enabled"
|
||||||
else
|
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
|
disable_extension_helper "$extension" >/dev/null 2>&1
|
||||||
pecl_install "$extension-$pecl_version"
|
pecl_install "$extension-$pecl_version"
|
||||||
add_extension_log "$extension-$pecl_version" "$message"
|
add_extension_log "$extension-$pecl_version" "Installed and enabled"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user