Skip to content

Commit 422a032

Browse files
committed
fix: vendor/osx/7za seems to be broken
Closes #296
1 parent 928070b commit 422a032

File tree

21 files changed

+87
-719
lines changed

21 files changed

+87
-719
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ before_install:
2828
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gnu-tar dpkg libicns graphicsmagick git-lfs; fi
2929
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then git lfs pull; fi
3030
- gem install --no-rdoc --no-ri fpm
31+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then curl -L https://github.com/github/git-lfs/releases/download/v1.1.2/git-lfs-linux-amd64-1.1.2.tar.gz | tar -xz; fi
32+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then git-lfs-1.1.2/git-lfs pull; fi
3133

3234
install:
3335
- nvm install $NODE_VERSION
3436
- npm install npm -g
3537
- npm prune
36-
- npm install Microsoft/TypeScript
3738
- npm install
3839

3940
script:

docs/multi-platform-build.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,26 @@ gem install fpm
3131
## Linux
3232
To build app in distributable format for Linux:
3333
```
34-
sudo apt-get install icnsutils graphicsmagick
34+
sudo apt-get install ruby-dev gcc make icnsutils graphicsmagick
35+
gem install fpm
3536
```
3637

38+
To build app in distributable format for Windows on Linux:
39+
* Install Wine:
40+
```
41+
sudo add-apt-repository ppa:ubuntu-wine/ppa
42+
sudo apt-get update
43+
sudo apt-get install wine1.8 winetricks
44+
winetricks -q vcrun2013
45+
```
46+
* Install [Mono](http://www.mono-project.com/docs/getting-started/install/linux/#usage):
47+
```
48+
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
49+
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
50+
sudo apt-get update
51+
sudo apt-get install mono-complete
52+
```
53+
3754
## Windows
3855

3956
Not documented yet.

package.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
"main": "out/index.js",
66
"files": [
77
"out",
8-
"templates",
9-
"vendor"
8+
"templates"
109
],
1110
"bin": {
1211
"build": "./out/build-cli.js",
@@ -55,12 +54,11 @@
5554
"dependencies": {
5655
"bluebird": "^3.3.4",
5756
"command-line-args": "^2.1.6",
58-
"electron-packager": "^6.0.0",
59-
"electron-winstaller-fixed": "^2.0.6-beta.7",
57+
"electron-packager": "^6.0.1",
58+
"electron-winstaller-fixed": "^2.0.6-beta.8",
6059
"fs-extra": "^0.26.7",
6160
"fs-extra-p": "^0.2.0",
6261
"globby": "^4.0.0",
63-
"gm": "^1.21.1",
6462
"hosted-git-info": "^2.1.4",
6563
"image-size": "^0.5.0",
6664
"lodash.template": "^4.2.4",
@@ -69,7 +67,8 @@
6967
"progress-stream": "^1.2.0",
7068
"read-package-json": "^2.0.3",
7169
"source-map-support": "^0.4.0",
72-
"tmp": "0.0.28"
70+
"tmp": "0.0.28",
71+
"7zip-bin": "^0.0.3"
7372
},
7473
"optionalDependencies": {
7574
"appdmg": "^0.3.6"
@@ -90,7 +89,7 @@
9089
"ts-babel": "^0.6.9",
9190
"tsconfig-glob": "^0.4.3",
9291
"tslint": "next",
93-
"typescript": "^1.9.0-dev.20160405",
92+
"typescript": "^1.9.0-dev.20160408",
9493
"validate-commit-msg": "^2.5.0"
9594
},
9695
"babel": {

src/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export async function build(originalOptions?: BuildOptions): Promise<void> {
4040
options.dist = true
4141
}
4242
else if (options.dist === undefined) {
43-
options.dist = lifecycleEvent === "dist" || lifecycleEvent === "build" || lifecycleEvent.startsWith("dist:")
43+
options.dist = lifecycleEvent === "dist" || lifecycleEvent === "build" || (lifecycleEvent != null && lifecycleEvent.startsWith("dist:"))
4444
}
4545

4646
let isPublishOptionGuessed = false

src/linuxPackager.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { Platform, LinuxBuildOptions } from "./metadata"
55
import { dir as _tpmDir, TmpOptions } from "tmp"
66
import { exec, log } from "./util"
77
import { outputFile, readFile, readdir } from "fs-extra-p"
8-
import { State as Gm } from "gm"
98
const template = require("lodash.template")
109

1110
//noinspection JSUnusedLocalSymbols
@@ -100,16 +99,11 @@ Icon=${this.metadata.name}
10099
const output = outputs[0].toString()
101100
log(output)
102101

103-
const gm = require("gm")
104-
105102
const imagePath = path.join(tempDir, "icon_256x256x32.png")
106103

107104
function resize(size: number): BluebirdPromise<any> {
108-
return new BluebirdPromise((resolve, reject) => {
109-
(<Gm>gm(imagePath))
110-
.resize(size, size)
111-
.write(path.join(tempDir, `icon_${size}x${size}x32.png`), error => error == null ? resolve() : reject(error))
112-
})
105+
const sizeArg = `${size}x${size}`
106+
return exec("gm", ["convert", "-size", sizeArg, imagePath, "-resize", sizeArg, path.join(tempDir, `icon_${size}x${size}x32.png`)])
113107
}
114108

115109
const promises: Array<Promise<any>> = [resize(24), resize(96)]

src/macPackager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { Promise as BluebirdPromise } from "bluebird"
55
import { log, spawn } from "./util"
66
import { createKeychain, deleteKeychain, CodeSigningInfo, generateKeychainName, sign } from "./codeSign"
77
import { stat } from "fs-extra-p"
8+
import { path7za } from "7zip-bin"
89

910
//noinspection JSUnusedLocalSymbols
1011
const __awaiter = require("./awaiter")
@@ -112,7 +113,7 @@ export default class MacPackager extends PlatformPackager<OsXBuildOptions> {
112113
}
113114
args.push(resultPath, this.appName + ".app")
114115

115-
return spawn(path.join(__dirname, "..", "vendor", "osx", "7za"), args, {
116+
return spawn(path7za, args, {
116117
cwd: outDir,
117118
stdio: ["ignore", "ignore", "inherit"],
118119
})

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export function installDependencies(appDir: string, electronVersion: string, arc
3535
let npmExecPath = process.env.npm_execpath || process.env.NPM_CLI_JS
3636
const npmExecArgs = [command, "--production"]
3737
if (npmExecPath == null) {
38-
npmExecPath = "npm"
38+
npmExecPath = process.platform === "win32" ? "npm.cmd" : "npm"
3939
}
4040
else {
4141
npmExecArgs.unshift(npmExecPath)

test/README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
1-
# Running Windows tests on OS X
2-
3-
```
4-
brew install Caskroom/cask/xquartz wine mono
5-
```
6-
7-
# Running Linux tests on OS X
8-
Do not use OS X bundled Ruby. Install using `brew`.
9-
10-
```
11-
brew install ruby gnu-tar dpkg libicns graphicsmagick
12-
gem install fpm
13-
```
1+
In addition to [required system packages](./multi-platform-build.md), on OS X `dpkg` is required to run Linux tests: `brew install dpkg`
142

153
# Inspect output if test uses temporary directory
164
Set environment variable `TEST_APP_TMP_DIR` (e.g. `/tmp/electron-builder-test`).
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "TestApp",
4-
"version": "1.0.0",
4+
"version": "1.1.0",
55
"homepage": "http://foo.example.com",
66
"description": "Test Application",
77
"scripts": {
@@ -10,15 +10,12 @@
1010
"author": "Foo Bar <foo@example.com>",
1111
"license": "MIT",
1212
"devDependencies": {
13-
"electron-prebuilt": "^0.37.3"
13+
"electron-prebuilt": "^0.37.5"
1414
},
1515
"build": {
1616
"app-bundle-id": "your.id",
1717
"app-category-type": "your.app.category.type",
1818
"iconUrl": "https://raw.githubusercontent.com/szwacz/electron-boilerplate/master/resources/windows/icon.ico",
19-
"compression": "store",
20-
"win": {
21-
"title": "My App"
22-
}
19+
"compression": "store"
2320
}
2421
}

test/fixtures/test-app/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "TestApp",
4-
"version": "1.0.0",
4+
"version": "1.1.0",
55
"description": "Test Application",
66
"author": "Foo Bar",
77
"homepage": "https://github.com/atom/electron-quick-start#readme",

0 commit comments

Comments
 (0)