Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[le12] service.nextpvr backport of PR 9323 #9470

Open
wants to merge 1 commit into
base: libreelec-12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.212 ${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