Skip to content

Commit

Permalink
Linux: Default to poco from system
Browse files Browse the repository at this point in the history
 #changelog #linux
  • Loading branch information
arturoc committed Mar 29, 2019
1 parent cd6b981 commit e157173
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 78 deletions.
30 changes: 14 additions & 16 deletions addons/ofxPoco/addon_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,23 @@ common:
ADDON_SOURCES_EXCLUDE = libs/poco/include/%

linux:
ADDON_LIBS = libs/poco/lib/linux/libPocoNetSSL.a
ADDON_LIBS += libs/poco/lib/linux/libPocoNet.a
ADDON_LIBS += libs/poco/lib/linux/libPocoCrypto.a
ADDON_LIBS += libs/poco/lib/linux/libPocoUtil.a
ADDON_LIBS += libs/poco/lib/linux/libPocoJSON.a
ADDON_LIBS += libs/poco/lib/linux/libPocoXML.a
ADDON_LIBS += libs/poco/lib/linux/libPocoFoundation.a
ADDON_LDFLAGS = -lcrypto
ADDON_LDFLAGS = -lPocoNetSSL
ADDON_LDFLAGS += -lPocoNet
ADDON_LDFLAGS += -lPocoCrypto
ADDON_LDFLAGS += -lPocoUtil
ADDON_LDFLAGS += -lPocoXML
ADDON_LDFLAGS += -lPocoFoundation
ADDON_LDFLAGS += -lcrypto
ADDON_LDFLAGS += -lssl

linux64:
ADDON_LIBS = libs/poco/lib/linux64/libPocoNetSSL.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoNet.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoCrypto.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoUtil.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoJSON.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoXML.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoFoundation.a
ADDON_LDFLAGS = -lcrypto
ADDON_LDFLAGS = -lPocoNetSSL
ADDON_LDFLAGS += -lPocoNet
ADDON_LDFLAGS += -lPocoCrypto
ADDON_LDFLAGS += -lPocoUtil
ADDON_LDFLAGS += -lPocoXML
ADDON_LDFLAGS += -lPocoFoundation
ADDON_LDFLAGS += -lcrypto
ADDON_LDFLAGS += -lssl

linuxarmv6l:
Expand Down
2 changes: 1 addition & 1 deletion scripts/linux/archlinux/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if [ $EUID != 0 ]; then
exit 1
fi

pacman -Sy --needed make pkgconf gcc openal glew freeglut freeimage gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav opencv libxcursor assimp boost glfw-x11 uriparser curl pugixml rtaudio
pacman -Sy --needed make pkgconf gcc openal glew freeglut freeimage gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-libav opencv libxcursor assimp boost glfw-x11 uriparser curl pugixml rtaudio poco

exit_code=$?
if [ $exit_code != 0 ]; then
Expand Down
10 changes: 3 additions & 7 deletions scripts/linux/debian/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fi


echo "installing OF dependencies"
apt-get install 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 libglfw3-dev liburiparser-dev libcurl4-openssl-dev libpugixml-dev
apt-get install 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 libglfw3-dev liburiparser-dev libcurl4-openssl-dev libpugixml-dev libpoco-dev
exit_code=$?
if [ $exit_code != 0 ]; then
echo "error installing dependencies, there could be an error with your internet connection"
Expand All @@ -56,8 +56,8 @@ fi

if [ -f /opt/vc/include/bcm_host.h ]; then
echo "detected Raspberry Pi"
echo "installing gstreamer omx and poco"
apt-get install gstreamer${GSTREAMER_VERSION}-omx libpoco-dev
echo "installing gstreamer omx"
apt-get install gstreamer${GSTREAMER_VERSION}-omx
fi

OS_CODENAME=$(cat /etc/os-release | grep VERSION= | sed "s/VERSION\=\"\(.*\)\"/\1/")
Expand All @@ -70,10 +70,6 @@ if [ "$OS_CODENAME" = "7 (wheezy)" ]; then
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 1 --force
fi

echo "If you are running a version of debian greated than 8 OF needs to install poco libraries in the system with the following packages:"
apt-get install libpoco-dev
cp $ROOT/../extra/poco_config.mk $ROOT/../../../addons/ofxPoco/addon_config.mk

# Update addon_config.mk files to use OpenCV 3 or 4 depending on what's installed
addons_dir="$(readlink -f "$ROOT/../../../addons")"
$(pkg-config opencv4 --exists)
Expand Down
30 changes: 16 additions & 14 deletions scripts/linux/extra/poco_config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,25 @@ common:
ADDON_SOURCES_EXCLUDE = libs/poco/include/%

linux:
ADDON_LDFLAGS = -lPocoNetSSL
ADDON_LDFLAGS += -lPocoNet
ADDON_LDFLAGS += -lPocoCrypto
ADDON_LDFLAGS += -lPocoUtil
ADDON_LDFLAGS += -lPocoXML
ADDON_LDFLAGS += -lPocoFoundation
ADDON_LDFLAGS += -lcrypto
ADDON_LIBS = libs/poco/lib/linux/libPocoNetSSL.a
ADDON_LIBS += libs/poco/lib/linux/libPocoNet.a
ADDON_LIBS += libs/poco/lib/linux/libPocoCrypto.a
ADDON_LIBS += libs/poco/lib/linux/libPocoUtil.a
ADDON_LIBS += libs/poco/lib/linux/libPocoJSON.a
ADDON_LIBS += libs/poco/lib/linux/libPocoXML.a
ADDON_LIBS += libs/poco/lib/linux/libPocoFoundation.a
ADDON_LDFLAGS = -lcrypto
ADDON_LDFLAGS += -lssl

