mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-17 05:24:19 +01:00
Rename "common" to "_init" because it not only exposes common functions but also initializes environment variables. Call _init in a single line in all dependency build scripts.
65 lines
1.3 KiB
Bash
Executable File
65 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -ex
|
|
. $(dirname ${BASH_SOURCE[0]})/_init
|
|
process_args "$@"
|
|
|
|
VERSION=1.0.29
|
|
FILENAME=libusb-$VERSION.tar.gz
|
|
PROJECT_DIR=libusb-$VERSION
|
|
SHA256SUM=7c2dd39c0b2589236e48c93247c986ae272e27570942b4163cb00a060fcf1b74
|
|
|
|
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 "$DIRNAME" ]]
|
|
then
|
|
echo "'$PWD/$DIRNAME' already exists, not reconfigured"
|
|
cd "$DIRNAME"
|
|
else
|
|
mkdir "$DIRNAME"
|
|
cd "$DIRNAME"
|
|
|
|
conf=(
|
|
--prefix="$INSTALL_DIR/$DIRNAME"
|
|
)
|
|
|
|
if [[ "$LINK_TYPE" == static ]]
|
|
then
|
|
conf+=(
|
|
--enable-static
|
|
--disable-shared
|
|
)
|
|
else
|
|
conf+=(
|
|
--disable-static
|
|
--enable-shared
|
|
)
|
|
fi
|
|
|
|
if [[ "$BUILD_TYPE" == cross ]]
|
|
then
|
|
conf+=(
|
|
--host="$HOST_TRIPLET"
|
|
)
|
|
fi
|
|
|
|
"$SOURCES_DIR/$PROJECT_DIR"/bootstrap.sh
|
|
"$SOURCES_DIR/$PROJECT_DIR"/configure "${conf[@]}"
|
|
fi
|
|
|
|
make -j
|
|
make install-strip
|