forked from aristocratos/btop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build
executable file
·75 lines (69 loc) · 1.65 KB
/
build
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
#!/bin/bash
#
# build - compile and optionally install btop components
#
build_btop() {
# Repo: https://github.com/doctorfree/btop
#
# Fork of Repo: https://github.com/aristocratos/btop
#
# Build Dependencies:
# On Ubuntu 20.04
# sudo apt update -y
# sudo apt upgrade -y
# sudo apt install coreutils git make tar zstd
# sudo apt install -y build-essential
# sudo apt install -y gcc-10 g++-10 cpp-10
# sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 \
# --slave /usr/bin/g++ g++ /usr/bin/g++-10 \
# --slave /usr/bin/gcov gcov /usr/bin/gcov-10
#
[ -f bin/btop ] || make STATIC=true STRIP=true
chmod +x bin/btop
[ "${INSTALL}" ] && sudo PREFIX=${PREFIX} make install
}
usage() {
printf "\nUsage: ./build [-i] [-p prefix] [-u] project [project2 ...]"
printf "\nWhere:"
printf "\n\t-i indicates install"
printf "\n\t-p prefix specifies installation prefix (default /usr)"
printf "\n\t-u displays this usage message and exits\n"
printf "\nNo arguments: build btop, configure with prefix=/usr, build\n"
exit 1
}
PROJ=btop
INSTALL=
PREFIX=/usr
while getopts "ip:u" flag; do
case $flag in
i)
INSTALL=1
;;
p)
PREFIX="$OPTARG"
;;
u)
usage
;;
esac
done
shift $(( OPTIND - 1 ))
if [ $# -eq 0 ]
then
PROJECTS=btop
else
PROJECTS="$*"
fi
for project in ${PROJECTS}
do
case "${project}" in
btop)
PROJ=btop
build_btop
;;
*)
echo "Unsupported project build: ${project}"
continue
;;
esac
done