Fix arm support for some tools and extensions [skip ci]

This commit is contained in:
Shivam Mathur 2025-01-18 02:03:40 +05:30
parent a541a60bc9
commit caf188e706
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A
4 changed files with 24 additions and 8 deletions

View File

@ -4,7 +4,7 @@ install_icu() {
if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then
get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu.tar.zst"
sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local
sudo cp -r /usr/local/icu/lib/* /usr/lib/x86_64-linux-gnu/
sudo cp -r /usr/local/icu/lib/* /usr/lib/"$(uname -m)"-linux-gnu/
fi
}

View File

@ -11,27 +11,35 @@ add_license_log() {
add_client() {
if [ ! -e "$oracle_client" ]; then
sudo mkdir -p -m 777 "$oracle_home" "$oracle_client"
arch="$(uname -m)"
for package in basiclite sdk; do
if [ "$os" = 'Linux' ]; then
libs='/usr/lib/'
os_name='linux'
arch='linuxx64'
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='linux-arm64' || arch_suffix='linuxx64'
lib_ext='so'
elif [ "$os" = 'Darwin' ]; then
libs='/usr/local/lib/'
os_name='mac'
arch='macos'
arch_suffix='macos'
lib_ext='dylib'
fi
get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch.zip"
if [[ "$os" = 'Darwin' && ("$arch" = 'arm64' || "$arch" = 'aarch64') ]]; then
get -q -n "/opt/oracle/$package.dmg" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-macos-arm64.dmg"
sudo hdiutil attach "/opt/oracle/$package.dmg"
(cd /Volumes/instantclient-"$package"-macos.arm64-* && bash install_ic.sh)
sudo cp -a ~/Downloads/instantclient_* /opt/oracle/
else
get -q -n "/opt/oracle/$package.zip" "https://download.oracle.com/otn_software/$os_name/instantclient/instantclient-$package-$arch_suffix.zip"
unzip -o "/opt/oracle/$package.zip" -d "$oracle_home"
fi
done
for icdir in /opt/oracle/instantclient_*; do
sudo mv "$icdir"/* "$oracle_client"/
done
sudo mkdir -p "$libs"
sudo ln -sf /opt/oracle/instantclient/*.$lib_ext* $libs
if [ "$os" = "Linux" ]; then
arch="$(uname -m)"
[ -e "$libs/$arch"-linux-gnu/libaio.so.1t64 ] && sudo ln -sf "$libs/$arch"-linux-gnu/libaio.so.1t64 "$libs/$arch"-linux-gnu/libaio.so.1
fi
fi

View File

@ -9,7 +9,13 @@ Function Add-Msys2() {
Function Add-GrpcPhpPlugin() {
$msys_location = Add-Msys2
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm mingw-w64-x86_64-grpc" >$null 2>&1
$arch = arch
if($arch -eq 'arm64' -or $arch -eq 'aarch64') {
$grpc_package = 'mingw-w64-clang-aarch64-grpc'
} else {
$grpc_package = 'mingw-w64-x86_64-grpc'
}
$logs = . $msys_location\usr\bin\bash -l -c "pacman -S --noconfirm $grpc_package" >$null 2>&1
$grpc_version = Get-ToolVersion 'Write-Output' "$logs"
Add-Path $msys_location\mingw64\bin
Set-Output grpc_php_plugin_path "$msys_location\mingw64\bin\grpc_php_plugin.exe"

View File

@ -17,7 +17,9 @@ add_protoc() {
(
platform='linux'
[ "$(uname -s)" = "Darwin" ] && platform='osx'
get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-x86_64.zip"
arch="$(uname -m)"
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch='aarch_64'
get -q -n /tmp/protobuf.zip "https://github.com/protocolbuffers/protobuf/releases/download/$protobuf_tag/protoc-${protobuf_tag:1}-$platform-$arch.zip"
sudo unzip /tmp/protobuf.zip -d /usr/local/
sudo chmod -R 777 /usr/local/bin/protoc /usr/local/include/google
) >/dev/null 2>&1