Add support for arm64 icu and intl builds

This commit is contained in:
Shivam Mathur 2025-01-18 19:57:22 +05:30
parent 7b76fc1ec5
commit 296db28120
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -2,7 +2,7 @@
install_icu() { install_icu() {
icu=$1 icu=$1
if [ "$(php -i | grep "ICU version =>" | sed -e "s|.*=> s*||")" != "$icu" ]; then 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" get -q -n /tmp/icu.tar.zst "https://github.com/shivammathur/icu-intl/releases/download/icu4c/icu4c-$icu$arch_suffix.tar.zst"
sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local sudo tar -I zstd -xf /tmp/icu.tar.zst -C /usr/local
sudo cp -r /usr/local/icu/lib/* /usr/lib/"$(uname -m)"-linux-gnu/ sudo cp -r /usr/local/icu/lib/* /usr/lib/"$(uname -m)"-linux-gnu/
fi fi
@ -17,8 +17,11 @@ add_intl() {
else else
[ "${ts:?}" = 'zts' ] && suffix='-zts' [ "${ts:?}" = 'zts' ] && suffix='-zts'
install_icu "$icu" >/dev/null 2>&1 install_icu "$icu" >/dev/null 2>&1
get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix.so" get -q -n "${ext_dir:?}/intl.so" "https://github.com/shivammathur/icu-intl/releases/download/intl/php${version:?}-intl-$icu$suffix$arch_suffix.so"
enable_extension intl extension enable_extension intl extension
add_extension_log intl "Installed and enabled with ICU $icu" add_extension_log intl "Installed and enabled with ICU $icu"
fi fi
} }
arch="$(uname -m)"
[[ "$arch" = 'arm64' || "$arch" = 'aarch64' ]] && arch_suffix='-arm64' || arch_suffix=''