forked from olegos2/mobox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
124 lines (102 loc) · 3.23 KB
/
install
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/bash
rm ~/x
echo "Installing termux-am"
pkg install termux-am -y
termux-setup-storage & sleep 4
while true; do
if [ -d ~/storage/shared ]; then
break
else
echo "Storage permission denied"
fi
sleep 3
done
# Clean and install all required dependencies
echo "Installing termux packages"
apt-get clean
apt-get update >/dev/null
apt-get -y --with-new-pkgs -o Dpkg::Options::="--force-confdef" upgrade >/dev/null
pkg install x11-repo -y
pkg install pulseaudio -y
pkg install xwayland -y
pkg install wget -y
pkg install tsu -y
pkg install root-repo -y
pkg install patchelf -y
pkg install p7zip -y
pkg install xorg-xrandr -y
pkg install ncurses-utils -y
pkg install hashdeep -y
pkg install termux-x11-nightly -y
# Remove previous glibc
if [ -e $PREFIX/glibc ]; then
echo -n "Removing previous glibc. Continue? (Y/n) "
read i
if [ "$i" = "Y" ] || [ "$i" = "y" ]; then
rm -rf $PREFIX/glibc
else
return 1
fi
fi
# Select new wow64 wine or wine-ge
INSTALL_WOW64=0
echo "Select an option"
echo "1) Install previous mobox with box86"
echo "2) Install new mobox wow64 version"
echo ""
echo -n "Selected number: "
read i
case "$i" in
1)
INSTALL_WOW64=0
;;
2)
INSTALL_WOW64=1
;;
*)
return 1
;;
esac
echo "Installing mobox"
# Download ESSENTIAL files from gitlab(hidden behind a project id and private token)
# Redundant as we're not downloading anything, instead we let package-manager handle it
# function wget-git-q {
# wget --show-progress --retry-connrefused --tries=0 --header "PRIVATE-TOKEN: $PRIVATE_TOKEN" "https://gitlab.com/api/v4/projects/$PROJECT_ID/repository/files/$1/raw?ref=main" -O $2
# return $?
# }
echo "Updating package manager"
# Create the following directory(It doesn't exist since we'd removed glibc earlier)
mkdir -p $PREFIX/glibc/opt/package-manager/installed
# Depending on what we selected earlier, set the private token and project id
if [ "$INSTALL_WOW64" = "1" ]; then
echo "PRIVATE_TOKEN=glpat-h5r7HjKoPKZPxmfg79xs
PROJECT_ID=54240888">$PREFIX/glibc/opt/package-manager/token
else
echo "PRIVATE_TOKEN=glpat-Xs4HfrCkMpbedkPycqzP
PROJECT_ID=52465323">$PREFIX/glibc/opt/package-manager/token
fi
# Loads up our private token and project id into our current shell session
. $PREFIX/glibc/opt/package-manager/token
# Downloads the package-manager script
# Use our repo's package manager only if wow64 is selected(As I haven't uploaded the non-wow64 versions to github)
if [ "$INSTALL_WOW64" = "1" ]; then
curl https://raw.githubusercontent.com/EDLLT/mobox/main/package-manager -o "$PREFIX/glibc/opt/package-manager/package-manager"
else
if ! wget-git-q "package-manager" "$PREFIX/glibc/opt/package-manager/package-manager"; then
echo "Download failed"
return 1
fi
fi
# Executes the package manager script which sets up everything mobox related
. $PREFIX/glibc/opt/package-manager/package-manager
# This is what installs everything mobox needs(base packages and wine?*)
sync-all
# Installs wine
if [ "$INSTALL_WOW64" = "1" ]; then
sync-package wine-9.3-vanilla-wow64
else
sync-package wine-ge-custom-8-25
fi
# Create a symlink for mobox
ln -sf $PREFIX/glibc/opt/scripts/mobox $PREFIX/bin/mobox
echo "To start - type \"mobox\""