openbsd-ports/lang/node/patches/patch-deps_npm_bin_node-gyp-bin_node-gyp
jasper e65c567a95 - update node to 0.8.0
* please see this blog post for more details on the changes:
  http://blog.nodejs.org/2012/06/25/node-v0-8-0/
  * the migration wiki can be consulted to port your code to node 0.8:
    https://github.com/joyent/node/wiki/API-changes-between-v0.6-and-v0.8
    - expose node-gyp, so it's now installed into ${LOCALBASE}/bin/ too

    from aaron bieber with tweaks by me
    ok jeremy@
2012-06-28 08:30:28 +00:00

22 lines
697 B
Plaintext

$OpenBSD: patch-deps_npm_bin_node-gyp-bin_node-gyp,v 1.1 2012/06/28 08:30:28 jasper Exp $
--- deps/npm/bin/node-gyp-bin/node-gyp.orig Mon Jun 25 16:15:51 2012
+++ deps/npm/bin/node-gyp-bin/node-gyp Mon Jun 25 16:16:25 2012
@@ -1,2 +1,16 @@
#!/usr/bin/env sh
-node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
+
+# dirname "$0" will have a different result when called internaly by node.
+
+DIR1=$( dirname "$0" )/../../node_modules/node-gyp/bin/node-gyp.js
+DIR2=$( dirname "$0" )/../lib/node_modules/node-gyp/bin/node-gyp.js
+
+if [ -e $DIR1 ]; then
+ node "$DIR1" "$@"
+else
+ if [ -e $DIR2 ]; then
+ node "$DIR2" "$@"
+ else
+ echo "Can't find node-gyp.js!"
+ fi
+fi