mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
hyperion: initial add-on
This commit is contained in:
parent
ff27133bf2
commit
49411fd61e
BIN
packages/addons/service/hyperion/icon/icon.png
Normal file
BIN
packages/addons/service/hyperion/icon/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 51 KiB |
94
packages/addons/service/hyperion/package.mk
Normal file
94
packages/addons/service/hyperion/package.mk
Normal file
@ -0,0 +1,94 @@
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - http://www.libreelec.tv
|
||||
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# LibreELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
PKG_NAME="hyperion"
|
||||
PKG_VERSION="f64b6eb"
|
||||
PKG_REV="0"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="https://github.com/tvdzwan/hyperion"
|
||||
PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz"
|
||||
PKG_DEPENDS_TARGET="toolchain Python libusb qt"
|
||||
PKG_SECTION="service"
|
||||
PKG_SHORTDESC="hyperion: an ambilight controller"
|
||||
PKG_LONGDESC="$PKG_NAME-$PKG_VERSION\nHyperion is an opensource 'AmbiLight' implementation"
|
||||
|
||||
PKG_IS_ADDON="yes"
|
||||
PKG_ADDON_NAME="Hyperion"
|
||||
PKG_ADDON_TYPE="xbmc.service"
|
||||
|
||||
PKG_MAINTAINER="Lukas Rusak (lrusak@libreelec.tv)"
|
||||
|
||||
AMLOGIC_SUPPORT="-DENABLE_AMLOGIC=0"
|
||||
DISPMANX_SUPPORT="-DENABLE_DISPMANX=0"
|
||||
FB_SUPPORT="-DENABLE_FB=1"
|
||||
X11_SUPPORT="-DENABLE_X11=0"
|
||||
|
||||
if [ "$KODIPLAYER_DRIVER" = "libamcodec" ]; then
|
||||
AMLOGIC_SUPPORT="-DENABLE_AMLOGIC=1"
|
||||
elif [ "$KODIPLAYER_DRIVER" = "bcm2835-driver" ]; then
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-driver"
|
||||
DISPMANX_SUPPORT="-DENABLE_DISPMANX=1"
|
||||
FB_SUPPORT="-DENABLE_FB=0"
|
||||
elif [ "$DISPLAYSERVER" = "x11" ]; then
|
||||
PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET xorg-server"
|
||||
X11_SUPPORT="-DENABLE_X11=1"
|
||||
fi
|
||||
|
||||
configure_target() {
|
||||
echo "" > ../cmake/FindGitVersion.cmake
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
|
||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||
-DCMAKE_PREFIX_PATH=$SYSROOT_PREFIX/usr \
|
||||
-DQT_QMAKE_EXECUTABLE=$ROOT/$TOOLCHAIN/bin/qmake \
|
||||
-DHYPERION_VERSION_ID="$PKG_VERSION" \
|
||||
$AMLOGIC_SUPPORT \
|
||||
$DISPMANX_SUPPORT \
|
||||
$FB_SUPPORT \
|
||||
-DENABLE_OSX=0 \
|
||||
-DENABLE_PROTOBUF=0 \
|
||||
-DENABLE_SPIDEV=1 \
|
||||
-DENABLE_TINKERFORGE=0 \
|
||||
-DENABLE_V4L2=0 \
|
||||
-DENABLE_WS2812BPWM=0 \
|
||||
-DENABLE_WS281XPWM=1 \
|
||||
$X11_SUPPORT \
|
||||
-DENABLE_QT5=0 \
|
||||
-DENABLE_TESTS=0 \
|
||||
-Wno-dev \
|
||||
..
|
||||
}
|
||||
|
||||
makeinstall_target() {
|
||||
: # nothing to do here
|
||||
}
|
||||
|
||||
addon() {
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||
cp -P $PKG_BUILD/.$TARGET_NAME/bin/hyperiond $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||
cp -P $PKG_BUILD/.$TARGET_NAME/bin/hyperion-remote $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/config
|
||||
cp -P $PKG_BUILD/config/hyperion.config.json $ADDON_BUILD/$PKG_ADDON_ID/config/hyperion.config.json.sample
|
||||
sed -i -e "s,/opt/hyperion/effects,/storage/.kodi/addons/service.hyperion/effects,g" \
|
||||
$ADDON_BUILD/$PKG_ADDON_ID/config/hyperion.config.json.sample
|
||||
|
||||
mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/effects
|
||||
cp -PR $PKG_BUILD/effects/* $ADDON_BUILD/$PKG_ADDON_ID/effects
|
||||
|
||||
debug_strip $ADDON_BUILD/$PKG_ADDON_ID/bin
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
diff --git a/libsrc/leddevice/LedDevicePhilipsHue.cpp b/libsrc/leddevice/LedDevicePhilipsHue.cpp
|
||||
index 332176a..81f421b 100755
|
||||
--- a/libsrc/leddevice/LedDevicePhilipsHue.cpp
|
||||
+++ b/libsrc/leddevice/LedDevicePhilipsHue.cpp
|
||||
@@ -105,10 +105,10 @@ CiColor PhilipsHueLight::rgbToCiColor(float red, float green, float blue) {
|
||||
// Convert to x,y space.
|
||||
float cx = X / (X + Y + Z);
|
||||
float cy = Y / (X + Y + Z);
|
||||
- if (isnan(cx)) {
|
||||
+ if (std::isnan(cx)) {
|
||||
cx = 0.0f;
|
||||
}
|
||||
- if (isnan(cy)) {
|
||||
+ if (std::isnan(cy)) {
|
||||
cy = 0.0f;
|
||||
}
|
||||
// Brightness is simply Y in the XYZ space.
|
24
packages/addons/service/hyperion/source/bin/hyperiond.start
Normal file
24
packages/addons/service/hyperion/source/bin/hyperiond.start
Normal file
@ -0,0 +1,24 @@
|
||||
#!/bin/sh
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - http://www.libreelec.tv
|
||||
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# LibreELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
. /etc/profile
|
||||
|
||||
oe_setup_addon service.hyperion
|
||||
|
||||
exec hyperiond $ADDON_HOME/hyperion.config.json
|
22
packages/addons/service/hyperion/source/default.py
Normal file
22
packages/addons/service/hyperion/source/default.py
Normal file
@ -0,0 +1,22 @@
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - http://www.libreelec.tv
|
||||
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# LibreELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
import xbmc
|
||||
|
||||
monitor = xbmc.Monitor()
|
||||
monitor.waitForAbort()
|
@ -0,0 +1,14 @@
|
||||
[Unit]
|
||||
Description=Hyperion service
|
||||
After=graphical.target
|
||||
ConditionPathExists=/storage/.kodi/userdata/addon_data/service.hyperion/hyperion.config.json
|
||||
|
||||
[Service]
|
||||
ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.hyperion/bin/hyperiond.start"
|
||||
TimeoutStopSec=2
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StartLimitInterval=0
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
41
tools/mkpkg/mkpkg_hyperion
Executable file
41
tools/mkpkg/mkpkg_hyperion
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/sh
|
||||
################################################################################
|
||||
# This file is part of LibreELEC - http://www.libreelec.tv
|
||||
# Copyright (C) 2009-2016 Lukas Rusak (lrusak@libreelec.tv)
|
||||
#
|
||||
# LibreELEC is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# LibreELEC is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with LibreELEC. If not, see <http://www.gnu.org/licenses/>.
|
||||
################################################################################
|
||||
|
||||
echo "getting sources..."
|
||||
if [ ! -d hyperion.git ]; then
|
||||
git clone --depth 1 --recursive https://github.com/tvdzwan/hyperion hyperion.git
|
||||
fi
|
||||
|
||||
cd hyperion.git
|
||||
git pull
|
||||
GIT_REV=`git log -n1 --format=%h`
|
||||
cd ..
|
||||
|
||||
echo "copying sources..."
|
||||
rm -rf hyperion-$GIT_REV
|
||||
cp -R hyperion.git hyperion-$GIT_REV
|
||||
|
||||
echo "cleaning sources..."
|
||||
rm -rf hyperion-$GIT_REV/.git
|
||||
|
||||
echo "packing sources..."
|
||||
tar cvJf hyperion-$GIT_REV.tar.xz hyperion-$GIT_REV
|
||||
|
||||
echo "remove temporary sourcedir..."
|
||||
rm -rf hyperion-$GIT_REV
|
Loading…
x
Reference in New Issue
Block a user