1
1
mirror of https://github.com/wez/wezterm.git synced 2024-11-27 12:23:46 +03:00
wezterm/get-deps

199 lines
3.9 KiB
Plaintext
Raw Normal View History

#!/bin/bash
2021-03-29 06:26:07 +03:00
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
2020-05-04 18:21:30 +03:00
if test -x /bin/dnf ; then
YUM="$SUDO dnf"
2020-05-04 18:21:30 +03:00
else
YUM="$SUDO yum"
2020-05-04 18:21:30 +03:00
fi
2020-11-29 21:26:11 +03:00
# Fedora 33 moved some perl bits around
$YUM install -y perl-FindBin perl-File-Compare || true
2020-05-04 18:21:30 +03:00
$YUM install -y \
2019-11-10 06:46:37 +03:00
make \
2020-02-11 09:16:34 +03:00
gcc \
gcc-c++ \
2019-06-17 00:11:15 +03:00
fontconfig-devel \
2019-06-17 00:11:36 +03:00
openssl-devel \
2020-11-29 21:26:11 +03:00
perl-interpreter \
2020-02-11 09:16:34 +03:00
python3 \
libxcb-devel \
2019-02-23 09:11:25 +03:00
libxkbcommon-devel \
libxkbcommon-x11-devel \
wayland-devel \
mesa-libEGL-devel \
2019-06-17 00:11:15 +03:00
xcb-util-keysyms-devel \
xcb-util-image-devel \
xcb-util-wm-devel \
2019-12-30 01:03:09 +03:00
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 \
2020-05-04 08:45:10 +03:00
libx11-xcb-dev \
libxcb-ewmh-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
2021-03-09 09:54:25 +03:00
libxcb-render0-dev \
libxcb-xkb-dev \
libxkbcommon-dev \
libxkbcommon-x11-dev \
lsb-release \
python3 \
xdg-utils \
xorg-dev
exit $?
fi
2020-06-07 20:57:41 +03:00
if test -e /etc/arch-release ; then
PACMAN="$SUDO pacman"
$PACMAN -S --noconfirm --needed \
2020-06-07 20:57:41 +03:00
'cargo' \
'cmake' \
'fontconfig' \
'git' \
'hicolor-icon-theme' \
'libx11' \
'libxkbcommon-x11' \
'pkgconf' \
'python3' \
'rust' \
'wayland' \
'xcb-util-image' \
2020-06-07 20:57:41 +03:00
'xcb-util-keysyms' \
'xcb-util-wm'
exit $?
fi
case $OSTYPE in
darwin*|msys)
exit 0
;;
2020-09-09 07:48:00 +03:00
freebsd*)
PKG="$SUDO pkg"
$PKG install -y \
2020-09-09 07:48:00 +03:00
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 \
2020-09-09 07:48:00 +03:00
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