mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-26 13:23:05 +07:00
Add support for debug builds
This commit is contained in:
parent
7aff4d7a22
commit
b556cf7292
11
src/configs/php_debug_packages
Normal file
11
src/configs/php_debug_packages
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
cgi
|
||||||
|
cli
|
||||||
|
curl
|
||||||
|
fpm
|
||||||
|
intl
|
||||||
|
mbstring
|
||||||
|
mysql
|
||||||
|
opcache
|
||||||
|
pgsql
|
||||||
|
xml
|
||||||
|
zip
|
@ -173,6 +173,7 @@ add_php() {
|
|||||||
existing_version=$2
|
existing_version=$2
|
||||||
add_brew_tap "$php_tap"
|
add_brew_tap "$php_tap"
|
||||||
update_dependencies
|
update_dependencies
|
||||||
|
[ "${debug:?}" = "debug" ] && php_formula="$php_formula-debug"
|
||||||
if [ "$existing_version" != "false" ]; then
|
if [ "$existing_version" != "false" ]; then
|
||||||
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
([ "$action" = "upgrade" ] && brew upgrade -f "$php_formula") || brew unlink "$php_formula"
|
||||||
else
|
else
|
||||||
|
@ -146,6 +146,7 @@ add_extension_from_source() {
|
|||||||
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
add_log "${cross:?}" "$source" "$source does not have a PHP extension"
|
||||||
else
|
else
|
||||||
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
[[ -n "${libraries// }" ]] && run_group "add_libs $libraries" "add libraries"
|
||||||
|
[ "${debug:?}" = "debug" ] && suffix_opts="$suffix_opts --enable-debug"
|
||||||
patch_extension "$extension" >/dev/null 2>&1
|
patch_extension "$extension" >/dev/null 2>&1
|
||||||
run_group "phpize" "phpize"
|
run_group "phpize" "phpize"
|
||||||
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
run_group "sudo $prefix_opts ./configure $suffix_opts $opts" "configure"
|
||||||
|
@ -75,9 +75,10 @@ check_package() {
|
|||||||
# Helper function to add an extension.
|
# Helper function to add an extension.
|
||||||
add_extension_helper() {
|
add_extension_helper() {
|
||||||
local extension=$1
|
local extension=$1
|
||||||
package=php"$version"-"$extension"
|
packages=(php"$version"-"$extension")
|
||||||
|
[ "${debug:?}" = "debug" ] && check_package php"$version"-"$extension"-dbgsym && packages+=(php"$version"-"$extension"-dbgsym)
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
(check_package "$package" && install_packages "$package") || pecl_install "$extension"
|
(check_package "${packages[0]}" && install_packages "${packages[@]}") || pecl_install "$extension"
|
||||||
add_extension_log "$extension" "Installed and enabled"
|
add_extension_log "$extension" "Installed and enabled"
|
||||||
sudo chmod 777 "${ini_file[@]}"
|
sudo chmod 777 "${ini_file[@]}"
|
||||||
}
|
}
|
||||||
@ -95,7 +96,7 @@ add_devtools() {
|
|||||||
|
|
||||||
# Function to setup the nightly build from shivammathur/php-builder
|
# Function to setup the nightly build from shivammathur/php-builder
|
||||||
setup_nightly() {
|
setup_nightly() {
|
||||||
run_script "php-builder" "${runner:?}" "$version"
|
run_script "php-builder" "${runner:?}" "$version" "${debug:?}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5.
|
||||||
@ -133,14 +134,22 @@ switch_version() {
|
|||||||
wait "${to_wait[@]}"
|
wait "${to_wait[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to get packages to install
|
||||||
|
get_php_packages() {
|
||||||
|
sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' '
|
||||||
|
if [ "${debug:?}" = "debug" ]; then
|
||||||
|
sed "s/[^ ]*/php$version-&-dbgsym/g" "$src"/configs/php_debug_packages | tr '\n' ' '
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Function to install packaged PHP
|
# Function to install packaged PHP
|
||||||
add_packaged_php() {
|
add_packaged_php() {
|
||||||
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
if [ "$runner" = "self-hosted" ] || [ "${use_package_cache:-true}" = "false" ]; then
|
||||||
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
add_ppa ondrej/php >/dev/null 2>&1 || update_ppa ondrej/php
|
||||||
IFS=' ' read -r -a packages <<<"$(sed "s/[^ ]*/php$version-&/g" "$src"/configs/php_packages | tr '\n' ' ')"
|
IFS=' ' read -r -a packages <<<"$(get_php_packages)"
|
||||||
install_packages "${packages[@]}"
|
install_packages "${packages[@]}"
|
||||||
else
|
else
|
||||||
run_script "php-ubuntu" "$version"
|
run_script "php-ubuntu" "$version" "${debug:?}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -154,8 +154,10 @@ add_ppa() {
|
|||||||
ppa=${1:-ondrej/php}
|
ppa=${1:-ondrej/php}
|
||||||
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
if [[ "$ID" = "ubuntu" || "$ID_LIKE" =~ ubuntu ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$lp_ppa/$ppa/ubuntu" "$lp_ppa/$ppa/ubuntu" "$VERSION_CODENAME" "main/debug"
|
||||||
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
elif [[ "$ID" = "debian" || "$ID_LIKE" =~ debian ]] && [[ "$ppa" =~ "ondrej/" ]]; then
|
||||||
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg
|
||||||
|
[ "${debug:?}" = "debug" ] && add_list "$ppa" "$sury"/"${ppa##*/}"/ "$sury"/"${ppa##*/}"/apt.gpg "$VERSION_CODENAME" "main/debug"
|
||||||
else
|
else
|
||||||
add_list "$ppa"
|
add_list "$ppa"
|
||||||
fi
|
fi
|
||||||
|
@ -50,6 +50,7 @@ set_output() {
|
|||||||
# Function to read env inputs.
|
# Function to read env inputs.
|
||||||
read_env() {
|
read_env() {
|
||||||
update="${update:-${UPDATE:-false}}"
|
update="${update:-${UPDATE:-false}}"
|
||||||
|
[ "${debug:-${DEBUG:-false}}" = "true" ] && debug=debug && update=true || debug=release
|
||||||
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
fail_fast="${fail_fast:-${FAIL_FAST:-false}}"
|
||||||
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
[[ -z "${ImageOS}" && -z "${ImageVersion}" ]] && _runner=self-hosted || _runner=github
|
||||||
runner="${runner:-${RUNNER:-$_runner}}"
|
runner="${runner:-${RUNNER:-$_runner}}"
|
||||||
|
Loading…
Reference in New Issue
Block a user