linux64:
ADDON_LDFLAGS = -lPocoNetSSL
ADDON_LDFLAGS += -lPocoNet
ADDON_LDFLAGS += -lPocoCrypto
ADDON_LDFLAGS += -lPocoUtil
ADDON_LDFLAGS += -lPocoXML
ADDON_LDFLAGS += -lPocoFoundation
ADDON_LDFLAGS += -lcrypto
ADDON_LIBS = libs/poco/lib/linux64/libPocoNetSSL.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoNet.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoCrypto.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoUtil.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoJSON.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoXML.a
ADDON_LIBS += libs/poco/lib/linux64/libPocoFoundation.a
ADDON_LDFLAGS = -lcrypto
ADDON_LDFLAGS += -lssl

linuxarmv6l:
Expand Down
23 changes: 1 addition & 22 deletions scripts/linux/fedora/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,14 @@ if [ $EUID != 0 ]; then
exit 1
fi

dnf install freeglut-devel alsa-lib-devel libXmu-devel libXxf86vm-devel gcc-c++ libraw1394-devel gstreamer1-devel gstreamer1-plugins-base-devel libudev-devel libtheora-devel libvorbis-devel openal-soft-devel libsndfile-devel python-lxml glew-devel flac-devel freeimage-devel cairo-devel pulseaudio-libs-devel openssl-devel libusbx-devel gtk2-devel libXrandr-devel libXi-devel opencv-devel libX11-devel assimp-devel rtaudio-devel boost-devel gtk3-devel glfw-devel uriparser-devel curl-devel pugixml-devel jack-audio-connection-kit-dbus
dnf install freeglut-devel alsa-lib-devel libXmu-devel libXxf86vm-devel gcc-c++ libraw1394-devel gstreamer1-devel gstreamer1-plugins-base-devel libudev-devel libtheora-devel libvorbis-devel openal-soft-devel libsndfile-devel python-lxml glew-devel flac-devel freeimage-devel cairo-devel pulseaudio-libs-devel openssl-devel libusbx-devel gtk2-devel libXrandr-devel libXi-devel opencv-devel libX11-devel assimp-devel rtaudio-devel boost-devel gtk3-devel glfw-devel uriparser-devel curl-devel pugixml-devel jack-audio-connection-kit-dbus poco-devel

exit_code=$?
if [ $exit_code != 0 ]; then
echo "error installing packages, there could be an error with your internet connection"
exit $exit_code
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
./apothecary -j${cores} update poco
fi

# Update addon_config.mk files to use OpenCV 3 or 4 depending on what's installed
addons_dir="$(readlink -f "$ROOT/../../../addons")"
$(pkg-config opencv4 --exists)
Expand Down
20 changes: 2 additions & 18 deletions scripts/linux/ubuntu/install_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ else
GLFW_PKG=
fi

PACKAGES="curl libjack-jackd2-0 libjack-jackd2-dev freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++${CXX_VER} libgl1-mesa-dev${XTAG} 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 libassimp-dev librtaudio-dev libboost-filesystem${BOOST_VER}-dev 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 gdb ${GLFW_PKG} liburiparser-dev libcurl4-openssl-dev libpugixml-dev libgconf2-4 libgtk2.0-0"
PACKAGES="curl libjack-jackd2-0 libjack-jackd2-dev freeglut3-dev libasound2-dev libxmu-dev libxxf86vm-dev g++${CXX_VER} libgl1-mesa-dev${XTAG} 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 libassimp-dev librtaudio-dev libboost-filesystem${BOOST_VER}-dev 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 gdb ${GLFW_PKG} liburiparser-dev libcurl4-openssl-dev libpugixml-dev libgconf2-4 libgtk2.0-0 libpoco-dev"

echo "installing OF dependencies"
echo "OF needs to install the following packages using apt-get:"
Expand All @@ -194,26 +194,10 @@ if [ "$1" != "-y" ]; then
fi
installPackages ${PACKAGES}

if [[ $MAJOR_VERSION -gt 18 || $MAJOR_VERSION -eq 18 ]]; then
PACKAGES="libpoco-dev"
echo "detected ubuntu 18.04 or greater"
echo "OF needs to install poco libraries in the system with the following packages:"
echo ${PACKAGES}
if [ "$1" != "-y" ]; then
read -p "Do you want to continue? [Y/n] "
if [[ $REPLY =~ ^[Nn]$ ]]; then
exit 0
fi

echo
echo "Installing..."
echo
fi
installPackages ${PACKAGES}
if [[ $MAJOR_VERSION -lt 18 ]]; then
cp $ROOT/../extra/poco_config.mk $ROOT/../../../addons/ofxPoco/addon_config.mk
fi


if [[ $MAJOR_VERSION -lt 14 || ($MAJOR_VERSION -eq 14 && $MINOR_VERSION -eq 4) ]]; then
echo "detected ubuntu default gcc too old for compatibility with c++11"
echo "OF needs at least ${CXX_VER} as default compiler, we can install this now"
Expand Down

0 comments on commit e157173

Please sign in to comment.