-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetenv
119 lines (91 loc) · 2.7 KB
/
setenv
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
#!/data/data/com.termux/files/usr/bin/bash
assert_not_root() {
if [ $(id -u) -eq 0 ]
then
echo "This must NOT be run as root as it will break your environment (root will be required for nearly everything due to changed file permissions)"
exit 1
fi
}
assert_not_root
termux-wake-lock
echo -e "\n #### Setting '.bashrc' and 'bash_aliases'"
if [ -e ~/.bashrc ]; then
echo removing old '.bashrc'
rm -rf ~/.bashrc
fi
if [ -e ~/.bash_aliases ]; then
echo removing old '.bash_aliases'
rm -rf ~/.bash_aliases
fi
ln -sv ~/termux-env/.bashrc ~/
ln -sv ~/termux-env/.bash_aliases ~/
source ~/.bashrc
echo -e "\n #### upgrading installed packages..."
apt update
apt full-upgrade -y
echo -e "\n"
# Base pkg
echo -e "\n #### installing python..."
apt install -y python
echo -e "\n #### installing clang n build-essentials..."
apt install -y build-essential clang make diffutils m4 patch
echo -e "\n #### installing ncurses-utils..."
apt install -y ncurses-utils # sudo dependancy
echo -e "\n #### upgrading pip..."
pip install --upgrade pip
echo -e "\n"
# youtube-dl
echo -e "\n #### installing ffmpeg n atomicparsley..."
apt install -y ffmpeg atomicparsley
echo -e "\n"
# saavn
echo -e "\n #### installing pip lxml dependencies..."
apt install -y libxml2 libxslt
# dev pkgs
echo -e "\n #### installing python dev packages..."
apt install -y python-dev libxml2-dev libxslt-dev
# dev pkgs
echo -e "\n #### installing PIP packages..."
pip install -r ~/termux-env/requirements.txt
echo -e "\n #### Setting mp4box..."
if [ -e ~/termux-env/bin/mp4box ]; then
echo removing '~/termux-env/bin/mp4box'
rm -rf ~/termux-env/bin/mp4box
fi
if [ -f ~/termux-env/mp4box/$(uname -m) ]; then
echo -e "\n #### Linking prebuid mp4box..."
ln -sv ~/termux-env/mp4box/$(uname -m) ~/termux-env/bin/mp4box
else
echo -e "\n #### No prebuid mp4box, trying to build..."
cwd2=$(pwd)
bash ~/termux-env/build_mp4box
cd $cwd2
if [ -f ~/gpac/bin/gcc/MP4Box ]; then
echo -e "\n #### Build OK, Linking mp4box..."
mv -fv ~/gpac/bin/gcc/MP4Box ~/termux-env/mp4box/$(uname -m)
ln -sv ~/termux-env/mp4box/$(uname -m) ~/termux-env/bin/mp4box
fi
fi
devicemodel=$(getprop ro.product.model)
devicemodel=$(echo $devicemodel | sed -e "s: ::g")
# echo $devicemodel
if [ -e ~/termux-env/patches/$devicemodel ]; then
echo -e "\n #### patching ~/termux-env/patches/$devicemodel"
bash ~/termux-env/patches/$devicemodel
else
echo -e "\n #### no patches Linking bins"
ln -sv ~/termux-env/topatch/bin/* ~/termux-env/bin/
fi
echo -e "\n #### Setting ~/bin"
chmod 774 ~/termux-env/bin
chmod 775 ~/termux-env/bin/*
if [[ -L ~/bin && -d ~/bin ]]
then
echo removing previous '~/bin'
rm -rf ~/bin
fi
cwd2=$(pwd)
cd ~
ln -sv ./termux-env/bin ~/
cd $cwd2
termux-wake-unlock