nixpkgs-suyu/pkgs/servers/emby/default.nix

54 lines
1.9 KiB
Nix
Raw Normal View History

2018-09-17 15:41:16 +02:00
{ stdenv, fetchurl, unzip, sqlite, makeWrapper, mono54, ffmpeg }:
2016-04-23 15:08:45 +02:00
stdenv.mkDerivation rec {
name = "emby-${version}";
2018-09-17 15:41:16 +02:00
version = "3.5.2.0";
# We are fetching a binary here, however, a source build is possible.
# See -> https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=emby-server-git#n43
# Though in my attempt it failed with this error repeatedly
# The type 'Attribute' is defined in an assembly that is not referenced. You must add a reference to assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
# This may also need msbuild (instead of xbuild) which isn't in nixpkgs
# See -> https://github.com/NixOS/nixpkgs/issues/29817
2016-04-23 15:08:45 +02:00
src = fetchurl {
2018-09-17 15:41:16 +02:00
url = "https://github.com/MediaBrowser/Emby.Releases/releases/download/${version}/embyserver-mono_${version}.zip";
sha256 = "12f9skvnr9qxnrvr3q014yggfwvkpjk0ynbgf0fwk56h4kal7fx8";
2016-04-23 15:08:45 +02:00
};
2018-09-17 15:41:16 +02:00
buildInputs = [
unzip
makeWrapper
];
2018-09-17 15:41:16 +02:00
propagatedBuildInputs = [
2018-08-24 00:42:47 +02:00
mono54
sqlite
];
2016-04-23 15:08:45 +02:00
2018-09-17 15:41:16 +02:00
preferLocalBuild = true;
# Need to set sourceRoot as unpacker will complain about multiple directory output
sourceRoot = ".";
buildPhase = ''
substituteInPlace SQLitePCLRaw.provider.sqlite3.dll.config --replace libsqlite3.so ${sqlite.out}/lib/libsqlite3.so
substituteInPlace MediaBrowser.Server.Mono.exe.config --replace ProgramData-Server "/var/lib/emby/ProgramData-Server"
2016-04-23 15:08:45 +02:00
'';
installPhase = ''
2018-09-17 15:41:16 +02:00
mkdir -p "$out/bin"
cp -r * "$out/bin"
2018-08-24 00:42:47 +02:00
makeWrapper "${mono54}/bin/mono" $out/bin/MediaBrowser.Server.Mono \
--add-flags "$out/bin/MediaBrowser.Server.Mono.exe -ffmpeg ${ffmpeg}/bin/ffmpeg -ffprobe ${ffmpeg}/bin/ffprobe"
2016-04-23 15:08:45 +02:00
'';
2018-09-17 15:41:16 +02:00
meta = with stdenv.lib; {
2016-04-23 15:08:45 +02:00
description = "MediaBrowser - Bring together your videos, music, photos, and live television";
2017-08-12 10:28:09 +02:00
homepage = https://emby.media/;
2018-09-17 15:41:16 +02:00
license = licenses.gpl2;
maintainers = with maintainers; [ fadenb ];
platforms = platforms.all;
2016-04-23 15:08:45 +02:00
};
}