Skip to content

Commit

Permalink
Moved gRPC node package root to repo root, made it depend on grpc.gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
murgatroid99 committed Oct 1, 2015
1 parent b3ca2ad commit 2af89e4
Show file tree
Hide file tree
Showing 22 changed files with 117 additions and 443 deletions.
File renamed without changes.
66 changes: 66 additions & 0 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"variables" : {
'config': '<!(echo $CONFIG)'
},
"targets" : [
{
'include_dirs': [
"<!(node -e \"require('nan')\")"
],
'cflags': [
'-std=c++0x',
'-Wall',
'-pthread',
'-g',
'-zdefs',
'-Werror',
'-Wno-error=deprecated-declarations'
],
'ldflags': [
'-g'
],
"conditions": [
['OS != "win"', {
'conditions': [
['config=="gcov"', {
'cflags': [
'-ftest-coverage',
'-fprofile-arcs',
'-O0'
],
'ldflags': [
'-ftest-coverage',
'-fprofile-arcs'
]
}
]
]
}],
['OS == "mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'OTHER_CFLAGS': [
'-std=c++11',
'-stdlib=libc++'
]
}
}]
],
"target_name": "grpc_node",
"sources": [
"src/node/ext/byte_buffer.cc",
"src/node/ext/call.cc",
"src/node/ext/channel.cc",
"src/node/ext/completion_queue_async_worker.cc",
"src/node/ext/credentials.cc",
"src/node/ext/node_grpc.cc",
"src/node/ext/server.cc",
"src/node/ext/server_credentials.cc",
"src/node/ext/timeval.cc"
],
"dependencies": [
"grpc.gyp:grpc"
]
}
]
}
8 changes: 7 additions & 1 deletion grpc.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,13 @@
'-ldl',
'-lpthread',
'-lz'
]
],
'direct_dependent_settings': {
'include_dirs': [
'.',
'include'
],
}
},
'targets': [
# TODO: Add C++ targets
Expand Down
38 changes: 21 additions & 17 deletions src/node/package.json → package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@
}
],
"directories": {
"lib": "src",
"example": "examples"
"lib": "src/node/src"
},
"scripts": {
"lint": "node ./node_modules/jshint/bin/jshint src test examples interop index.js",
"test": "./node_modules/.bin/mocha && npm run-script lint",
"gen_docs": "./node_modules/.bin/jsdoc -c jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha"
"lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/examples src/node/interop src/node/index.js",
"test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
"gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test"
},
"dependencies": {
"bindings": "^1.2.0",
Expand All @@ -47,17 +46,22 @@
},
"files": [
"LICENSE",
"README.md",
"index.js",
"binding.gyp",
"bin",
"cli",
"examples",
"ext",
"interop",
"src",
"test"
"src/node/README.md",
"src/node/index.js",
"src/node/bin",
"src/node/cli",
"src/node/examples",
"src/node/ext",
"src/node/health_check",
"src/node/interop",
"src/node/src",
"src/node/test",
"src/core",
"test/proto",
"include",
"grpc.gyp",
"binding.gyp"
],
"main": "index.js",
"main": "src/node/index.js",
"license": "BSD-3-Clause"
}
28 changes: 0 additions & 28 deletions src/node/LICENSE

This file was deleted.

36 changes: 0 additions & 36 deletions src/node/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,19 @@ Beta

## PREREQUISITES
- `node`: This requires `node` to be installed. If you instead have the `nodejs` executable on Debian, you should install the [`nodejs-legacy`](https://packages.debian.org/sid/nodejs-legacy) package.
- [homebrew][] on Mac OS X. These simplify the installation of the gRPC C core.

## INSTALLATION

**Linux (Debian):**

Add [Debian jessie-backports][] to your `sources.list` file. Example:

```sh
echo "deb http://http.debian.net/debian jessie-backports main" | \
sudo tee -a /etc/apt/sources.list
```

Install the gRPC Debian package

```sh
sudo apt-get update
sudo apt-get install libgrpc-dev
```

Install the gRPC NPM package

```sh
npm install grpc
```

**Mac OS X**

Install [homebrew][]. Run the following command to install gRPC Node.js.
```sh
$ curl -fsSL https://goo.gl/getgrpc | bash -s nodejs
```
This will download and run the [gRPC install script][], then install the latest version of gRPC Nodejs npm package.

## BUILD FROM SOURCE
1. Clone [the grpc Git Repository](https://github.com/grpc/grpc).
2. Follow the instructions in the `INSTALL` file in the root of that repository to install the C core library that this package depends on.
3. Run `npm install`.

If you install the gRPC C core library in a custom location, then you need to set some environment variables to install this library. The command will look like this:

```sh
CXXFLAGS=-I<custom location>/include LDFLAGS=-L<custom location>/lib npm install [grpc]
```

## TESTING
To run the test suite, simply run `npm test` in the install location.

Expand Down Expand Up @@ -110,7 +78,3 @@ ServerCredentials
```

An object with factory methods for creating credential objects for servers.

[homebrew]:http://brew.sh
[gRPC install script]:https://raw.githubusercontent.com/grpc/homebrew-grpc/master/scripts/install
[Debian jessie-backports]:http://backports.debian.org/Instructions/
100 changes: 0 additions & 100 deletions src/node/binding.gyp

This file was deleted.

3 changes: 1 addition & 2 deletions src/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ var server = require('./src/server.js');

var Metadata = require('./src/metadata.js');

var grpc = require('bindings')('grpc');
var grpc = require('bindings')('grpc_node');

/**
* Load a gRPC object from an existing ProtoBuf.Reflect object.
Expand Down Expand Up @@ -90,7 +90,6 @@ exports.load = function load(filename, format) {
default:
throw new Error('Unrecognized format "' + format + '"');
}

return loadObject(builder.ns);
};

Expand Down
43 changes: 0 additions & 43 deletions src/node/interop/empty.proto

This file was deleted.

4 changes: 3 additions & 1 deletion src/node/interop/interop_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ var fs = require('fs');
var path = require('path');
var _ = require('lodash');
var grpc = require('..');
var testProto = grpc.load(__dirname + '/test.proto').grpc.testing;
var testProto = grpc.load({
root: __dirname + '/../../..',
file: 'test/proto/test.proto'}).grpc.testing;
var GoogleAuth = require('google-auth-library');

var assert = require('assert');
Expand Down
Loading

0 comments on commit 2af89e4

Please sign in to comment.