nixpkgs/pkgs/by-name/um/ums/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

44 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper
, libzen, libmediainfo , jre8
}:
stdenv.mkDerivation rec {
pname = "ums";
version = "10.12.0";
src = {
i686-linux = fetchurl {
url = "mirror://sourceforge/project/unimediaserver/${version}/" + lib.toUpper "${pname}-${version}" + "-x86.tgz";
sha256 = "0j3d5zcwwswlcr2vicmvnnr7n8cg3q46svz0mbmga4j3da4473i6";
};
x86_64-linux = fetchurl {
url = "mirror://sourceforge/project/unimediaserver/${version}/" + lib.toUpper "${pname}-${version}" + "-x86_64.tgz";
sha256 = "06f96vkf593aasyfw458fa4x3rnai2k83vpgzc83hlwr0rw70qfn";
};
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
nativeBuildInputs = [ makeWrapper ];
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
rm -rf $out/jre8
makeWrapper "$out/UMS.sh" "$out/bin/ums" \
--prefix LD_LIBRARY_PATH ":" "${lib.makeLibraryPath [ libzen libmediainfo] }" \
--set JAVA_HOME "${jre8}"
'';
meta = {
description = "Universal Media Server: a DLNA-compliant UPnP Media Server";
license = lib.licenses.gpl2Only;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ thall snicket2100 ];
mainProgram = "ums";
};
}