Simplify chdir shenanigans when building .bare.zip.
[pwl6.git] / tools / nw-linux-wrapper
index d13e39f..5dfd687 100755 (executable)
@@ -1,7 +1,10 @@
 #!/bin/sh
 
-# https://github.com/rogerwang/node-webkit/issues/136
-# https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0
+# https://github.com/nwjs/nw.js/issues/136
+# https://github.com/nwjs/nw.js/wiki/The-solution-of-lacking-libudev.so.0
+#
+# A fix has landed in Chromium (but not in NW.js yet)
+# https://code.google.com/p/chromium/issues/detail?id=415212
 #
 # Though that page would be more accurately titled "apparently even
 # Intel, Google, and every commercial distribution can't be bothered
 SELF=$(readlink -f "$0")
 NWDIR=$(dirname "$SELF")/nw
 NWBIN=$(command -v "$NWDIR/nw" nw | head -n 1)
+NWFLAGS="--enable-webgl --ignore-gpu-blacklist"
 PACKAGE="$NWDIR/package.nw"
 
 if [ ! -x "$NWBIN" ]; then
-    echo "node-webkit (nw) executable could not be found." >&2
+    echo "NW.js (nw) executable could not be found." >&2
     exit 127
 fi
 
-"$NWBIN" "$@" "$PACKAGE"
+"$NWBIN" $NWFLAGS "$@" "$PACKAGE"
 if [ "$?" = "127" -a -w "$NWBIN" ]; then
     echo "Applying libudev.so.1 hack." >&2
     sed -i 's/udev\.so\.0/udev.so.1/g' "$NWBIN"
-    "$NWBIN" "$@" "$PACKAGE"
+    "$NWBIN" $NWFLAGS "$@" "$PACKAGE"
 fi