diff --git a/config/path b/config/path
index 5dbfe40ca4..686028a652 100644
--- a/config/path
+++ b/config/path
@@ -239,6 +239,8 @@ BUILD_INDENT_SIZE=4
boldwhite="\e[1;37m"
endcolor="\e[0m"
+unset LD_LIBRARY_PATH
+
# multilib? nah
unset CONFIG_SITE
diff --git a/packages/addons/addon-depends/icu/package.mk b/packages/addons/addon-depends/icu/package.mk
index 114bbc6183..7fe2e94dbc 100644
--- a/packages/addons/addon-depends/icu/package.mk
+++ b/packages/addons/addon-depends/icu/package.mk
@@ -21,7 +21,7 @@ PKG_VERSION="57.1"
PKG_ARCH="any"
PKG_LICENSE="Custom"
PKG_SITE="http://www.icu-project.org"
-PKG_URL="http://download.icu-project.org/files/${PKG_NAME}4c/${PKG_VERSION}/${PKG_NAME}4c-${PKG_VERSION//./_}-src.tgz"
+PKG_URL="https://github.com/unicode-org/icu/releases/download/release-${PKG_VERSION//./-}/${PKG_NAME}4c-${PKG_VERSION//./_}-src.tgz"
PKG_SOURCE_DIR="icu"
PKG_DEPENDS_TARGET="toolchain icu:host"
PKG_SECTION="textproc"
diff --git a/packages/addons/driver/steamcontroller/changelog.txt b/packages/addons/driver/steamcontroller/changelog.txt
deleted file mode 100644
index bac318fd4b..0000000000
--- a/packages/addons/driver/steamcontroller/changelog.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-101
-- Update to 60499dc
-- Fix cpu usage due to high polling rate
-
-100
-- Initial add-on
diff --git a/packages/addons/driver/steamcontroller/icon/icon.png b/packages/addons/driver/steamcontroller/icon/icon.png
deleted file mode 100644
index e75bb57a61..0000000000
Binary files a/packages/addons/driver/steamcontroller/icon/icon.png and /dev/null differ
diff --git a/packages/addons/driver/steamcontroller/package.mk b/packages/addons/driver/steamcontroller/package.mk
deleted file mode 100644
index 629f51597d..0000000000
--- a/packages/addons/driver/steamcontroller/package.mk
+++ /dev/null
@@ -1,66 +0,0 @@
-################################################################################
-# This file is part of LibreELEC - https://libreelec.tv
-# Copyright (C) 2016 Team LibreELEC
-#
-# 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 .
-################################################################################
-
-PKG_NAME="steamcontroller"
-PKG_VERSION="60499dc"
-PKG_REV="101"
-PKG_ARCH="any"
-PKG_LICENSE="MIT"
-PKG_SITE="https://github.com/ynsta/steamcontroller"
-PKG_URL="https://github.com/ynsta/steamcontroller/archive/$PKG_VERSION.tar.gz"
-PKG_DEPENDS_TARGET="toolchain Python distutilscross:host python-libusb1 enum34 linux:host"
-PKG_SECTION="driver"
-PKG_SHORTDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed."
-PKG_LONGDESC="A standalone userland driver for the steam controller to be used where steam client can't be installed."
-PKG_AUTORECONF="no"
-
-PKG_IS_ADDON="yes"
-PKG_ADDON_NAME="Steam Controller Driver"
-PKG_ADDON_TYPE="xbmc.service"
-
-pre_make_target() {
- export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
- export LDSHARED="$CC -shared"
-}
-
-make_target() {
- python setup.py build
-}
-
-makeinstall_target() {
- :
-}
-
-addon() {
- mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin
- cp -a $PKG_BUILD/build/scripts-2.7/* $ADDON_BUILD/$PKG_ADDON_ID/bin/
-
- mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib
- cp -a $PKG_BUILD/build/lib.linux-*-2.7/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
- cp -a $(get_build_dir python-libusb1)/build/lib/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
- cp -a $(get_build_dir enum34)/build/lib/* $ADDON_BUILD/$PKG_ADDON_ID/lib/
-
- mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/include/linux
- if [ -f "$(get_build_dir linux)/usr/include/linux/input-event-codes.h" ]; then
- cp $(get_build_dir linux)/usr/include/linux/input-event-codes.h $ADDON_BUILD/$PKG_ADDON_ID/include/linux/
- fi
- cp $(get_build_dir linux)/usr/include/linux/input.h $ADDON_BUILD/$PKG_ADDON_ID/include/linux/
-
- python -Wi -t -B $TOOLCHAIN/lib/python2.7/compileall.py $ADDON_BUILD/$PKG_ADDON_ID/lib/ -f 1>/dev/null
- find $ADDON_BUILD/$PKG_ADDON_ID/lib/ -name '*.py' -exec rm {} \;
-}
diff --git a/packages/addons/driver/steamcontroller/patches/steamcontroller-0001-fix-include-dir.patch b/packages/addons/driver/steamcontroller/patches/steamcontroller-0001-fix-include-dir.patch
deleted file mode 100644
index 5f30545cf7..0000000000
--- a/packages/addons/driver/steamcontroller/patches/steamcontroller-0001-fix-include-dir.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-commit 8da1123bcbf3ad12b6c9d7975ebbb3f8663fd166
-Author: Lukas Rusak
-Date: Sat Jan 7 13:50:30 2017 -0800
-
- fix include dir
-
-diff --git a/src/uinput.py b/src/uinput.py
-index 684a018..ffc2354 100644
---- a/src/uinput.py
-+++ b/src/uinput.py
-@@ -36,10 +36,10 @@ from steamcontroller.tools import get_so_extensions
- from collections import deque
-
- # Get All defines from linux headers
--if os.path.exists('/usr/include/linux/input-event-codes.h'):
-- CHEAD = defines('/usr/include', 'linux/input-event-codes.h')
-+if os.path.exists('/storage/.kodi/addons/driver.steamcontroller/include/linux/input-event-codes.h'):
-+ CHEAD = defines('/storage/.kodi/addons/driver.steamcontroller/include', 'linux/input-event-codes.h')
- else:
-- CHEAD = defines('/usr/include', 'linux/input.h')
-+ CHEAD = defines('/storage/.kodi/addons/driver.steamcontroller/include', 'linux/input.h')
-
- # Keys enum contains all keys and button from linux/uinput.h (KEY_* BTN_*)
- Keys = IntEnum('Keys', {i: CHEAD[i] for i in CHEAD.keys() if (i.startswith('KEY_') or
diff --git a/packages/addons/driver/steamcontroller/patches/steamcontroller-0002-append-python-path.patch b/packages/addons/driver/steamcontroller/patches/steamcontroller-0002-append-python-path.patch
deleted file mode 100644
index 9e7aa285bf..0000000000
--- a/packages/addons/driver/steamcontroller/patches/steamcontroller-0002-append-python-path.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-commit b1bcba9b73d1e5e755ef6cda014ea3cc5a5ba270
-Author: Lukas Rusak
-Date: Sat Jan 7 13:51:01 2017 -0800
-
- append python path
-
-diff --git a/scripts/sc-callbacks.py b/scripts/sc-callbacks.py
-index eaeb658..35a272a 100755
---- a/scripts/sc-callbacks.py
-+++ b/scripts/sc-callbacks.py
-@@ -25,6 +25,8 @@
- """Steam Controller Callback Mode example"""
- import sys
-
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- from steamcontroller import SteamController, SCButtons
- from steamcontroller.events import EventMapper, Pos
- from steamcontroller.uinput import Keys
-diff --git a/scripts/sc-desktop.py b/scripts/sc-desktop.py
-index 9eff430..e0b8ec7 100755
---- a/scripts/sc-desktop.py
-+++ b/scripts/sc-desktop.py
-@@ -22,6 +22,10 @@
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
-
-+import sys
-+
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- """Steam Controller Mouse, Keyboard mode"""
-
- from steamcontroller import SteamController, SCButtons
-diff --git a/scripts/sc-dump.py b/scripts/sc-dump.py
-index b6f2c24..b582771 100755
---- a/scripts/sc-dump.py
-+++ b/scripts/sc-dump.py
-@@ -25,6 +25,9 @@
- """Steam Controller USB Dumper"""
-
- import sys
-+
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- from steamcontroller import SteamController
-
- def dump(_, sci):
-diff --git a/scripts/sc-mixed.py b/scripts/sc-mixed.py
-index 4a9c3c0..5e25af9 100755
---- a/scripts/sc-mixed.py
-+++ b/scripts/sc-mixed.py
-@@ -22,6 +22,10 @@
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
-
-+import sys
-+
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- """Steam Controller XBOX360 Gamepad Emulator"""
-
- from steamcontroller import \
-diff --git a/scripts/sc-test-cmsg.py b/scripts/sc-test-cmsg.py
-index 08c8481..a59fbe9 100755
---- a/scripts/sc-test-cmsg.py
-+++ b/scripts/sc-test-cmsg.py
-@@ -26,6 +26,9 @@
-
- import sys
- import struct
-+
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- from steamcontroller import SteamController
-
- def dump(_, sci):
-diff --git a/scripts/sc-xbox.py b/scripts/sc-xbox.py
-index 814c8bc..89d4f55 100755
---- a/scripts/sc-xbox.py
-+++ b/scripts/sc-xbox.py
-@@ -22,6 +22,10 @@
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- # THE SOFTWARE.
-
-+import sys
-+
-+sys.path.append('/storage/.kodi/addons/driver.steamcontroller/lib')
-+
- """Steam Controller XBOX360 Gamepad Emulator"""
-
- from steamcontroller import \
diff --git a/packages/addons/driver/steamcontroller/patches/steamcontroller-0003-wait-for-controller-connection.patch b/packages/addons/driver/steamcontroller/patches/steamcontroller-0003-wait-for-controller-connection.patch
deleted file mode 100644
index 5dbbba38c3..0000000000
--- a/packages/addons/driver/steamcontroller/patches/steamcontroller-0003-wait-for-controller-connection.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-commit 21abfb33340ba34de9c7266568515fc42608b339
-Author: Lukas Rusak
-Date: Fri Jan 13 14:27:18 2017 -0800
-
- wait for controller
-
-diff --git a/src/__init__.py b/src/__init__.py
-index 1bf111e..353f032 100644
---- a/src/__init__.py
-+++ b/src/__init__.py
-@@ -24,7 +24,7 @@ import struct
- from enum import IntEnum
-
- from threading import Timer
--from time import time
-+from time import time, sleep
-
-
- VENDOR_ID = 0x28de
-@@ -121,24 +121,28 @@ class SteamController(object):
- self._cmsg = []
- self._ctx = usb1.USBContext()
-
-+ _handle = None
- handle = []
- pid = []
- endpoint = []
- ccidx = []
-- for i in range(len(PRODUCT_ID)):
-- _pid = PRODUCT_ID[i]
-- _endpoint = ENDPOINT[i]
-- _ccidx = CONTROLIDX[i]
--
-- _handle = self._ctx.openByVendorIDAndProductID(
-- VENDOR_ID, _pid,
-- skip_on_error=True,
-- )
-- if _handle != None:
-- handle.append(_handle)
-- pid.append(_pid)
-- endpoint.append(_endpoint)
-- ccidx.append(_ccidx)
-+
-+ while _handle is None:
-+ for i in range(len(PRODUCT_ID)):
-+ _pid = PRODUCT_ID[i]
-+ _endpoint = ENDPOINT[i]
-+ _ccidx = CONTROLIDX[i]
-+
-+ _handle = self._ctx.openByVendorIDAndProductID(
-+ VENDOR_ID, _pid,
-+ skip_on_error=True,
-+ )
-+ if _handle != None:
-+ handle.append(_handle)
-+ pid.append(_pid)
-+ endpoint.append(_endpoint)
-+ ccidx.append(_ccidx)
-+ sleep(2)
-
- if len(handle) == 0:
- raise ValueError('No SteamControler Device found')
diff --git a/packages/addons/driver/steamcontroller/patches/steamcontroller-0004-use-run-for-pid-directory.patch b/packages/addons/driver/steamcontroller/patches/steamcontroller-0004-use-run-for-pid-directory.patch
deleted file mode 100644
index d074cb6409..0000000000
--- a/packages/addons/driver/steamcontroller/patches/steamcontroller-0004-use-run-for-pid-directory.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-commit 5947f69820db3ce2d976ac533fb64319637d3f93
-Author: Lukas Rusak
-Date: Sat Jan 7 13:53:36 2017 -0800
-
- use run for pid directory
-
-diff --git a/scripts/sc-desktop.py b/scripts/sc-desktop.py
-index e0b8ec7..ad494d8 100755
---- a/scripts/sc-desktop.py
-+++ b/scripts/sc-desktop.py
-@@ -87,9 +87,9 @@ if __name__ == '__main__':
- parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
- args = parser.parse_args()
- if args.index != None:
-- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
-+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
- else:
-- daemon = SCDaemon('/tmp/steamcontroller.pid')
-+ daemon = SCDaemon('/run/steamcontroller.pid')
-
- if 'start' == args.command:
- daemon.start()
-diff --git a/scripts/sc-mixed.py b/scripts/sc-mixed.py
-index 5e25af9..c9139e7 100755
---- a/scripts/sc-mixed.py
-+++ b/scripts/sc-mixed.py
-@@ -126,9 +126,9 @@ if __name__ == '__main__':
- parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
- args = parser.parse_args()
- if args.index != None:
-- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
-+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
- else:
-- daemon = SCDaemon('/tmp/steamcontroller.pid')
-+ daemon = SCDaemon('/run/steamcontroller.pid')
-
- if 'start' == args.command:
- daemon.start()
-diff --git a/scripts/sc-xbox.py b/scripts/sc-xbox.py
-index 89d4f55..0c61b4e 100755
---- a/scripts/sc-xbox.py
-+++ b/scripts/sc-xbox.py
-@@ -86,9 +86,9 @@ if __name__ == '__main__':
- parser.add_argument('-i', '--index', type=int, choices=[0,1,2,3], default=None)
- args = parser.parse_args()
- if args.index != None:
-- daemon = SCDaemon('/tmp/steamcontroller{:d}.pid'.format(args.index))
-+ daemon = SCDaemon('/run/steamcontroller{:d}.pid'.format(args.index))
- else:
-- daemon = SCDaemon('/tmp/steamcontroller.pid')
-+ daemon = SCDaemon('/run/steamcontroller.pid')
-
- if 'start' == args.command:
- daemon.start()
diff --git a/packages/addons/driver/steamcontroller/patches/steamcontroller-0005-steam-client-will-never-be-running.patch b/packages/addons/driver/steamcontroller/patches/steamcontroller-0005-steam-client-will-never-be-running.patch
deleted file mode 100644
index 8a2061cb32..0000000000
--- a/packages/addons/driver/steamcontroller/patches/steamcontroller-0005-steam-client-will-never-be-running.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-commit 1467b7cd9d153be6680cc818b10c66967a2f0951
-Author: Lukas Rusak
-Date: Sat Jan 7 14:11:25 2017 -0800
-
- steam client will never be running
-
-diff --git a/src/daemon.py b/src/daemon.py
-index 964c765..fba7792 100644
---- a/src/daemon.py
-+++ b/src/daemon.py
-@@ -9,7 +9,6 @@ import time
- import atexit
- import signal
- import syslog
--import psutil
- import traceback
- import gc
-
-@@ -92,16 +91,12 @@ class Daemon(object):
- self.daemonize()
- syslog.syslog(syslog.LOG_INFO, '{}: started'.format(os.path.basename(sys.argv[0])))
- while True:
-- # look if steam is running
-- if len([p for p in psutil.process_iter() if p.name() == 'steam']) == 0:
-- try:
-- self.run()
-- except Exception as e: # pylint: disable=W0703
-- syslog.syslog(syslog.LOG_ERR, '{}: {!s}'.format(os.path.basename(sys.argv[0]), e))
-- syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
-- gc.collect()
-- else:
-- syslog.syslog(syslog.LOG_INFO, '{}: steam client is runing'.format(os.path.basename(sys.argv[0])))
-+ try:
-+ self.run()
-+ except Exception as e: # pylint: disable=W0703
-+ syslog.syslog(syslog.LOG_ERR, '{}: {!s}'.format(os.path.basename(sys.argv[0]), e))
-+ syslog.syslog(syslog.LOG_ERR, traceback.format_exc())
-+ gc.collect()
- time.sleep(2)
-
- def stop(self):
diff --git a/packages/addons/driver/steamcontroller/source/default.py b/packages/addons/driver/steamcontroller/source/default.py
deleted file mode 100644
index 6c6b84a8a5..0000000000
--- a/packages/addons/driver/steamcontroller/source/default.py
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-# This file is part of LibreELEC - https://libreelec.tv
-# Copyright (C) 2016 Team LibreELEC
-#
-# 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 .
-################################################################################
-
-import subprocess
-import xbmc
-import xbmcaddon
-
-
-class Monitor(xbmc.Monitor):
-
- def __init__(self, *args, **kwargs):
- xbmc.Monitor.__init__(self)
- self.id = xbmcaddon.Addon().getAddonInfo('id')
-
- def onSettingsChanged(self):
- subprocess.call(['systemctl', 'restart', self.id])
-
-
-if __name__ == '__main__':
- Monitor().waitForAbort()
diff --git a/packages/addons/driver/steamcontroller/source/system.d/driver.steamcontroller.service b/packages/addons/driver/steamcontroller/source/system.d/driver.steamcontroller.service
deleted file mode 100644
index 3ac057e4c8..0000000000
--- a/packages/addons/driver/steamcontroller/source/system.d/driver.steamcontroller.service
+++ /dev/null
@@ -1,14 +0,0 @@
-[Unit]
-Description=Steam Controller driver
-
-[Service]
-Type=forking
-ExecStart=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py start
-ExecReload=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py restart
-ExecStop=/usr/bin/python /storage/.kodi/addons/driver.steamcontroller/bin/sc-xbox.py stop
-PIDFile=/run/steamcontroller.pid
-Restart=on-failure
-RestartSec=10
-
-[Install]
-WantedBy=multi-user.target
diff --git a/packages/compress/bzip2/package.mk b/packages/compress/bzip2/package.mk
index 6a45c033e9..95cc505a8b 100644
--- a/packages/compress/bzip2/package.mk
+++ b/packages/compress/bzip2/package.mk
@@ -21,7 +21,7 @@ PKG_VERSION="1.0.6"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://www.bzip.org"
-PKG_URL="http://www.bzip.org/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_URL="https://sourceware.org/pub/bzip2/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_HOST="toolchain"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="compress"
diff --git a/packages/devel/libcec/package.mk b/packages/devel/libcec/package.mk
index 6535bc6b00..11fc693a26 100644
--- a/packages/devel/libcec/package.mk
+++ b/packages/devel/libcec/package.mk
@@ -1,73 +1,51 @@
-################################################################################
-# This file is part of OpenELEC - http://www.openelec.tv
-# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
-#
-# OpenELEC 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.
-#
-# OpenELEC 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 OpenELEC. If not, see .
-################################################################################
+# SPDX-License-Identifier: GPL-2.0-or-later
+# Copyright (C) 2009-2016 Stephan Raue (stephan@openelec.tv)
+# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="libcec"
-PKG_VERSION="2fc92b5"
-PKG_ARCH="any"
+PKG_VERSION="libcec-4.0.4"
+PKG_SHA256="4382a964bf8c511c22c03cdab5ba2d81c241536e6479072a61516966804f400a"
PKG_LICENSE="GPL"
PKG_SITE="http://libcec.pulse-eight.com/"
PKG_URL="https://github.com/Pulse-Eight/libcec/archive/$PKG_VERSION.tar.gz"
-[ "$PROJECT" = "imx6" ] && PKG_PATCH_DIRS="${LINUX#imx6-}"
-PKG_DEPENDS_TARGET="toolchain systemd lockdev p8-platform"
-PKG_SECTION="system"
-PKG_SHORTDESC="libCEC is an open-source dual licensed library designed for communicating with the Pulse-Eight USB - CEC Adaptor"
+PKG_DEPENDS_TARGET="toolchain systemd p8-platform swig:host"
PKG_LONGDESC="libCEC is an open-source dual licensed library designed for communicating with the Pulse-Eight USB - CEC Adaptor."
-PKG_IS_ADDON="no"
-PKG_AUTORECONF="no"
-
PKG_CMAKE_OPTS_TARGET="-DBUILD_SHARED_LIBS=1 \
-DCMAKE_INSTALL_LIBDIR:STRING=lib \
- -DCMAKE_INSTALL_LIBDIR_NOARCH:STRING=lib"
-
-if [ "$KODIPLAYER_DRIVER" = "bcm2835-firmware" ]; then
- PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-firmware"
+ -DCMAKE_INSTALL_LIBDIR_NOARCH:STRING=lib \
+ -DSKIP_PYTHON_WRAPPER=1 \
+ -DHAVE_IMX_API=0 \
+ -DHAVE_AOCEC_API=0 -DHAVE_AMLOGIC_API=0 \
+ -DHAVE_GIT_BIN=0"
+
+if [ "$PROJECT" = "RPi" ]; then
+ PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET bcm2835-driver"
fi
-if [ "$KODIPLAYER_DRIVER" = "libfslvpuwrap" ]; then
- PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_IMX_API=1"
-else
- PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_IMX_API=0"
+# libX11 and xrandr to read the sink's EDID, used to determine the PC's HDMI physical address
+if [ "$DISPLAYSERVER" = "x11" ]; then
+ PKG_DEPENDS_TARGET="$PKG_DEPENDS_TARGET libX11 libXrandr"
fi
-if [ "$KODIPLAYER_DRIVER" = "libamcodec" ]; then
- if [ "$TARGET_ARCH" = "aarch64" ]; then
- PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_AOCEC_API=1"
- else
- PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_AMLOGIC_API=1"
- fi
-else
- PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_AOCEC_API=0 -DHAVE_AMLOGIC_API=0"
+if [ "$CEC_FRAMEWORK_SUPPORT" = "yes" ]; then
+ PKG_PATCH_DIRS="cec-framework"
+ PKG_CMAKE_OPTS_TARGET="$PKG_CMAKE_OPTS_TARGET -DHAVE_LINUX_API=1"
fi
pre_configure_target() {
- if [ "$KODIPLAYER_DRIVER" = "bcm2835-firmware" ]; then
- export CXXFLAGS="$CXXFLAGS \
- -I$SYSROOT_PREFIX/usr/include/interface/vcos/pthreads/ \
- -I$SYSROOT_PREFIX/usr/include/interface/vmcs_host/linux"
-
+ if [ "$PROJECT" = "RPi" ]; then
# detecting RPi support fails without -lvchiq_arm
export LDFLAGS="$LDFLAGS -lvchiq_arm"
fi
}
post_makeinstall_target() {
- if [ -d $INSTALL/usr/lib/python2.7/dist-packages ]; then
- mv $INSTALL/usr/lib/python2.7/dist-packages $INSTALL/usr/lib/python2.7/site-packages
+ # Remove the Python3 demo - useless for us
+ rm -f $INSTALL/usr/bin/pyCecClient
+
+ PYTHON_DIR=$INSTALL/usr/lib/$PKG_PYTHON_VERSION
+ if [ -d $PYTHON_DIR/dist-packages ]; then
+ mv $PYTHON_DIR/dist-packages $PYTHON_DIR/site-packages
fi
}
diff --git a/packages/devel/libcec/patches/cec-framework/libcec-0001-PR380.patch b/packages/devel/libcec/patches/cec-framework/libcec-0001-PR380.patch
new file mode 100644
index 0000000000..49af7eadf3
--- /dev/null
+++ b/packages/devel/libcec/patches/cec-framework/libcec-0001-PR380.patch
@@ -0,0 +1,887 @@
+From 467cc79fd289403e7d4f6e4e817b906c0c0027dd Mon Sep 17 00:00:00 2001
+From: Jonas Karlman
+Date: Wed, 6 Sep 2017 17:37:05 +0200
+Subject: [PATCH] Add Linux CEC Adapter
+
+---
+ docs/README.linux.md | 6 +
+ include/cectypes.h | 11 +
+ src/libcec/CECTypeUtils.h | 2 +
+ src/libcec/CMakeLists.txt | 2 +
+ src/libcec/adapter/AdapterFactory.cpp | 26 +-
+ .../Linux/LinuxCECAdapterCommunication.cpp | 438 ++++++++++++++++++
+ .../Linux/LinuxCECAdapterCommunication.h | 95 ++++
+ .../Linux/LinuxCECAdapterDetection.cpp | 50 ++
+ .../adapter/Linux/LinuxCECAdapterDetection.h | 51 ++
+ src/libcec/cmake/CheckPlatformSupport.cmake | 12 +
+ src/libcec/cmake/DisplayPlatformSupport.cmake | 6 +
+ src/libcec/env.h.in | 3 +
+ 12 files changed, 700 insertions(+), 2 deletions(-)
+ create mode 100644 src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp
+ create mode 100644 src/libcec/adapter/Linux/LinuxCECAdapterCommunication.h
+ create mode 100644 src/libcec/adapter/Linux/LinuxCECAdapterDetection.cpp
+ create mode 100644 src/libcec/adapter/Linux/LinuxCECAdapterDetection.h
+
+diff --git a/docs/README.linux.md b/docs/README.linux.md
+index c59fb80..e8053cc 100644
+--- a/docs/README.linux.md
++++ b/docs/README.linux.md
+@@ -51,5 +51,11 @@ Pass the argument `-DHAVE_TDA995X_API=1` to the cmake command in the compilation
+ cmake -DHAVE_TDA995X_API=1 ..
+ ```
+
++### Linux CEC Framework (v4.10+)
++Pass the argument `-DHAVE_LINUX_API=1` to the cmake command in the compilation instructions:
++```
++cmake -DHAVE_LINUX_API=1 ..
++```
++
+ ### Debian / Ubuntu .deb packaging
+ See [docs/README.debian.md](README.debian.md).
+\ No newline at end of file
+diff --git a/include/cectypes.h b/include/cectypes.h
+index 9c91842..2c32e4d 100644
+--- a/include/cectypes.h
++++ b/include/cectypes.h
+@@ -281,6 +281,16 @@ namespace CEC {
+ */
+ #define CEC_MAX_DATA_PACKET_SIZE (16 * 4)
+
++/*!
++ * the path to use for the Linux CEC device
++ */
++#define CEC_LINUX_PATH "/dev/cec0"
++
++/*!
++ * the name of the virtual COM port to use for the Linux' CEC wire
++ */
++#define CEC_LINUX_VIRTUAL_COM "Linux"
++
+ /*!
+ * the path to use for the AOCEC HDMI CEC device
+ */
+@@ -861,6 +871,7 @@ typedef enum cec_adapter_type
+ ADAPTERTYPE_RPI = 0x100,
+ ADAPTERTYPE_TDA995x = 0x200,
+ ADAPTERTYPE_EXYNOS = 0x300,
++ ADAPTERTYPE_LINUX = 0x400,
+ ADAPTERTYPE_AOCEC = 0x500
+ } cec_adapter_type;
+
+diff --git a/src/libcec/CECTypeUtils.h b/src/libcec/CECTypeUtils.h
+index 25c1c6e..15f9543 100644
+--- a/src/libcec/CECTypeUtils.h
++++ b/src/libcec/CECTypeUtils.h
+@@ -766,6 +766,8 @@ namespace CEC
+ return "Raspberry Pi";
+ case ADAPTERTYPE_TDA995x:
+ return "TDA995x";
++ case ADAPTERTYPE_LINUX:
++ return "Linux";
+ default:
+ return "unknown";
+ }
+diff --git a/src/libcec/CMakeLists.txt b/src/libcec/CMakeLists.txt
+index 6baee69..74fe5f3 100644
+--- a/src/libcec/CMakeLists.txt
++++ b/src/libcec/CMakeLists.txt
+@@ -89,6 +89,8 @@ set(CEC_HEADERS devices/CECRecordingDevice.h
+ adapter/Exynos/ExynosCEC.h
+ adapter/Exynos/ExynosCECAdapterDetection.h
+ adapter/Exynos/ExynosCECAdapterCommunication.h
++ adapter/Linux/LinuxCECAdapterDetection.h
++ adapter/Linux/LinuxCECAdapterCommunication.h
+ adapter/AOCEC/AOCEC.h
+ adapter/AOCEC/AOCECAdapterDetection.h
+ adapter/AOCEC/AOCECAdapterCommunication.h
+diff --git a/src/libcec/adapter/AdapterFactory.cpp b/src/libcec/adapter/AdapterFactory.cpp
+index 91195ea..323c272 100644
+--- a/src/libcec/adapter/AdapterFactory.cpp
++++ b/src/libcec/adapter/AdapterFactory.cpp
+@@ -58,6 +58,11 @@
+ #include "Exynos/ExynosCECAdapterCommunication.h"
+ #endif
+
++#if defined(HAVE_LINUX_API)
++#include "Linux/LinuxCECAdapterDetection.h"
++#include "Linux/LinuxCECAdapterCommunication.h"
++#endif
++
+ #if defined(HAVE_AOCEC_API)
+ #include "AOCEC/AOCECAdapterDetection.h"
+ #include "AOCEC/AOCECAdapterCommunication.h"
+@@ -131,6 +136,18 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
+ }
+ #endif
+
++#if defined(HAVE_LINUX_API)
++ if (iAdaptersFound < iBufSize && CLinuxCECAdapterDetection::FindAdapter())
++ {
++ snprintf(deviceList[iAdaptersFound].strComPath, sizeof(deviceList[iAdaptersFound].strComPath), CEC_LINUX_PATH);
++ snprintf(deviceList[iAdaptersFound].strComName, sizeof(deviceList[iAdaptersFound].strComName), CEC_LINUX_VIRTUAL_COM);
++ deviceList[iAdaptersFound].iVendorId = 0;
++ deviceList[iAdaptersFound].iProductId = 0;
++ deviceList[iAdaptersFound].adapterType = ADAPTERTYPE_LINUX;
++ iAdaptersFound++;
++ }
++#endif
++
+ #if defined(HAVE_AOCEC_API)
+ if (iAdaptersFound < iBufSize && CAOCECAdapterDetection::FindAdapter())
+ {
+@@ -144,7 +161,7 @@ int8_t CAdapterFactory::DetectAdapters(cec_adapter_descriptor *deviceList, uint8
+ #endif
+
+
+-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_AOCEC_API)
++#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_LINUX_API) && !defined(HAVE_AOCEC_API)
+ #error "libCEC doesn't have support for any type of adapter. please check your build system or configuration"
+ #endif
+
+@@ -163,6 +180,11 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
+ return new CExynosCECAdapterCommunication(m_lib->m_cec);
+ #endif
+
++#if defined(HAVE_LINUX_API)
++ if (!strcmp(strPort, CEC_LINUX_VIRTUAL_COM))
++ return new CLinuxCECAdapterCommunication(m_lib->m_cec);
++#endif
++
+ #if defined(HAVE_AOCEC_API)
+ if (!strcmp(strPort, CEC_AOCEC_VIRTUAL_COM))
+ return new CAOCECAdapterCommunication(m_lib->m_cec);
+@@ -177,7 +199,7 @@ IAdapterCommunication *CAdapterFactory::GetInstance(const char *strPort, uint16_
+ return new CUSBCECAdapterCommunication(m_lib->m_cec, strPort, iBaudRate);
+ #endif
+
+-#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_AOCEC_API)
++#if !defined(HAVE_RPI_API) && !defined(HAVE_P8_USB) && !defined(HAVE_TDA995X_API) && !defined(HAVE_EXYNOS_API) && !defined(HAVE_LINUX_API) && !defined(HAVE_AOCEC_API)
+ return NULL;
+ #endif
+ }
+diff --git a/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp b/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp
+new file mode 100644
+index 0000000..6a28835
+--- /dev/null
++++ b/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.cpp
+@@ -0,0 +1,438 @@
++/*
++ * This file is part of the libCEC(R) library.
++ *
++ * libCEC Linux CEC Adapter is Copyright (C) 2017-2019 Jonas Karlman
++ * based heavily on:
++ * libCEC AOCEC Code is Copyright (C) 2016 Gerald Dachs
++ * libCEC Exynos Code is Copyright (C) 2014 Valentin Manea
++ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
++ * libCEC(R) is an original work, containing original code.
++ *
++ * libCEC(R) is a trademark of Pulse-Eight Limited.
++ *
++ * This program is dual-licensed; 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.
++ *
++ * This program 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 this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ *
++ * Alternatively, you can license this library under a commercial license,
++ * please contact Pulse-Eight Licensing for more information.
++ *
++ * For more information contact:
++ * Pulse-Eight Licensing
++ * http://www.pulse-eight.com/
++ * http://www.pulse-eight.net/
++ */
++
++#include "env.h"
++#include
++#include
++
++#if defined(HAVE_LINUX_API)
++#include "LinuxCECAdapterCommunication.h"
++#include "CECTypeUtils.h"
++#include "LibCEC.h"
++#include "p8-platform/util/buffer.h"
++#include
++
++using namespace CEC;
++using namespace P8PLATFORM;
++
++#define LIB_CEC m_callback->GetLib()
++
++// Required capabilities
++#define CEC_LINUX_CAPABILITIES (CEC_CAP_LOG_ADDRS | CEC_CAP_TRANSMIT | CEC_CAP_PASSTHROUGH)
++
++CLinuxCECAdapterCommunication::CLinuxCECAdapterCommunication(IAdapterCommunicationCallback *callback)
++ : IAdapterCommunication(callback)
++{
++ m_fd = INVALID_SOCKET_VALUE;
++}
++
++CLinuxCECAdapterCommunication::~CLinuxCECAdapterCommunication(void)
++{
++ Close();
++}
++
++bool CLinuxCECAdapterCommunication::Open(uint32_t UNUSED(iTimeoutMs), bool UNUSED(bSkipChecks), bool bStartListening)
++{
++ if (IsOpen())
++ Close();
++
++ if ((m_fd = open(CEC_LINUX_PATH, O_RDWR)) >= 0)
++ {
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Open - m_fd=%d bStartListening=%d", m_fd, bStartListening);
++
++ // Ensure the CEC device supports required capabilities
++ struct cec_caps caps = {};
++ if (ioctl(m_fd, CEC_ADAP_G_CAPS, &caps) || (caps.capabilities & CEC_LINUX_CAPABILITIES) != CEC_LINUX_CAPABILITIES)
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_G_CAPS failed - capabilities=%02x errno=%d", caps.capabilities, errno);
++ Close();
++ return false;
++ }
++
++ if (!bStartListening)
++ {
++ Close();
++ return true;
++ }
++
++ // This is an exclusive follower, in addition put the CEC device into passthrough mode
++ uint32_t mode = CEC_MODE_INITIATOR | CEC_MODE_EXCL_FOLLOWER_PASSTHRU;
++ if (ioctl(m_fd, CEC_S_MODE, &mode))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Open - ioctl CEC_S_MODE failed - errno=%d", errno);
++ Close();
++ return false;
++ }
++
++ uint16_t addr;
++ if (ioctl(m_fd, CEC_ADAP_G_PHYS_ADDR, &addr))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_G_PHYS_ADDR failed - errno=%d", errno);
++ Close();
++ return false;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_G_PHYS_ADDR - addr=%04x", addr);
++
++ if (addr == CEC_PHYS_ADDR_INVALID)
++ LIB_CEC->AddLog(CEC_LOG_WARNING, "CLinuxCECAdapterCommunication::Open - physical address is invalid");
++
++ // Clear existing logical addresses and set the CEC device to the unconfigured state
++ struct cec_log_addrs log_addrs = {};
++ if (ioctl(m_fd, CEC_ADAP_S_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS failed - errno=%d", errno);
++ Close();
++ return false;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=%04x num_log_addrs=%u", log_addrs.log_addr_mask, log_addrs.num_log_addrs);
++
++ // Set logical address to unregistered, without any logical address configured no messages is transmitted or received
++ log_addrs = {};
++ log_addrs.cec_version = CEC_OP_CEC_VERSION_1_4;
++ log_addrs.vendor_id = CEC_VENDOR_PULSE_EIGHT;
++ log_addrs.num_log_addrs = 1;
++ log_addrs.flags = CEC_LOG_ADDRS_FL_ALLOW_UNREG_FALLBACK;
++ log_addrs.log_addr[0] = CEC_LOG_ADDR_UNREGISTERED;
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_SWITCH;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_UNREGISTERED;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_SWITCH;
++ if (ioctl(m_fd, CEC_ADAP_S_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS failed - errno=%d", errno);
++ Close();
++ return false;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Open - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=%04x num_log_addrs=%u", log_addrs.log_addr_mask, log_addrs.num_log_addrs);
++
++ if (CreateThread())
++ return true;
++
++ Close();
++ }
++
++ return false;
++}
++
++void CLinuxCECAdapterCommunication::Close(void)
++{
++ StopThread(0);
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Close - m_fd=%d", m_fd);
++
++ close(m_fd);
++ m_fd = INVALID_SOCKET_VALUE;
++}
++
++bool CLinuxCECAdapterCommunication::IsOpen(void)
++{
++ return m_fd != INVALID_SOCKET_VALUE;
++}
++
++cec_adapter_message_state CLinuxCECAdapterCommunication::Write(const cec_command &data, bool &bRetry, uint8_t UNUSED(iLineTimeout), bool UNUSED(bIsReply))
++{
++ if (IsOpen())
++ {
++ struct cec_msg msg;
++ cec_msg_init(&msg, data.initiator, data.destination);
++
++ if (data.opcode_set)
++ {
++ msg.msg[msg.len++] = data.opcode;
++
++ if (data.parameters.size)
++ {
++ memcpy(&msg.msg[msg.len], data.parameters.data, data.parameters.size);
++ msg.len += data.parameters.size;
++ }
++ }
++
++ if (ioctl(m_fd, CEC_TRANSMIT, &msg))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT failed - tx_status=%02x errno=%d", msg.tx_status, errno);
++ return ADAPTER_MESSAGE_STATE_ERROR;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Write - ioctl CEC_TRANSMIT - tx_status=%02x len=%d addr=%02x opcode=%02x", msg.tx_status, msg.len, msg.msg[0], cec_msg_opcode(&msg));
++
++ // The CEC driver will make re-transmission attempts
++ bRetry = false;
++
++ if (msg.tx_status & CEC_TX_STATUS_OK)
++ return ADAPTER_MESSAGE_STATE_SENT_ACKED;
++
++ if (msg.tx_status & CEC_TX_STATUS_NACK)
++ return ADAPTER_MESSAGE_STATE_SENT_NOT_ACKED;
++
++ return ADAPTER_MESSAGE_STATE_ERROR;
++ }
++
++ return ADAPTER_MESSAGE_STATE_UNKNOWN;
++}
++
++bool CLinuxCECAdapterCommunication::SetLogicalAddresses(const cec_logical_addresses &addresses)
++{
++ if (IsOpen())
++ {
++ struct cec_log_addrs log_addrs = {};
++ if (ioctl(m_fd, CEC_ADAP_G_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_G_LOG_ADDRS failed - errno=%d", errno);
++ return false;
++ }
++
++ // TODO: Claiming a logical address will only work when CEC device has a valid physical address
++
++ // Clear existing logical addresses and set the CEC device to the unconfigured state
++ if (log_addrs.num_log_addrs)
++ {
++ log_addrs = {};
++ if (ioctl(m_fd, CEC_ADAP_S_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS failed - errno=%d", errno);
++ return false;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=%04x num_log_addrs=%u", log_addrs.log_addr_mask, log_addrs.num_log_addrs);
++ }
++
++ if (!addresses.IsEmpty())
++ {
++ // NOTE: This can only be configured when num_log_addrs > 0
++ // and gets reset when num_log_addrs = 0
++ log_addrs.cec_version = CEC_OP_CEC_VERSION_1_4;
++ log_addrs.vendor_id = CEC_VENDOR_PULSE_EIGHT;
++
++ // TODO: Support more then the primary logical address
++ log_addrs.num_log_addrs = 1;
++ log_addrs.log_addr[0] = addresses.primary;
++
++ switch (addresses.primary)
++ {
++ case CECDEVICE_AUDIOSYSTEM:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_AUDIOSYSTEM;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_AUDIOSYSTEM;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_AUDIOSYSTEM;
++ break;
++ case CECDEVICE_PLAYBACKDEVICE1:
++ case CECDEVICE_PLAYBACKDEVICE2:
++ case CECDEVICE_PLAYBACKDEVICE3:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_PLAYBACK;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_PLAYBACK;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_PLAYBACK;
++ break;
++ case CECDEVICE_RECORDINGDEVICE1:
++ case CECDEVICE_RECORDINGDEVICE2:
++ case CECDEVICE_RECORDINGDEVICE3:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_RECORD;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_RECORD;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_RECORD;
++ break;
++ case CECDEVICE_TUNER1:
++ case CECDEVICE_TUNER2:
++ case CECDEVICE_TUNER3:
++ case CECDEVICE_TUNER4:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_TUNER;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_TUNER;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_TUNER;
++ break;
++ case CECDEVICE_TV:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_TV;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_TV;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_TV;
++ break;
++ default:
++ log_addrs.primary_device_type[0] = CEC_OP_PRIM_DEVTYPE_SWITCH;
++ log_addrs.log_addr_type[0] = CEC_LOG_ADDR_TYPE_UNREGISTERED;
++ log_addrs.all_device_types[0] = CEC_OP_ALL_DEVTYPE_SWITCH;
++ break;
++ }
++ }
++ else
++ log_addrs.num_log_addrs = 0;
++
++ if (ioctl(m_fd, CEC_ADAP_S_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS failed - errno=%d", errno);
++ return false;
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::SetLogicalAddresses - ioctl CEC_ADAP_S_LOG_ADDRS - log_addr_mask=%04x num_log_addrs=%u", log_addrs.log_addr_mask, log_addrs.num_log_addrs);
++
++ if (log_addrs.num_log_addrs && !log_addrs.log_addr_mask)
++ return false;
++
++ return true;
++ }
++
++ return false;
++}
++
++cec_logical_addresses CLinuxCECAdapterCommunication::GetLogicalAddresses(void) const
++{
++ cec_logical_addresses addresses;
++ addresses.Clear();
++
++ if (m_fd != INVALID_SOCKET_VALUE)
++ {
++ struct cec_log_addrs log_addrs = {};
++ if (ioctl(m_fd, CEC_ADAP_G_LOG_ADDRS, &log_addrs))
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::GetLogicalAddresses - ioctl CEC_ADAP_G_LOG_ADDRS failed - errno=%d", errno);
++ return addresses;
++ }
++
++ for (int i = 0; i < log_addrs.num_log_addrs; i++)
++ addresses.Set(cec_logical_address(log_addrs.log_addr[i]));
++ }
++
++ return addresses;
++}
++
++uint16_t CLinuxCECAdapterCommunication::GetPhysicalAddress(void)
++{
++ if (IsOpen())
++ {
++ uint16_t addr;
++ if (!ioctl(m_fd, CEC_ADAP_G_PHYS_ADDR, &addr))
++ return addr;
++
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::GetPhysicalAddress - ioctl CEC_ADAP_G_PHYS_ADDR failed - errno=%d", errno);
++ }
++
++ return CEC_INVALID_PHYSICAL_ADDRESS;
++}
++
++cec_vendor_id CLinuxCECAdapterCommunication::GetVendorId(void)
++{
++ if (IsOpen())
++ {
++ struct cec_log_addrs log_addrs = {};
++ if (!ioctl(m_fd, CEC_ADAP_G_LOG_ADDRS, &log_addrs))
++ return cec_vendor_id(log_addrs.vendor_id);
++
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::GetVendorId - ioctl CEC_ADAP_G_LOG_ADDRS failed - errno=%d", errno);
++ }
++
++ return CEC_VENDOR_UNKNOWN;
++}
++
++void *CLinuxCECAdapterCommunication::Process(void)
++{
++ CTimeout phys_addr_timeout;
++ bool phys_addr_changed = false;
++ uint16_t phys_addr = CEC_INVALID_PHYSICAL_ADDRESS;
++ fd_set rd_fds;
++ fd_set ex_fds;
++
++ while (!IsStopped())
++ {
++ struct timeval timeval = {};
++ timeval.tv_sec = 1;
++
++ FD_ZERO(&rd_fds);
++ FD_ZERO(&ex_fds);
++ FD_SET(m_fd, &rd_fds);
++ FD_SET(m_fd, &ex_fds);
++
++ if (select(m_fd + 1, &rd_fds, NULL, &ex_fds, &timeval) < 0)
++ {
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Process - select failed - errno=%d", errno);
++ break;
++ }
++
++ if (FD_ISSET(m_fd, &ex_fds))
++ {
++ struct cec_event ev = {};
++ if (ioctl(m_fd, CEC_DQEVENT, &ev))
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Process - ioctl CEC_DQEVENT failed - errno=%d", errno);
++ else if (ev.event == CEC_EVENT_STATE_CHANGE)
++ {
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Process - CEC_DQEVENT - CEC_EVENT_STATE_CHANGE - log_addr_mask=%04x phys_addr=%04x", ev.state_change.log_addr_mask, ev.state_change.phys_addr);
++
++ // TODO: handle ev.state_change.log_addr_mask change
++
++ phys_addr = ev.state_change.phys_addr;
++ phys_addr_changed = true;
++
++ if (ev.state_change.phys_addr == CEC_PHYS_ADDR_INVALID)
++ {
++ // Debounce change to invalid physical address with 2 seconds because
++ // EDID refresh and other events may cause short periods of invalid physical address
++ phys_addr_timeout.Init(2000);
++ }
++ else
++ {
++ // Debounce change to valid physical address with 500 ms when no logical address have been claimed
++ phys_addr_timeout.Init(ev.state_change.log_addr_mask ? 0 : 500);
++ }
++ }
++ }
++
++ if (phys_addr_changed && !phys_addr_timeout.TimeLeft() && !IsStopped())
++ {
++ phys_addr_changed = false;
++ m_callback->HandlePhysicalAddressChanged(phys_addr);
++ }
++
++ if (FD_ISSET(m_fd, &rd_fds))
++ {
++ struct cec_msg msg = {};
++ if (ioctl(m_fd, CEC_RECEIVE, &msg))
++ LIB_CEC->AddLog(CEC_LOG_ERROR, "CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE failed - rx_status=%02x errno=%d", msg.rx_status, errno);
++ else if (msg.len > 0)
++ {
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Process - ioctl CEC_RECEIVE - rx_status=%02x len=%d addr=%02x opcode=%02x", msg.rx_status, msg.len, msg.msg[0], cec_msg_opcode(&msg));
++
++ cec_command cmd;
++ cmd.PushArray(msg.len, msg.msg);
++
++ if (!IsStopped())
++ m_callback->OnCommandReceived(cmd);
++ }
++ }
++
++ if (!IsStopped())
++ Sleep(5);
++ }
++
++ LIB_CEC->AddLog(CEC_LOG_DEBUG, "CLinuxCECAdapterCommunication::Process - stopped - m_fd=%d", m_fd);
++ return 0;
++}
++
++#endif
+diff --git a/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.h b/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.h
+new file mode 100644
+index 0000000..f4fac87
+--- /dev/null
++++ b/src/libcec/adapter/Linux/LinuxCECAdapterCommunication.h
+@@ -0,0 +1,95 @@
++#pragma once
++/*
++ * This file is part of the libCEC(R) library.
++ *
++ * libCEC Linux CEC Adapter is Copyright (C) 2017-2018 Jonas Karlman
++ * based heavily on:
++ * libCEC AOCEC Code is Copyright (C) 2016 Gerald Dachs
++ * libCEC Exynos Code is Copyright (C) 2014 Valentin Manea
++ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
++ * libCEC(R) is an original work, containing original code.
++ *
++ * libCEC(R) is a trademark of Pulse-Eight Limited.
++ *
++ * This program is dual-licensed; 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.
++ *
++ * This program 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 this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ *
++ * Alternatively, you can license this library under a commercial license,
++ * please contact Pulse-Eight Licensing for more information.
++ *
++ * For more information contact:
++ * Pulse-Eight Licensing
++ * http://www.pulse-eight.com/
++ * http://www.pulse-eight.net/
++ */
++
++#include "env.h"
++
++#if defined(HAVE_LINUX_API)
++#include "p8-platform/threads/threads.h"
++#include "../AdapterCommunication.h"
++
++namespace CEC
++{
++ class CLinuxCECAdapterCommunication : public IAdapterCommunication, public P8PLATFORM::CThread
++ {
++ public:
++ /*!
++ * @brief Create a new Linux CEC communication handler.
++ * @param callback The callback to use for incoming CEC commands.
++ */
++ CLinuxCECAdapterCommunication(IAdapterCommunicationCallback *callback);
++ virtual ~CLinuxCECAdapterCommunication(void);
++
++ /** @name IAdapterCommunication implementation */
++ ///{
++ bool Open(uint32_t iTimeoutMs = CEC_DEFAULT_CONNECT_TIMEOUT, bool bSkipChecks = false, bool bStartListening = true) override;
++ void Close(void) override;
++ bool IsOpen(void) override;
++ cec_adapter_message_state Write(const cec_command &data, bool &bRetry, uint8_t iLineTimeout, bool bIsReply) override;
++
++ bool SetLineTimeout(uint8_t UNUSED(iTimeout)) override { return true; }
++ bool StartBootloader(void) override { return false; }
++ bool SetLogicalAddresses(const cec_logical_addresses &addresses) override;
++ cec_logical_addresses GetLogicalAddresses(void) const override;
++ bool PingAdapter(void) override { return true; }
++ uint16_t GetFirmwareVersion(void) override { return 0; }
++ uint32_t GetFirmwareBuildDate(void) override { return 0; }
++ bool IsRunningLatestFirmware(void) override { return true; }
++ bool SetControlledMode(bool UNUSED(controlled)) override { return true; }
++ bool PersistConfiguration(const libcec_configuration & UNUSED(configuration)) override { return false; }
++ bool SetAutoMode(bool UNUSED(automode)) override { return false; }
++ bool GetConfiguration(libcec_configuration & UNUSED(configuration)) override { return false; }
++ std::string GetPortName(void) override { return std::string("LINUX"); }
++ uint16_t GetPhysicalAddress(void) override;
++ cec_vendor_id GetVendorId(void) override;
++ bool SupportsSourceLogicalAddress(const cec_logical_address address) override { return address > CECDEVICE_TV && address <= CECDEVICE_BROADCAST; }
++ cec_adapter_type GetAdapterType(void) override { return ADAPTERTYPE_LINUX; }
++ uint16_t GetAdapterVendorId(void) const override { return 1; }
++ uint16_t GetAdapterProductId(void) const override { return 1; }
++ void SetActiveSource(bool UNUSED(bSetTo), bool UNUSED(bClientUnregistered)) override {}
++ ///}
++
++ /** @name P8PLATFORM::CThread implementation */
++ ///{
++ void *Process(void) override;
++ ///}
++
++ private:
++ int m_fd;
++ };
++};
++
++#endif
+diff --git a/src/libcec/adapter/Linux/LinuxCECAdapterDetection.cpp b/src/libcec/adapter/Linux/LinuxCECAdapterDetection.cpp
+new file mode 100644
+index 0000000..7b72238
+--- /dev/null
++++ b/src/libcec/adapter/Linux/LinuxCECAdapterDetection.cpp
+@@ -0,0 +1,50 @@
++/*
++ * This file is part of the libCEC(R) library.
++ *
++ * libCEC Linux CEC Adapter is Copyright (C) 2017 Jonas Karlman
++ * based heavily on:
++ * libCEC AOCEC Code is Copyright (C) 2016 Gerald Dachs
++ * libCEC Exynos Code is Copyright (C) 2014 Valentin Manea
++ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
++ * libCEC(R) is an original work, containing original code.
++ *
++ * libCEC(R) is a trademark of Pulse-Eight Limited.
++ *
++ * This program is dual-licensed; 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.
++ *
++ * This program 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 this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ *
++ * Alternatively, you can license this library under a commercial license,
++ * please contact Pulse-Eight Licensing for more information.
++ *
++ * For more information contact:
++ * Pulse-Eight Licensing
++ * http://www.pulse-eight.com/
++ * http://www.pulse-eight.net/
++ */
++
++#include "env.h"
++#include
++
++#if defined(HAVE_LINUX_API)
++#include "LinuxCECAdapterDetection.h"
++
++using namespace CEC;
++
++bool CLinuxCECAdapterDetection::FindAdapter(void)
++{
++ return access(CEC_LINUX_PATH, 0) == 0;
++}
++
++#endif
+diff --git a/src/libcec/adapter/Linux/LinuxCECAdapterDetection.h b/src/libcec/adapter/Linux/LinuxCECAdapterDetection.h
+new file mode 100644
+index 0000000..f5ea2c4
+--- /dev/null
++++ b/src/libcec/adapter/Linux/LinuxCECAdapterDetection.h
+@@ -0,0 +1,51 @@
++#pragma once
++/*
++ * This file is part of the libCEC(R) library.
++ *
++ * libCEC Linux CEC Adapter is Copyright (C) 2017 Jonas Karlman
++ * based heavily on:
++ * libCEC AOCEC Code is Copyright (C) 2016 Gerald Dachs
++ * libCEC Exynos Code is Copyright (C) 2014 Valentin Manea
++ * libCEC(R) is Copyright (C) 2011-2015 Pulse-Eight Limited. All rights reserved.
++ * libCEC(R) is an original work, containing original code.
++ *
++ * libCEC(R) is a trademark of Pulse-Eight Limited.
++ *
++ * This program is dual-licensed; 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.
++ *
++ * This program 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 this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
++ *
++ *
++ * Alternatively, you can license this library under a commercial license,
++ * please contact Pulse-Eight Licensing for more information.
++ *
++ * For more information contact:
++ * Pulse-Eight Licensing
++ * http://www.pulse-eight.com/
++ * http://www.pulse-eight.net/
++ */
++
++#include "env.h"
++
++#if defined(HAVE_LINUX_API)
++
++namespace CEC
++{
++ class CLinuxCECAdapterDetection
++ {
++ public:
++ static bool FindAdapter(void);
++ };
++};
++
++#endif
+diff --git a/src/libcec/cmake/CheckPlatformSupport.cmake b/src/libcec/cmake/CheckPlatformSupport.cmake
+index 2d7102f..dacca0f 100644
+--- a/src/libcec/cmake/CheckPlatformSupport.cmake
++++ b/src/libcec/cmake/CheckPlatformSupport.cmake
+@@ -9,6 +9,7 @@
+ # HAVE_RPI_API ON if Raspberry Pi is supported
+ # HAVE_TDA995X_API ON if TDA995X is supported
+ # HAVE_EXYNOS_API ON if Exynos is supported
++# HAVE_LINUX_API ON if Linux is supported
+ # HAVE_AOCEC_API ON if AOCEC is supported
+ # HAVE_P8_USB ON if Pulse-Eight devices are supported
+ # HAVE_P8_USB_DETECT ON if Pulse-Eight devices can be auto-detected
+@@ -30,6 +31,7 @@ SET(HAVE_LIBUDEV OFF CACHE BOOL "udev not supported")
+ SET(HAVE_RPI_API OFF CACHE BOOL "raspberry pi not supported")
+ SET(HAVE_TDA995X_API OFF CACHE BOOL "tda995x not supported")
+ SET(HAVE_EXYNOS_API OFF CACHE BOOL "exynos not supported")
++SET(HAVE_LINUX_API OFF CACHE BOOL "linux not supported")
+ SET(HAVE_AOCEC_API OFF CACHE BOOL "aocec not supported")
+ # Pulse-Eight devices are always supported
+ set(HAVE_P8_USB ON CACHE BOOL "p8 usb-cec supported" FORCE)
+@@ -139,6 +141,16 @@ else()
+ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_EXYNOS})
+ endif()
+
++ # Linux
++ if (${HAVE_LINUX_API})
++ set(LIB_INFO "${LIB_INFO}, Linux")
++ SET(HAVE_LINUX_API ON CACHE BOOL "linux supported" FORCE)
++ set(CEC_SOURCES_ADAPTER_LINUX adapter/Linux/LinuxCECAdapterDetection.cpp
++ adapter/Linux/LinuxCECAdapterCommunication.cpp)
++ source_group("Source Files\\adapter\\Linux" FILES ${CEC_SOURCES_ADAPTER_LINUX})
++ list(APPEND CEC_SOURCES ${CEC_SOURCES_ADAPTER_LINUX})
++ endif()
++
+ # AOCEC
+ if (${HAVE_AOCEC_API})
+ set(LIB_INFO "${LIB_INFO}, AOCEC")
+diff --git a/src/libcec/cmake/DisplayPlatformSupport.cmake b/src/libcec/cmake/DisplayPlatformSupport.cmake
+index 83a778a..f47b1f7 100644
+--- a/src/libcec/cmake/DisplayPlatformSupport.cmake
++++ b/src/libcec/cmake/DisplayPlatformSupport.cmake
+@@ -44,6 +44,12 @@ else()
+ message(STATUS "DRM support: no")
+ endif()
+
++if (HAVE_LINUX_API)
++ message(STATUS "Linux support: yes")
++else()
++ message(STATUS "Linux support: no")
++endif()
++
+ if (HAVE_AOCEC_API)
+ message(STATUS "AOCEC support: yes")
+ else()
+diff --git a/src/libcec/env.h.in b/src/libcec/env.h.in
+index 456a2e7..71895a8 100644
+--- a/src/libcec/env.h.in
++++ b/src/libcec/env.h.in
+@@ -76,6 +76,9 @@
+ /* Define to 1 for Exynos support */
+ #cmakedefine HAVE_EXYNOS_API @HAVE_EXYNOS_API@
+
++/* Define to 1 for Linux support */
++#cmakedefine HAVE_LINUX_API @HAVE_LINUX_API@
++
+ /* Define to 1 for AOCEC support */
+ #cmakedefine HAVE_AOCEC_API @HAVE_AOCEC_API@
+
diff --git a/packages/devel/popt/package.mk b/packages/devel/popt/package.mk
index 10155538ce..a4a54c93d9 100644
--- a/packages/devel/popt/package.mk
+++ b/packages/devel/popt/package.mk
@@ -21,7 +21,7 @@ PKG_VERSION="1.16"
PKG_ARCH="any"
PKG_LICENSE="GPL"
PKG_SITE="http://rpm5.org/files/popt/"
-PKG_URL="http://rpm5.org/files/popt/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_URL="http://ftp.rpm.org/mirror/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="devel"
PKG_SHORTDESC="popt: library for parsing command line options."
diff --git a/packages/mediacenter/plexht/package.mk b/packages/mediacenter/plexht/package.mk
index 2f2ca0cfd9..20b4af5df4 100644
--- a/packages/mediacenter/plexht/package.mk
+++ b/packages/mediacenter/plexht/package.mk
@@ -202,6 +202,7 @@ if [ "$KODIPLAYER_DRIVER" = bcm2835-driver ]; then
-DENABLE_PYTHON=ON \
-DEXTERNAL_PYTHON_HOME="$SYSROOT_PREFIX/usr" \
-DPYTHON_EXEC="$PYTHON_EXEC" \
+ -DPYTHON_INCLUDE_DIRS=$SYSROOT_PREFIX/usr/include/python2.7 \
-DSWIG_EXECUTABLE=`which swig` \
-DSWIG_DIR="$BUILD/toolchain" \
-DCMAKE_PREFIX_PATH="$SYSROOT_PREFIX" \
@@ -223,6 +224,7 @@ elif [ "$KODIPLAYER_DRIVER" = libamcodec ]; then
-DENABLE_PYTHON=ON \
-DEXTERNAL_PYTHON_HOME="$SYSROOT_PREFIX/usr" \
-DPYTHON_EXEC="$PYTHON_EXEC" \
+ -DPYTHON_INCLUDE_DIRS=$SYSROOT_PREFIX/usr/include/python2.7 \
-DSWIG_EXECUTABLE=`which swig` \
-DSWIG_DIR="$BUILD/toolchain" \
-DCMAKE_PREFIX_PATH="$SYSROOT_PREFIX" \
@@ -241,9 +243,10 @@ elif [ "$KODIPLAYER_DRIVER" = libamcodec ]; then
else
export PYTHON_EXEC="$SYSROOT_PREFIX/usr/bin/python2.7"
cmake -G Ninja -DCMAKE_TOOLCHAIN_FILE=$CMAKE_CONF \
- -DENABLE_PYTHON=ON \
+ -DENABLE_PYTHON=OFF \
-DEXTERNAL_PYTHON_HOME="$SYSROOT_PREFIX/usr" \
-DPYTHON_EXEC="$PYTHON_EXEC" \
+ -DPYTHON_INCLUDE_DIRS=$SYSROOT_PREFIX/usr/include/python2.7 \
-DSWIG_EXECUTABLE=`which swig` \
-DSWIG_DIR="$BUILD/toolchain" \
-DCMAKE_PREFIX_PATH="$SYSROOT_PREFIX" \
diff --git a/packages/python/audio/onkyo-eiscp/package.mk b/packages/python/audio/onkyo-eiscp/package.mk
new file mode 100644
index 0000000000..94b278f47b
--- /dev/null
+++ b/packages/python/audio/onkyo-eiscp/package.mk
@@ -0,0 +1,31 @@
+PKG_NAME="onkyo-eiscp"
+PKG_VERSION="1.2.7"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="http://pypi.org/project/onkyo-eiscp/"
+PKG_URL="http://pypi.python.org/packages/source/o/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_DEPENDS_TARGET="toolchain Python"
+PKG_SECTION="python/system"
+PKG_SHORTDESC="This is a Python library to control and interact with Onkyo receivers over the network."
+PKG_LONGDESC="This is a Python library to control and interact with Onkyo receivers over the network. It is also a ready-made command line script you can use without knowing how to program. Finally, this repository contains a YAML file containing all the commands defined by the Onkyo protocol, automatically generated by parsing the official documentation."
+
+PKG_IS_ADDON="no"
+PKG_AUTORECONF="no"
+
+pre_make_target() {
+ strip_lto
+ export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
+}
+
+make_target() {
+ python setup.py build --cross-compile
+}
+
+makeinstall_target() {
+ python setup.py install --root=$INSTALL --prefix=/usr
+}
+
+post_makeinstall_target() {
+ find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
+ rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
+}
diff --git a/packages/python/devel/docopt/package.mk b/packages/python/devel/docopt/package.mk
new file mode 100644
index 0000000000..95635f999e
--- /dev/null
+++ b/packages/python/devel/docopt/package.mk
@@ -0,0 +1,31 @@
+PKG_NAME="docopt"
+PKG_VERSION="0.6.2"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="https://pypi.org/project/docopt/"
+PKG_URL="http://pypi.python.org/packages/source/d/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_DEPENDS_TARGET="toolchain Python"
+PKG_SECTION="python/system"
+PKG_SHORTDESC="docopt creates beautiful command-line interfaces"
+PKG_LONGDESC="You know what’s awesome? It’s when the option parser is generated based on the beautiful help message that you write yourself! This way you don’t need to write this stupid repeatable parser-code, and instead can write only the help message–the way you want it."
+
+PKG_IS_ADDON="no"
+PKG_AUTORECONF="no"
+
+pre_make_target() {
+ strip_lto
+ export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
+}
+
+make_target() {
+ python setup.py build --cross-compile
+}
+
+makeinstall_target() {
+ python setup.py install --root=$INSTALL --prefix=/usr
+}
+
+post_makeinstall_target() {
+ find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
+ rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
+}
diff --git a/packages/python/system/netifaces/package.mk b/packages/python/system/netifaces/package.mk
new file mode 100644
index 0000000000..68666064fd
--- /dev/null
+++ b/packages/python/system/netifaces/package.mk
@@ -0,0 +1,31 @@
+PKG_NAME="netifaces"
+PKG_VERSION="0.10.9"
+PKG_ARCH="any"
+PKG_LICENSE="OSS"
+PKG_SITE="http://pypi.org/project/netifaces/"
+PKG_URL="http://pypi.python.org/packages/source/n/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz"
+PKG_DEPENDS_TARGET="toolchain Python"
+PKG_SECTION="python/system"
+PKG_SHORTDESC="Portable network interface information."
+PKG_LONGDESC="It’s been annoying me for some time that there’s no easy way to get the address(es) of the machine’s network interfaces from Python."
+
+PKG_IS_ADDON="no"
+PKG_AUTORECONF="no"
+
+pre_make_target() {
+ strip_lto
+ export PYTHONXCPREFIX="$SYSROOT_PREFIX/usr"
+}
+
+make_target() {
+ python setup.py build --cross-compile
+}
+
+makeinstall_target() {
+ python setup.py install --root=$INSTALL --prefix=/usr
+}
+
+post_makeinstall_target() {
+ find $INSTALL/usr/lib -name "*.py" -exec rm -rf "{}" ";"
+ rm -rf $INSTALL/usr/lib/python*/site-packages/*/tests
+}