Skip to content

Display and control your Android device

Refactor dependency build scripts initialization

Romain Vimont925949d54ad8
diff --git a/app/deps/common b/app/deps/_init
similarity index 92%
rename from app/deps/common
rename to app/deps/_init
index daaa96c0..4612d9fe 100644
--- a/app/deps/common
+++ b/app/deps/_init
@@ -1,10 +1,9 @@
-#!/usr/bin/env bash
# This file is intended to be sourced by other scripts, not executed
process_args() {
if [[ $# != 3 ]]
then
- # <host>: win32 or win64
+ # <host>: linux, macos, win32 or win64
# <build_type>: native or cross
# <link_type>: static or shared
echo "Syntax: $0 <host> <build_type> <link_type>" >&2
@@ -12,8 +11,8 @@ process_args() {
fi
HOST="$1"
- BUILD_TYPE="$2" # native or cross
- LINK_TYPE="$3" # static or shared
+ BUILD_TYPE="$2"
+ LINK_TYPE="$3"
DIRNAME="$HOST-$BUILD_TYPE-$LINK_TYPE"
if [[ "$BUILD_TYPE" != native && "$BUILD_TYPE" != cross ]]
diff --git a/app/deps/adb_linux.sh b/app/deps/adb_linux.sh
index a3e339ec..c284dd24 100755
--- a/app/deps/adb_linux.sh
+++ b/app/deps/adb_linux.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init "$@"
VERSION=36.0.0
FILENAME=platform-tools_r$VERSION-linux.zip
diff --git a/app/deps/adb_macos.sh b/app/deps/adb_macos.sh
index 6880fb93..e580e571 100755
--- a/app/deps/adb_macos.sh
+++ b/app/deps/adb_macos.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init "$@"
VERSION=36.0.0
FILENAME=platform-tools_r$VERSION-darwin.zip
diff --git a/app/deps/adb_windows.sh b/app/deps/adb_windows.sh
index b9bd05dc..da95bb81 100755
--- a/app/deps/adb_windows.sh
+++ b/app/deps/adb_windows.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init "$@"
VERSION=36.0.0
FILENAME=platform-tools_r$VERSION-win.zip
diff --git a/app/deps/dav1d.sh b/app/deps/dav1d.sh
index 3069b6fe..89956636 100755
--- a/app/deps/dav1d.sh
+++ b/app/deps/dav1d.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init
process_args "$@"
VERSION=1.5.0
diff --git a/app/deps/ffmpeg.sh b/app/deps/ffmpeg.sh
index fb8b9a25..a879669d 100755
--- a/app/deps/ffmpeg.sh
+++ b/app/deps/ffmpeg.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init
process_args "$@"
VERSION=7.1.1
diff --git a/app/deps/libusb.sh b/app/deps/libusb.sh
index 887a2a77..d1dd4cbf 100755
--- a/app/deps/libusb.sh
+++ b/app/deps/libusb.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init
process_args "$@"
VERSION=1.0.29
diff --git a/app/deps/sdl.sh b/app/deps/sdl.sh
index e04deb0d..d382c183 100755
--- a/app/deps/sdl.sh
+++ b/app/deps/sdl.sh
@@ -1,8 +1,6 @@
#!/usr/bin/env bash
set -ex
-DEPS_DIR=$(dirname ${BASH_SOURCE[0]})
-cd "$DEPS_DIR"
-. common
+. $(dirname ${BASH_SOURCE[0]})/_init
process_args "$@"
VERSION=2.32.8