1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/servers/emby/default.nix

53 lines
1.7 KiB
Nix
Raw Normal View History

2018-10-02 11:13:53 +01:00
{ stdenv, fetchurl, unzip, sqlite, makeWrapper, dotnet-sdk, ffmpeg }:
2016-04-23 14:08:45 +01:00
stdenv.mkDerivation rec {
name = "emby-${version}";
2018-10-02 11:13:53 +01:00
version = "3.5.3.0";
2018-09-17 14:41:16 +01:00
# 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 14:08:45 +01:00
src = fetchurl {
2018-10-02 11:13:53 +01:00
url = "https://github.com/MediaBrowser/Emby.Releases/releases/download/${version}/embyserver-netcore_${version}.zip";
sha256 = "0311af3q813cx0ykbdk9vkmnyqi2l8rx66jnvdkw927q6invnnpj";
2016-04-23 14:08:45 +01:00
};
2018-09-17 14:41:16 +01:00
buildInputs = [
unzip
makeWrapper
];
2018-09-17 14:41:16 +01:00
propagatedBuildInputs = [
2018-10-02 11:13:53 +01:00
dotnet-sdk
sqlite
];
2016-04-23 14:08:45 +01:00
2018-09-17 14:41:16 +01:00
preferLocalBuild = true;
buildPhase = ''
2018-10-02 11:13:53 +01:00
rm -rf {electron,runtimes}
2016-04-23 14:08:45 +01:00
'';
installPhase = ''
2018-10-04 09:12:57 +01:00
install -dm 755 "$out/opt/emby-server"
cp -r * "$out/opt/emby-server"
2018-10-02 11:13:53 +01:00
makeWrapper "${dotnet-sdk}/bin/dotnet" $out/bin/emby \
2018-10-02 11:37:34 +01:00
--prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
sqlite
]}" \
--add-flags "$out/opt/emby-server/EmbyServer.dll -ffmpeg ${ffmpeg}/bin/ffmpeg -ffprobe ${ffmpeg}/bin/ffprobe"
2016-04-23 14:08:45 +01:00
'';
2018-09-17 14:41:16 +01:00
meta = with stdenv.lib; {
2016-04-23 14:08:45 +01:00
description = "MediaBrowser - Bring together your videos, music, photos, and live television";
2017-08-12 09:28:09 +01:00
homepage = https://emby.media/;
2018-09-17 14:41:16 +01:00
license = licenses.gpl2;
maintainers = with maintainers; [ fadenb ];
platforms = platforms.all;
2016-04-23 14:08:45 +01:00
};
}