From 7f155b8fc45df7e511063cf2a768b880f9e59d4c Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Fri, 6 May 2022 20:21:38 -0400 Subject: [PATCH] add armv7l support to scripts --- script/build.ts | 2 +- script/dist-info.ts | 8 ++++++-- script/package-debian.ts | 4 ++-- script/package-electron-builder.ts | 2 +- script/package-redhat.ts | 4 ++-- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/script/build.ts b/script/build.ts index 223009c5ce2..99e41096b47 100755 --- a/script/build.ts +++ b/script/build.ts @@ -156,7 +156,7 @@ function packageApp() { targetArch = os.arch() } - if (targetArch === 'arm64' || targetArch === 'x64') { + if (targetArch === 'arm64' || targetArch === 'x64' || targetArch === 'armv7l') { return targetArch } diff --git a/script/dist-info.ts b/script/dist-info.ts index 153bed7caae..dcc430b9c08 100644 --- a/script/dist-info.ts +++ b/script/dist-info.ts @@ -143,11 +143,12 @@ export function getReleaseSHA() { return pieces[2] } -export function getDistArchitecture(): 'arm64' | 'x64' { +export function getDistArchitecture(): 'arm64' | 'x64' | 'armv7l' { // If a specific npm_config_arch is set, we use that one instead of the OS arch (to support cross compilation) if ( process.env.npm_config_arch === 'arm64' || - process.env.npm_config_arch === 'x64' + process.env.npm_config_arch === 'x64' || + process.env.npm_config_arch === 'armv7l' ) { return process.env.npm_config_arch } @@ -155,6 +156,9 @@ export function getDistArchitecture(): 'arm64' | 'x64' { if (process.arch === 'arm64') { return 'arm64' } + if (process.arch === 'armv7l') { + return 'armv7l' + } // TODO: Check if it's x64 running on an arm64 Windows with IsWow64Process2 // More info: https://www.rudyhuyn.com/blog/2017/12/13/how-to-detect-that-your-x86-application-runs-on-windows-on-arm/ diff --git a/script/package-debian.ts b/script/package-debian.ts index 15314d519dd..b3f89c94dc8 100644 --- a/script/package-debian.ts +++ b/script/package-debian.ts @@ -16,7 +16,7 @@ type DebianOptions = { // required src: string dest: string - arch: 'amd64' | 'i386' | 'arm64' + arch: 'amd64' | 'i386' | 'arm64' | 'armhf' // optional description?: string productDescription?: string @@ -39,7 +39,7 @@ type DebianOptions = { const options: DebianOptions = { src: getDistPath(), dest: distRoot, - arch: 'amd64', + arch: 'armhf', description: 'Simple collaboration from your desktop', productDescription: 'This is the unofficial port of GitHub Desktop for Linux distributions', diff --git a/script/package-electron-builder.ts b/script/package-electron-builder.ts index 7b26f48b2b5..7c9297f1b4c 100644 --- a/script/package-electron-builder.ts +++ b/script/package-electron-builder.ts @@ -27,7 +27,7 @@ export async function packageElectronBuilder(): Promise> { 'build', '--prepackaged', distPath, - '--x64', + '--armv7l', '--config', configPath, ] diff --git a/script/package-redhat.ts b/script/package-redhat.ts index 66ef2f39f37..ac16878e66e 100644 --- a/script/package-redhat.ts +++ b/script/package-redhat.ts @@ -16,7 +16,7 @@ type RedhatOptions = { // required src: string dest: string - arch: 'x86_64' + arch: 'armv7l' // optional description?: string productDescription?: string @@ -36,7 +36,7 @@ type RedhatOptions = { const options: RedhatOptions = { src: getDistPath(), dest: distRoot, - arch: 'x86_64', + arch: 'armv7l', description: 'Simple collaboration from your desktop', productDescription: 'This is the unofficial port of GitHub Desktop for Linux distributions',