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 = " e m b y - ${ 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 = " h t t p s : / / g i t h u b . c o m / M e d i a B r o w s e r / E m b y . R e l e a s e s / r e l e a s e s / d o w n l o a d / ${ version } / e m b y s e r v e r - n e t c o r e _ ${ version } . z i p " ;
sha256 = " 0 3 1 1 a f 3 q 8 1 3 c x 0 y k b d k 9 v k m n y q i 2 l 8 r x 6 6 j n v d k w 9 2 7 q 6 i n v n n p j " ;
2016-04-23 14:08:45 +01:00
} ;
2018-09-17 14:41:16 +01:00
buildInputs = [
2017-01-30 19:20:11 +00:00
unzip
2016-10-03 11:14:46 +01:00
makeWrapper
] ;
2018-09-17 14:41:16 +01:00
propagatedBuildInputs = [
2018-10-02 11:13:53 +01:00
dotnet-sdk
2016-05-25 20:23:42 +01:00
sqlite
] ;
2016-04-23 14:08:45 +01:00
2018-09-17 14:41:16 +01:00
preferLocalBuild = true ;
2016-05-25 20:23:42 +01:00
buildPhase = ''
2018-10-02 11:13:53 +01:00
rm - rf { electron , runtimes }
2016-04-23 14:08:45 +01:00
'' ;
installPhase = ''
2018-10-03 08:44:53 +01:00
install - dm 755 " $ o u t / l i b / e m b y - s e r v e r "
cp - r * " $ o u t / l i b / e m b y - s e r v e r "
2016-10-03 11:14:46 +01:00
2018-10-02 11:13:53 +01:00
makeWrapper " ${ dotnet-sdk } / b i n / d o t n e t " $ out/bin/emby \
2018-10-02 11:37:34 +01:00
- - prefix LD_LIBRARY_PATH : " ${ stdenv . lib . makeLibraryPath [
sqlite
] } " \
2018-10-03 08:44:53 +01:00
- - add-flags " $ o u t / l i b / e m b y - s e r v e r / E m b y S e r v e r . d l l - p r o g r a m d a t a / v a r / l i b / e m b y / P r o g r a m D a t a - S e r v e r - f f m p e g ${ ffmpeg } / b i n / f f m p e g - f f p r o b e ${ ffmpeg } / b i n / f f p r o b e "
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 = " M e d i a B r o w s e r - B r i n g t o g e t h e r y o u r v i d e o s , m u s i c , p h o t o s , a n d l i v e t e l e v i s i o n " ;
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
} ;
}