Permalink
Browse files

Replace waf with gyp

  • Loading branch information...
1 parent 5dc2cec commit beaf7c9adf6be402a2f5ff298cdcfc93d6847ef2 @mscdex committed Oct 1, 2012
Showing with 33 additions and 77 deletions.
  1. +1 −18 README.md
  2. +0 −2 TODO
  3. +28 −0 binding.gyp
  4. +4 −4 package.json
  5. +0 −53 wscript
View
@@ -7,24 +7,7 @@ node-ncurses is an ncurses binding for [node.js](http://nodejs.org/).
Requirements
============
-* [node.js](http://nodejs.org/) -- v0.1.94+
-
-To build node-curses:
-
- node-waf configure build
-
-
-Troubleshooting
-===============
-
-If you encounter "Error opening terminal" while executing one of the examples or
-any other script that uses node-ncurses, do this:
-
-* Ensure you have built node-ncurses properly
-* Change to `deps/ncurses` in the source package
-* Execute `sudo make install.data`
-
-That should solve this particular problem.
+* [node.js](http://nodejs.org/) -- v0.6.0+
Terminology
View
@@ -12,5 +12,3 @@
* Add more useful widgets
* More tests/examples
-
-* Add option to wscript to allow use of a shared ncurses library instead
View
@@ -0,0 +1,28 @@
+{
+ 'targets': [
+ {
+ 'target_name': 'ncurses',
+ 'sources': [
+ 'src/binding.cc',
+ ],
+ 'dependencies': [
+ 'deps/libncurses/ncurses.gyp:libncurses',
+ ],
+ 'cflags!': [ '-O2' ],
+ 'cflags+': [ '-O3' ],
+ 'cflags_cc!': [ '-O2' ],
+ 'cflags_cc+': [ '-O3' ],
+ 'cflags_c!': [ '-O2' ],
+ 'cflags_c+': [ '-O3' ],
+ 'libraries': [
+ '-lncursesw',
+ '-lncurses++w',
+ ],
+ #'conditions': [
+ # ['target_arch=="x64"', {
+ # 'cflags+': [ '-fPIC' ]
+ # }],
+ #],
+ },
+ ],
+}
View
@@ -1,10 +1,10 @@
{ "name": "ncurses",
- "version": "0.2.4",
+ "version": "0.3.0",
"author": "Brian White <mscdex@mscdex.net>",
"description": "An ncurses binding for node.js",
- "scripts": { "preinstall": "node-waf configure build" },
- "main": "./ncurses",
- "engines": { "node": ">0.1.93" },
+ "scripts": { "preinstall": "node-gyp rebuild" },
+ "main": "./index",
+ "engines": { "node": ">0.6.0" },
"keywords": [ "console", "ncurses", "curses", "graphics" ],
"licenses": [ { "type": "MIT", "url": "http://github.com/mscdex/node-ncurses/raw/master/LICENSE" } ],
"repository": { "type": "git", "url": "http://github.com/mscdex/node-ncurses.git" }
View
@@ -1,53 +0,0 @@
-import Options
-from os import unlink, symlink
-from os.path import exists, abspath
-import os
-
-srcdir = '.'
-blddir = 'build'
-ncursesdir = abspath(srcdir) + "/deps/ncurses"
-VERSION = '0.0.1'
-
-def set_options(opt):
- opt.tool_options('compiler_cxx')
-
-def configure(conf):
- conf.check_tool('compiler_cxx')
- conf.check_tool('node_addon')
-
- # ugly hack to append -fPIC for x64
- hack = ""
- if (conf.env['DEST_CPU'] == 'x86_64'):
- hack = "sed -i 's/^CFLAGS_NORMAL.*$/CFLAGS_NORMAL\t= $(CCFLAGS) -fPIC/' " + ncursesdir + "/c++/Makefile && sed -i 's/^CFLAGS_NORMAL.*$/CFLAGS_NORMAL\t= $(CCFLAGS) -fPIC/' " + ncursesdir + "/ncurses/Makefile && sed -i 's/^CFLAGS_NORMAL.*$/CFLAGS_NORMAL\t= $(CCFLAGS) -fPIC/' " + ncursesdir + "/panel/Makefile"
-
- # configure ncurses
- print "Configuring ncurses library ..."
- cmd = "cd deps/ncurses && sh configure --without-debug --without-tests --without-progs --without-ada --without-manpages --enable-widec --enable-ext-colors"
- if os.system(cmd) != 0:
- conf.fatal("Configuring ncurses failed.")
- else:
- os.system(hack)
-
-def build(bld):
- print "Building ncurses library ..."
- cmd = "cd deps/ncurses && make"
- if os.system(cmd) != 0:
- conf.fatal("Building ncurses failed.")
- else:
- obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
- obj.target = 'ncurses_addon'
- obj.source = 'ncurses.cc'
- obj.includes = [ncursesdir + '/include', ncursesdir + '/c++']
- obj.cxxflags = ['-O2']
- obj.linkflags = [ncursesdir + '/lib/libncurses++w.a', ncursesdir + '/lib/libpanelw.a', ncursesdir + '/lib/libncursesw.a']
-
-def shutdown():
- # HACK to get ncurses_addon.node out of build directory.
- # better way to do this?
- if Options.commands['clean']:
- if exists('ncurses_addon.node'): unlink('ncurses_addon.node')
- else:
- if exists('build/Release/ncurses_addon.node') and not exists('ncurses_addon.node'):
- symlink('build/Release/ncurses_addon.node', 'ncurses_addon.node')
- if exists('build/default/ncurses_addon.node') and not exists('ncurses_addon.node'):
- symlink('build/default/ncurses_addon.node', 'ncurses_addon.node')

0 comments on commit beaf7c9

Please sign in to comment.