forked from intel-iot-devkit/joule-code-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mraa-install.sh
43 lines (41 loc) · 1.07 KB
/
mraa-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
#!/bin/bash
#Installing Mraa
clear
echo "Beginning install!"
sleep 1
mkdir buildMraa
cd buildMraa
checkCmake="1"
#Check if Cmake exists
command -v cmake >/dev/null 2>&1 || { echo >&2 "MRAA requires Cmake, Installing Cmake!"; checkCmake="0"; }
if [ "$checkCmake" = "0" ]; then #Have to install Cmake
sleep 1
git clone https://github.com/Kitware/CMake.git
cd CMake
./bootstrap
make
make install
cd ..
clear
echo "CMake installed! Preparing to build Mraa."
sleep 1
fi
echo "CMake already installed, preparing to build Mraa."
sleep 1
git clone https://github.com/intel-iot-devkit/mraa.git
cd mraa
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=/usr
make
make install #Should install Mraa in /usr/lib64/
rm /usr/lib/libmraa.so* #Remove previous version of Mraa
mv /usr/lib64/libmraa.so* /usr/lib #Move NEW Mraa files to lib
mv /usr/lib64/pkgconfig/* /usr/lib/pkgconfig #Move package configuration info
rm -r /usr/lib64/
#Cleanup
cd ../../../
rm -r buildMraa
clear
echo $'Install complete!\n'
mraa-gpio version