unityhub: package cleanup

This commit is contained in:
huantian
2025-08-03 15:00:02 -07:00
parent 7a637d9c2d
commit 40c0959d6c
+8 -14
View File
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local/pool/main/u/unity/unityhub_amd64/unityhub-amd64-${version}.deb";
sha256 = "sha256-gBQrz6CNlUyhxeLmY6tNtxpaQJSEW00r7MGyIDtYdiY=";
hash = "sha256-gBQrz6CNlUyhxeLmY6tNtxpaQJSEW00r7MGyIDtYdiY=";
};
nativeBuildInputs = [
@@ -117,8 +117,6 @@ stdenv.mkDerivation rec {
++ extraLibs pkgs;
};
unpackCmd = "dpkg -x $curSrc src";
dontConfigure = true;
dontBuild = true;
@@ -129,35 +127,31 @@ stdenv.mkDerivation rec {
mv opt/ usr/share/ $out
# `/opt/unityhub/unityhub` is a shell wrapper that runs `/opt/unityhub/unityhub-bin`
# Which we don't need and overwrite with our own custom wrapper
# which we don't need and overwrite with our own wrapper that uses the fhs env.
makeWrapper ${fhsEnv}/bin/${pname}-fhs-env $out/opt/unityhub/unityhub \
--add-flags $out/opt/unityhub/unityhub-bin \
--argv0 unityhub
# Link binary
mkdir -p $out/bin
ln -s $out/opt/unityhub/unityhub $out/bin/unityhub
# Replace absolute path in desktop file to correctly point to nix store
substituteInPlace $out/share/applications/unityhub.desktop \
--replace /opt/unityhub/unityhub $out/opt/unityhub/unityhub
--replace-fail /opt/unityhub/unityhub $out/opt/unityhub/unityhub
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
meta = {
description = "Official Unity3D app to download and manage Unity Projects and installations";
homepage = "https://unity.com/";
downloadPage = "https://unity.com/unity-hub";
changelog = "https://unity.com/unity-hub/release-notes";
license = licenses.unfree;
maintainers = with maintainers; [
tesq0
huantian
];
changelog = "https://unity.com/unity-hub/release-notes#${version}";
license = lib.licenses.unfree;
maintainers = with lib.maintainers; [ huantian ];
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
}