Skip to content

Commit

Permalink
Simplify build process: switch from node-pre-gyp to prebuildify
Browse files Browse the repository at this point in the history
  • Loading branch information
intrueder committed Feb 18, 2020
1 parent 1d47a24 commit 6e4d2ca
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 312 deletions.
4 changes: 2 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
pids
logs
results
lib/binding
npm-debug.log
node_modules
build
test.js
test.js
CUESDK
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ Node.js native wrapper around CUE SDK
=====================================

This wrapper can be used in node and electron apps.
It uses [node-pre-gyp](https://www.npmjs.com/package/node-pre-gyp) and is prebuilt for some environments (see [Releases](https://github.com/intrueder/cue-sdk/releases))
It uses [prebuildify](https://github.com/prebuild/prebuildify) and is prebuilt for some runtime environments:

**Node**: 8.16.0, 10.16.0, 11.8.0, 12.0.0

**Electron**: 6.0.0, 7.0.0, 8.0.0

The API is almost the same as in CUE SDK itself.

Expand Down
27 changes: 11 additions & 16 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
{
"variables": {
"module_name%": "node.abi72",
"prebuilds_path%": "<(module_root_dir)/prebuilds/win32-<(target_arch)"
},
"targets": [
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [
"<(module_name)"
],
"copies": [
{
"files": [
"<(PRODUCT_DIR)/<(module_name).node"
],
"destination": "<(module_path)"
}
]
},
{
"target_name": "<(module_name)",
"sources": [
Expand Down Expand Up @@ -65,7 +54,13 @@
],
"copies": [
{
"destination": "<(module_path)",
"destination": "<(prebuilds_path)",
"files": [
"<(module_root_dir)/CUESDK/redist/<(sdk_arch_path)/CUESDK<(sdk_arch)_2015.dll"
]
},
{
"destination": "<(PRODUCT_DIR)",
"files": [
"<(module_root_dir)/CUESDK/redist/<(sdk_arch_path)/CUESDK<(sdk_arch)_2015.dll"
]
Expand Down
5 changes: 1 addition & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
const binary = require('node-pre-gyp');
const path = require('path');
const binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
const binding = require(binding_path);
const binding = require('node-gyp-build')(__dirname)
const enums = require('./src/enums');

const sdk = {
Expand Down
Loading

0 comments on commit 6e4d2ca

Please sign in to comment.