Void-packages: Package Request: Jellyfin

Created on 7 Jan 2019  路  15Comments  路  Source: void-linux/void-packages

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

request

Most helpful comment

DotNet is packaged, I鈥榣l get to jellyfin soon.

All 15 comments

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

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

I鈥榣l see what I can do.

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

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

DotNet is packaged, I鈥榣l get to jellyfin soon.

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

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.

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 <[email protected]>"
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 <[email protected]>"
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*}
}

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 <[email protected]>"
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}"
}

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:
https://github.com/ppy/osu/issues/7994#issuecomment-591084486
ln -s /usr/lib/libssl.so.47.0.6 /usr/lib/libssl.so.1.0.0

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 <[email protected]>"
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
}

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

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.

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

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.

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).

Was this page helpful?
0 / 5 - 0 ratings