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

Package Request: Jellyfin #6684

Closed
anarchomoh opened this issue Jan 7, 2019 · 19 comments
Closed

Package Request: Jellyfin #6684

anarchomoh opened this issue Jan 7, 2019 · 19 comments
Labels
request Package request Stale

Comments

@anarchomoh
Copy link

The github website is: https://github.com/jellyfin/jellyfin
Thanks!

@maxice8 maxice8 added the request Package request label Jan 7, 2019
@Anachron
Copy link
Contributor

Anachron commented Apr 6, 2019

They have their own build script which is kind of horrible.

https://github.com/jellyfin/jellyfin/blob/master/build

I‘ll see what I can do.

@CameronNemo
Copy link
Contributor

Please do check out the debian packaging I linked. The build script is intended to support many platforms and thus it is indeed complicated.

@Anachron
Copy link
Contributor

Anachron commented Apr 14, 2019

Tried packaging jellyfin but it requires dotnet which is required to be packaged here: #10773
So this is blocked until dotnet is packaged.

The Arch PKGBUILD as reference: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=jellyfin

@Anachron
Copy link
Contributor

DotNet is packaged, I‘ll get to jellyfin soon.

@anarchomoh
Copy link
Author

hi @Anachron, have you had a chance to review?

@Anachron
Copy link
Contributor

Oh well since dotnet was removed I'll have to repackage it first but I'm quite busy the next weeks.
Either someone else jumps on it or I'll try to package it after my summer holiday.

@Anachron
Copy link
Contributor

For everyone wondering what the progress is:

The build fails as following:

=> jellyfin-10.3.7_1: running do_build ...
Cannot get required symbol d2i_ASN1_type_bytes from libssl
/void-packages/srcpkgs/jellyfin/template: line 24: 17910 Aborted
 dotnet build --configuration Release Jellyfin.Server
=> ERROR: jellyfin-10.3.7_1: do_build: 'dotnet build --configuration Release Jellyfin.Server' exited with 134
=> ERROR:   in do_build() at srcpkgs/jellyfin/template:27

dotnet-sdk template:

# Template file for 'dotnet-sdk'
pkgname=dotnet-sdk
version=2.2.203
revision=1
archs="x86_64 armv7 aarch64"
wrksrc="${pkgname}-${version}"
create_wrksrc=yes
short_desc="Provides the .NET SDK components"
maintainer="Anachron <gith@cron.world>"
license="MIT"
homepage="https://dotnet.microsoft.com"
nopie=yes

case "${XBPS_TARGET_MACHINE}" in
	x86_64)
	_arch="x64"
	_path="647f8505-3bf0-48c5-ac0f-3839be6816d7/d0c2762ded5a1ded3c79b1e495e43b7c"
	distfiles="https://download.visualstudio.microsoft.com/download/pr/${_path}/${pkgname}-${version}-linux-${_arch}.tar.gz"
	checksum="d1e2368b1335a6a5f496b887950ad5da3d85783ec76f74a663214989817bb497"
	;;
	armv7)
	_arch="arm"
	_path="e5573b57-df74-4b5b-8cd8-06973b66c3ac/b9ee29318ad2d87fa05adfaf74a8271c"
	distfiles="https://download.visualstudio.microsoft.com/download/pr/${_path}/${pkgname}-${version}-linux-${_arch}.tar.gz"
	checksum="76488566b7c81f12a517274562bf5bbb77e003cd9ca568f90d9bfb2865de3242"
	;;
	aarch64)
	_arch="arm64"
	_path="50979c85-1634-4c40-a4d0-4d25c9dae08d/cfa1d7e5ef765cef1d2c9127c9e14599"
	distfiles="https://download.visualstudio.microsoft.com/download/pr/${_path}/${pkgname}-${version}-linux-${_arch}.tar.gz"
	checksum="6f49fa85aef7f69ec04bbb4f61e4029a472d5a01ea5a4154986df27e26521879"
	;;
esac

_target='opt/dotnet'

