forked from wez/wezterm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
get-deps
executable file
·198 lines (186 loc) · 3.92 KB
/
get-deps
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
#!/bin/bash
min_rust=(1 51 0)
rust_ver=()
parse_rustc_version() {
local IFS
IFS=' '
local FIELDS
read -ra FIELDS <<< $(rustc --version)
IFS='.'
read -ra rust_ver <<< "${FIELDS[1]}"
}
check_rust_version() {
parse_rustc_version
# rust_ver=(1 46 0) for testing purposes
if [[ "${rust_ver[0]}" -gt "${min_rust[0]}" ]] ; then
return 0
fi
if [[ "${rust_ver[0]}" -lt "${min_rust[0]}" ]] ; then
return 1
fi
if [[ "${rust_ver[1]}" -gt "${min_rust[1]}" ]] ; then
return 0
fi
if [[ "${rust_ver[1]}" -lt "${min_rust[1]}" ]] ; then
return 1
fi
if [[ "${rust_ver[2]}" -gt "${min_rust[2]}" ]] ; then
return 0
fi
if [[ "${rust_ver[2]}" -lt "${min_rust[2]}" ]] ; then
return 1
fi
return 0
}
if ! check_rust_version ; then
rust_ver=$(IFS=. ; echo "${rust_ver[*]}")
min_rust=$(IFS=. ; echo "${min_rust[*]}")
echo "Installed rustc version $rust_ver is less than required $min_rust"
echo
echo "Using rustup to manage your installed version of Rust is recommended"
echo "https://www.rust-lang.org/en-US/install.html"
echo
echo "See https://wezfurlong.org/wezterm/install/source.html for complete"
echo "installation instructions for wezterm"
exit 1
fi
if test -z "${SUDO+x}" && hash sudo 2>/dev/null; then
SUDO="sudo"
fi
# Centos may not have lsb_release installed
if test -e /etc/centos-release || test -e /etc/fedora-release; then
if test -x /bin/dnf ; then
YUM="$SUDO dnf"
else
YUM="$SUDO yum"
fi
# Fedora 33 moved some perl bits around
$YUM install -y perl-FindBin perl-File-Compare || true
$YUM install -y \
make \
gcc \
gcc-c++ \
fontconfig-devel \
openssl-devel \
perl-interpreter \
python3 \
libxcb-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
wayland-devel \
mesa-libEGL-devel \
xcb-util-keysyms-devel \
xcb-util-image-devel \
xcb-util-wm-devel \
rpm-build \
redhat-lsb-core
exit $?
fi
if test -x /usr/bin/lsb_release && test `lsb_release -si` = "openSUSE"; then
ZYPPER="$SUDO zypper"
$ZYPPER install -y perl-FindBin perl-File-Compare || true
$ZYPPER install -y \
make \
gcc \
gcc-c++ \
fontconfig-devel \
openssl-devel \
perl \
python3 \
libxcb-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
wayland-devel \
Mesa-libEGL-devel \
xcb-util-keysyms-devel \
xcb-util-image-devel \
xcb-util-wm-devel \
rpm-build
exit $?
fi
if test -e /etc/debian_version ; then
APT="$SUDO apt-get"
$APT install -y \
bsdutils \
cmake \
dpkg-dev \
fakeroot \
gcc \
g++ \
libegl1-mesa-dev \
libssl-dev \
libfontconfig1-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-ewmh-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-render0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
lsb-release \
python3 \
xdg-utils \
xorg-dev
exit $?
fi
if test -e /etc/arch-release ; then
PACMAN="$SUDO pacman"
$PACMAN -S --noconfirm --needed \
'cargo' \
'cmake' \
'fontconfig' \
'git' \
'hicolor-icon-theme' \
'libx11' \
'libxkbcommon-x11' \
'pkgconf' \
'python3' \
'rust' \
'wayland' \
'xcb-util-image' \
'xcb-util-keysyms' \
'xcb-util-wm'
exit $?
fi
case $OSTYPE in
darwin*|msys)
exit 0
;;
freebsd*)
PKG="$SUDO pkg"
$PKG install -y \
cmake \
curl \
egl-wayland \
expat \
fontconfig \
gcc \
gettext \
git \
gmake \
libxcb \
libxkbcommon \
mesa-devel \
openssl \
p5-ExtUtils-MakeMaker \
perl5 \
pkgconf \
python3 \
rust \
wayland \
xcb-util-image \
xcb-util-keysyms \
xcb-util-wm \
z \
zip
exit $?
;;
*)
echo "Please contribute the commands to install the deps"
echo "For `lsb_release -ds`"
exit 1
;;
esac