Skip to content

Instantly share code, notes, and snippets.

@jmontleon
Last active February 29, 2024 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmontleon/460bb6e9890e77aecfbd0a73868e0d92 to your computer and use it in GitHub Desktop.
Save jmontleon/460bb6e9890e77aecfbd0a73868e0d92 to your computer and use it in GitHub Desktop.
jellyfin 10.9.0 ppc64le build
diff --git a/fedora/Makefile b/fedora/Makefile
index 3188cf603..b5bcb056e 100644
--- a/fedora/Makefile
+++ b/fedora/Makefile
@@ -11,7 +11,7 @@ epel-7-x86_64_repos := https://packages.microsoft.com/rhel/7/prod/
fed_ver := $(shell rpm -E %fedora)
# fallback when not running on Fedora
fed_ver ?= 36
-TARGET ?= fedora-$(fed_ver)-x86_64
+TARGET ?= fedora-$(fed_ver)-ppc64le
outdir ?= $(PWD)/$(DIR)/
diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec
index 5327495ad..06442d63a 100644
--- a/fedora/jellyfin.spec
+++ b/fedora/jellyfin.spec
@@ -23,6 +23,9 @@ BuildRequires: libcurl-devel, fontconfig-devel, freetype-devel, openssl-devel,
BuildRequires: dotnet-runtime-8.0, dotnet-sdk-8.0
Requires: %{name}-server = %{version}-%{release}, %{name}-web = %{version}-%{release}
+# Gross libSkiaSharp workaround
+BuildRequires: clang git-core gn ninja-build python-unversioned-command
+
%description
Jellyfin is a free software media system that puts you in control of managing and streaming your media.
@@ -49,19 +52,37 @@ the Jellyfin server to bind to ports 80 and/or 443 for example.
%prep
%autosetup -n jellyfin-server-%{version} -b 0
-
%build
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export PATH=$PATH:/usr/local/bin
# cannot use --output due to https://github.com/dotnet/sdk/issues/22220
-dotnet publish --configuration Release --self-contained --runtime linux-x64 \
+dotnet publish --configuration Release --self-contained --runtime fedora.39-ppc64le \
-p:DebugSymbols=false -p:DebugType=none Jellyfin.Server
+# Gross libSkiaSharp workaround
+git clone https://github.com/mono/skia.git -b v2.88.3
+git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
+cd skia
+sed -i '10 i #include <iterator>' src/utils/SkParseColor.cpp
+python tools/git-sync-deps
+gn gen 'out/linux/ppc64le' --args='
+ is_official_build=true skia_enable_tools=false
+ target_os="linux" target_cpu="ppc64le"
+ skia_use_icu=false skia_use_sfntly=false skia_use_piex=true
+ skia_use_system_expat=false skia_use_system_freetype2=false skia_use_system_libjpeg_turbo=false skia_use_system_libpng=false skia_use_system_libwebp=false skia_use_system_zlib=false
+ skia_enable_gpu=true
+ extra_cflags=[ "-DSKIA_C_DLL" ]
+ linux_soname_version="88.1.0"'
+../depot_tools/ninja 'SkiaSharp' -C 'out/linux/ppc64le'
%install
# Jellyfin files
%{__mkdir} -p %{buildroot}%{_libdir}/jellyfin %{buildroot}%{_bindir}
-%{__cp} -r Jellyfin.Server/bin/Release/net8.0/linux-x64/publish/* %{buildroot}%{_libdir}/jellyfin
+%{__cp} -r Jellyfin.Server/bin/Release/net8.0/fedora.39-ppc64le/publish/* %{buildroot}%{_libdir}/jellyfin
+
+# Gross libSkiaSharp workaround
+%{__cp} skia/out/linux/ppc64le/libSkiaSharp.so.88.1.0 %{buildroot}%{_libdir}/jellyfin/libSkiaSharp.so
+
%{__install} -D %{SOURCE10} %{buildroot}%{_bindir}/jellyfin
sed -i -e 's|/usr/lib64|%{_libdir}|g' %{buildroot}%{_bindir}/jellyfin
@@ -93,7 +114,7 @@ sed -i -e 's|/usr/lib64|%{_libdir}|g' %{buildroot}%{_bindir}/jellyfin
# Jellyfin files
%{_bindir}/jellyfin
# Needs 755 else only root can run it since binary build by dotnet is 722
-%attr(755,root,root) %{_libdir}/jellyfin/createdump
+#%attr(755,root,root) %{_libdir}/jellyfin/createdump
%attr(755,root,root) %{_libdir}/jellyfin/jellyfin
%{_libdir}/jellyfin/*
%attr(755,root,root) %{_bindir}/jellyfin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment