Merge pull request #5551 from heitbaum/jellyfin

Jellyfin: add new addon package (LE11)
This commit is contained in:
CvH 2021-08-17 10:10:06 +02:00 committed by GitHub
commit d2aed0dddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 311 additions and 29 deletions

View File

@ -0,0 +1,26 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="aspnet5-runtime"
PKG_VERSION="5.0.7"
PKG_LICENSE="MIT"
PKG_SITE="https://dotnet.microsoft.com/"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="ASP.NET Core Runtime enables you to run existing web/server applications."
PKG_TOOLCHAIN="manual"
case "${ARCH}" in
"aarch64")
PKG_SHA256="219f233d4e23e2381d93dc99a7cbdbe55c55e45da2e025b5d139d1338d11d62a"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/d0a22fa3-b916-49ce-8284-97131b424cb3/cb884163ad34b83f1ae1dbd33e09d77a/aspnetcore-runtime-5.0.7-linux-arm64.tar.gz"
;;
"arm")
PKG_SHA256="c14e64527f2bf7356d1de154132a07b86de4a30c62129e138f3ca95a43c2dd54"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/2f690848-1342-4768-a7d7-45fa476a4a22/50dd1c50ed7864140b04fec057bb8bd6/aspnetcore-runtime-5.0.7-linux-arm.tar.gz"
;;
"x86_64")
PKG_SHA256="22f9f93b4d6a00e76980918b721f7f62654421d7582d486e830ec478c365707c"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/d6be94b3-458f-43c4-8bb5-9ba261de8c9c/bbe13b54208d088b5fdf428759b5bc0a/aspnetcore-runtime-5.0.7-linux-x64.tar.gz"
;;
esac
PKG_SOURCE_NAME="aspnetcore-runtime_${PKG_VERSION}_${ARCH}.tar.gz"

View File

@ -0,0 +1,26 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="dotnet3-runtime"
PKG_VERSION="3.1.16"
PKG_LICENSE="MIT"
PKG_SITE="https://dotnet.microsoft.com/"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC="ASP.NET Core Runtime runs applications built with .NET Core, a cross-platform .NET implementation."
PKG_TOOLCHAIN="manual"
case "${ARCH}" in
"aarch64")
PKG_SHA256="b76c049484efd86466d2e1cd88994521633c399d090adb1c6804128603816abe"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/64353333-3080-45f7-a3d5-33e391e4596c/e9d5d53cb318628485e8d1fbd26ec30d/aspnetcore-runtime-3.1.16-linux-arm64.tar.gz"
;;
"arm")
PKG_SHA256="a0163cd5c5ceae228bfffb40053f3509e155a110c23e81c38705757a870e24cc"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/bd734390-3b5f-402a-826f-e0eae538b8ba/5914dd937ede96cb9297e6e7a80f46f3/aspnetcore-runtime-3.1.16-linux-arm.tar.gz"
;;
"x86_64")
PKG_SHA256="b1a2f61d8a49e2a3ca5eb9daa103b83eb49ea1bcf14914560e601222e94a3022"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/c20a5ac5-5174-46b8-a875-b916a416050d/b2ddd212a183260569178d880899bd94/aspnetcore-runtime-3.1.16-linux-x64.tar.gz"
;;
esac
PKG_SOURCE_NAME="aspnetcore3-runtime_${PKG_VERSION}_${ARCH}.tar.gz"

View File

@ -0,0 +1,26 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="dotnet5-runtime"
PKG_VERSION="5.0.7"
PKG_LICENSE="MIT"
PKG_SITE="https://dotnet.microsoft.com/"
PKG_DEPENDS_TARGET="toolchain"
PKG_LONGDESC=".NET Runtime runs applications built with .NET Core, a cross-platform .NET implementation."
PKG_TOOLCHAIN="manual"
case "${ARCH}" in
"aarch64")
PKG_SHA256="375956c3d326f5030a1eff2cafdba8b994ed0e1b87db2dd812ce17e0bca5fb27"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/a9a37d9f-6158-43a4-a610-f0f9e8c2cb73/c69c6d22c668cb09b2d00bea8209335b/dotnet-runtime-5.0.7-linux-arm64.tar.gz"
;;
"arm")
PKG_SHA256="fcc811f37cb6914bf3aa1c96040b1a46fad42939e6b1e1e7e0f513a9be1de680"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/09a24e9f-0096-454a-b761-70cdf9504775/eafe9578bbedd15c9319b7580d5a20d9/dotnet-runtime-5.0.7-linux-arm.tar.gz"
;;
"x86_64")
PKG_SHA256="ed864299f0e736f9d284b655e62d8a29aee97c14741ef8baf13d5ff493f83a47"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/f229fc63-747e-46c8-89ac-88563c2e0b7d/8e59115deda958a26e1546f603cbad9a/dotnet-runtime-5.0.7-linux-x64.tar.gz"
;;
esac
PKG_SOURCE_NAME="dotnet-runtime_${PKG_VERSION}_${ARCH}.tar.gz"

