-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
42 lines (32 loc) · 1.76 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
#!/usr/bin/bash
# Description: Install F1-LED-Leaderboard software (github.com/feram18/f1-led-leaderboard)
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
function installMatrixLibrary() {
printf "\nInstalling rpi-rgb-led-matrix library...\n"
cd "${ROOT_DIR}/rpi-rgb-led-matrix/" || exit
make build-python PYTHON="$(command -v python3)"
sudo make install-python PYTHON="$(command -v python3)"
cd "${ROOT_DIR}" || exit
}
main() {
echo "$(tput setaf 5)__________________________________________________________________________________________"
echo "$(tput setaf 5) ___ _ __ __ ___ __ _ _ _ "
echo "$(tput setaf 5) / __\/ | / / /__\/ \ / / ___ __ _ __| | ___ _ __| |__ ___ __ _ _ __ __| |"
echo "$(tput setaf 5) / _\ | | / / /_\ / /\ / / / / _ \/ _\` |/ _\` |/ _ \ '__| '_ \ / _ \ / _\` | '__/ _\` |"
echo "$(tput setaf 5)/ / | | / /___//__/ /_// / /__| __/ (_| | (_| | __/ | | |_) | (_) | (_| | | | (_| |"
echo "$(tput setaf 5)\/ |_| \____/\__/___,' \____/\___|\__,_|\__,_|\___|_| |_.__/ \___/ \__,_|_| \__,_|"
echo "$(tput setaf 5)__________________________________________________________________________________________"
echo -e "$(tput setaf 7)\nUpdating system & installing Python 3"
sudo apt-get update && sudo apt install python3-dev
installMatrixLibrary
chmod +x update.sh
if [[ "$*" == *"--ci"* ]]; then
echo "This is a test build."
else
./update.sh
fi
echo -e "\n$(tput setaf 2)If there are no errors shown above, installation was successful."
echo "$(tput setaf 7)To make sure your matrix is working properly, execute the samples located in ./rpi-rgb-led-matrix/bindings/python/samples"
exit
}
main "$@"