mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-23 04:11:06 +07:00
Link libs of updated PHP dependencies on macOS
This commit is contained in:
parent
c20693a6ca
commit
0769672a24
6
dist/index.js
vendored
6
dist/index.js
vendored
@ -1825,7 +1825,7 @@ async function addExtensionDarwin(extension_csv, version) {
|
|||||||
// match 7.1pcov to 8.0pcov
|
// match 7.1pcov to 8.0pcov
|
||||||
case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|msgpack|^(pecl_)?http$|propro|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
|
case /(5\.6|7\.[0-4]|8.0)(amqp|grpc|igbinary|imagick|imap|msgpack|^(pecl_)?http$|propro|protobuf|raphf|redis|swoole|xdebug|xdebug2|zmq)/.test(version_extension):
|
||||||
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
case /(7\.[1-4]|8\.0])pcov/.test(version_extension):
|
||||||
command = 'add_brew_extension ' + extension_name;
|
command = 'add_brew_extension ' + extension_name.replace('pecl_', '');
|
||||||
break;
|
break;
|
||||||
// match sqlite
|
// match sqlite
|
||||||
case /^sqlite$/.test(extension):
|
case /^sqlite$/.test(extension):
|
||||||
@ -1879,7 +1879,7 @@ async function addExtensionWindows(extension_csv, version) {
|
|||||||
script +=
|
script +=
|
||||||
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
|
||||||
break;
|
break;
|
||||||
// match 7.2xdebug
|
// match 7.2xdebug2 to 7.4xdebug2
|
||||||
case /7\.[2-4]xdebug2/.test(version_extension):
|
case /7\.[2-4]xdebug2/.test(version_extension):
|
||||||
script += '\nAdd-Extension xdebug stable 2.9.8';
|
script += '\nAdd-Extension xdebug stable 2.9.8';
|
||||||
break;
|
break;
|
||||||
@ -1959,7 +1959,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
|
|||||||
' ' +
|
' ' +
|
||||||
version;
|
version;
|
||||||
return;
|
return;
|
||||||
// match 7.2xdebug
|
// match 7.2xdebug2 to 7.4xdebug2
|
||||||
case /^7\.[2-4]xdebug2$/.test(version_extension):
|
case /^7\.[2-4]xdebug2$/.test(version_extension):
|
||||||
script += '\nadd_pecl_extension xdebug 2.9.8 ' + ext_prefix;
|
script += '\nadd_pecl_extension xdebug 2.9.8 ' + ext_prefix;
|
||||||
return;
|
return;
|
||||||
|
1130
package-lock.json
generated
1130
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -40,7 +40,7 @@
|
|||||||
"eslint-plugin-import": "^2.22.1",
|
"eslint-plugin-import": "^2.22.1",
|
||||||
"eslint-plugin-jest": "^24.1.5",
|
"eslint-plugin-jest": "^24.1.5",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.3.1",
|
||||||
"husky": "^5.1.0",
|
"husky": "^4.3.8",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"jest-circus": "^26.6.3",
|
"jest-circus": "^26.6.3",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.2.1",
|
||||||
@ -50,7 +50,7 @@
|
|||||||
"husky": {
|
"husky": {
|
||||||
"skipCI": true,
|
"skipCI": true,
|
||||||
"hooks": {
|
"hooks": {
|
||||||
"pre-commit": "npm run format && npm run lint && npm run build && npm run release"
|
"pre-commit": "npm run format && npm run lint && npm run test && npm run build && npm run release"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -213,7 +213,7 @@ add_composertool() {
|
|||||||
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
|
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
|
||||||
fi
|
fi
|
||||||
if [ "$tool" = "codeception" ]; then
|
if [ "$tool" = "codeception" ]; then
|
||||||
sudo ln -s $composer_bin/codecept $composer_bin/codeception
|
sudo ln -s "$composer_bin"/codecept "$composer_bin"/codeception
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,22 +230,32 @@ add_pecl() {
|
|||||||
add_log "$tick" "PECL" "Added"
|
add_log "$tick" "PECL" "Added"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Function to backup all libraries of a formula
|
||||||
|
link_libraries() {
|
||||||
|
formula=$1
|
||||||
|
formula_prefix="$(brew --prefix "$formula")"
|
||||||
|
sudo mkdir -p "$formula_prefix"/lib
|
||||||
|
sudo cp -a "$formula_prefix"/lib/*.dylib "$brew_prefix/lib" 2>/dev/null || true
|
||||||
|
}
|
||||||
|
|
||||||
# Function to update dependencies
|
# Function to update dependencies
|
||||||
update_dependencies() {
|
update_dependencies() {
|
||||||
if [ "$version" = '8.0' ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
if [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
|
||||||
while read -r formula; do
|
while read -r formula; do
|
||||||
curl -o "$brew_prefix/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/$formula.rb" "${curl_opts[@]}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb" &
|
(
|
||||||
|
curl -o "$tap_dir/homebrew/homebrew-core/Formula/$formula.rb" "${curl_opts[@]}" "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/$formula.rb"
|
||||||
|
link_libraries $formula
|
||||||
|
) &
|
||||||
to_wait+=( $! )
|
to_wait+=( $! )
|
||||||
done < "$brew_prefix/Homebrew/Library/Taps/shivammathur/homebrew-php/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
done < "$tap_dir/shivammathur/homebrew-php/.github/deps/${ImageOS:?}_${ImageVersion:?}"
|
||||||
wait "${to_wait[@]}"
|
wait "${to_wait[@]}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to setup PHP and composer
|
# Function to setup PHP and composer
|
||||||
setup_php() {
|
setup_php() {
|
||||||
update_dependencies
|
|
||||||
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
|
|
||||||
add_brew_tap shivammathur/homebrew-php
|
add_brew_tap shivammathur/homebrew-php
|
||||||
|
update_dependencies
|
||||||
brew upgrade shivammathur/php/php@"$version" 2>/dev/null || brew install shivammathur/php/php@"$version"
|
brew upgrade shivammathur/php/php@"$version" 2>/dev/null || brew install shivammathur/php/php@"$version"
|
||||||
brew link --force --overwrite php@"$version"
|
brew link --force --overwrite php@"$version"
|
||||||
}
|
}
|
||||||
@ -276,6 +286,7 @@ existing_version=$(php-config --version 2>/dev/null | cut -c 1-3)
|
|||||||
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
export HOMEBREW_CHANGE_ARCH_TO_ARM=1
|
||||||
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
export HOMEBREW_NO_INSTALL_CLEANUP=1
|
||||||
export HOMEBREW_NO_AUTO_UPDATE=1
|
export HOMEBREW_NO_AUTO_UPDATE=1
|
||||||
|
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
|
||||||
|
|
||||||
# Setup PHP
|
# Setup PHP
|
||||||
step_log "Setup PHP"
|
step_log "Setup PHP"
|
||||||
|
@ -218,7 +218,7 @@ add_composertool() {
|
|||||||
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
|
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
|
||||||
fi
|
fi
|
||||||
if [ "$tool" = "codeception" ]; then
|
if [ "$tool" = "codeception" ]; then
|
||||||
sudo ln -s $composer_bin/codecept $composer_bin/codeception
|
sudo ln -s "$composer_bin"/codecept "$composer_bin"/codeception
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user