ums: 10.12.0 -> 13.2.1 (#388436)

This commit is contained in:
Pol Dellaiera 2025-03-28 21:59:25 +01:00 committed by GitHub
commit 4fed6d71eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 = {