From 229e6a4aedd958d41fc341d31b734b787f1ad8fb Mon Sep 17 00:00:00 2001 From: Tien Do Nam Date: Mon, 4 Dec 2023 18:06:32 +0100 Subject: [PATCH] feat: should use correct architecture --- .../lib/src/makers/deb/make_deb_config.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart b/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart index a956a9b0..d784037f 100644 --- a/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart +++ b/packages/flutter_app_packager/lib/src/makers/deb/make_deb_config.dart @@ -270,7 +270,7 @@ class MakeDebConfig extends MakeLinuxPackageConfig { 'Version': appVersion.toString(), 'Section': section, 'Priority': priority, - 'Architecture': 'amd64', + 'Architecture': _getArchitecture(), 'Essential': essential != null ? (essential == true ? 'yes' : 'no') : null, 'Installed-Size': installedSize, @@ -368,3 +368,12 @@ class MakeDebConfigLoader extends DefaultMakeConfigLoader { return MakeDebConfig.fromJson(map).copyWith(baseMakeConfig); } } + +String _getArchitecture() { + final result = Process.runSync('uname', ['-m']); + if ('${result.stdout}'.trim() == 'aarch64') { + return 'arm64'; + } else { + return 'amd64'; + } +}