-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathbuild_linux.sh
104 lines (82 loc) · 3.31 KB
/
build_linux.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
#!/bin/bash
COLOR='\033[0;36m'
NOCOLOR='\033[0m'
printf "\n\n${COLOR}--------------------\nngPAWS linux builder\n--------------------${NOCOLOR}\n\n";
printf "${COLOR}*${NOCOLOR} You need Lazarus, git, and gcc installed on your system\n\n";
if [ $(which lazbuild) = "" ]; then
printf "lazbuild coudn't be found. Please install Lazarus"
else
#Start the build
#build ngPAWS
if [ -d "build" ]; then
printf "${COLOR}*${NOCOLOR} Deleting build directory\n"
rm -Rf build
fi
if [ -d "Release-linux-en" ]; then
printf "${COLOR}*${NOCOLOR} Deleting Release-linux-en directory\n"
rm -Rf Release-linux-en
fi
if [ -d "Release-linux-es" ]; then
printf "${COLOR}*${NOCOLOR} Deleting Release-linux-es directory\n"
rm -Rf Release-linux-es
fi
if [ -d "Release-linux-es" ]; then
printf "${COLOR}*${NOCOLOR} Deleting Release-linux-es directory\n"
rm -Rf Release-linux-es
fi
printf "${COLOR}*${NOCOLOR} Building IDE (may take a while)\n"
mkdir build
cp -R newIDE build/newIDE
lazbuild build/newIDE/ngpaws_linux.lpi
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
printf "\n${COLOR}*${NOCOLOR} Building npgc compiler\n"
cp -R compiler build/compiler/
make -C build/compiler/
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
#build txtpaws
if [ -d "txtpaws" ]; then
printf "\n${COLOR}*${NOCOLOR} txtpaws project directory exists\n"
else
printf "\n${COLOR}*${NOCOLOR} Cloning txtpaws\n"
git clone https://github.com/Baltasarq/txtpaws/
fi
make -C txtpaws/src/ clean
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
make -C txtpaws/src/ txtpaws
rc=$?; if [[ $rc != 0 ]]; then exit $rc; fi
#prepare the Release files
if [ -d "Release-linux" ]; then
printf "\n${COLOR}*${NOCOLOR} Deleting Release directory\n"
rm -Rf Release-linux
fi
if [ -d "Release-linux-en" ]; then
printf "${COLOR}*${NOCOLOR} Deleting Release-linux-en directory\n"
rm -Rf Release-linux-en
fi
if [ -d "Release-linux-es" ]; then
printf "${COLOR}*${NOCOLOR} Deleting Release-linux-es directory\n"
rm -Rf Release-linux-es
fi
printf "${COLOR}*${NOCOLOR} Prepare files for Release\n"
mkdir Release-linux
mv build/newIDE/ngpaws Release-linux/ngpaws
mv $(find -iname ngpc -type d -printf "%T@ %p\n" | sort -nr | head -1 | cut -d' ' -f 2) Release-linux/ngpc
cp txtpaws/src/txtpaws Release-linux/txtpaws
cp -R jsl example-code extra_langs installation_aux_files/* plugins Release-linux/
cp -R Release-linux Release-linux-es
mv Release-linux Release-linux-en
printf "${COLOR}*${NOCOLOR} Setting Spanish database as default for Release-linux-es"
mv Release-linux-es/database.start.spanish Release-linux-es/database.start
printf "${COLOR}*${NOCOLOR} Setting English database as default for Release-linux-en"
mv Release-linux-en/database.start.english Release-linux-en/database.start
printf "${COLOR}*${NOCOLOR} Cleaning build folders\n\n"
if [ -d "txtpaws" ]; then
rm -Rf txtpaws
fi
if [ -d "build" ]; then
rm -Rf build
fi
printf "${COLOR}* English release is in Release-linux-en folder\n"
printf "${COLOR}* Spanish release is in Release-linux-es folder\n"
printf "\n${COLOR}--------------------\nDone\n--------------------${NOCOLOR}\n\n";
fi