Skip to content

Commit

Permalink
replace node-pre-gyp with node-gyp, remove artifacts directory-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Schuhfuss committed Jun 8, 2015
1 parent 884b5f3 commit c5aace8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 43 deletions.
6 changes: 3 additions & 3 deletions binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"dependencies": [ "serialport" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
"files": [ "<(PRODUCT_DIR)/serialport.node" ],
"destination": "."
}
]
}
Expand Down
42 changes: 5 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,26 @@
{
"name": "serialport",
"name": "serialport-electron",
"version": "1.7.4",
"description": "Welcome your robotic javascript overlords. Better yet, program them!",
"description": "Unmaintaned fork of serialport that builds with electron!",
"author": {
"name": "Chris Williams",
"email": "[email protected]",
"url": "http://www.voodootikigod.com"
},
"binary": {
"module_name": "serialport",
"module_path": "./build/{module_name}/v{version}/{configuration}/{node_abi}-{platform}-{arch}/",
"remote_path": "./{module_name}/v{version}/{configuration}/",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz",
"host": "https://node-serialport.s3.amazonaws.com"
},
"main": "./serialport",
"repository": {
"type": "git",
"url": "git://github.com/voodootikigod/node-serialport.git"
"url": "git://github.com/usefulthink/node-serialport.git"
},
"maintainers": [
{
"name": "Chris Williams",
"email": "[email protected]"
},
{
"name": "Joe Ferner",
"email": "[email protected]"
},
{
"name": "Jay Beavers",
"email": "[email protected]"
},
{
"name": "Rob Giseburt",
"email": "[email protected]"
},
{
"name": "Francis Gulotta",
"email": "[email protected]"
}
],
"dependencies": {
"async": "0.9.0",
"bindings": "1.2.1",
"debug": "^2.1.1",
"nan": "~1.8.4",
"node-pre-gyp": "0.6.x",
"node-gyp": "^2.0.1",
"optimist": "~0.6.1",
"sf": "0.1.7"
},
"bundledDependencies": [
"node-pre-gyp"
],
"devDependencies": {
"mocha": "*",
"chai": "*",
Expand All @@ -72,7 +40,7 @@
"serialportterm": "./bin/serialportTerminal.js"
},
"scripts": {
"install": "node-pre-gyp install --fallback-to-build",
"install": "node-gyp rebuild",
"test": "grunt --verbose"
}
}
4 changes: 1 addition & 3 deletions serialport.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
// to regular build from source.

var debug = require('debug')('serialport');
var binary = require('node-pre-gyp');
var path = require('path');
var PACKAGE_JSON = path.join(__dirname, 'package.json');
var binding_path = binary.find(path.resolve(PACKAGE_JSON));
var SerialPortBinding = require(binding_path);
var SerialPortBinding = require('./serialport.node');

var parsers = require('./parsers');
var EventEmitter = require('events').EventEmitter;
Expand Down

6 comments on commit c5aace8

@kjlaw89
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked perfectly for compiling against electron (using electron-rebuild to make things easier). Is there anything left to do? Otherwise it'd be great to see this merged into serialport so it works out of the box for Electron.

@usefulthink
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main problem has to do with the node-pre-gyp process node-serialport is using. So merging this would result in longer install-times for everybody else. I think the best place to address this would be the node-pre-gyp project (I recall there was already an issue about it, but I didn't have the time to look further).

@kjlaw89
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it'd be best to wait for node-pre-gyp to support Electron compiling. In the meantime your fork is simple enough to implement whenever I need to compile changes. Thanks!

@gfpacheco
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although I got serialport to work with electron with these changes, I'm also getting full cpu usage. Are you having the same issue or is it just me?

@kjlaw89
Copy link

@kjlaw89 kjlaw89 commented on c5aace8 Sep 2, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not experiencing full CPU usage, but I'm not maintaining a two-way, constant connection with a device, just occasionally send data to a device

@gfpacheco
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post some sample code of your approach? Just by instantiating the SerialPort drains my cpu:

new serialport.SerialPort('/dev/cu.wchusbserial1420');

Please sign in to comment.