58 lines
1.6 KiB
Bash
58 lines
1.6 KiB
Bash
#!/usr/bin/env bash
|
|
|
|
installNeovide() {
|
|
if ! command_exists cargo; then
|
|
curl --proto '=https' --tlsv1.2 -sSf "https://sh.rustup.rs" | sh
|
|
"$HOME/.cargo/bin/cargo" install --git https://github.com/neovide/neovide
|
|
else
|
|
cargo install --git https://github.com/neovide/neovide
|
|
fi
|
|
|
|
if [ -e "$HOME/.cargo/bin/neovide" ]; then
|
|
$_sudo ln -rs "$HOME/.cargo/bin/neovide" /bin/neovide
|
|
fi
|
|
}
|
|
|
|
i_arch() {
|
|
deps="base-devel fontconfig freetype2 libglvnd sndio cmake git gtk3 python sdl2 vulkan-intel libxkbcommon-x11"
|
|
for dep in $deps; do
|
|
if ! command_exists $dep; then
|
|
_install "$dep" || echo_error "Couldn't install $dep"
|
|
fi
|
|
done
|
|
}
|
|
|
|
i_debian() {
|
|
deps="curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev libsndio-dev freeglut3-dev libxmu-dev libxi-dev libfontconfig1-dev libxcursor-dev"
|
|
for dep in $deps; do
|
|
if ! command_exists $dep; then
|
|
silentexec $_sudo apt-get install --assume-yes "$dep" || echo_error "Couldn't install $dep"
|
|
fi
|
|
done
|
|
}
|
|
|
|
i_fedora() {
|
|
deps="fontconfig-devel freetype-devel libX11-xcb libX11-devel libstdc++-static libstdc++-devel dnf-plugins-core"
|
|
for dep in $deps; do
|
|
if ! command_exists $dep; then
|
|
_install "$dep" || echo_error "Couldn't install $dep"
|
|
fi
|
|
done
|
|
$_sudo dnf groupinstall "Development Tools" "Development Libraries"
|
|
}
|
|
|
|
setup() {
|
|
case "$distro" in
|
|
arch) i_arch ;;
|
|
fedora) i_fedora ;;
|
|
debian | ubuntu) i_debian ;;
|
|
*)
|
|
echo_error "$distro is not supported by this script"
|
|
return 69
|
|
;;
|
|
esac
|
|
}
|
|
|
|
if setup; then
|
|
installNeovide
|
|
fi
|