-
Notifications
You must be signed in to change notification settings - Fork 0
/
qt.sh
executable file
·70 lines (58 loc) · 1.53 KB
/
qt.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
#!/bin/bash
function is_root {
[ "${EUID:-$(id -u)}" -eq 0 ];
}
if ! is_root; then
echo -e "\x1B[31m[ERROR] This script requires root privileges."
exit 1
fi
QT="${1}"
DIR="${2}"
TMP_WORK_DIR="/tmp/qt"
CURRENT_USER=$(who | awk 'NR==1{print $1}')
if [ -z "${QT}" ]; then
QT="6.4.0"
fi
if [ -z "${DIR}" ]; then
DIR="/opt/qt"
fi
apt install 'libxcb*-dev' \
build-essential \
libb2-dev \
libdbus-1-3 \
libdouble-conversion-dev \
libfreetype6-dev \
libgl-dev libglu-dev \
libharfbuzz-dev \
libjpeg-dev \
libmd4c-dev \
libpcre2-dev \
libpng-dev \
libpulse-mainloop-glib0 \
libsqlite3-dev \
libssl-dev \
libvulkan1 \
libwayland-dev \
libx11-xcb-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
libz-dev \
mesa-vulkan-drivers \
vulkan-tools \
x11-xkb-utils \
xkb-data \
'^libxcb.*-dev' \
libx11-xcb-dev \
libglu1-mesa-dev \
libxrender-dev \
libxi-dev -y
pip3 install aqtinstall
rm -rf "${TMP_WORK_DIR}"
mkdir -p "${TMP_WORK_DIR}"
pushd "${TMP_WORK_DIR}" || exit 1
aqt install-qt linux desktop "${QT}" -O "${DIR}"
popd || exit 1
rm -rf "${TMP_WORK_DIR}"
chown "${CURRENT_USER}":"${CURRENT_USER}" "${DIR}" -R
chown "${CURRENT_USER}":"${CURRENT_USER}" "/usr/local/bin/aqt" -R