From 269a7a6f55d0c532793417ed0ae7f0713a2a43e0 Mon Sep 17 00:00:00 2001 From: Lisa Marie Maginnis Date: Tue, 22 Oct 2024 21:47:24 +0200 Subject: [PATCH] Added the ablity to select target architechture for linux builds via the enviormental variable `$ARCH`. Defaults to if ARCH not provided`x64`. Updated the README to reflect new build options. --- README.md | 11 +++++++++++ bin/build-tools/lib/build-linux.ts | 10 +++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 03483738079..afd419a4324 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,17 @@ export ENABLE_ASAR="false" yarn build:linux ``` +### Other architectures + +To build for another architecture such as `arm64` run the following command: + +```shell +export ARCH= +yarn build:linux +``` + +Replace `` with your desired target (e.g. `arm64`). Have a look at the [documentation for `electron-builder`](https://www.electron.build/electron-builder.enumeration.arch) for the available target architectures. Only one architecture may be specified at a time. + ### Troubleshooting If you are having troubles building Wire for Desktop, then [our troubleshooting page](https://github.com/wireapp/wire-desktop/wiki/Troubleshooting) might be of help. diff --git a/bin/build-tools/lib/build-linux.ts b/bin/build-tools/lib/build-linux.ts index 6ae6f490d0a..4ea09d0a457 100755 --- a/bin/build-tools/lib/build-linux.ts +++ b/bin/build-tools/lib/build-linux.ts @@ -130,7 +130,15 @@ export async function buildLinuxWrapper( packageJsonPath: string, wireJsonPath: string, envFilePath: string, - architecture: electronBuilder.Arch = electronBuilder.Arch.x64, + architecture: electronBuilder.Arch = (() => { + const archMap: { [key: string]: electronBuilder.Arch } = { + 'arm64': electronBuilder.Arch.arm64, + 'armv7l': electronBuilder.Arch.armv7l, + 'ia32': electronBuilder.Arch.ia32, + 'x64': electronBuilder.Arch.x64 + }; + return archMap[process.env.ARCH?.toLowerCase() || 'x64']; + })(), ): Promise { const wireJsonResolved = path.resolve(wireJsonPath); const packageJsonResolved = path.resolve(packageJsonPath);