mirror of
https://github.com/Genymobile/scrcpy
synced 2024-12-18 05:14:35 +00:00
be3d357a6d
Legitimate or not, we should not use sources that do not match the repository. Refs <https://github.com/libusb/libusb/issues/1468#issuecomment-1974787595> Refs <https://news.ycombinator.com/item?id=39866309> Refs #4713 <https://github.com/Genymobile/scrcpy/pull/4713>
46 lines
1003 B
Bash
Executable File
46 lines
1003 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
|
|
cd "$DEPS_DIR"
|
|
. common
|
|
|
|
VERSION=1.0.27
|
|
FILENAME=libusb-$VERSION.tar.gz
|
|
PROJECT_DIR=libusb-$VERSION
|
|
SHA256SUM=e8f18a7a36ecbb11fb820bd71540350d8f61bcd9db0d2e8c18a6fb80b214a3de
|
|
|
|
cd "$SOURCES_DIR"
|
|
|
|
if [[ -d "$PROJECT_DIR" ]]
|
|
then
|
|
echo "$PWD/$PROJECT_DIR" found
|
|
else
|
|
get_file "https://github.com/libusb/libusb/archive/refs/tags/v$VERSION.tar.gz" "$FILENAME" "$SHA256SUM"
|
|
tar xf "$FILENAME" # First level directory is "$PROJECT_DIR"
|
|
fi
|
|
|
|
mkdir -p "$BUILD_DIR/$PROJECT_DIR"
|
|
cd "$BUILD_DIR/$PROJECT_DIR"
|
|
|
|
export CFLAGS='-O2'
|
|
export CXXFLAGS="$CFLAGS"
|
|
|
|
if [[ -d "$HOST" ]]
|
|
then
|
|
echo "'$PWD/$HOST' already exists, not reconfigured"
|
|
cd "$HOST"
|
|
else
|
|
mkdir "$HOST"
|
|
cd "$HOST"
|
|
|
|
"$SOURCES_DIR/$PROJECT_DIR"/bootstrap.sh
|
|
"$SOURCES_DIR/$PROJECT_DIR"/configure \
|
|
--prefix="$INSTALL_DIR/$HOST" \
|
|
--host="$HOST_TRIPLET" \
|
|
--enable-shared \
|
|
--disable-static
|
|
fi
|
|
|
|
make -j
|
|
make install-strip
|