Browse files

change: build with node-gyp.

  • Loading branch information...
1 parent de85f2e commit b37452ec1e956bf4d2d63824c6e157109882941d @mah0x211 committed Apr 30, 2013
Showing with 26 additions and 10 deletions.
  1. +19 −0 binding.gyp
  2. +1 −5 index.js
  3. +1 −2 install.sh
  4. +2 −2 package.json
  5. +2 −0 src/uuid.cc
  6. +1 −1 test/test.js
View
19 binding.gyp
@@ -0,0 +1,19 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'ossp-uuid',
+ 'sources': [
+ 'src/uuid.cc'
+ ],
+ 'include_dirs': [
+ './depend/include'
+ ],
+ 'ldflags': [
+ '-L./depend/lib'
+ ],
+ 'libraries': [
+ '-luuid'
+ ]
+ }
+ ]
+}
View
6 index.js
@@ -4,11 +4,7 @@
email: mah0x211@gmail.com
(C) Masatoshi Teruya
*/
-try{
- module.exports = require( __dirname + '/build/default/uuid_binding');
-}catch(e){
- module.exports = require( __dirname + '/build/Release/uuid_binding');
-}
+module.exports = require('./build/Release/ossp-uuid');
module.exports.BIN = 0; /* binary representation (import/export) */
module.exports.STR = 1; /* string representation (import/export) */
module.exports.SIV = 2; /* single integer value (import/export) */
View
3 install.sh
@@ -55,5 +55,4 @@ LDFLAGS="-L${MOD_DEPEND}/lib"
export CPPFLAGS
export LINKFLAGS
export LDFLAGS
-node-waf configure
-node-waf build
+node-gyp rebuild
View
4 package.json
@@ -7,13 +7,13 @@
],
"description": "OSSP uuid bindings for node.js",
"author": "Masatoshi Teruya <mah0x211@gmail.com>",
- "version" : "0.0.9",
+ "version" : "0.1.0",
"main" : "./index.js",
"scripts" : {
"install" : "./install.sh"
},
"engines" : {
- "node" : ">= 0.4.7"
+ "node" : ">= 0.8.23"
},
"repository": {
"type" : "git",
View
2 src/uuid.cc
@@ -108,3 +108,5 @@ void init( Handle<Object> target )
NODE_SET_METHOD( target, "version", version );
NODE_SET_METHOD( target, "generate", generate );
};
+
+NODE_MODULE( ossp_uuid, init );
View
2 test/test.js
@@ -1,5 +1,5 @@
var util = require('util'),
- uuid = require( __dirname + '/../lib/ossp_uuid');
+ uuid = require('../');
console.log(
"version 1\n" +

0 comments on commit b37452e

Please sign in to comment.