Skip to content

Commit

Permalink
fix: installs failing on arm architecture (#35)
Browse files Browse the repository at this point in the history
* fix: installs failing on arm
  • Loading branch information
ryanbourdais authored Sep 25, 2023
1 parent 8bec469 commit b473172
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
1 change: 1 addition & 0 deletions .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
integration-test-macos:
macos:
xcode: 14.2.0
resource_class: macos.m1.large.gen1
steps:
- checkout
- flutter/install_sdk_and_pub:
Expand Down
30 changes: 15 additions & 15 deletions src/scripts/install-sdk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

INSTALL_LOCATION=$(eval "echo $ORB_EVAL_INSTALL_LOCATION")

if [ ! -d "$INSTALL_LOCATION/flutter" ]; then
mkdir -p "$INSTALL_LOCATION"
if [ "$(uname)" == 'Darwin' ]; then
curl -o flutter_sdk.zip https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_$ORB_VAL_FLUTTER_SDK_VERSION-stable.zip
unzip -qq flutter_sdk.zip -d "$INSTALL_LOCATION"
rm flutter_sdk.zip
elif uname -a | grep -q "Linux" ; then
curl -o flutter_sdk.tar.xz https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_$ORB_VAL_FLUTTER_SDK_VERSION-stable.tar.xz
tar xf flutter_sdk.tar.xz -C "$INSTALL_LOCATION"
rm -f flutter_sdk.tar.xz
else
echo "This platform ($(uname -a)) is not supported."
exit 1
fi
fi
function install_flutter() {
local machine=${1:-"Linux"}
local arch=${2:-"amd64"}
[[ $machine == "Darwin" ]] && uname=macos || uname=linux
[[ $arch == "arm64" ]] && version="flutter_${uname}_arm64" || version="flutter_${uname}"
[[ $uname == "linux" ]] && suffix="tar.xz" || suffix="zip"

baseurl="https://storage.googleapis.com/flutter_infra_release/releases/stable"

fullurl="$baseurl/$uname/${version}_$ORB_VAL_FLUTTER_SK_VERSION-stable.${suffix}"

curl -o "flutter_sdk.${suffix}" "$fullurl"
}

install_flutter "$(uname)" "$(uname -a)"

echo "export PATH=$INSTALL_LOCATION/flutter/bin:\$PATH" >> "$BASH_ENV"

Expand Down

0 comments on commit b473172

Please sign in to comment.