Skip to content

Commit

Permalink
feat: bundle osslsigncode for Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
develar committed Aug 11, 2016
1 parent b9e1e03 commit fc8d6c6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ matrix:
env: TEST_FILES=BuildTest,linuxPackagerTest,globTest NODE_VERSION=6 PUBLISH_TO_NPM=true

- os: osx
env: TEST_FILES=macPackagerTest,winPackagerTest,nsisTest NODE_VERSION=6
env: TEST_FILES=winPackagerTest,nsisTest,macPackagerTest NODE_VERSION=6

- os: osx
env: TEST_FILES=macPackagerTest,CodeSignTest NODE_VERSION=4
Expand All @@ -32,7 +32,6 @@ install:
- nvm use --delete-prefix $NODE_VERSION
- if [[ "$TRAVIS_OS_NAME" == "osx" && "$NODE_VERSION" == "4" ]]; then npm install npm -g ; fi
- npm install
- npm install @develar/semantic-release
- npm prune
- (cd test/fixtures/app-executable-deps/app && npm install && npm prune)

Expand Down
9 changes: 2 additions & 7 deletions docker/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ ENV USE_SYSTEM_FPM true
ENV DEBUG_COLORS true
ENV FORCE_COLOR true

# libcurl4-openssl-dev, libtool and automake are required to build osslsigncode

RUN apt-get update -y && \
apt-get install --no-install-recommends -y xorriso bsdtar build-essential autoconf automake libcurl4-openssl-dev libtool libssl-dev icnsutils graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \
apt-get install --no-install-recommends -y xorriso bsdtar build-essential autoconf libssl-dev icnsutils graphicsmagick gcc-multilib g++-multilib libgnome-keyring-dev lzip rpm yasm && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
curl -L http://tukaani.org/xz/xz-$XZ_VERSION.tar.xz | tar -xJ && cd xz-$XZ_VERSION && ./configure && make && make install && cd .. && rm -rf xz-$XZ_VERSION && ldconfig && \
mkdir -p /tmp/7z && curl -L http://downloads.sourceforge.net/project/p7zip/p7zip/15.14.1/p7zip_15.14.1_src_all.tar.bz2 | tar -xj -C /tmp/7z --strip-components 1 && cd /tmp/7z && cp makefile.linux_amd64_asm makefile.machine && make && make install && rm -rf /tmp/7z && \
mkdir -p /tmp/s && cd /tmp/s && \
curl -L https://dl.bintray.com/develar/bin/osslsigncode-src.7z > a.7z && \
7za x -oosslsigncode a.7z && cd osslsigncode && ./autogen.sh && ./configure && make && make install && rm -rf /tmp/s
mkdir -p /tmp/7z && curl -L http://downloads.sourceforge.net/project/p7zip/p7zip/15.14.1/p7zip_15.14.1_src_all.tar.bz2 | tar -xj -C /tmp/7z --strip-components 1 && cd /tmp/7z && cp makefile.linux_amd64_asm makefile.machine && make && make install && rm -rf /tmp/7z

# nodejs keys
RUN set -ex \
Expand Down
File renamed without changes.
7 changes: 1 addition & 6 deletions docs/Multi Platform Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Use [brew](http://brew.sh) to install required packages.

### To build app for Windows on MacOS:
```
brew install wine --with-win64 --without-x11 --devel
brew install wine --without-x11
brew install mono
```

Expand Down Expand Up @@ -66,11 +66,6 @@ To build pacman: `sudo apt-get install --no-install-recommends -y bsdtar`.
sudo apt-get install --no-install-recommends -y mono-devel ca-certificates-mono
```

* Install osslsigncode.
```
apt-get install --no-install-recommends -y osslsigncode
```

### To build app in 32 bit from a machine with 64 bit:

```
Expand Down
12 changes: 6 additions & 6 deletions src/windowsCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import { getBin } from "./util/binDownload"
//noinspection JSUnusedLocalSymbols
const __awaiter = require("./util/awaiter")

const TOOLS_VERSION = "winCodeSign-1.1.0"
const TOOLS_VERSION = "winCodeSign-1.3.0"

export function getSignVendorPath() {
return getBin("winCodeSign", TOOLS_VERSION, `https://dl.bintray.com/electron-userland/bin/${TOOLS_VERSION}.7z`, "f9cd51c00f673c49290e2a1c610ba1106b84e68fc23f7075b98e4e10403d6e02")
return getBin("winCodeSign", TOOLS_VERSION, `https://dl.bintray.com/electron-userland/bin/${TOOLS_VERSION}.7z`, "cfe9569f7e5aef605c11704d90a3ce22d2445984b51f145c97140eec68bd9833")
}

export interface SignOptions {
Expand Down Expand Up @@ -127,15 +127,15 @@ function getOutputPath(inputPath: string, hash: string) {
}

async function getToolPath() {
if (process.env.USE_SYSTEM_SIGNCODE) {
return "osslsigncode"
}

let result = process.env.SIGNTOOL_PATH
if (result) {
return result
}

if (process.env.USE_SYSTEM_SIGNCODE || process.platform === "linux") {
return "osslsigncode"
}

const vendorPath = await getSignVendorPath()
if (process.platform === "win32") {
return path.join(vendorPath, `windows-${(release().startsWith("6.") ? "6" : "10")}`, "signtool.exe")
Expand Down

0 comments on commit fc8d6c6

Please sign in to comment.