sapphire: initial add-on

This commit is contained in:
Lukas Rusak 2016-07-21 13:10:04 -07:00
parent fd571aacc6
commit fcdb4f5efc
7 changed files with 163 additions and 0 deletions

View File

@ -0,0 +1,2 @@
8.0.100
- Initial add-on

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -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 <http://www.gnu.org/licenses/>.
################################################################################
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
}

View File

@ -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

View File

@ -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 <http://www.gnu.org/licenses/>.
################################################################################
. /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

View File

@ -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 <http://www.gnu.org/licenses/>.
################################################################################

View File

@ -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