Skip to content

Instantly share code, notes, and snippets.

@lucyllewy
Created December 10, 2019 11:47
Show Gist options
  • Save lucyllewy/2b79066afb790257e4b0e1f6798205d3 to your computer and use it in GitHub Desktop.
Save lucyllewy/2b79066afb790257e4b0e1f6798205d3 to your computer and use it in GitHub Desktop.
snapcraft for jellyfin
name: jellyfin
adopt-info: jellyfin
summary: The Free Software Media System
description: >
Jellyfin is a Free Software Media System that puts you in control
of managing and streaming your media. It is an alternative to the
proprietary Emby and Plex, to provide media from a dedicated
server to end-user devices via multiple apps. Jellyfin is
descended from Emby's 3.5.2 release and ported to the .NET Core
framework to enable full cross-platform support. There are no
strings attached, no premium licenses or features, and no hidden
agendas: just a team who want to build something better and work
together to achieve it. We welcome anyone who is interested in
joining us in our quest!
grade: stable
confinement: strict
base: core
parts:
#### ffmpeg ####
nv-codec-headers:
plugin: make
source: https://github.com/FFmpeg/nv-codec-headers/releases/download/n9.0.18.1/nv-codec-headers-9.0.18.1.tar.gz
override-build: |
make install PREFIX=/usr
build-packages:
- pkg-config
fdk-aac:
plugin: autotools
source: https://github.com/mstorsjo/fdk-aac/archive/v2.0.0.tar.gz
build-packages:
- g++
configflags:
- --prefix=/usr
- --disable-static
prime:
- usr/lib
- -usr/lib/pkgconfig
ffmpeg:
plugin: autotools
source: https://github.com/FFmpeg/FFmpeg.git
override-pull: |
snapcraftctl pull
last_committed_tag="$(git tag -l | grep -v v | sort -rV | head -n1)"
last_committed_tag_ver="$(echo ${last_committed_tag} | sed 's/n//')"
last_released_tag="$(snap info ffmpeg | awk '$1 == "beta:" { print $2 }')"
# If the latest tag from the upstream project has not been released to
# beta, build that tag instead of master.
if [ "${last_committed_tag_ver}" != "${last_released_tag}" ]; then
git fetch
git checkout "${last_committed_tag}"
fi
build-packages:
- libass-dev
- libbz2-dev
- libdrm-dev
- libgnutls28-dev
- liblzma-dev
- libmp3lame-dev
- libomxil-bellagio-dev
- libopenal-dev
- libopencore-amrnb-dev
- libopencore-amrwb-dev
- libopus-dev
- libpulse-dev
- libsctp-dev
- libsdl2-dev
- libspeex-dev
- libtheora-dev
- libtwolame-dev
- libva-dev
- libv4l-dev
- libvdpau-dev
- libvorbis-dev
- libvpx-dev
- libx264-dev
- libx265-dev
- libxcb-shape0-dev
- libxcb-shm0-dev
- libxcb-xfixes0-dev
- libxv-dev
- libxvidcore-dev
- ocl-icd-opencl-dev
- opencl-headers
- pkg-config
- yasm
- on amd64:
- libcrystalhd-dev
- on i386:
- libcrystalhd-dev
stage-packages:
- libass5
- libdrm2
- libgnutls30
- libmp3lame0
- libopenal1
- libopencore-amrnb0
- libopencore-amrwb0
- libopus0
- libpulse0
- libsdl2-2.0-0
- libspeex1
- libtheora0
- libtwolame0
- libv4l-0
- libv4l2rds0
- libva-drm1
- libva-glx1
- libva-wayland1
- libvdpau-va-gl1
- libvorbis0a
- libvorbisenc2
- libvpx3
- libx264-148
- libx265-79
- libx11-6
- libxau6
- libxcb-shape0
- libxcb-shm0
- libxcb-xfixes0
- libxcb1
- libxdmcp6
- libxext6
- libxv1
- libxvidcore4
- mesa-va-drivers
- mesa-vdpau-drivers
- ocl-icd-libopencl1
- on amd64:
- i965-va-driver
- libcrystalhd3
- on i386:
- i965-va-driver
- libcrystalhd3
configflags:
- --prefix=/usr
- --disable-debug
- --disable-doc
- --disable-static
- --enable-avisynth
- --enable-cuda
- --enable-cuvid
- --enable-libdrm
- --enable-ffplay
- --enable-gnutls
- --enable-gpl
- --enable-libass
- --enable-libfdk-aac
- --enable-libfontconfig
- --enable-libfreetype
- --enable-libmp3lame
- --enable-libopencore_amrnb
- --enable-libopencore_amrwb
- --enable-libopus
- --enable-libpulse
- --enable-sdl2
- --enable-libspeex
- --enable-libtheora
- --enable-libtwolame
- --enable-libv4l2
- --enable-libvorbis
- --enable-libvpx
- --enable-libx264
- --enable-libx265
- --enable-libxcb
- --enable-libxvid
- --enable-nonfree
- --enable-nvenc
- --enable-omx
- --enable-openal
- --enable-opencl
- --enable-runtime-cpudetect
- --enable-shared
- --enable-vaapi
- --enable-vdpau
- --enable-version3
- --enable-xlib
after:
- nv-codec-headers
- fdk-aac
prime:
- usr/bin
- usr/lib
- -usr/lib/pkgconfig
- -usr/include
- -usr/share/doc
- -usr/share/man
ffmpeg-wrapper:
plugin: dump
source: https://github.com/snapcrafters/ffmpeg.git
source-subdir: files
stage-packages:
- mesa-utils
organize:
'ffplay': bin/
'ffmpeg': bin/
'ffprobe': bin/
'wrapper': bin/
after:
- ffmpeg
#### end ffmpeg ####
jellyfin:
source: https://github.com/jellyfin/jellyfin.git
source-subdir: Jellyfin.Server
plugin: dotnet
dotnet-runtime-version: '2.2.3'
override-pull: |
snapcraftctl pull
git checkout "$(git describe --tags --abbrev=0 --match v*)"
snapcraftctl set-version "$(git describe --tags | sed -e 's|^v||')"
environment:
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:$SNAP/usr/lib:/usr/lib/$SNAPCRAFT_ARCH_TRIPLET:/usr/lib:$SNAP/lib/$SNAPCRAFT_ARCH_TRIPLET:$SNAP/lib:/lib/$SNAPCRAFT_ARCH_TRIPLET:/lib:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa-egl:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri:/var/lib/snapd/lib/gl
apps:
jellyfin:
command: jellyfin
daemon: simple
plugs:
- desktop
- hardware-observe
- mount-observe
- network
- network-bind
- network-control
- network-observe
- process-control
- pulseaudio
- removable-media
- wayland
- x11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment