{"action":"created","issue":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/4009","repository_url":"https://api.github.com/repos/nwjs/nw.js","labels_url":"https://api.github.com/repos/nwjs/nw.js/issues/4009/labels{/name}","comments_url":"https://api.github.com/repos/nwjs/nw.js/issues/4009/comments","events_url":"https://api.github.com/repos/nwjs/nw.js/issues/4009/events","html_url":"https://github.com/nwjs/nw.js/issues/4009","id":119370270,"number":4009,"title":"nw-gyp all build steps not clear.","user":{"login":"hartsantler","id":764882,"avatar_url":"https://avatars.githubusercontent.com/u/764882?v=3","gravatar_id":"","url":"https://api.github.com/users/hartsantler","html_url":"https://github.com/hartsantler","followers_url":"https://api.github.com/users/hartsantler/followers","following_url":"https://api.github.com/users/hartsantler/following{/other_user}","gists_url":"https://api.github.com/users/hartsantler/gists{/gist_id}","starred_url":"https://api.github.com/users/hartsantler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hartsantler/subscriptions","organizations_url":"https://api.github.com/users/hartsantler/orgs","repos_url":"https://api.github.com/users/hartsantler/repos","events_url":"https://api.github.com/users/hartsantler/events{/privacy}","received_events_url":"https://api.github.com/users/hartsantler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-29T16:54:35Z","updated_at":"2016-02-22T21:01:15Z","closed_at":null,"body":"All the steps to build a c++ module using nw-gyp should be outlined on the wiki here:\r\nhttps://github.com/nwjs/nw.js/wiki/Build-native-modules-with-nw-gyp\r\n\r\nThe wikipage says for more info to go to: https://github.com/nwjs/nw-gyp\r\nbut all the steps required to build a hello world are not listed there either.\r\n\r\nHere is what I understand so far from the documentation:\r\n```bash\r\nsudo npm install -g nw-gyp\r\ncd myaddon\r\nnw-gyp configure --target=<nw.js version number>\r\nnw-gyp build\r\n```\r\n\r\nThe github frontpage it links to this helloworld:\r\nhttps://github.com/nodejs/node-v0.x-archive/tree/master/test/addons/hello-world\r\n\r\nThis is the contents of the example `binding.cc`\r\n```c++\r\n#include <node.h>\r\n#include <v8.h>\r\nusing namespace v8;\r\nvoid Method(const FunctionCallbackInfo<Value>& args) {\r\n  Isolate* isolate = Isolate::GetCurrent();\r\n  HandleScope scope(isolate);\r\n  args.GetReturnValue().Set(String::NewFromUtf8(isolate, \"world\"));\r\n}\r\nvoid init(Handle<Object> target) {\r\n  NODE_SET_METHOD(target, \"hello\", Method);\r\n}\r\nNODE_MODULE(binding, init);\r\n```\r\n\r\nThe example requires `node.h` and `v8.h`.  The steps that are not clear to me is how to install those.  Do I need to do a full source code checkout of NW.js, Chromium, and Node.js?  And rebuild them all from source?\r\n\r\nIt would be nice to have some links where to download, and how to build Chromium and Node.js if that is required.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28693742-nw-gyp-all-build-steps-not-clear?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F51989&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"},"comment":{"url":"https://api.github.com/repos/nwjs/nw.js/issues/comments/187380331","html_url":"https://github.com/nwjs/nw.js/issues/4009#issuecomment-187380331","issue_url":"https://api.github.com/repos/nwjs/nw.js/issues/4009","id":187380331,"user":{"login":"spirodonfl","id":314869,"avatar_url":"https://avatars.githubusercontent.com/u/314869?v=3","gravatar_id":"","url":"https://api.github.com/users/spirodonfl","html_url":"https://github.com/spirodonfl","followers_url":"https://api.github.com/users/spirodonfl/followers","following_url":"https://api.github.com/users/spirodonfl/following{/other_user}","gists_url":"https://api.github.com/users/spirodonfl/gists{/gist_id}","starred_url":"https://api.github.com/users/spirodonfl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spirodonfl/subscriptions","organizations_url":"https://api.github.com/users/spirodonfl/orgs","repos_url":"https://api.github.com/users/spirodonfl/repos","events_url":"https://api.github.com/users/spirodonfl/events{/privacy}","received_events_url":"https://api.github.com/users/spirodonfl/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T21:01:15Z","updated_at":"2016-02-22T21:01:15Z","body":"node.h and v8.h come from install node-gyp if I'm not mistaken (someone can correct me). I've been fiddling around with this myself lately."}}