Patch libusb for android custom open function

This idea was inspired by:
https://github.com/PointCloudLibrary/mobile/blob/master/3rdparty/android/patches/libusb.patch

The whole thing is re-written from scratch but the idea came from there,
and its a way simpler way of getting a system-opened fd to the right
place than patching every call in the stack to pass a fd down.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2015-08-21 00:19:37 +02:00 committed by Dirk Hohndel
parent 55353bda40
commit 676c1b319f
2 changed files with 100 additions and 0 deletions

View file

@ -203,6 +203,12 @@ fi
if [ ! -e libusb-${LIBUSB_VERSION} ] ; then
tar -zxf libusb-${LIBUSB_VERSION}.tar.gz
fi
if ! grep -q libusb_set_android_open_callback libusb-${LIBUSB_VERSION}/libusb/libusb.h ; then
# Patch in our libusb callback
pushd libusb-${LIBUSB_VERSION}
patch -p1 < $SUBSURFACE_SOURCE/packaging/android/patches/libusb-android.patch
popd
fi
if [ ! -e libusb-${LIBUSB_VERSION}/configure ] ; then
pushd libusb-${LIBUSB_VERSION}
mkdir m4