Squashed commit of ca128f7dcd28cbcfba154c8577ed54d4aa71dd02 with
contributions from Mark Constable (markc@renta.net) and Daniel Gröber
(darklord@darkboxed.org).
Mostly just upgraded tools/test.py to the latest one that's in V8. But also
fixing the before and after hooks to preserve the test/tmp directory so that
running tests manually usually works.
Add a setUp and tearDown function to the test case class, and use it to
create and remove the test/tmp directory for each test.
TODO: amend other tests.
Those variables have following defaults :
- NODE_PREFIX is relative to the current path of the node_addon.py file
It is used as the base path of node include files.
- NODE_PATH is ~/.node_libraries
It's where modules are installed when calling `node-waf install`
Note .js files must be explicitely installed by the module's wscript.
Usage :
NODE_PREFIX=/usr/local NODE_PATH=~/.node_libraries node-waf configure
Instead of installing the files in /usr/lib/node/libraries and loading them
from the file system, the files are built-in to the node executable.
However, they are only compiled on demand.
The reasoning is:
1. Allow for more complex internal javascript. In particular,
process.stdout and process.stdin can be js implemented streams.
2. Ease system installs. Loading from disk each time is unnecessary
overhead. Note that there is no "system" path for modules anymore. Only
$HOME/.node_libraries.
Simply place this into the root of your nodejs git working copy and
run ./tools/osx-dist.sh. It will create an dist-osx folder which will
comprise of the resulting .dmg file (install path is
/usr/local/nodejs with symlinks added to /usr/local/bin) along with
other files used during its construction.
$ ls -1 dist-osx/
nodejs-v0.1.26-11-gcd6397c
nodejs-v0.1.26-11-gcd6397c.dmg
nodejs-v0.1.26-11-gcd6397c.pkg
nodejs-v0.1.26-11-gcd6397c.plist
The resulting installed package is going to be visible using the
OS X 'pkgutil --packages' command. You can even safely uninstall
sudoing 'pkgutil --unlink org.nodejs.NodeJS-...' and subsequently
let the system forget about the package being ever seen by
'pkgutil --forget org.nodejs.NodeJS-...'.
Here is the current package ID I have installed:
$ pkgutil --pkgs | grep node
org.nodejs.NodeJS-v0.1.26-11-gcd6397c
Use this patch freely without hesitation.
Signed-off-by: Standa Opichal <opichals@gmail.com>