#!/bin/sh # https://github.com/rogerwang/node-webkit/issues/136 # https://github.com/rogerwang/node-webkit/wiki/The-solution-of-lacking-libudev.so.0 # # Though that page would be more accurately titled "apparently even # Intel, Google, and every commercial distribution can't be bothered # to maintain trivial compatibility on desktop Linux." 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 exit 127 fi "$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" $NWFLAGS "$@" "$PACKAGE" fi