-
Notifications
You must be signed in to change notification settings - Fork 6
/
install.sh
executable file
·84 lines (71 loc) · 2.73 KB
/
install.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/bin/bash
# neopo: A lightweight solution for local Particle development.
# Copyright (c) 2021 Nathan Robinson.
# Docker/root compatiblity
if [ "$EUID" -ne 0 ]; then
SUDO="sudo"
SUDOPY="sudo -H"
fi
# Install additional dependencies for Linux
case "$(uname)" in
Linux)
echo "Installing Linux dependencies..."
# Ubuntu / Debian / Linux Mint
if hash apt >/dev/null 2>&1; then
case "$(uname -m)" in
x86_64)
$SUDO dpkg --add-architecture i386
$SUDO apt update
$SUDO apt install libarchive-zip-perl libc6-i386 python3 git vim libncurses5:i386 libncurses5 python3-setuptools python3-pip jq
;;
armv7l)
$SUDO apt install libarchive-zip-perl libusb-1.0-0-dev dfu-util libudev-dev libisl15 libfl-dev python3 git vim python3-pip python3-setuptools libncurses5 jq
esac
# Fedora
elif hash yum >/dev/null 2>&1; then
$SUDO yum install glibc.i686 perl-Archive-Zip python3 vim git ncurses-compat-libs python3-pip python3-setuptools ncurses-libs jq
# Void Linux
elif hash xbps-install >/dev/null 2>&1; then
$SUDO xbps-install -S dfu-util python3 git vim perl-Archive-Zip void-repo-multilib bash-completion python3-pip python3-setuptools ncurses-libs jq
$SUDO xbps-install -S glibc-32bit ncurses-libs-32bit
# Manjaro / Arch (x86_64 and aarch64)
elif hash pacman >/dev/null 2>&1; then
$SUDO pacman -S --needed git base-devel
TEMPDIR="$(mktemp -d)"
cd "$TEMPDIR"
git clone https://aur.archlinux.org/neopo-git
cd neopo-git
makepkg -sif
neopo install -s
exit
fi
;;
# TODO: Mac dependencies
Darwin)
python3 -m pip install --upgrade pip
python3 -m pip install wheel
;;
# This script does not support Windows
*)
echo "To install neopo on Windows follow the instructions here:"
echo " https://neopo.xyz/tutorials/windows"
exit 1
esac
# Install neopo as python module (experimental)
TEMPDIR="$(mktemp -d)"
git clone https://github.com/nrobinson2000/neopo "$TEMPDIR/neopo"
cd "$TEMPDIR/neopo"
$SUDOPY python3 -m pip install .
# Run the neopo installer
neopo install -s
# Run Particle CLI so that it has a chance to pre-download its dependencies
neopo particle usb configure
# Attempt to install bash completion script
# if [ -d /etc/bash_completion.d ]; then
# echo "Installing tab completion script:"
# $SUDO curl -fsSLo /etc/bash_completion.d/neopo "https://raw.githubusercontent.com/nrobinson2000/neopo/master/completion/neopo"
# else
# echo "The tab completion script is recommended for the best experience."
# echo "You can follow the installation instructions here:"
# echo " https://neopo.xyz/docs/full-docs#tab-completion"
# fi