Skip to content

Commit

Permalink
Add Jellyfin (#3932)
Browse files Browse the repository at this point in the history
* Add native nodejs

* Add jellyfin 10.6.4

* jellyfin add ARMv7l as unsupported arch

* fix Jellyfin, compile to single binary

fixes publicarray#27

* Jellyfin: don't use single file build

prepare for shared framework

* Jellyfin: Update (not backwards compatible)

Ensure you back up before upgrading

* Jellyfin: add libstdc++

* Jellyfin: fixes

* Jellyfin: require newer/synocommunity ffmpeg version

* Jellyfin: Add help URLs

* jellyfin: hardware acceleration

* Jellyfin: Update paths for DSM 7

* Jellyfin: update version

* Jellyfin: don't use chmod

* add PLIST for spk/jellyfin and fix PLIST of cross/jellyfin-web

* Jellyfin: add message about permissions

* Jellyfin: Update wizard, drop beta and update change log

* Jellyfin: update wizard

* Jellyfin: warn about permission issue

* update icon

- resize icon to 512x512 with some margin

* fix icon 512x512

Co-authored-by: hgy59 <hpgy59@gmail.com>
  • Loading branch information
publicarray and hgy59 committed Apr 21, 2021
1 parent 83f850f commit 4f26acd
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cross/jellyfin-web/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
PKG_NAME = jellyfin-web
PKG_VERS = 10.7.2
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/jellyfin/jellyfin-web/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

HOMEPAGE = https://jellyfin.org
COMMENT = Jellyfin Web is the frontend used for most of the clients available for end users
LICENSE = GPLv2

.PHONY: jellyfin_compile_target
BUILD_DEPENDS = native/nodejs

CONFIGURE_TARGET = nop
COMPILE_TARGET = jellyfin_compile_target
INSTALL_TARGET = nop

include ../../mk/spksrc.cross-dotnet.mk

ENV += NPM_CONFIG_USER=root
PATH := $(WORK_DIR)/../../../native/nodejs/work-native/node/bin:$(PATH)

jellyfin_compile_target:
install -m 755 -d $(STAGING_INSTALL_PREFIX)/web
$(RUN) npm install && npm run build:production
cp -R $(WORK_DIR)/$(PKG_NAME)-$(PKG_VERS)/dist/* $(STAGING_INSTALL_PREFIX)/web
1 change: 1 addition & 0 deletions cross/jellyfin-web/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rsc:web/
3 changes: 3 additions & 0 deletions cross/jellyfin-web/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jellyfin-web-10.7.2.tar.gz SHA1 e23b49bfcac734eb0185046a271322ecd679b5df
jellyfin-web-10.7.2.tar.gz SHA256 bbd3987a06615bb25c1c08bbd05467761ef9e7eda3fb0e29de81da753ddb9196
jellyfin-web-10.7.2.tar.gz MD5 ae95a49173999ed5c5c911627fb3d77c
20 changes: 20 additions & 0 deletions cross/jellyfin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
PKG_NAME = jellyfin
PKG_VERS = 10.7.2
PKG_EXT = tar.gz
PKG_DIST_NAME = v$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://github.com/jellyfin/jellyfin/archive
PKG_DIST_FILE = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

HOMEPAGE = https://jellyfin.org
COMMENT = The Free Software Media System. It is an alternative to the proprietary Emby and Plex.
LICENSE = GPLv2

DOTNET_VERSION=5.0
BUILD_DEPENDS = native/dotnet-sdk-$(DOTNET_VERSION)

DOTNET_OPTIMIZE=1
DOTNET_OUTPUT_PATH=share
DOTNET_PACKAGE_NAME=Jellyfin.Server

include ../../mk/spksrc.cross-dotnet.mk
2 changes: 2 additions & 0 deletions cross/jellyfin/PLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
rsc:share
rsc:web
3 changes: 3 additions & 0 deletions cross/jellyfin/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
jellyfin-10.7.2.tar.gz SHA1 080efb9a28ecd012ee9957b9e4e543eec3e75826
jellyfin-10.7.2.tar.gz SHA256 9afe22c959396182ac8703eb88e319808dfec8ce3913ee6bb11434e9141037bf
jellyfin-10.7.2.tar.gz MD5 ee6402ce725adb5fdcb3f8df1c74c48e
23 changes: 23 additions & 0 deletions native/nodejs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
PKG_NAME = nodejs
# Latest Current Version: 13.13.0 (includes npm 6.14.4)
PKG_VERS = 13.13.0
PKG_EXT = tar.xz
PKG_DIST_NAME = node-v$(PKG_VERS)-linux-x64.$(PKG_EXT)
PKG_DIST_SITE = https://nodejs.org/dist/v$(PKG_VERS)
PKG_DIR = node-v$(PKG_VERS)-linux-x64

DEPENDS =

HOMEPAGE = https://nodejs.org/
COMMENT = JavaScript runtime built on Chrome's V8 JavaScript engine.
LICENSE = https://github.com/nodejs/node/blob/master/LICENSE

CONFIGURE_TARGET = nop
COMPILE_TARGET = nop
INSTALL_TARGET = nodejs-install

include ../../mk/spksrc.native-cc.mk

.PHONY: nodejs-install
nodejs-install:
mv -f $(WORK_DIR)/$(PKG_DIR)/ $(WORK_DIR)/node/
3 changes: 3 additions & 0 deletions native/nodejs/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node-v13.13.0-linux-x64.tar.xz SHA1 dfaa7351f74078ecd461d2b7b95c1f8caccfa048
node-v13.13.0-linux-x64.tar.xz SHA256 41d60cda7422f53156711626d670f9b5079075b1ecc6736aea99319fe36c20a6
node-v13.13.0-linux-x64.tar.xz MD5 7efabb595dd4d93d9932c1b2bf173e48
37 changes: 37 additions & 0 deletions spk/jellyfin/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
SPK_NAME = jellyfin
SPK_VERS = 10.7.2
SPK_REV = 1
SPK_ICON = src/jellyfin.png
WIZARDS_DIR = src/wizard/
DSM_UI_DIR = app

DEPENDS = cross/libstdc++ cross/$(SPK_NAME) cross/$(SPK_NAME)-web

MAINTAINER = publicarray
DESCRIPTION = "The Free Software Media System. It is an alternative to the proprietary Emby and Plex."
DISPLAY_NAME = Jellyfin
STARTABLE = yes
CHANGELOG = "Initial Release"
HOMEPAGE = https://jellyfin.org
HELPURL = https://jellyfin.org/docs/general/server/settings.html
SUPPORTURL = https://jellyfin.org/docs/general/getting-help.html
LICENSE = GPLv2
LICENSE_FILE = $(WORK_DIR)/$(SPK_NAME)-$(SPK_VERS)/LICENSE
SPK_DEPENDS = "ffmpeg>=4.2"

# 'auto' reserved value grabs SPK_NAME
SERVICE_USER = auto
SERVICE_SETUP = src/service-setup.sh

CONF_DIR = src/conf

# Service configuration
SERVICE_PORT = 8096
SERVICE_PORT_TITLE = Jellyfin (HTTP)

# Admin link
ADMIN_PORT = $(SERVICE_PORT)

UNSUPPORTED_ARCHS = $(PPC_ARCHS) $(ARMv5_ARCHS) $(i686_ARCHS) $(ARMv7L_ARCHS)

include ../../mk/spksrc.spk.mk
Empty file added spk/jellyfin/PLIST
Empty file.
15 changes: 15 additions & 0 deletions spk/jellyfin/src/app/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
".url": {
"com.synocommunity.packages.jellyfin": {
"title": "Jellyfin",
"desc": "Jellyfin Web UI",
"icon": "images/jellyfin-{0}.png",
"type": "url",
"protocol": "http",
"port": "8096",
"url": "/",
"allUsers": true,
"grantPrivilege": "local"
}
}
}
1 change: 1 addition & 0 deletions spk/jellyfin/src/conf/resource
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"video-driver":{}}
Binary file added spk/jellyfin/src/jellyfin.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions spk/jellyfin/src/service-setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# https://github.com/dotnet/core/issues/4011
[ -z "$DOTNET_BUNDLE_EXTRACT_BASE_DIR" ] && export DOTNET_BUNDLE_EXTRACT_BASE_DIR="${XDG_CACHE_HOME:-"/var/packages/jellyfin/target/var/"}/dotnet_bundle_extract"

JELLYFIN_ARGS="--service \
--package-name synology \
-d ${SYNOPKG_PKGVAR}/data \
-C ${SYNOPKG_PKGVAR}/cache \
-c ${SYNOPKG_PKGVAR}/config \
-l ${SYNOPKG_PKGVAR}/log \
-w ${SYNOPKG_PKGDEST}/web \
--ffmpeg /var/packages/ffmpeg/target/bin/ffmpeg"

SERVICE_COMMAND="env LD_LIBRARY_PATH=${SYNOPKG_PKGDEST}/lib ${SYNOPKG_PKGDEST}/share/jellyfin ${JELLYFIN_ARGS}"

SVC_BACKGROUND=y
SVC_WRITE_PID=y

GROUP=sc-media

service_postinst ()
{
if [ "$SYNOPKG_DSM_VERSION_MAJOR" -ge 7 ]; then
mkdir -p --mode=0777 /var/packages/jellyfin/var/data/transcodes
fi
}
13 changes: 13 additions & 0 deletions spk/jellyfin/src/wizard/install_uifile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"step_title": "Important information",
"items": [
{
"desc": "Permissions for the package are managed by a \"System internal user\" named <b>sc-jellyfin</b>.<br>For DSM 6 and below you can use the generic <b>sc-media</b> group instead.<br>For DSM 7 you may need to give <b>sc-ffmpeg</b> the same permissions as sc-jellyfin.<br>Please read <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Permission-Management\">Permission Management</a> for details."
},
{
"desc": "Information regarding Jellyfin troubleshooting and hardware acceleration support for your NAS can be found <a target=\"_blank\" href=\"https://github.com/SynoCommunity/spksrc/wiki/Jellyfin\">here</a>"
}
]
}
]

0 comments on commit 4f26acd

Please sign in to comment.