View File

@ -14,5 +14,5 @@ PKG_TOOLCHAIN="make"
pre_configure_target() { pre_configure_target() {
LDFLAGS+=" -ldl" LDFLAGS+=" -ldl"
cmake -G "Unix Makefiles" ./source cmake -DCMAKE_INSTALL_PREFIX=/usr -G "Unix Makefiles" ./source
} }

View File

@ -7,7 +7,7 @@ PKG_SHA256="06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909"
PKG_LICENSE="LGPLv2.1+" PKG_LICENSE="LGPLv2.1+"
PKG_SITE="https://ffmpeg.org" PKG_SITE="https://ffmpeg.org"
PKG_URL="https://ffmpeg.org/releases/ffmpeg-${PKG_VERSION}.tar.xz" PKG_URL="https://ffmpeg.org/releases/ffmpeg-${PKG_VERSION}.tar.xz"
PKG_DEPENDS_TARGET="toolchain aom bzip2 gnutls libvorbis opus x264 zlib" PKG_DEPENDS_TARGET="toolchain aom bzip2 gnutls lame libvorbis opus x264 x265 zlib"
PKG_LONGDESC="FFmpegx is an complete FFmpeg build to support encoding and decoding." PKG_LONGDESC="FFmpegx is an complete FFmpeg build to support encoding and decoding."
PKG_BUILD_FLAGS="-gold -sysroot" PKG_BUILD_FLAGS="-gold -sysroot"
@ -61,6 +61,12 @@ pre_configure_target() {
--enable-hwaccel=vp8_vaapi \ --enable-hwaccel=vp8_vaapi \
--enable-hwaccel=vp9_vaapi \ --enable-hwaccel=vp9_vaapi \
--enable-hwaccel=wmv3_vaapi" --enable-hwaccel=wmv3_vaapi"
PKG_FFMPEG_X26x_GENERIC="\
--enable-libx264 \
--enable-encoder=x264 \
--enable-libx265 \
--enable-encoder=x265"
fi fi
# Encoders # Encoders
@ -69,10 +75,7 @@ pre_configure_target() {
--enable-libvpx \ --enable-libvpx \
--enable-encoder=libvpx_vp8 \ --enable-encoder=libvpx_vp8 \
--enable-encoder=libvpx_vp9 \ --enable-encoder=libvpx_vp9 \
--enable-libx264 \ ${PKG_FFMPEG_X26x_GENERIC} \
--enable-encoder=x264 \
--enable-libx265 \
--enable-encoder=x265 \
--enable-libaom \ --enable-libaom \
--enable-encoder=libaom_av1 \ --enable-encoder=libaom_av1 \
\ \
@ -109,6 +112,7 @@ configure_target() {
\ \
`#Static and Shared` \ `#Static and Shared` \
--enable-static \ --enable-static \
--pkg-config-flags="--static" \
--disable-shared \ --disable-shared \
\ \
`#Licensing options` \ `#Licensing options` \
@ -120,6 +124,8 @@ configure_target() {
`#Hardware accelerated decoding encoding` \ `#Hardware accelerated decoding encoding` \
${PKG_FFMPEG_HW_ENCODERS_GENERIC} \ ${PKG_FFMPEG_HW_ENCODERS_GENERIC} \
\ \
${PKG_FFMPEG_ENCODERS} \
\
`#General options` \ `#General options` \
--enable-avresample \ --enable-avresample \
--disable-lzma \ --disable-lzma \

View File

@ -0,0 +1,2 @@
100
- Initial release

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -0,0 +1,33 @@
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="jellyfin"
PKG_VERSION="1.0"
PKG_VERSION_NUMBER="10.7.6"
PKG_REV="100"
PKG_ARCH="any"
PKG_LICENSE="GPLv2"
PKG_SITE="https://jellyfin.org/"
PKG_DEPENDS_TARGET="toolchain"
PKG_SECTION="service"
PKG_SHORTDESC="Jellyfin: The Free Software Media System"
PKG_LONGDESC="Jellyfin is a Free Software Media System that puts you in control of managing and streaming your media. Stream to any device from your own server. Your media, your server, your way."
PKG_TOOLCHAIN="manual"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Jellyfin"
PKG_ADDON_TYPE="xbmc.service"
PKG_ADDON_REQUIRES="tools.ffmpeg-tools:0.0.0 tools.dotnet-runtime:0.0.0"
PKG_ADDON_PROVIDES="executable"
make_target() {
:
}
addon() {
:
}
post_install_addon() {
sed -e "s/@JELLYFIN_VERSION@/${PKG_VERSION_NUMBER}/g" -i "${INSTALL}/bin/jellyfin-downloader"
}

View File

@ -0,0 +1,69 @@
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.jellyfin
ICON="${ADDON_DIR}/resources/icon.png"
CONTROL_FILE="/tmp/curl.done"
DATA_FILE="/tmp/curl.data"
JELLYFIN_FILE="jellyfin_@JELLYFIN_VERSION@.tar.gz"
# check for enough free disk space
if [ $(df . | awk 'END {print $4}') -lt 200000 ]; then
kodi-send --action="Notification(Not enough disk space, at least 200MB are required,30000,${ICON})" >/dev/null
exit 0;
fi
# remove install status and folders
if [ -f ${ADDON_DIR}/extract.ok ]; then
rm ${ADDON_DIR}/extract.ok
fi
if [ -d ${ADDON_DIR}/libs ]; then
rm -rf ${ADDON_DIR}/libs
fi
# create tmp download dir
TEMP_DIR=`mktemp -d`
mkdir -p ${TEMP_DIR}/tmp_download
if [ -d ${TEMP_DIR}/tmp_download ]; then
cd ${TEMP_DIR}/tmp_download
else
kodi-send --action="Notification(Unable to download Jellyfin - no temp directory,30000,${ICON})" >/dev/null
exit 0
fi
echo "Downloading Jellyfin"
# download Jellyfin
rm -f ${CONTROL_FILE} ${DATA_FILE}
(
curl -L -# -O -C - https://repo.jellyfin.org/releases/server/portable/versions/stable/combined/@JELLYFIN_VERSION@/${JELLYFIN_FILE} 2>${DATA_FILE}
touch ${CONTROL_FILE}
) | \
while [ : ]; do
[ -f ${DATA_FILE} ] && prog="$(tr '\r' '\n' < ${DATA_FILE} | tail -n 1 | sed -r 's/^[# ]+/#/;s/^[^0-9]*//g')" || prog=
kodi-send --action="Notification(Downloading Jellyfin,\"${prog:-0.0%}\",3000,${ICON})" >/dev/null
[ -f ${CONTROL_FILE} ] && break
sleep 4
done
rm -f ${CONTROL_FILE} ${DATA_FILE}
# extract Jellyfin
kodi-send --action="Notification(Extracting Jellyfin,Starting,1000,${ICON})" >/dev/null
# extract JELLYFIN_FILE to libs directory
mkdir ${ADDON_DIR}/libs
tar xf ${JELLYFIN_FILE} -C ${ADDON_DIR}/libs --strip-components=2
# cleanup
cd ${ADDON_DIR}
rm -rf ${TEMP_DIR}/tmp_download
rmdir ${TEMP_DIR}
touch ${ADDON_DIR}/extract.ok
kodi-send --action="Notification(Extracting Jellyfin,Finished,1000,${ICON})" >/dev/null

View File

@ -0,0 +1,21 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.jellyfin
# check if jellyfin is already successful installed
if [ ! -f "$ADDON_DIR/extract.ok" ]; then
cd $ADDON_DIR
jellyfin-downloader
fi
libs="${ADDON_DIR}/libs"
ff="/storage/.kodi/addons/tools.ffmpeg-tools/bin"
exec \
nice -n "$jellyfin_nice" \
dotnet "${libs}/jellyfin.dll" \
--datadir "${ADDON_HOME}" \
--ffmpeg "${ff}/ffmpeg"

View File

@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
import json
import subprocess
import xbmc
import xbmcaddon
import xbmcgui
def jsonrpc(request):
return json.loads(xbmc.executeJSONRPC(json.dumps(request)))
def disable_conflicting(conficting,
message='{that} conflicts with {this} and has been disabled'):
is_enabled = {'jsonrpc': '2.0', 'method': 'Addons.GetAddonDetails', 'id': 1,
'params': {'addonid': conficting, 'properties': ['enabled']}}
disable = {'jsonrpc': '2.0', 'method': 'Addons.SetAddonEnabled', 'id': 1,
'params': {'addonid': conficting, 'enabled': False}}
try:
if jsonrpc(is_enabled)['result']['addon']['enabled']:
this = xbmcaddon.Addon().getAddonInfo('name')
that = xbmcaddon.Addon(conficting).getAddonInfo('name')
jsonrpc(disable)
dialog = xbmcgui.Dialog()
dialog.ok(this, message.format(
this=this, that=that))
del dialog
except KeyError:
pass
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__':
disable_conflicting('service.emby')
Monitor().waitForAbort()

View File

@ -0,0 +1,14 @@
# Kodi Media Center language file
# Addon Name: jellyfin
# Addon id: service.jellyfin
# Addon Provider: Team LibreELEC
msgid ""
msgstr ""
msgctxt "#30000"
msgid "Configuration"
msgstr ""
msgctxt "#30001"
msgid "Priority (nice, 0=max, 19=min)"
msgstr ""

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="30000">
<setting label="30001" id="jellyfin_nice" type="slider" default="10" range="0,1,19" option="int" />
</category>
</settings>

View File

@ -0,0 +1,3 @@
<settings version="2">
<setting id="jellyfin_nice" default="true">10</setting>
</settings>

View File

@ -0,0 +1,13 @@
[Unit]
Description=Jellyfin - The Free Software Media System
Documentation=https://jellyfin.org/
Wants=multi-user.target
After=multi-user.target
[Service]
SyslogIdentifier=%N
ExecStart=/bin/sh /storage/.kodi/addons/%N/bin/jellyfin-start
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -1,3 +1,7 @@
114
- Add .NET Runtime 5.0.7
- Add ASP.NET Core Runtime 5.0.7
113 113
- Update to ASP.NET Core Runtime 3.1.16 - Update to ASP.NET Core Runtime 3.1.16

View File

@ -2,42 +2,29 @@
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="dotnet-runtime" PKG_NAME="dotnet-runtime"
PKG_VERSION="3.1.16" PKG_REV="114"
PKG_REV="113"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="MIT" PKG_LICENSE="MIT"
PKG_SITE="https://dotnet.microsoft.com/" PKG_SITE="https://dotnet.microsoft.com/"
PKG_DEPENDS_TARGET="toolchain icu" PKG_DEPENDS_TARGET="toolchain icu aspnet5-runtime dotnet3-runtime dotnet5-runtime icu"
PKG_SECTION="tools" PKG_SECTION="tools"
PKG_SHORTDESC=".NET Core Runtime" PKG_SHORTDESC="ASP.NET Core Runtime"
PKG_LONGDESC=".NET Core Runtime (${PKG_VERSION}) runs applications built with .NET Core, a cross-platform .NET implementation." PKG_LONGDESC="ASP.NET Core Runtimes ($(get_pkg_version dotnet3-runtime)) and ($(get_pkg_version dotnet5-runtime)) enables you to run existing console/web/server applications."
PKG_TOOLCHAIN="manual" PKG_TOOLCHAIN="manual"
PKG_IS_ADDON="yes" PKG_IS_ADDON="yes"
PKG_ADDON_NAME=".Net Core Runtime" PKG_ADDON_NAME="ASP.Net Core Runtimes"
PKG_ADDON_PROJECTS="any !RPi1" PKG_ADDON_PROJECTS="any !RPi1"
PKG_ADDON_TYPE="xbmc.python.script" PKG_ADDON_TYPE="xbmc.python.script"
PKG_MAINTAINER="Anton Voyl (awiouy)" PKG_MAINTAINER="Anton Voyl (awiouy)"
case "${ARCH}" in
"aarch64")
PKG_SHA256="b76c049484efd86466d2e1cd88994521633c399d090adb1c6804128603816abe"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/64353333-3080-45f7-a3d5-33e391e4596c/e9d5d53cb318628485e8d1fbd26ec30d/aspnetcore-runtime-3.1.16-linux-arm64.tar.gz"
;;
"arm")
PKG_SHA256="a0163cd5c5ceae228bfffb40053f3509e155a110c23e81c38705757a870e24cc"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/bd734390-3b5f-402a-826f-e0eae538b8ba/5914dd937ede96cb9297e6e7a80f46f3/aspnetcore-runtime-3.1.16-linux-arm.tar.gz"
;;
"x86_64")
PKG_SHA256="b1a2f61d8a49e2a3ca5eb9daa103b83eb49ea1bcf14914560e601222e94a3022"
PKG_URL="https://download.visualstudio.microsoft.com/download/pr/c20a5ac5-5174-46b8-a875-b916a416050d/b2ddd212a183260569178d880899bd94/aspnetcore-runtime-3.1.16-linux-x64.tar.gz"
;;
esac
PKG_SOURCE_NAME="aspnetcore-runtime_${PKG_VERSION}_${ARCH}.tar.gz"
addon() { addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -r ${PKG_BUILD}/* \ cp -r $(get_build_dir dotnet3-runtime)/* \
${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -r $(get_build_dir dotnet5-runtime)/* \
${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -r $(get_build_dir aspnet5-runtime)/* \
${ADDON_BUILD}/${PKG_ADDON_ID}/bin ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/lib