From f9e8a3c00cef2a1fc7c7b6991f9b0241782d2c99 Mon Sep 17 00:00:00 2001 From: Jonathan Wohl Date: Sun, 19 Jun 2016 18:02:45 -0400 Subject: [PATCH] Use local install_dependencies.sh in order to add -y flags --- install.sh | 2 +- install_dependencies.sh | 91 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100755 install_dependencies.sh diff --git a/install.sh b/install.sh index ab3dbb5..47999e1 100755 --- a/install.sh +++ b/install.sh @@ -19,7 +19,7 @@ if [ $os == "Linux" ]; then # same for any debian disto # Do we want to lock this to a specific OF release rather than pulling from master? - sudo bash -c "$(curl https://raw.githubusercontent.com/openframeworks/openFrameworks/master/scripts/linux/debian/install_dependencies.sh)" + sudo bash ./install_dependencies.sh if [ $arq == "armv7l" ]; then # on RaspberryPi 2 or higher diff --git a/install_dependencies.sh b/install_dependencies.sh new file mode 100755 index 0000000..5c6936a --- /dev/null +++ b/install_dependencies.sh @@ -0,0 +1,91 @@ +#!/usr/bin/env bash + +if [ $EUID != 0 ]; then + echo "this script must be run as root" + echo "" + echo "usage:" + echo "sudo "$0 + exit $exit_code + exit 1 +fi + +apt-get update + +GSTREAMER_VERSION=0.10 +GSTREAMER_FFMPEG=gstreamer${GSTREAMER_VERSION}-ffmpeg + +echo "detecting latest gstreamer version" +apt-cache show libgstreamer1.0-dev +exit_code=$? +if [ $exit_code = 0 ]; then + echo selecting gstreamer 1.0 + GSTREAMER_VERSION=1.0 + GSTREAMER_FFMPEG=gstreamer${GSTREAMER_VERSION}-libav +fi + +GTK_VERSION=2.0 +echo "detecting latest gtk version" +apt-cache show libgtk-3-dev +exit_code=$? +if [ $exit_code = 0 ]; then + echo selecting gtk 3 + GTK_VERSION=-3 +fi + + + +echo "installing OF dependencies" +apt-get install -y freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++ libgl1-mesa-dev libglu1-mesa-dev libraw1394-dev libudev-dev libdrm-dev libglew-dev libopenal-dev libsndfile-dev libfreeimage-dev libcairo2-dev libfreetype6-dev libssl-dev libpulse-dev libusb-1.0-0-dev libgtk${GTK_VERSION}-dev libopencv-dev libegl1-mesa-dev libgles1-mesa-dev libgles2-mesa-dev libassimp-dev librtaudio-dev libboost-filesystem-dev +exit_code=$? +if [ $exit_code != 0 ]; then + echo "error installing dependencies, there could be an error with your internet connection" + echo "if the error persists, please report an issue in github: http://github.com/openframeworks/openFrameworks/issues" + exit $exit_code +fi + +echo "installing gstreamer" +apt-get install -y libgstreamer${GSTREAMER_VERSION}-dev libgstreamer-plugins-base${GSTREAMER_VERSION}-dev ${GSTREAMER_FFMPEG} gstreamer${GSTREAMER_VERSION}-pulseaudio gstreamer${GSTREAMER_VERSION}-x gstreamer${GSTREAMER_VERSION}-plugins-bad gstreamer${GSTREAMER_VERSION}-alsa gstreamer${GSTREAMER_VERSION}-plugins-base gstreamer${GSTREAMER_VERSION}-plugins-good +exit_code=$? +if [ $exit_code != 0 ]; then + echo "error installing gstreamer, there could be an error with your internet connection" + echo "if the error persists, please report an issue in github: http://github.com/openframeworks/openFrameworks/issues" + exit $exit_code +fi + +if [ -f /opt/vc/include/bcm_host.h ]; then + echo "detected Raspberry Pi" + echo "installing gstreamer omx" + apt-get install -y gstreamer${GSTREAMER_VERSION}-omx +fi + +OS_CODENAME=$(cat /etc/os-release | grep VERSION= | sed "s/VERSION\=\"\(.*\)\"/\1/") + +if [ "$OS_CODENAME" = "7 (wheezy)" ]; then + echo "detected wheezy, installing g++4.8 for c++11 compatibility" + apt-get install -y g++-4.8 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.6 20 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.6 20 + sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50 +fi + +export LC_ALL=C +GCC_MAJOR_GT_4=$(expr `gcc -dumpversion | cut -f1 -d.` \> 4) +if [ $GCC_MAJOR_GT_4 -eq 1 ]; then + echo + echo + echo "It seems you are running gcc 5 or later, due to incomatible ABI with previous versions" + echo "we need to recompile poco. This will take a while" + read -p "Press any key to continue... " -n1 -s + + sys_cores=$(getconf _NPROCESSORS_ONLN) + if [ $sys_cores -gt 1 ]; then + cores=$(($sys_cores-1)) + else + cores=1 + fi + + DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) + cd ${DIR}/../../apothecary + ./apothecary -j${cores} update poco +fi \ No newline at end of file