Skip to content

Commit

Permalink
Merge branch 'master' into Refactor_LedDevices
Browse files Browse the repository at this point in the history
# Conflicts:
#	include/leddevice/LedDevice.h
#	libsrc/leddevice/LedDeviceTemplate.cpp
#	libsrc/leddevice/LedDeviceTemplate.h
#	libsrc/leddevice/dev_hid/LedDeviceMultiLightpack.cpp
#	libsrc/leddevice/dev_net/LedDeviceAtmoOrb.cpp
#	libsrc/leddevice/dev_net/LedDeviceNanoleaf.cpp
  • Loading branch information
Lord-Grey committed Jul 12, 2020
2 parents aa346ed + 1e93a73 commit 978ac75
Show file tree
Hide file tree
Showing 96 changed files with 474 additions and 426 deletions.
1 change: 1 addition & 0 deletions .azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ jobs:
python -m pip install aqtinstall
python -m aqt install -O c:\Qt 5.15.0 windows desktop win64_msvc2019_64
displayName: 'Install Qt 5.15.0'
# build process
- bash: ./.ci/ci_build.sh
env:
Expand Down
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
"type": "shell",
"command": "${workspaceFolder}/build/bin/hyperiond -d",
"windows": {
"command": "${workspaceFolder}/build/bin/Debug/hyperiond"
"command": "${workspaceFolder}/build/bin/Debug/hyperiond -d -c"
},
"group": "build"
},
Expand All @@ -115,7 +115,7 @@
"type": "shell",
"command": "${workspaceFolder}/build/bin/hyperiond -d",
"windows": {
"command": "${workspaceFolder}/build/bin/Release/hyperiond"
"command": "${workspaceFolder}/build/bin/Release/hyperiond -d -c"
},
"group": "build"
}
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- An option to reset (delete) the database for the commandline has been added (#820)
- Improve language selection usability (#812)
- readded V4L2 Input method from old Hyperion (#825)
- Windows: Start Hyperion with a console window `hyperiond -c` (Or new start menu entry) (#860)

### Changed
- Updated dependency rpi_ws281x to latest upstream (#820)
- Updated websocket-extensions (#826)
Expand Down
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ else()
endif()

# Set build variables
SET ( DEFAULT_AMLOGIC OFF )
SET ( DEFAULT_DISPMANX OFF )
SET ( DEFAULT_AMLOGIC ON )
SET ( DEFAULT_DISPMANX ON )
SET ( DEFAULT_OSX OFF )
SET ( DEFAULT_X11 OFF )
SET ( DEFAULT_X11 ON )
SET ( DEFAULT_QT ON )
SET ( DEFAULT_WS281XPWM OFF )
SET ( DEFAULT_WS281XPWM ON )
SET ( DEFAULT_AVAHI ON )
SET ( DEFAULT_USE_SHARED_AVAHI_LIBS ON )
SET ( DEFAULT_USE_SYSTEM_FLATBUFFERS_LIBS OFF )
Expand Down Expand Up @@ -390,6 +390,9 @@ endif ()
# Add resources directory
add_subdirectory(resources)

# Add the doxygen generation directory
add_subdirectory(doc)

# remove generated files on make cleaan too
LIST( APPEND GENERATED_QRC
${CMAKE_BINARY_DIR}/EffectEngine.qrc
Expand Down
3 changes: 2 additions & 1 deletion CompileHowto.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ wget -qN https://raw.github.com/hyperion-project/hyperion.ng/master/bin/scripts/

```
sudo apt-get update
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite libssl-dev zlib1g-dev
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite libssl-dev zlib1g-dev
```

**on RPI you need the videocore IV headers**
Expand Down Expand Up @@ -82,6 +82,7 @@ We assume a 64bit Windows 7 or higher. Install the following
- Open a console window and execute `pip install aqtinstall`.
- Now we can download Qt to _C:\Qt_ `mkdir c:\Qt && aqt install -O c:\Qt 5.15.0 windows desktop win64_msvc2019_64`
- [CMake (Windows win64-x64 Installer)](https://cmake.org/download/) (Check: Add to PATH)
- [Win64 OpenSSL v1.1.1g](https://slproweb.com/products/Win32OpenSSL.html) ([direct link](https://slproweb.com/download/Win64OpenSSL-1_1_1g.exe))
- [Visual Studio 2019 Build Tools](https://go.microsoft.com/fwlink/?linkid=840931) ([direct link](https://aka.ms/vs/16/release/vs_buildtools.exe))
- Select C++ Buildtools
- On the right, just select `MSVC v142 VS 2019 C++ x64/x86-Buildtools` and latest `Windows 10 SDK`. Everything else is not needed.
Expand Down
4 changes: 2 additions & 2 deletions CrossCompileHowto.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Use a clean Raspbian Stretch Lite (on target) and Ubuntu 18/19 (on host) to exec
## On the Target system (here Raspberry Pi)
Install required additional packages.
```
sudo apt-get install qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite aptitude qt5-default rsync libssl-dev zlib1g-dev
sudo apt-get install qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite aptitude qt5-default rsync libssl-dev zlib1g-dev
```
## On the Host system (here Ubuntu)
Update the Ubuntu environment to the latest stage and install required additional packages.
```
sudo apt-get update
sudo apt-get upgrade
sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite libssl-dev zlib1g-dev
sudo apt-get -qq -y install git rsync cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev python3-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libjpeg-dev libturbojpeg0-dev libqt5sql5-sqlite libssl-dev zlib1g-dev
```

Refine the target IP or hostname, plus userID as required and set-up cross-compilation environment:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ Covers these topics (WorkInProgress)

[![Visit Documentation](https://img.shields.io/website?down_message=offline&label=Documentation%20%20&up_message=online&url=https%3A%2F%2Fdocs.hyperion-project.org)](https://docs.hyperion-project.org)

## Changelog
Released and unreleased changes at [Changelog.md](CHANGELOG.md)

## Building
See [CompileHowto](CompileHowto.md) and [CrossCompileHowto](CrossCompileHowto.md).

Expand Down
2 changes: 1 addition & 1 deletion bin/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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 libturbojpeg0-dev python3-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libssl-dev libjpeg-dev libqt5sql5-sqlite zlib1g-dev || exit 1
sudo apt-get install git cmake build-essential qtbase5-dev libqt5serialport5-dev libusb-1.0-0-dev libturbojpeg0-dev python3-dev libxcb-util0-dev libxcb-randr0-dev libxrandr-dev libxrender-dev libavahi-core-dev libavahi-compat-libdnssd-dev libssl-dev libjpeg-dev libqt5sql5-sqlite zlib1g-dev || exit 1

if [ -e /dev/vc-cma -a -e /dev/vc-mem ]
then
Expand Down
3 changes: 3 additions & 0 deletions bin/create_oe_depedencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ tar --create --verbose --gzip --absolute-names --show-transformed-names --derefe
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libX11.so.6" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXau.so.6" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libxcb.so.1" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libxcb-util.so" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libxcb-randr.so" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXdmcp.so.6" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXext.so.6" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXrandr.so.2" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXrender.so.1" \
"$IMX6_ROOTFS/usr/lib/arm-linux-gnueabihf/libXt.so.6" \
"./openelec/hyperiond.sh" \
Expand Down
141 changes: 98 additions & 43 deletions cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
macro(DeployUnix TARGET)
set(TARGET_FILE ${CMAKE_BINARY_DIR}/bin/${TARGET})
set(SYSTEM_LIBS_SKIP
"libc"
"libdl"
"libexpat"
"libfontconfig"
"libfreetype"
"libgcc_s"
"libgcrypt"
"libGL"
"libGLdispatch"
"libglib-2"
"libGLX"
"libgpg-error"
"libm"
"libpthread"
"librt"
"libstdc++"
"libudev"
"libusb-1"
"libutil"
"libX11"
"libz"
)

if(EXISTS ${TARGET_FILE})
message(STATUS "Collecting Dependencies for target file: ${TARGET_FILE}")
include(GetPrerequisites)

set(SYSTEM_LIBS_SKIP
"libc"
"libdl"
"libexpat"
"libfontconfig"
"libfreetype"
"libgcc_s"
"libgcrypt"
"libGL"
"libGLdispatch"
"libglib-2"
"libGLX"
"libgpg-error"
"libm"
"libpthread"
"librt"
"libstdc++"
"libudev"
"libusb-1"
"libutil"
"libX11"
"libz"
)

if (APPLE)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl)
endif(APPLE)
Expand Down Expand Up @@ -133,17 +133,19 @@ macro(DeployUnix TARGET)
)
endforeach()

# Detect the Python version and modules directory
if (NOT CMAKE_VERSION VERSION_LESS "3.12")

# Detect the Python modules directory
set(PYTHON_VERSION_MAJOR_MINOR "${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}")
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE
)

else()

# Detect the Python modules directory
set(PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_MAJOR}${PYTHON_VERSION_MINOR}")
execute_process(
COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(standard_lib=True))"
OUTPUT_VARIABLE PYTHON_MODULES_DIR
Expand All @@ -152,19 +154,43 @@ macro(DeployUnix TARGET)

endif()

# Copy Python modules to 'share/hyperion/lib/python'
# Pack Python modules to pythonXX.zip or copy to 'share/hyperion/lib/python'
if (PYTHON_MODULES_DIR)
install(
DIRECTORY ${PYTHON_MODULES_DIR}/
DESTINATION "share/hyperion/lib/python"
COMPONENT "Hyperion"
)
# Since version 3.3.2 CMake has the functionality to generate a zip file built-in.
if (NOT CMAKE_VERSION VERSION_LESS "3.3.2")

file(GLOB PYTHON_MODULE_FILES RELATIVE "${PYTHON_MODULES_DIR}" "${PYTHON_MODULES_DIR}/*")
set(PYTHON_ZIP "python${PYTHON_VERSION_MAJOR_MINOR}.zip")

execute_process(
COMMAND "${CMAKE_COMMAND}" "-E" "tar" "cf" "${CMAKE_BINARY_DIR}/${PYTHON_ZIP}" "--format=zip" ${PYTHON_MODULE_FILES}
WORKING_DIRECTORY "${PYTHON_MODULES_DIR}"
OUTPUT_QUIET
)

install(
FILES "${CMAKE_BINARY_DIR}/${PYTHON_ZIP}"
DESTINATION "share/hyperion/bin"
COMPONENT "Hyperion"
)

else()

install(
DIRECTORY ${PYTHON_MODULES_DIR}/
DESTINATION "share/hyperion/lib/python"
COMPONENT "Hyperion"
)

endif()

endif(PYTHON_MODULES_DIR)

else()
# Run CMake after target was built to run get_prerequisites on ${TARGET_FILE}
add_custom_command(
TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND}
COMMAND "${CMAKE_COMMAND}" "-DTARGET_FILE=$<TARGET_FILE:${TARGET}>"
ARGS ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
VERBATIM
Expand All @@ -173,11 +199,10 @@ macro(DeployUnix TARGET)
endmacro()

macro(DeployWindows TARGET)
# TODO Find out what build type it is
set(TARGET_FILE ${CMAKE_BINARY_DIR}/bin/Release/${TARGET}.exe)

if(EXISTS ${TARGET_FILE})
message(STATUS "Collecting Dependencies for target file: ${TARGET_FILE}")
find_package(Qt5Core REQUIRED)
find_package(OpenSSL REQUIRED)

# Find the windeployqt binaries
get_target_property(QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
Expand All @@ -191,11 +216,11 @@ macro(DeployWindows TARGET)
execute_process(
COMMAND "${CMAKE_COMMAND}" -E
env "PATH=${COMPILER_PATH};${QT_BIN_DIR}" "${WINDEPLOYQT_EXECUTABLE}"
--dry-run
${WINDEPLOYQT_PARAMS}
--list mapping
"${TARGET_FILE}"
OUTPUT_VARIABLE DEPS
--dry-run
${WINDEPLOYQT_PARAMS}
--list mapping
"${TARGET_FILE}"
OUTPUT_VARIABLE DEPS
OUTPUT_STRIP_TRAILING_WHITESPACE
)

Expand Down Expand Up @@ -226,6 +251,36 @@ macro(DeployWindows TARGET)
list(REMOVE_AT DEPENDENCIES 0 1)
endwhile()

# Copy OpenSSL Libs
if (OPENSSL_FOUND)
string(REGEX MATCHALL "[0-9]+" openssl_versions "${OPENSSL_VERSION}")
list(GET openssl_versions 0 openssl_version_major)
list(GET openssl_versions 1 openssl_version_minor)

set(library_suffix "-${openssl_version_major}_${openssl_version_minor}")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
string(APPEND library_suffix "-x64")
endif()

find_file(OPENSSL_SSL
NAMES "libssl${library_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

find_file(OPENSSL_CRYPTO
NAMES "libcrypto${library_suffix}.dll"
PATHS ${OPENSSL_INCLUDE_DIR}/.. ${OPENSSL_INCLUDE_DIR}/../bin
NO_DEFAULT_PATH
)

install(
FILES ${OPENSSL_SSL} ${OPENSSL_CRYPTO}
DESTINATION "bin"
COMPONENT "Hyperion"
)
endif(OPENSSL_FOUND)

# Create a qt.conf file in 'bin' to override hard-coded search paths in Qt plugins
file(WRITE "${CMAKE_BINARY_DIR}/qt.conf" "[Paths]\nPlugins=../lib/\n")
install(
Expand Down Expand Up @@ -277,7 +332,7 @@ macro(DeployWindows TARGET)
# Run CMake after target was built
add_custom_command(
TARGET ${TARGET} POST_BUILD
COMMAND ${CMAKE_COMMAND}
COMMAND "${CMAKE_COMMAND}" "-DTARGET_FILE=$<TARGET_FILE:${TARGET}>"
ARGS ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
VERBATIM
Expand Down
18 changes: 18 additions & 0 deletions cmake/nsis/template/NSIS.template.in
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,24 @@ Section "-Core installation"

@CPACK_NSIS_EXTRA_INSTALL_COMMANDS@

; Custom vcredist install script, detection is not reliable
;ReadRegStr $1 HKLM "SOFTWARE\Microsoft\VisualStudio\14.0\VC\Runtimes\X64" "Bld"
;DetailPrint "VCREDIS KEY: $1"
;
;IntCmp $1 28508 Equal Val1Less Val1More
;Equal:
; DetailPrint "$1 = 28508 "
; Goto End
;Val1Less:
; DetailPrint "$1 < 28508 "
; Goto End
;Val1More:
; DetailPrint "$1 > 28508 "
; Goto End
;End:

ExecWait '"$INSTDIR\bin\vc_redist.x64.exe" /install /quiet'

SectionEnd

Section "-Add to path"
Expand Down
8 changes: 5 additions & 3 deletions cmake/packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,16 @@ SET ( CPACK_NSIS_PACKAGE_NAME "Hyperion" )
SET ( CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\hyperiond.exe")
SET ( CPACK_NSIS_HELP_LINK "https://www.hyperion-project.org")
SET ( CPACK_NSIS_URL_INFO_ABOUT "https://www.hyperion-project.org")
# hyperiond startmenu link
# additional hyperiond startmenu link, won't be created if the user disables startmenu links
SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion (Console).lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' '-d -c'")
SET ( CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion (Console).lnk'")


#SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion.lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe'")
#SET ( CPACK_NSIS_DELETE_ICONS_EXTRA "Delete '$SMPROGRAMS\\\\$START_MENU\\\\Hyperion.lnk'")
# hyperiond desktop link
#SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$DESKTOP\\\\Hyperion.lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' ")
#SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete '$DESKTOP\\\\Hyperion.lnk' ")

# With cli args: SET ( CPACK_NSIS_CREATE_ICONS_EXTRA "CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\Hyperion (Debug).lnk' '$INSTDIR\\\\bin\\\\hyperiond.exe' '-d'")
#SET ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "CreateShortCut \\\"$DESKTOP\\\\Hyperion.lnk\\\" \\\"$INSTDIR\\\\bin\\\\hyperiond.exe\\\" ")
#SET ( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "Delete \\\"$DESKTOP\\\\Hyperion.lnk\\\" ")

Expand Down
Loading

0 comments on commit 978ac75

Please sign in to comment.