Link libs of updated PHP dependencies on macOS

This commit is contained in:
Shivam Mathur 2021-02-28 19:08:35 +05:30
parent c20693a6ca
commit 0769672a24
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
5 changed files with 837 additions and 334 deletions

6
dist/index.js vendored
View File

@ -1825,7 +1825,7 @@ async function addExtensionDarwin(extension_csv, version) {
// 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 /(7\.[1-4]|8\.0])pcov/.test(version_extension):
command = 'add_brew_extension ' + extension_name;
command = 'add_brew_extension ' + extension_name.replace('pecl_', '');
break;
// match sqlite
case /^sqlite$/.test(extension):
@ -1879,7 +1879,7 @@ async function addExtensionWindows(extension_csv, version) {
script +=
'\nAdd-Extension mysql\nAdd-Extension mysqli\nAdd-Extension mysqlnd';
break;
// match 7.2xdebug
// match 7.2xdebug2 to 7.4xdebug2
case /7\.[2-4]xdebug2/.test(version_extension):
script += '\nAdd-Extension xdebug stable 2.9.8';
break;
@ -1959,7 +1959,7 @@ async function addExtensionLinux(extension_csv, version, pipe) {
' ' +
version;
return;
// match 7.2xdebug
// match 7.2xdebug2 to 7.4xdebug2
case /^7\.[2-4]xdebug2$/.test(version_extension):
script += '\nadd_pecl_extension xdebug 2.9.8 ' + ext_prefix;
return;

1130
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -40,7 +40,7 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jest": "^24.1.5",
"eslint-plugin-prettier": "^3.3.1",
"husky": "^5.1.0",
"husky": "^4.3.8",
"jest": "^26.6.3",
"jest-circus": "^26.6.3",
"prettier": "^2.2.1",
@ -50,7 +50,7 @@
"husky": {
"skipCI": true,
"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"
}
}
}

View File

@ -213,7 +213,7 @@ add_composertool() {
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
fi
if [ "$tool" = "codeception" ]; then
sudo ln -s $composer_bin/codecept $composer_bin/codeception
sudo ln -s "$composer_bin"/codecept "$composer_bin"/codeception
fi
}
@ -230,22 +230,32 @@ add_pecl() {
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
update_dependencies() {
if [ "$version" = '8.0' ] && [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
if [ "${ImageOS:-}" != "" ] && [ "${ImageVersion:-}" != "" ]; then
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+=( $! )
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[@]}"
fi
}
# Function to setup PHP and composer
setup_php() {
update_dependencies
export HOMEBREW_NO_INSTALL_CLEANUP=TRUE
add_brew_tap shivammathur/homebrew-php
update_dependencies
brew upgrade shivammathur/php/php@"$version" 2>/dev/null || brew install shivammathur/php/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_NO_INSTALL_CLEANUP=1
export HOMEBREW_NO_AUTO_UPDATE=1
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
# Setup PHP
step_log "Setup PHP"

View File

@ -218,7 +218,7 @@ add_composertool() {
sudo cp -p "$tool_path_dir/composer" "$composer_bin"
fi
if [ "$tool" = "codeception" ]; then
sudo ln -s $composer_bin/codecept $composer_bin/codeception
sudo ln -s "$composer_bin"/codecept "$composer_bin"/codeception
fi
}