diff --git a/packages/addons/addon-depends/bash/package.mk b/packages/addons/addon-depends/bash/package.mk new file mode 100644 index 0000000000..112de1bc82 --- /dev/null +++ b/packages/addons/addon-depends/bash/package.mk @@ -0,0 +1,43 @@ +################################################################################ +# 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="bash" +PKG_VERSION="4.3.46" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.gnu.org/software/bash/bash.html" +PKG_URL="ftp://ftp.cwru.edu/pub/$PKG_NAME/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_PRIORITY="optional" +PKG_SECTION="devel" +PKG_SHORTDESC="The GNU Bourne Again shell" +PKG_LONGDESC="The GNU Bourne Again shell" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +PKG_CONFIGURE_OPTS_TARGET="--enable-static \ + --disable-shared \ + --with-curses \ + --enable-readline \ + --without-bash-malloc \ + --with-installed-readline" + +pre_configure_target() { + export LIBS="-lterminfo" +} diff --git a/packages/addons/driver/sapphire/changelog.txt b/packages/addons/driver/sapphire/changelog.txt new file mode 100644 index 0000000000..c47577cb4a --- /dev/null +++ b/packages/addons/driver/sapphire/changelog.txt @@ -0,0 +1,2 @@ +8.0.100 +- Initial add-on diff --git a/packages/addons/driver/sapphire/icon/icon.png b/packages/addons/driver/sapphire/icon/icon.png new file mode 100644 index 0000000000..c0fdfee8fa Binary files /dev/null and b/packages/addons/driver/sapphire/icon/icon.png differ diff --git a/packages/addons/driver/sapphire/package.mk b/packages/addons/driver/sapphire/package.mk new file mode 100644 index 0000000000..2b40b56e13 --- /dev/null +++ b/packages/addons/driver/sapphire/package.mk @@ -0,0 +1,76 @@ +################################################################################ +# 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="sapphire" +PKG_VERSION="6.6" +PKG_REV="100" +PKG_ARCH="any" +PKG_LICENSE="OSS" +PKG_SITE="https://libreelec.tv" +PKG_URL="http://www.rtr.ca/sapphire_remote/$PKG_NAME-$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain linux bash" +PKG_PRIORITY="optional" +PKG_SECTION="driver.remote" +PKG_SHORTDESC="A Linux driver to add support for sapphire remotes" +PKG_LONGDESC="A Linux driver to add support for sapphire remotes" +PKG_AUTORECONF="no" + +PKG_IS_ADDON="yes" +PKG_ADDON_NAME="Sapphire Remote Driver" +PKG_ADDON_TYPE="xbmc.service" +PKG_ADDON_REPOVERSION="8.0" + +if [ -f $SYSROOT_PREFIX/usr/include/linux/input-event-codes.h ]; then + INPUT_H="$SYSROOT_PREFIX/usr/include/linux/input-event-codes.h" +else + INPUT_H="$SYSROOT_PREFIX/usr/include/linux/input.h" +fi + +make_target() { + KVER=$(kernel_version) KDIR=$(kernel_path) INPUT_H=$INPUT_H make +} + +post_make_target() { + sed -i -e 's|modprobe sapphire|insmod /storage/.kodi/addons/driver.remote.sapphire/lib/sapphire.ko|' \ + -e 's|/etc/sapphire.keymap|/storage/.kodi/userdata/addon_data/driver.remote.sapphire/sapphire.keymap|' \ + -e 's|/usr/local/bin/sapphire_keymap.sh|/storage/.kodi/addons/driver.remote.sapphire/bin/sapphire_keymap.sh|' \ + -e 's|\&\& /usr/local/bin/sapphire_keymap.sh|\&\& /storage/.kodi/addons/driver.remote.sapphire/bin/sapphire_keymap.sh /storage/.kodi/userdata/addon_data/driver.remote.sapphire/sapphire.keymap|' \ + sapphire_startup.sh + + sed -i -e 's|\#\!/bin/bash|\#\!/storage/.kodi/addons/driver.remote.sapphire/bin/bash|' \ + sapphire_startup.sh sapphire_keymap.sh +} + +makeinstall_target() { + : +} + +addon() { + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/lib/ + cp $PKG_BUILD/*.ko $ADDON_BUILD/$PKG_ADDON_ID/lib + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/etc + cp $PKG_BUILD/keymap.default $ADDON_BUILD/$PKG_ADDON_ID/etc + + mkdir -p $ADDON_BUILD/$PKG_ADDON_ID/bin/ + cp $PKG_BUILD/sapphire_startup.sh $ADDON_BUILD/$PKG_ADDON_ID/bin + cp $PKG_BUILD/sapphire_keymap.sh $ADDON_BUILD/$PKG_ADDON_ID/bin + + # bash + cp $(get_build_dir bash)/.install_pkg/usr/bin/bash $ADDON_BUILD/$PKG_ADDON_ID/bin +} diff --git a/packages/addons/driver/sapphire/patches/sapphire-0001-fix-makefile.patch b/packages/addons/driver/sapphire/patches/sapphire-0001-fix-makefile.patch new file mode 100644 index 0000000000..62128c4386 --- /dev/null +++ b/packages/addons/driver/sapphire/patches/sapphire-0001-fix-makefile.patch @@ -0,0 +1,29 @@ +diff -Naur a/Makefile b/Makefile +--- a/Makefile 2016-04-24 18:28:49.000000000 -0700 ++++ b/Makefile 2016-07-09 13:39:17.008211023 -0700 +@@ -8,14 +8,14 @@ + BLACKLIST=/etc/modprobe.d/blacklist-$(CONFLICTS).conf + KEYMAP_SCRIPT=sapphire_keymap.sh + EXTRACT_KEYDEFS=extract_keydefs.sh +-INPUT_H=$(shell [ -e /usr/include/linux/input-event-codes.h ] && echo /usr/include/linux/input-event-codes.h || echo /usr/include/linux/input.h) ++INPUT_H ?= $(shell [ -e /usr/include/linux/input-event-codes.h ] && echo /usr/include/linux/input-event-codes.h || echo /usr/include/linux/input.h) + + ## MODPARMS is not used any more, but we have to nuke old copies to prevent issues: + MODPARMS=/etc/modprobe.d/$(MODNAME).conf + + CWD = $(shell pwd -P) + KVER ?= $(shell uname -r) +-KDIR = /lib/modules/$(KVER) ++KDIR ?= /lib/modules/$(KVER) + obj-m += $(MODNAME).o + + #EXTRA_CFLAGS += -Werror +@@ -31,7 +31,7 @@ + @exit 1 + + kmod: +- $(MAKE) -C $(KDIR)/build M=$(CWD) modules ++ $(MAKE) -C $(KDIR) M=$(CWD) modules + + $(MODNAME).ko: $(MODSOURCE) $(MODNAME).h + $(MAKE) kmod diff --git a/packages/addons/driver/sapphire/source/bin/sapphire-config b/packages/addons/driver/sapphire/source/bin/sapphire-config new file mode 100755 index 0000000000..779e03cb53 --- /dev/null +++ b/packages/addons/driver/sapphire/source/bin/sapphire-config @@ -0,0 +1,25 @@ +#!/bin/sh +################################################################################ +# 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 . +################################################################################ + +. /etc/profile +oe_setup_addon driver.remote.sapphire + +if [ ! -f $ADDON_HOME/sapphire.keymap ]; then + cp $ADDON_DIR/etc/keymap.default $ADDON_HOME/sapphire.keymap +fi diff --git a/packages/addons/driver/sapphire/source/default.py b/packages/addons/driver/sapphire/source/default.py new file mode 100644 index 0000000000..0ba8038b6d --- /dev/null +++ b/packages/addons/driver/sapphire/source/default.py @@ -0,0 +1,18 @@ +################################################################################ +# 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 . +################################################################################ + diff --git a/packages/addons/driver/sapphire/source/system.d/driver.remote.sapphire.service b/packages/addons/driver/sapphire/source/system.d/driver.remote.sapphire.service new file mode 100644 index 0000000000..af6fd55985 --- /dev/null +++ b/packages/addons/driver/sapphire/source/system.d/driver.remote.sapphire.service @@ -0,0 +1,13 @@ +[Unit] +Description=Sapphire remote start script +Before=kodi.service + +[Service] +Type=oneshot +Environment=HOME=/storage +ExecStartPre=/storage/.kodi/addons/driver.remote.sapphire/bin/sapphire-config +ExecStart=/storage/.kodi/addons/driver.remote.sapphire/bin/sapphire_startup.sh +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target