Skip to content

Commit

Permalink
Fix builds and remove ia32
Browse files Browse the repository at this point in the history
  • Loading branch information
hansonw committed Oct 14, 2016
1 parent 7ffe8d2 commit 0f3be68
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 26 deletions.
35 changes: 13 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,18 @@ matrix:
include:
# linux
- os: linux # abi 47
env: NODE_VERSION="5.1.1" TARGET_ARCH="x64"
env: NODE_VERSION="5.1.1" CXX="g++-4.9"
- os: linux # abi 48
env: NODE_VERSION="6" TARGET_ARCH="x64"
env: NODE_VERSION="6" CXX="g++-4.9"
- os: linux # abi 49
env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="x64"
env: NODE_VERSION="6" ELECTRON="1.3.6" CXX="g++-4.9"
# os x x86
- os: osx
env: NODE_VERSION="5.1.1" TARGET_ARCH="x64" CXX="clang"
env: NODE_VERSION="5.1.1" CXX="clang"
- os: osx
env: NODE_VERSION="6" TARGET_ARCH="x64" CXX="clang"
env: NODE_VERSION="6" CXX="clang"
- os: osx
env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="x64" CXX="clang"
# osx ia32
- os: osx
env: NODE_VERSION="5.1.1" TARGET_ARCH="ia32" CXX="clang"
- os: osx
env: NODE_VERSION="6" TARGET_ARCH="ia32" CXX="clang"
- os: osx
env: NODE_VERSION="6" ELECTRON="1.3.6" TARGET_ARCH="ia32" CXX="clang"
env: NODE_VERSION="6" ELECTRON="1.3.6" CXX="clang"

before_install:
- rm -rf ~/.nvm/ && git clone --depth 1 "https://github.com/creationix/nvm.git" ~/.nvm
Expand All @@ -39,21 +32,19 @@ before_install:
- export PATH="./node_modules/.bin/:$PATH"

install:
- if [[ -n "$ELECTRON" ]]; then
export npm_config_target=$ELECTRON;
export npm_config_disturl=https://atom.io/download/atom-shell;
export npm_config_runtime=electron;
export npm_config_build_from_source=true;
fi
- npm install

script:
- if [[ -z "$ELECTRON" ]]; then
node-pre-gyp rebuild package testpackage \
--build-from-source --target_arch=$TARGET_ARCH;
else
node-pre-gyp rebuild package testpackage \
--runtime=electron --target=$ELECTRON \
--dist-url=https://atom.io/download/atom-shell \
--build-from-source --target_arch=$TARGET_ARCH;
fi
- if [[ "$TARGET_ARCH" == "x64" && -z "$ELECTRON" ]]; then
npm test;
fi
- node-pre-gyp package testpackage

git:
depth: 10
Expand Down
13 changes: 11 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
'use strict';

var binary = require('pre-binding');
var path = require('path');
var binding_path = binary.find(path.resolve(path.join(__dirname, '../package.json')));
var pack = require('../package.json');
var binding_path = path.join(
__dirname,
'../build/fuzzy-native/',
'v' + pack.version,
// ABI v49 is only for Electron. https://github.com/electron/electron/issues/5851
process.versions.modules === '49'
? ['electron', 'v1.3', process.platform, process.arch].join('-')
: ['node', 'v' + process.versions.modules, process.platform, process.arch].join('-'),
'fuzzy-native.node'
);

module.exports = require(binding_path);
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"license": "MIT",
"dependencies": {
"nan": "^2.0.0",
"node-pre-gyp": "^0.6.5",
"pre-binding": "^1.1.0",
"node-pre-gyp": "^0.6.30",
"semver": "^5.0.0"
},
"bundledDependencies": [
Expand Down

0 comments on commit 0f3be68

Please sign in to comment.