Skip to content

Commit

Permalink
[le12] service.nextpvr backport of PR 9323
Browse files Browse the repository at this point in the history
Also include PR #9507

Please do not merge maintenance release no yet on GitHub
  • Loading branch information
emveepee committed Nov 18, 2024
1 parent cdddc9d commit 1e652e6
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configure_target() {
--host=${TARGET_NAME} \
--build=${HOST_NAME} \
--enable-static \
--disable-shared \
--enable-shared \
--prefix=/usr \
--enable-visibility
}
Expand All @@ -36,6 +36,9 @@ makeinstall_target() {
mkdir -p ${INSTALL}/usr/include/MediaInfo/${i}/
cp -aP ../../../Source/MediaInfo/${i}/*.h ${INSTALL}/usr/include/MediaInfo/${i}/
done
cp -P .libs/* ${INSTALL}/usr/lib
cp -P libmediainfo.pc ${INSTALL}/usr/lib/pkgconfig
cp -P .libs/libmediainfo.a ${INSTALL}/usr/lib

# move shared lib so mediainfo will not detect it and perform a static build
mkdir -p ${INSTALL}/shared-lib
cp -P .libs/libmediainfo.so* ${INSTALL}/shared-lib
}
5 changes: 5 additions & 0 deletions packages/addons/service/nextpvr/changelog.txt
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
2
- download NextPVR 7.0.1
- install and configure, hdhomerun_config, comskip and libmediainfo
- fix manual updates from NPVR.zip

initial release
15 changes: 12 additions & 3 deletions packages/addons/service/nextpvr/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)

PKG_NAME="nextpvr"
PKG_VERSION="6.1.5~Omega"
PKG_ADDON_VERSION="6.1.5~4"
PKG_VERSION="7.0.1~Omega"
PKG_ADDON_VERSION="7.0.1~2"
PKG_REV="0"
PKG_ARCH="any"
PKG_LICENSE="NextPVR"
PKG_SITE="https://nextpvr.com"
PKG_DEPENDS_TARGET="toolchain"
PKG_DEPENDS_TARGET="toolchain libhdhomerun libmediainfo comskip"
PKG_SECTION="service"
PKG_SHORTDESC="NextPVR Server"
PKG_LONGDESC="NextPVR is a personal video recorder application. It allows to watch or record live TV, provides great features like series recordings and web scheduling."
Expand All @@ -25,4 +25,13 @@ addon() {

post_install_addon() {
sed -e "s/@NEXTPVR_VERSION@/${PKG_ADDON_VERSION}/g" -i "${INSTALL}/bin/nextpvr-downloader"

mkdir -p ${INSTALL}/{lbin,lib.private}
cp $(get_build_dir libmediainfo)/Project/GNU/Library/.libs/libmediainfo.so ${INSTALL}/lib.private
cp -P $(get_build_dir libhdhomerun)/hdhomerun_config ${INSTALL}/lbin
cp -P $(get_install_dir comskip)/usr/bin/comskip ${INSTALL}/lbin
if [ "${TARGET_ARCH}" = "x86_64" ]; then
cp -P $(get_install_dir x265)/usr/lib/libx265.so.209 ${INSTALL}/lib.private
patchelf --add-rpath '${ORIGIN}/../lib.private' ${INSTALL}/lbin/comskip
fi
}
2 changes: 2 additions & 0 deletions packages/addons/service/nextpvr/source/addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def updateNextPVR(self):
xbmc.log('Running: %s' % command, xbmc.LOGDEBUG)
os.system(command)
os.remove(archive)
command = 'find {0}/DeviceHost -name DeviceHostLinux -exec chmod 755 {{}} \;'.format(dest_folder)
os.system(command)
xbmcgui.Dialog().notification(ADDON_NAME, LS(30039), xbmcgui.NOTIFICATION_INFO)
xbmc.log('NPVR.zip installed', xbmc.LOGDEBUG)
if xbmcgui.Dialog().yesno("NextPVR Server", LS(30020)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ echo "Downloading NextPVR"
# download NextPVR
rm -f ${CONTROL_FILE} ${DATA_FILE}
(
curl -L -# -O -C - https://github.com/sub3/releases/releases/download/${NEXTPVR_VERSION%~*}/${NEXTPVR_FILE} 2>${DATA_FILE}
curl -L -# -O -C - https://github.com/sub3/releases/releases/download/${NEXTPVR_VERSION%~*}/${NEXTPVR_FILE} 2>${DATA_FILE}
touch ${CONTROL_FILE}
) |
while [ : ]; do
Expand All @@ -61,6 +61,12 @@ fi
# extract NextPVR
kodi-send --action="Notification(Extracting NextPVR,starting,1000,${ICON})" >/dev/null
mkdir -p ${ADDON_DIR}/nextpvr-bin

chmod +x ${ADDON_DIR}/lbin/hdhomerun_config
chmod +x ${ADDON_DIR}/lbin/comskip
ln -s ${ADDON_DIR}/lbin/hdhomerun_config ${ADDON_DIR}/nextpvr-bin
ln -s ${ADDON_DIR}/lib.private/libmediainfo.so ${ADDON_DIR}/nextpvr-bin

unzip ${NEXTPVR_FILE} -d ${ADDON_DIR}/nextpvr-bin >/dev/null

if [ "$(uname -m)" != "x86_64" ]; then
Expand Down
29 changes: 29 additions & 0 deletions packages/addons/service/nextpvr/source/sleep.d/nextpvr.power
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2024-present Team LibreELEC (https://libreelec.tv)

. /etc/profile

oe_setup_addon service.nextpvr

SERVICE="service.nextpvr"

case "$1" in
pre)
if systemctl is-active "$SERVICE" &>/dev/null ; then
systemctl stop "$SERVICE"
for module in $REMOVE_MODULES ; do
rmmod $module
done
fi
;;
post)
if systemctl is-enabled "$SERVICE" &>/dev/null ; then
for module in $REMOVE_MODULES ; do
modprobe $module
done
systemctl start "$SERVICE"
fi
;;
esac

0 comments on commit 1e652e6

Please sign in to comment.