From aa9248e815928aa195a7e206fe577dbaa4024841 Mon Sep 17 00:00:00 2001 From: redpanther Date: Sat, 2 Sep 2017 22:26:22 +0200 Subject: [PATCH] fix compile issue on rpi (possible caused by latest cmake version) --- CompileHowto.md | 27 +++++++++++++++------------ bin/compile.sh | 27 +++++++++++++++++++++++++++ src/hyperiond/CMakeLists.txt | 7 +++++++ src/hyperiond/hyperiond.h | 2 +- 4 files changed, 50 insertions(+), 13 deletions(-) create mode 100755 bin/compile.sh diff --git a/CompileHowto.md b/CompileHowto.md index 1fd5a1a8..11c6b93b 100644 --- a/CompileHowto.md +++ b/CompileHowto.md @@ -7,19 +7,16 @@ sudo apt-get update sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev ``` +**on RPI you need the videocore IV headers** + +``` +sudo apt-get install libraspberrypi-dev +``` + + **ATTENTION Win10LinuxSubsystem** we do not (/we can't) support using hyperion in linux subsystem of MS Windows 10, albeit some users tested it with success. Keep in mind to disable all linux specific led and grabber hardware via cmake. Because we use QT as framework in hyperion, serialport leds and network driven devices could work. -## RPI Only -when you build on the rapberry pi and include the dispmanx grabber (which is the default) -you also need the firmware including headers installed. This downloads the firmware from the raspberrypi github -and copies the required files to the correct place. The firmware directory can be deleted afterwards if desired. - -``` -export FIRMWARE_DIR="raspberrypi-firmware" -git clone --depth 1 https://github.com/raspberrypi/firmware.git "$FIRMWARE_DIR" -sudo cp -R "$FIRMWARE_DIR/hardfp/opt/" / -``` ## Arch See [AUR](https://aur.archlinux.org/packages/?O=0&SeB=nd&K=hyperion&outdated=&SB=n&SO=a&PP=50&do_Search=Go) for PKGBUILDs on arch. If the PKGBUILD does not work ask questions there please. @@ -40,9 +37,15 @@ brew install doxygen # Compiling and installing Hyperion ### The general quick way (without big comments) -be sure you fullfill the prerequisites above. -assume your home is /home/pi +complete automated process: +```bash +wget -qO- https://raw.githubusercontent.com/hyperion-project/hyperion.ng/master/bin/compile.sh | sh +``` + +some more detailed way: (or more or less the content of the script above) +be sure you fulfill the prerequisites above. + ```bash git clone --recursive https://github.com/hyperion-project/hyperion.ng.git hyperion cd hyperion diff --git a/bin/compile.sh b/bin/compile.sh new file mode 100755 index 00000000..a9b2bde9 --- /dev/null +++ b/bin/compile.sh @@ -0,0 +1,27 @@ +#!/bin/sh + +TARGET=${1:-hyperion} +CFG="${2:-Release}" +INST="$( [ "${3:-}" = "install" ] && echo true || echo false )" + +sudo apt-get update +sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev || exit 1 + +if [ -e /dev/vc-cma -a -e /dev/vc-mem ] +then + sudo apt-get install libraspberrypi-dev || exit 1 +fi + +git clone --recursive https://github.com/hyperion-project/hyperion.ng.git ${TARGET} || exit 1 + +rm -rf $TARGET/build +mkdir -p $TARGET/build || exit 1 +cd $TARGET/build || exit 1 +cmake -DCMAKE_BUILD_TYPE=$CFG .. || exit 1 +make -j $(nproc) || exit 1 + +# optional: install into your system +$INST && sudo make install/strip +echo "to uninstall (not very well tested, please keep that in mind):" +echo " sudo make uninstall" + diff --git a/src/hyperiond/CMakeLists.txt b/src/hyperiond/CMakeLists.txt index d99ed863..b6e888ba 100644 --- a/src/hyperiond/CMakeLists.txt +++ b/src/hyperiond/CMakeLists.txt @@ -21,6 +21,13 @@ target_link_libraries(hyperiond ) if (ENABLE_DISPMANX) + IF ( "${PLATFORM}" MATCHES rpi) + find_package(BCM REQUIRED) + include_directories(${BCM_INCLUDE_DIRS}) + ELSE() + SET(BCM_INCLUDE_DIRS "") + SET(BCM_LIBRARIES "") + ENDIF() target_link_libraries(hyperiond dispmanx-grabber) endif () diff --git a/src/hyperiond/hyperiond.h b/src/hyperiond/hyperiond.h index 173fdd37..68b3ca12 100644 --- a/src/hyperiond/hyperiond.h +++ b/src/hyperiond/hyperiond.h @@ -54,7 +54,7 @@ class SysTray; class HyperionDaemon : public QObject { Q_OBJECT - + friend SysTray; public: