forked from OpenHD/OpenHD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_build_dep.sh
executable file
·71 lines (56 loc) · 1.99 KB
/
install_build_dep.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
#!/usr/bin/env bash
set -e
PLATFORM="$1"
BASE_PACKAGES="libpoco-dev clang-format libusb-1.0-0-dev libpcap-dev libsodium-dev libnl-3-dev libnl-genl-3-dev libnl-route-3-dev libsdl2-dev"
VIDEO_PACKAGES="libgstreamer-plugins-base1.0-dev libv4l-dev"
BUILD_PACKAGES="git build-essential autotools-dev automake libtool python3-pip autoconf apt-transport-https ruby-dev cmake"
function install_pi_packages {
PLATFORM_PACKAGES="libcamera-openhd"
PLATFORM_PACKAGES_REMOVE="python3-libcamera libcamera0"
}
function install_x86_packages {
PLATFORM_PACKAGES="libunwind-dev gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly"
PLATFORM_PACKAGES_REMOVE=""
}
function install_rock_packages {
PLATFORM_PACKAGES="gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly"
PLATFORM_PACKAGES_REMOVE=""
}
# Add OpenHD Repository platform-specific packages
apt update
apt install -y curl
curl -1sLf 'https://dl.cloudsmith.io/public/openhd/release/setup.deb.sh'| sudo -E bash
apt update
apt upgrade -y --allow-downgrades
# Main function
if [[ "${PLATFORM}" == "rpi" ]]; then
install_pi_packages
elif [[ "${PLATFORM}" == "ubuntu-x86" ]] ; then
install_x86_packages
elif [[ "${PLATFORM}" == "rock5" ]] ; then
install_rock_packages
else
echo "platform not supported"
fi
# Install platform-specific packages
echo "Removing platform-specific packages..."
for package in ${PLATFORM_PACKAGES_REMOVE}; do
echo "Removing ${package}..."
apt purge -y ${package}
if [ $? -ne 0 ]; then
echo "Failed to remove ${package}!"
exit 1
fi
done
# Install platform-specific packages
echo "Installing platform-specific packages..."
for package in ${PLATFORM_PACKAGES} ${BASE_PACKAGES} ${VIDEO_PACKAGES} ${BUILD_PACKAGES}; do
echo "Installing ${package}..."
apt install -y -o Dpkg::Options::="--force-overwrite" --no-install-recommends ${package}
if [ $? -ne 0 ]; then
echo "Failed to install ${package}!"
exit 1
fi
done
# Installing ruby packages
gem install fpm