Skip to content

Commit

Permalink
feat(AppImage): support armv7l arch
Browse files Browse the repository at this point in the history
Close #1478
  • Loading branch information
develar committed Jan 6, 2018
1 parent 1586f7f commit fd2a1f0
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
18 changes: 17 additions & 1 deletion packages/electron-builder-lib/src/targets/AppImageTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default class AppImageTarget extends Target {
// default gzip compression - 51.9, xz - 50.4 difference is negligible, start time - well, it seems, a little bit longer (but on Parallels VM on external SSD disk)
// so, to be decided later, is it worth to use xz by default
const args = [
"--runtime-file", path.join(vendorDir, `runtime-${(arch === Arch.ia32 ? "i686" : (arch === Arch.x64 ? "x86_64" : "armv7l"))}`),
"--runtime-file", path.join(vendorDir, `runtime-${(archToRuntimeName(arch))}`),
"--no-appstream",
]
if (debug.enabled) {
Expand Down Expand Up @@ -171,4 +171,20 @@ function copyDirUsingHardLinks(source: string, destination: string) {
.then(() => exec("pax", ["-rwl", "-p", "amp" /* Do not preserve file access times, Do not preserve file modification times, Preserve the file mode bits */, ".", destination], {
cwd: source,
}))
}

function archToRuntimeName(arch: Arch) {
switch (arch) {
case Arch.armv7l:
return "armv7"

case Arch.ia32:
return "i686"

case Arch.x64:
return "x86_64"

default:
throw new Error(`AppImage for arch ${Arch[arch]} not supported`)
}
}
2 changes: 1 addition & 1 deletion packages/electron-builder-lib/src/targets/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getLinuxToolsPath() {

export function getAppImage() {
//noinspection SpellCheckingInspection
return getBinFromGithub("appimage", "9.0.3", "jaOGGGXLKjJV4SXajFOoIb7vCq4GbN0ggy5eosd8F0GAh0ythYfZSq9Lj/+uymmw2h3kKf9W8Y2KBnWxIjU0aw==")
return getBinFromGithub("appimage", "9.0.4", "pTFOnybYI2iGAyDUgXjzTkfuQ/E2ux8uLI1lXGB0RDoKhvFEq3y+q0sFzMOsbPTKZCcBRGhTujRlnsnTwgJmyw==")
}

export const fpmPath = new Lazy(() => {
Expand Down
16 changes: 16 additions & 0 deletions test/out/linux/__snapshots__/linuxPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,22 @@ Object {
}
`;

exports[`AppImage arm 1`] = `
Object {
"linux": Array [
Object {
"arch": "armv7l",
"file": "TestApp-1.1.0-armv7l.AppImage",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
],
}
`;

exports[`AppImage ia32 1`] = `
Object {
"linux": Array [
Expand Down
7 changes: 7 additions & 0 deletions test/src/linux/linuxPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ test.ifAll.ifNotWindows.ifNotCiMac("AppImage ia32", app({
},
}))

test.ifAll.ifNotWindows.ifNotCiMac("AppImage arm", app({
targets: Platform.LINUX.createTarget("Appimage", Arch.armv7l),
config: {
publish: null,
},
}))

test.ifNotWindows.ifNotCiMac.ifAll("AppImage - doNotAsk system integration", app({
targets: Platform.LINUX.createTarget(),
config: {
Expand Down

1 comment on commit fd2a1f0

@simone
Copy link

@simone simone commented on fd2a1f0 Jan 6, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really appreciate!

Please sign in to comment.