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

43 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-15 08:07:56 +01:00
{ lib, stdenv, fetchurl, makeWrapper
2015-11-08 09:52:04 +01:00
, libzen, libmediainfo , jre8
}:
stdenv.mkDerivation rec {
pname = "ums";
2021-09-30 22:37:42 +02:00
version = "10.12.0";
2020-05-07 00:17:17 +02:00
src = {
i686-linux = fetchurl {
2021-01-15 08:07:56 +01:00
url = "mirror://sourceforge/project/unimediaserver/${version}/" + lib.toUpper "${pname}-${version}" + "-x86.tgz";
2021-09-30 22:37:42 +02:00
sha256 = "0j3d5zcwwswlcr2vicmvnnr7n8cg3q46svz0mbmga4j3da4473i6";
2020-05-07 00:17:17 +02:00
};
x86_64-linux = fetchurl {
2021-01-15 08:07:56 +01:00
url = "mirror://sourceforge/project/unimediaserver/${version}/" + lib.toUpper "${pname}-${version}" + "-x86_64.tgz";
2021-09-30 22:37:42 +02:00
sha256 = "06f96vkf593aasyfw458fa4x3rnai2k83vpgzc83hlwr0rw70qfn";
2020-05-07 00:17:17 +02:00
};
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
2015-11-08 09:52:04 +01:00
nativeBuildInputs = [ makeWrapper ];
2015-11-08 09:52:04 +01:00
installPhase = ''
cp -a . $out/
mkdir $out/bin
mv $out/documentation /$out/doc
# ums >= 9.0.0 ships its own JRE in the package. if we remove it, the `UMS.sh`
# script will correctly fall back to the JRE specified by JAVA_HOME
2021-09-30 22:37:42 +02:00
rm -rf $out/jre8
2015-11-08 09:52:04 +01:00
makeWrapper "$out/UMS.sh" "$out/bin/ums" \
2021-01-15 08:07:56 +01:00
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath [ libzen libmediainfo] }" \
2015-11-08 09:52:04 +01:00
--set JAVA_HOME "${jre8}"
'';
meta = {
description = "Universal Media Server: a DLNA-compliant UPnP Media Server";
2021-01-15 08:07:56 +01:00
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ thall snicket2100 ];
2015-11-08 09:52:04 +01:00
};
}