Skip to content

Commit

Permalink
fix(linux): correctly set size of icon converted using openjpeg2
Browse files Browse the repository at this point in the history
Close #2599
  • Loading branch information
develar committed Feb 21, 2018
1 parent f799062 commit 99c1025
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 29 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
"////": "All typings are added into root `package.json` to avoid duplication errors in the IDE compiler (several `node.d.ts` files).",
"dependencies": {
"7zip-bin": "~3.1.0",
"app-builder-bin": "1.3.6",
"app-builder-bin": "1.3.7",
"archiver": "^2.1.1",
"async-exit-hook": "^2.0.1",
"aws-sdk": "^2.198.0",
"aws-sdk": "^2.199.0",
"bluebird-lst": "^1.0.5",
"chalk": "^2.3.0",
"chromium-pickle-js": "^0.2.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/builder-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"out"
],
"dependencies": {
"app-builder-bin": "1.3.6",
"app-builder-bin": "1.3.7",
"temp-file": "^3.1.1",
"fs-extra-p": "^4.5.2",
"is-ci": "^1.1.0",
Expand Down
8 changes: 6 additions & 2 deletions packages/builder-util/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,15 @@ function handleProcess(event: string, childProcess: ChildProcess, command: strin

childProcess.once(event, (code: number) => {
if (log.isDebugEnabled) {
log.debug({
const fields: any = {
command: path.basename(command),
code,
pid: childProcess.pid,
}, "exited")
}
if (out.length > 0) {
fields.out = out
}
log.debug(fields, "exited")
}

if (code === 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-builder-lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"homepage": "https://github.com/electron-userland/electron-builder",
"dependencies": {
"7zip-bin": "~3.1.0",
"app-builder-bin": "1.3.6",
"app-builder-bin": "1.3.7",
"async-exit-hook": "^2.0.1",
"bluebird-lst": "^1.0.5",
"chromium-pickle-js": "^0.2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export default class AppImageTarget extends Target {
const artifactPath = path.join(this.outDir, artifactName)
this.logBuilding("AppImage", artifactPath, arch)

// pax doesn't like dir with leading dot (e.g. `.__appimage`)
const stageDir = await createStageDir(this, packager, arch)
const resourceName = `appimagekit-${this.packager.executableName}`
const installIcons = await this.copyIcons(stageDir.dir, resourceName)
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-publisher-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"dependencies": {
"fs-extra-p": "^4.5.2",
"aws-sdk": "^2.198.0",
"aws-sdk": "^2.199.0",
"mime": "^2.2.0",
"electron-publish": "~0.0.0-semantic-release",
"builder-util": "^0.0.0-semantic-release",
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 @@ -128,6 +128,22 @@ Object {
}
`;

exports[`icons dir with images without size in the filename 1`] = `
Object {
"linux": Array [
Object {
"arch": "x64",
"file": "TestApp-1.1.0-x86_64.AppImage",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
],
}
`;

exports[`icons from ICNS (mac) 1`] = `
Object {
"linux": Array [
Expand Down
22 changes: 21 additions & 1 deletion test/src/linux/linuxPackagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ test.ifNotWindows.ifNotCiMac("AppImage - default icon, custom executable and cus
},
}))

// test prepacked asar also https://github.com/electron-userland/electron-builder/issues/1102
test.ifNotWindows("icons from ICNS (mac)", app({
targets: appImageTarget,
config: {
Expand All @@ -92,6 +91,27 @@ test.ifNotWindows("icons from ICNS (mac)", app({
},
}))

test.ifNotWindows("icons dir with images without size in the filename", app({
targets: appImageTarget,
config: {
publish: null,
win: {
// doesn't matter, but just to be sure that presense of this configuration doesn't lead to errors
icon: "icons/icon.ico",
},
},
}, {
projectDirCreated: async projectDir => {
await rename(path.join(projectDir, "build", "icons", "256x256.png"), path.join(projectDir, "build", "icon.png"))
await remove(path.join(projectDir, "build", "icons"))
await rename(path.join(projectDir, "build"), path.join(projectDir, "icons"))
},
packed: async context => {
const projectDir = context.getResources(Platform.LINUX)
await assertThat(projectDir).isDirectory()
},
}))

// test prepacked asar also https://github.com/electron-userland/electron-builder/issues/1102
test.ifNotWindows("icons from ICNS", app({
targets: appImageTarget,
Expand Down
40 changes: 20 additions & 20 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -275,25 +275,25 @@ anymatch@^1.3.0:
micromatch "^2.1.5"
normalize-path "^2.0.0"

[email protected].6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-linux/-/app-builder-bin-linux-1.3.6.tgz#45344c4b09b3c2febc3a452e8916fa00aa645b62"
[email protected].7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/app-builder-bin-linux/-/app-builder-bin-linux-1.3.7.tgz#9eeb28f7f2c9eb91f4dcd02f03e9117b45891cae"

[email protected].6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-mac/-/app-builder-bin-mac-1.3.6.tgz#c7df8f4c349292c789e557a285df2279d05b8201"
[email protected].7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/app-builder-bin-mac/-/app-builder-bin-mac-1.3.7.tgz#43705d9f0c75ef8ac2a07dcf9c31d9c0d3e27770"

[email protected].6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin-win/-/app-builder-bin-win-1.3.6.tgz#b492c0573cfa4206fb9f33756d6ab844e04ce0b8"
[email protected].7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/app-builder-bin-win/-/app-builder-bin-win-1.3.7.tgz#f5ddef00b0822885fd376f4323aa48c14a5788bf"

[email protected].6:
version "1.3.6"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-1.3.6.tgz#fbc49a3b74917f5e23632c71ea1a3ea9b083424e"
[email protected].7:
version "1.3.7"
resolved "https://registry.yarnpkg.com/app-builder-bin/-/app-builder-bin-1.3.7.tgz#4df1bc9b9448935caaa2f45283655b0704ab994f"
optionalDependencies:
app-builder-bin-linux "1.3.6"
app-builder-bin-mac "1.3.6"
app-builder-bin-win "1.3.6"
app-builder-bin-linux "1.3.7"
app-builder-bin-mac "1.3.7"
app-builder-bin-win "1.3.7"

append-transform@^0.4.0:
version "0.4.0"
Expand Down Expand Up @@ -484,9 +484,9 @@ atob@^2.0.0:
version "2.0.3"
resolved "https://registry.yarnpkg.com/atob/-/atob-2.0.3.tgz#19c7a760473774468f20b2d2d03372ad7d4cbf5d"

aws-sdk@^2.198.0:
version "2.198.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.198.0.tgz#2245311337ddc844cc34c13f3fcf3b7ea843f434"
aws-sdk@^2.199.0:
version "2.199.0"
resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.199.0.tgz#94c2484b030f299dda494c94bacc4f66e4b32de9"
dependencies:
buffer "4.9.1"
events "^1.1.1"
Expand Down Expand Up @@ -3688,8 +3688,8 @@ map-visit@^1.0.0:
object-visit "^1.0.0"

marked@^0.3.12, marked@~0.3.6:
version "0.3.15"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.15.tgz#de96982e54c880962f5093a2fa93d0866bf73668"
version "0.3.16"
resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.16.tgz#2f188b7dfcfa6540fe9940adaf0f3b791c9a5cba"

[email protected]:
version "0.3.0"
Expand Down

0 comments on commit 99c1025

Please sign in to comment.