-
Notifications
You must be signed in to change notification settings - Fork 10
/
install_dependencies.sh
executable file
·62 lines (49 loc) · 1.14 KB
/
install_dependencies.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
#!/bin/bash
set -eu -o pipefail # fail on error and report it, debug all lines
if [ "$EUID" -ne 0 ]; then
echo "You should run this script as root"
exit 1
fi
ID=""
ID_LIKE=""
TYPE=""
. /etc/os-release
if [[ $ID == "ubuntu" || $ID == "debian" ]]; then
TYPE=$ID
fi
if [[ $TYPE == "" ]]; then
LIKE=${ID_LIKE%% *}
if [[ $LIKE == "ubuntu" ]]; then
TYPE="ubuntu"
elif [[ $LIKE == "debian" ]]; then
TYPE="debian"
fi
fi
if [[ $TYPE == "" ]]; then
echo "Current distribution is very likely currently unsupported, aborting."
exit 1
fi
libwx="libwxgtk3.2-dev"
if [[ ($TYPE == "ubuntu" && ${VERSION_ID:0:2} -le 22) || ($TYPE == "debian" && $VERSION_ID -le 11) ]]; then
libwx="libwxbase3.0-dev libwxgtk3.0-gtk3-dev"
fi
headers=""
if [[ $TYPE == "ubuntu" ]]; then
if [[ $VERSION_ID == "23.10" ]]; then
VERSION_ID=22.04
fi
headers="linux-headers-generic-hwe-${VERSION_ID}"
elif [[ $TYPE == "debian" ]]; then
headers="linux-headers-generic"
fi
yes=""
if [[ ${1-} == "-y" ]]; then
yes="-y"
fi
apt-get install $yes --no-install-recommends \
build-essential \
cmake \
$headers \
libsoapysdr-dev \
libusb-1.0-0-dev \
$libwx