Skip to content

Commit 30c1038

Browse files
cortecciaAlexeyBulatov
authored andcommitted
C++: all: add script for dependencies
Installation of dependencies, if it is necessary, was added. Now all required dependencies (such as pigpio) can be installed independently.
1 parent b5abe2b commit 30c1038

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

C++/Navio/get_dependencies.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
ARCH=`dpkg --print-architecture`
4+
5+
confirm_guard() {
6+
echo "Would you like to install missing dependencies (requires sudo)? [y/n]"
7+
while true; do
8+
read answer
9+
case $answer in
10+
[Yy]* ) return ;;
11+
[Nn]* ) exit ;;
12+
* ) echo "Wrong answer" ;;
13+
esac
14+
done
15+
}
16+
17+
if [[ "$ARCH" == *"arm"* ]]; then
18+
if ! dpkg -s pigpio &> /dev/null; then
19+
confirm_guard
20+
sudo apt-get update
21+
sudo apt-get install pigpio
22+
fi
23+
else
24+
git submodule update --init --recursive;
25+
pushd pigpio;
26+
make CROSS_PREFIX=arm-linux-gnueabihf-
27+
popd;
28+
fi

0 commit comments

Comments
 (0)