#!/bin/sh # 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 # 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 "NW.js (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