do_install() {
	vmkdir usr/bin
	ln -sf "/${_target}/dotnet" "${DESTDIR}/usr/bin/dotnet"
	vmkdir "${_target}"
	vcopy dotnet "${_target}"
	vcopy host "${_target}"
	vcopy shared "${_target}"
	vcopy sdk "${_target}"
	vlicense "LICENSE.txt"
}

jellyfin template:

# Template file for 'jellyfin'
pkgname=jellyfin
version=10.3.7
revision=1
wrksrc="${pkgname}-${version}"
#create_wrksrc=yes
#archs="i686 x86_64"
build_style=meta
#configure_args=""
#make_build_args=""
#make_install_args=""
#conf_files=""
#make_dirs="/var/log/dir 0755 root root"
hostmakedepends=""
makedepends="dotnet-sdk icu-devel libssl47"
depends="dotnet-sdk"
short_desc="Free Software Media System "
maintainer="Anachron <gith@cron.world>"
license="GPL-3.0-or-later"
homepage="https://jellyfin.readthedocs.io"
distfiles="https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz"
checksum=70914629ece0c704e3bd3d3948ba8c5dad3ebae712118b43e5210afcd54d5bdf

do_build() {
  export DOTNET_CLI_TELEMETRY_OPTOUT=1
  export CLR_OPENSSL_VERSION_OVERRIDE=47
  dotnet build --configuration Release Jellyfin.Server
  dotnet publish --configuration Release Jellyfin.Server --output "$PWD"/publish
  rm -rfv publish/runtimes/{alpine-*,osx*,tizen-*,win*}
}

@tesfaye
Copy link

tesfaye commented Mar 17, 2020

An update. I was able to get jellyfin to build with #20147 and the following template file for jellyfin.

# Template file for 'jellyfin'
pkgname=jellyfin
version=10.5.0
revision=1
wrksrc="${pkgname}-${version}"
create_wrksrc=yes
archs="x86_64"
build_style=meta
makedepends="dotnet-sdk icu-devel libssl47 yarn git"
depends="ffmpeg sqlite"
short_desc="Free Software Media System "
maintainer="Abel Tesfaye <abel-tesfaye@hotmail.com>"
license="GPL-2.0-or-later"
homepage="https://jellyfin.readthedocs.io"
distfiles="
 https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz
 https://github.com/${pkgname}/${pkgname}-web/archive/v${version}.tar.gz>${pkgname}-web-${version}.tar.gz"
checksum="
 f5631758c2a175ae04bedd6d8f8566b2222b14254261bdf29019ecdffde0dddd
 e50b280e805469367bedfef41c32070907e191d4a856b92049e6f6fd558e1dea"
nopie=yes

do_build() {
  cd jellyfin-web-${version}
  yarn install

  #cp -r dist/. ../jellyfin-${version}/MediaBrowser.WebDashboard/jellyfin-web

  cd ../jellyfin-${version}

  export DOTNET_CLI_TELEMETRY_OPTOUT=1
  export CLR_OPENSSL_VERSION_OVERRIDE=47
  dotnet build --configuration Release Jellyfin.Server
  dotnet publish --configuration Release Jellyfin.Server --output "$PWD"/publish
  rm -rfv publish/runtimes/{alpine-*,osx*,tizen-*,win*,linux-arm*,linux-musl*}
  
  mkdir publish/jellyfin-web
  cp -rv ../jellyfin-web-${version}/dist/. publish/jellyfin-web

  rm -rfv Jellyfin.Server/
}

do_install() {
  vmkdir "usr/lib/${pkgname}"
  #cd ${pkgname}-${version}/publish/
  #vcopy . usr/lib/${pkgname}
  vcopy "${pkgname}-${version}/publish/." "usr/lib/jellyfin"
  #vcopy "${pkgname}-${version}/publish/." "usr/bin/${pkgname}"
}

@Anachron
Copy link
Contributor

Anachron commented Mar 20, 2020

How did you get it to run? I receive:

