Skip to content

Commit

Permalink
fix runner build on x86_64
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Nov 24, 2024
1 parent 597e27d commit 4f477fb
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions build-counter-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -Eeu

pwd=`pwd`
PWD=`pwd`

# Path to Flutter SDK
export FLUTTER_SDK=/opt/flutter-elinux/flutter
Expand All @@ -11,7 +11,17 @@ export PATH=$PATH:${FLUTTER_SDK}/bin

# Package name of the build target Flutter app
export APP_PACKAGE_NAME=counter
export SOURCE_DIR=${pwd}/Examples/${APP_PACKAGE_NAME}
export SOURCE_DIR=${PWD}/Examples/${APP_PACKAGE_NAME}

ARCH=`arch`

if [ "X${ARCH}" == "Xaarch64" ]; then
ARCH=arm64
elif [ "X${ARCH}" == "Xx86_64" ]; then
ARCH=x64
fi

ARCH="linux-${ARCH}"

# The build data.
export RESULT_DIR=build/elinux/arm64
Expand All @@ -24,8 +34,8 @@ mkdir -p ${RESULT_DIR}/${BUILD_MODE}/bundle/lib/
mkdir -p ${RESULT_DIR}/${BUILD_MODE}/bundle/data/

# Build Flutter assets.
flutter-elinux build bundle --asset-dir=${RESULT_DIR}/${BUILD_MODE}/bundle/data/flutter_assets
cp ${FLUTTER_SDK}/bin/cache/artifacts/engine/linux-arm64/icudtl.dat \
${FLUTTER_SDK}/../bin/flutter-elinux build bundle --asset-dir=${RESULT_DIR}/${BUILD_MODE}/bundle/data/flutter_assets
cp ${FLUTTER_SDK}/bin/cache/artifacts/engine/${ARCH}/icudtl.dat \
${RESULT_DIR}/${BUILD_MODE}/bundle/data/

# Build kernel_snapshot.
Expand All @@ -47,7 +57,7 @@ ${FLUTTER_SDK}/bin/cache/dart-sdk/bin/dartaotruntime \
package:${APP_PACKAGE_NAME}/main.dart

# Build AOT image.
${FLUTTER_SDK}/bin/cache/artifacts/engine/linux-arm64/gen_snapshot \
${FLUTTER_SDK}/bin/cache/artifacts/engine/${ARCH}/gen_snapshot \
--deterministic \
--snapshot_kind=app-aot-elf \
--elf=.dart_tool/flutter_build/flutter-embedded-linux/app.so \
Expand Down

0 comments on commit 4f477fb

Please sign in to comment.