forked from muldjord/skyscraper
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathdeps
More file actions
81 lines (65 loc) · 1.64 KB
/
deps
File metadata and controls
81 lines (65 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
set -euo pipefail
set -x
export SKYSCRAPER_HOME="$(cd "$(dirname "$0")/.." && pwd)"
source "${SKYSCRAPER_HOME}/scripts/core.sh"
get_platform() {
if [[ "$OSTYPE" == "darwin"* ]]; then
echo "osx"
elif echo "${PREFIX:-}" | grep -q "com.termux"; then
echo "termux"
else
echo "linux"
fi
}
export PLATFORM="$(get_platform)"
_install() {
local deps=()
for dep in "$@"; do
if ! command -v "$dep"; then
deps+=("$dep");
fi
done
if [ ${#deps[@]} -eq 0 ]; then
return 0
fi
case "$PLATFORM" in
"osx") brew install "${deps[@]}" ;;
"termux") pkg add "${deps[@]}" ;;
"linux") sudo apt-get install -y "${deps[@]}" ;;
esac
}
_setup_termux() {
cd "$SKYSCRAPER_HOME"
mkdir ./buildsrc
cp -R ./* ./buildsrc || true
git clone https://github.com/termux/termux-packages --depth 1
git clone https://github.com/termux/x11-packages --depth 1 || true
cp -r ./x11-packages/packages/* "./termux-packages/packages" || true
mkdir -p "./termux-packages/packages/${PKG_NAME}" || true
rm "./termux-packages/packages/${PKG_NAME}/build.sh" || true
cp ./scripts/build.sh "./termux-packages/packages/${PKG_NAME}/build.sh"
mv ./buildsrc ./termux-packages/packages/
}
main() {
case "${1:-}" in
*android*)
_setup_termux
return 0
;;
esac
_install git bash tar
case "$PLATFORM" in
"osx")
_install brew qt5
brew link qt5 --force || true
;;
"termux")
_install x11-repo qt5-qtbase
;;
"linux")
_install build-essential qtbase5-dev qt5-qmake qtbase5-dev-tools
;;
esac
}
main "$@"