$ DOTNET_ROOT=/usr/lib/dotnet /usr/lib/jellyfin/jellyfin
[08:02:31] [INF] [1] Main: Jellyfin version: 10.5.0
[08:02:31] [INF] [1] Main: Arguments: ["/usr/lib/jellyfin/jellyfin.dll"]
[08:02:31] [INF] [1] Main: Operating system: Linux
[08:02:31] [INF] [1] Main: Architecture: X64
[08:02:31] [INF] [1] Main: 64-Bit Process: True
[08:02:31] [INF] [1] Main: User Interactive: True
[08:02:31] [INF] [1] Main: Processor count: 4
[08:02:31] [INF] [1] Main: Program data path: /home/anon/.local/share/jellyfin
[08:02:31] [INF] [1] Main: Web resources path: /usr/lib/jellyfin/jellyfin-web
[08:02:31] [INF] [1] Main: Application directory: /usr/lib/jellyfin/
No usable version of libssl was found
Canceled

Edit: It seems like it just need the symlink mentioned here:
ppy/osu#7994 (comment)
ln -s /usr/lib/libssl.so.47.0.6 /usr/lib/libssl.so.1.0.0

@Anachron
Copy link
Contributor

Anachron commented Mar 20, 2020

This works on aarch64 too:

I'll check later if armv7l also works as intended.

EDIT: NEW WIP:

# Template file for 'jellyfin'
pkgname=jellyfin
version=10.5.0
revision=1
wrksrc="${pkgname}-${version}"
create_wrksrc=yes
archs="i686 x86_64 aarmv7l aarch64"
build_style=meta
hostmakedepends="dotnet-sdk-bin yarn"
makedepends="icu-devel libssl47 git"
depends="ffmpeg sqlite"
short_desc="Free Software Media System "
maintainer="Abel Tesfaye <abel-tesfaye@hotmail.com>"
license="GPL-2.0-or-later"
homepage="https://jellyfin.readthedocs.io"
distfiles="
 https://github.com/${pkgname}/${pkgname}/archive/v${version}.tar.gz>${pkgname}-${version}.tar.gz
 https://github.com/${pkgname}/${pkgname}-web/archive/v${version}.tar.gz>${pkgname}-web-${version}.tar.gz"
checksum="
 f5631758c2a175ae04bedd6d8f8566b2222b14254261bdf29019ecdffde0dddd
 e50b280e805469367bedfef41c32070907e191d4a856b92049e6f6fd558e1dea"
nopie=yes

system_accounts="jellyfin"
jellyfin_homedir="/var/lib/jellyfin"

do_build() {
  cd jellyfin-web-${version}
  yarn install

  # https://docs.microsoft.com/de-de/dotnet/core/rid-catalog#linux-rids
  case "${XBPS_TARGET_MACHINE}" in
    i686) _build_arch="x86";;
    x86_64) _build_arch="x64";;
    armv7l) _build_arch="arm";;
    aarch64) _build_arch="arm64";;
  esac

  cd ../jellyfin-${version}

  export DOTNET_CLI_TELEMETRY_OPTOUT=1
  export CLR_OPENSSL_VERSION_OVERRIDE=47
  dotnet build -r "linux-${_build_arch}" --configuration Release Jellyfin.Server
  dotnet publish -r "linux-${_build_arch}" --configuration Release Jellyfin.Server --output "$PWD"/publish
  rm -rfv publish/runtimes/{alpine-*,osx*,tizen-*,win*,linux-musl-x64,linux-armel}

  test "${XBPS_TARGET_MACHINE}" = 'i686' || rm -rfv publish/runtimes/linux-x86
  test "${XBPS_TARGET_MACHINE}" = 'x86_64' || rm -rfv publish/runtimes/linux-x64
  test "${XBPS_TARGET_MACHINE}" = 'armv7l' || rm -rfv publish/runtimes/linux-arm
  test "${XBPS_TARGET_MACHINE}" = 'aarch64' || rm -rfv publish/runtimes/linux-arm64
  
  mkdir publish/jellyfin-web
  cp -rv ../jellyfin-web-${version}/dist/. publish/jellyfin-web
}

do_install() {
  vmkdir usr/lib/jellyfin
  #vmkdir etc/default
  #vcopy "${FILESDIR}/jellyfin.default" etc/default/jellyfin 
  vcopy "${pkgname}-${version}/publish/." usr/lib/jellyfin
  #vsv jellyfin
}

