2022-02-07 07:52:17 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
DIR=$(dirname ${BASH_SOURCE[0]})
|
|
|
|
cd "$DIR"
|
|
|
|
. common
|
|
|
|
mkdir -p "$PREBUILT_DATA_DIR"
|
|
|
|
cd "$PREBUILT_DATA_DIR"
|
|
|
|
|
2023-11-24 20:19:18 +00:00
|
|
|
VERSION=1.0.26
|
|
|
|
DEP_DIR="libusb-$VERSION"
|
2022-02-07 07:52:17 +00:00
|
|
|
|
2023-11-24 20:19:18 +00:00
|
|
|
FILENAME="libusb-$VERSION-binaries.7z"
|
2022-04-22 11:33:50 +00:00
|
|
|
SHA256SUM=9c242696342dbde9cdc47239391f71833939bf9f7aa2bbb28cdaabe890465ec5
|
2022-02-07 07:52:17 +00:00
|
|
|
|
|
|
|
if [[ -d "$DEP_DIR" ]]
|
|
|
|
then
|
|
|
|
echo "$DEP_DIR" found
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2023-11-24 20:19:18 +00:00
|
|
|
get_file "https://github.com/libusb/libusb/releases/download/v$VERSION/$FILENAME" \
|
|
|
|
"$FILENAME" "$SHA256SUM"
|
2022-02-07 07:52:17 +00:00
|
|
|
|
|
|
|
mkdir "$DEP_DIR"
|
|
|
|
cd "$DEP_DIR"
|
|
|
|
|
|
|
|
7z x "../$FILENAME" \
|
2023-11-24 20:19:18 +00:00
|
|
|
"libusb-$VERSION-binaries/libusb-MinGW-Win32/" \
|
|
|
|
"libusb-$VERSION-binaries/libusb-MinGW-x64/"
|
|
|
|
|
|
|
|
mv "libusb-$VERSION-binaries/libusb-MinGW-Win32" .
|
|
|
|
mv "libusb-$VERSION-binaries/libusb-MinGW-x64" .
|
|
|
|
rm -rf "libusb-$VERSION-binaries"
|
2023-11-24 20:25:13 +00:00
|
|
|
|
|
|
|
# Rename the dll to get the same library name on all platforms
|
|
|
|
mv libusb-MinGW-Win32/bin/msys-usb-1.0.dll libusb-MinGW-Win32/bin/libusb-1.0.dll
|
|
|
|
mv libusb-MinGW-x64/bin/msys-usb-1.0.dll libusb-MinGW-x64/bin/libusb-1.0.dll
|