-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
48 lines (41 loc) · 1.21 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
#!/bin/bash
set -e # Any error will cause the script to fail
# Redirects output on &3 to /dev/null unless -v or --verbose is passed
if [ "$1" = "-v" ]; then
exec 3>&1
else
exec 3>/dev/null
fi
echo "Cloning submodules..."
git submodule update --init >&3
echo "Building OpenCV. This could take up to 10 minutes..."
cd opencv_ffi
./build.sh >&3
cd ..
cd video/src
if [ ! -f /usr/local/lib/librealsense2.so ]
then
echo "Compiling librealsense. This could take up to 45 minutes..."
sh build.sh
fi
echo "Compiling RealSense FFI..."
make shared
cd ../..
echo "Compiling the video program. This could take up to a minute..."
cd video
dart pub get >&3
dart compile exe bin/video.dart -o ~/video.exe >&3
cd ..
echo "Installing configuration files..."
sudo cp ./10-cameras.rules /etc/udev/rules.d
sudo cp ./video.service /etc/systemd/system
sudo systemctl enable video >&3
sudo systemctl start video >&3
sudo udevadm control --reload-rules
sudo udevadm trigger
echo ""
echo "Done! Here's what just happened"
echo "- OpenCV was built and installed as a dynamic library"
echo "- The video program was compiled to ~/video.exe"
echo "- udev will auto-detect cameras when plugged in"
echo "- systemd will auto-start the video program on boot"