-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathsetup.sh
173 lines (158 loc) · 4.56 KB
/
setup.sh
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
#!/bin/sh
rootdir=`pwd`
logfile=setup.log
installdir=$rootdir/vendor
repodir=$installdir/src
if [ ! -d $installdir ]; then
mkdir $installdir
fi
if [ ! -d $repodir ]; then
mkdir $repodir
fi
echo "============================================" >> $logfile
echo "start at" `date` >> $logfile
echo "============================================" >> $logfile
echo "rootdir: ${rootdir}"
echo "logfile: ${logfile}"
echo "repodir: ${repodir}"
echo "installdir: ${installdir}"
echo ""
install_xmake() {
if [ ! -x "$(which xmake)" ]; then
echo installing xmake ...
curl -fsSL https://xmake.io/shget.text > install_xmake.sh
bash install_xmake.sh
rm install_xmake.sh
source ~/.xmake/profile
fi
}
install_dependencies() {
echo installing dependencies ...
sudo apt-get -qq -y install build-essential automake libtool pkg-config libsqlite3-dev libpng-dev libjpeg-dev libxml2-dev libfreetype6-dev libx11-dev
}
install_lcui() {
echo "============================================" >> $logfile
echo "install LCUI" >> $logfile
echo "============================================" >> $logfile
cd $repodir
if [ ! -d "LCUI" ]; then
echo "downloading LCUI ..."
wget https://github.com/lc-soft/LCUI/archive/develop.zip -O LCUI-develop.zip
echo "extracting LCUI ..."
unzip LCUI-develop.zip >> $logfile
rm LCUI-develop.zip
mv LCUI-develop LCUI
cd LCUI
./autogen.sh >> $logfile
echo "configuring LCUI ..."
./configure --prefix=$installdir >> $logfile
else
cd LCUI
fi
echo "building LCUI ..."
make >> $logfile
make install >> $logfile
echo "LCUI have been installed"
cd $repodir
}
install_lcdesign() {
echo "============================================" >> $logfile
echo "install lc-design" >> $logfile
echo "============================================" >> $logfile
cd $repodir
if [ ! -d "lc-design" ]; then
echo "downloading lc-design ..."
wget https://github.com/lc-ui/lc-design/archive/develop.zip -O lc-design-develop.zip
echo "extracting lc-design ..."
unzip lc-design-develop.zip >> $logfile
rm lc-design-develop.zip
mv lc-design-develop lc-design
cd lc-design
npm install
xmake config --linkdirs=$installdir/lib --includedirs=$installdir/include --project=.
else
cd lc-design
fi
echo "building lc-design ..."
npm run build-css >> $logfile
npm run build-font >> $logfile
xmake build --project=. >> $logfile
xmake install --installdir=$installdir --project=. >> $logfile
cp -r $installdir/share/assets ${rootdir}/app/
echo "lc-design have been installed"
cd $repodir
}
install_darknetlib() {
echo "============================================" >> $logfile
echo "install darknetlib" >> $logfile
echo "============================================" >> $logfile
cd $repodir
if [ ! -d "darknetlib" ]; then
echo "downloading darknetlib ..."
git clone https://github.com/lc-soft/darknetlib.git >> $logfile
cd darknetlib
git submodule init >> $logfile
git submodule update >> $logfile
else
cd darknetlib
fi
echo "building darknetlib ..."
make >> $logfile
cp libdarknet.so $installdir/lib
cp include/*.h $installdir/include
echo "darknetlib have been installed"
cd $repodir
}
install_libyaml() {
echo "============================================" >> $logfile
echo "install libyaml" >> $logfile
echo "============================================" >> $logfile
cd $repodir
if [ ! -d "libyaml" ]; then
echo "downloading libyaml ..."
git clone https://github.com/yaml/libyaml.git
cd libyaml
if [ ! -f "configure" ]; then
./bootstrap >> $logfile
fi
./configure --prefix=$installdir >> $logfile
else
cd libyaml
fi
echo "building libyaml ..."
make >> $logfile
make install >> $logfile
echo "libyaml have been installed"
cd $repodir
}
install_unqlite() {
echo "============================================" >> $logfile
echo "install unqlite" >> $logfile
echo "============================================" >> $logfile
cd $repodir
if [ ! -d "unqlite" ]; then
echo "downloading unqlite ..."
git clone https://github.com/symisc/unqlite.git --branch master --depth 1
cd unqlite
else
cd unqlite
fi
cp unqlite.c $rootdir/src/lib
cp unqlite.h $installdir/include
echo "unqlite have been installed"
cd $repodir
}
install_dependencies
install_xmake
install_lcui
install_lcdesign
install_libyaml
install_unqlite
install_darknetlib
cd $rootdir
if [ ! -d "app/lib" ]; then
mkdir app/lib
fi
cp vendor/lib/*.so.* app/lib
cp vendor/lib/*.so app/lib
echo the building environment has been completed!