@tesfaye
Copy link

tesfaye commented Mar 22, 2020

Unfortunately, Jellyfin doesn't support x86 since Microsoft doesn't provide x86 .net binaries for Linux

@Anachron
Copy link
Contributor

Yep but can be built from source it seems:
https://github.com/dotnet/source-build/blob/release/3.1/cross/build-rootfs.sh

I'll see if I can get it working.

@tesfaye
Copy link

tesfaye commented Mar 22, 2020

fail: Microsoft.DotNet.Darc.Operations.Operation[0] Something failed while cloning. System.Exception: Something went wrong when cloning repo https://github.com/dotnet/arcade at <default branch> into /builddir/dotnet-core-3.1.102/bin/src/arcade ---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'git2-7ce88e6' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-7ce88e6: cannot open shared object file: No such file or directory at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() at LibGit2Sharp.Core.NativeMethods..cctor() --- End of inner exception stack trace ---
I tried building from source, but it fails at this step. Here is the template file I used if it's any help. I modified Arch's buildfile and patches from the AUR.

https://gist.github.com/tesfaye/9f9b37a67948860111049f55ed6f60d8

@Johnnynator
Copy link
Member

Building from source still pulls in random binaries, some of them link against OpenSSL (e.g. libgit), which is most likely the issue you see right now.

@Anachron
Copy link
Contributor

Anachron commented Jul 9, 2020

I'll get back to this,- I'm currently packaging 10.5.5 and plan to retry building dotnet from source (maybe its easier now).

@Anachron
Copy link
Contributor

Anachron commented Jul 12, 2021

WIP of jellyfin-bin (I'm tired of trying to build dotnet from source ...)

This work on both x86_64 and aarch64 (RPI 3B+)

# Template file for 'jellyfin-bin'
pkgname=jellyfin-bin
version=10.7.6
revision=1
archs="x86_64 aarch64"
wrksrc="jellyfin-${version}"
create_wrksrc=yes
build_style=meta
depends="ffmpeg sqlite icu"
short_desc="Free Software Media System"
maintainer="Anachron <gith@cron.world>"
license="GPL-3.0-or-later"
homepage="https://jellyfin.org"
distfiles="https://repo.jellyfin.org/releases/server/linux/stable/web/jellyfin-web_${version}_portable.tar.gz"
checksum="c714c6357176ce44ca4e3d354875ad7c11578af358cb5fa520a5f29626e5fe00"

system_accounts="_jellyfin"
_jellyfin_homedir="/var/lib/jellyfin"

case "${XBPS_TARGET_MACHINE}" in
  x86_64)
    distfiles+=" https://repo.jellyfin.org/releases/server/linux/stable/server/jellyfin-server_${version}_linux-amd64.tar.gz"
    checksum+=" 883f30229fd97bc6fc8a421dd3c7d358dd821363fd8d9c5ea0283c514dae3cc9"
    ;;
  aarch64)
    distfiles+=" https://repo.jellyfin.org/releases/server/linux/stable/server/jellyfin-server_${version}_linux-arm64.tar.gz"
    checksum+=" ace584ffdde02b685d0d8b9b45a50e84e86422e86c23f11193b56d2a3e43d673"
    ;;
esac

post_extract() {
  mv jellyfin-server_*/* .
  rmdir jellyfin-server_*
  mv jellyfin-web_* jellyfin-web
}

do_install() {
  vmkdir usr/lib/jellyfin
  vcopy . usr/lib/jellyfin
  vsv jellyfin
}

@github-actions

This comment was marked as outdated.

@github-actions github-actions bot added Stale and removed Stale labels Apr 15, 2022
@kjkent

This comment was marked as off-topic.

@Anachron
Copy link
Contributor

I've been using this template on my aarch64 powered RoockPro64:

https://git.sr.ht/~anachron/void-package-templates/tree/master/item/srcpkgs/jellyfin-bin

So if you are like me and don't want to wait another eternity for dotnet to appear in the Void Repos, you can go ahead and package from binary in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Package request Stale
Projects
None yet
Development

No branches or pull requests

8 participants