From 49cb60c0d66d6a8b9cc5d50103ff52b62880a84e Mon Sep 17 00:00:00 2001 From: emaryn Date: Sun, 9 Mar 2025 21:56:49 +0800 Subject: [PATCH] ums: 10.12.0 -> 13.2.1 --- pkgs/by-name/um/ums/package.nix | 49 +++++++++++++++++---------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/pkgs/by-name/um/ums/package.nix b/pkgs/by-name/um/ums/package.nix index 43a52adbab86..1fcda5dae0b2 100644 --- a/pkgs/by-name/um/ums/package.nix +++ b/pkgs/by-name/um/ums/package.nix @@ -5,51 +5,54 @@ makeWrapper, libzen, libmediainfo, - jre8, + jdk17, }: stdenv.mkDerivation rec { pname = "ums"; - version = "10.12.0"; + version = "13.2.1"; src = - { - i686-linux = fetchurl { - url = - "mirror://sourceforge/project/unimediaserver/${version}/" - + lib.toUpper "${pname}-${version}" - + "-x86.tgz"; - sha256 = "0j3d5zcwwswlcr2vicmvnnr7n8cg3q46svz0mbmga4j3da4473i6"; + let + selectSystem = + attrs: + attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + arch = selectSystem { + x86_64-linux = "x86_64"; + aarch64-linux = "arm64"; }; - x86_64-linux = fetchurl { - url = - "mirror://sourceforge/project/unimediaserver/${version}/" - + lib.toUpper "${pname}-${version}" - + "-x86_64.tgz"; - sha256 = "06f96vkf593aasyfw458fa4x3rnai2k83vpgzc83hlwr0rw70qfn"; + in + fetchurl { + url = "mirror://sourceforge/project/unimediaserver/${version}/UMS-${version}-${arch}.tgz"; + hash = selectSystem { + x86_64-linux = "sha256-MGi5S0jA9WVh7PuNei5hInUVZLcypJu8izwWJpDi42s="; + aarch64-linux = "sha256-9x1M1rZxwg65RdMmxQ2geeF0yXrukQ3dQPXKfQ2GRIw="; }; - } - .${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + }; nativeBuildInputs = [ makeWrapper ]; installPhase = '' - cp -a . $out/ + runHook preInstall + + 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 + rm -rf $out/jre17 - makeWrapper "$out/UMS.sh" "$out/bin/ums" \ - --prefix LD_LIBRARY_PATH ":" "${ + makeWrapper $out/UMS.sh $out/bin/ums \ + --prefix LD_LIBRARY_PATH : ${ lib.makeLibraryPath [ libzen libmediainfo ] - }" \ - --set JAVA_HOME "${jre8}" + } \ + --set JAVA_HOME ${jdk17} + + runHook postInstall ''; meta = {