From 40c0959d6cf04791cca0c161de571e7231d1fbfd Mon Sep 17 00:00:00 2001 From: huantian Date: Sat, 5 Jul 2025 13:24:27 -0700 Subject: [PATCH] unityhub: package cleanup --- pkgs/by-name/un/unityhub/package.nix | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/un/unityhub/package.nix b/pkgs/by-name/un/unityhub/package.nix index 6200bd8270df..292eae8e8696 100644 --- a/pkgs/by-name/un/unityhub/package.nix +++ b/pkgs/by-name/un/unityhub/package.nix @@ -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 ]; }; }