Skip to content

Commit

Permalink
add armv7l support to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed May 7, 2022
1 parent 68bd523 commit 7f155b8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion script/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function packageApp() {
targetArch = os.arch()
}

if (targetArch === 'arm64' || targetArch === 'x64') {
if (targetArch === 'arm64' || targetArch === 'x64' || targetArch === 'armv7l') {
return targetArch
}

Expand Down
8 changes: 6 additions & 2 deletions script/dist-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,22 @@ 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
}

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/
Expand Down
4 changes: 2 additions & 2 deletions script/package-debian.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion script/package-electron-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function packageElectronBuilder(): Promise<Array<string>> {
'build',
'--prepackaged',
distPath,
'--x64',
'--armv7l',
'--config',
configPath,
]
Expand Down
4 changes: 2 additions & 2 deletions script/package-redhat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type RedhatOptions = {
// required
src: string
dest: string
arch: 'x86_64'
arch: 'armv7l'
// optional
description?: string
productDescription?: string
Expand All @@ -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',
Expand Down

0 comments on commit 7f155b8

Please sign in to comment.