nixpkgs/pkgs/development/tools/unityhub/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

144 lines
3.1 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchurl
, dpkg
, makeWrapper
, buildFHSEnv
2022-12-01 21:44:59 +00:00
, extraPkgs ? pkgs: [ ]
, extraLibs ? pkgs: [ ]
}:
2019-12-28 18:16:18 +00:00
2022-12-01 21:44:59 +00:00
stdenv.mkDerivation rec {
2022-04-30 00:44:52 +00:00
pname = "unityhub";
2023-12-28 21:22:34 +00:00
version = "3.7.0";
2022-04-30 00:44:52 +00:00
2021-08-05 07:29:28 +00:00
src = fetchurl {
2022-12-01 21:44:59 +00:00
url = "https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local/pool/main/u/unity/unityhub_amd64/unityhub-amd64-${version}.deb";
2023-12-28 21:22:34 +00:00
sha256 = "sha256-cFHcfpsHSDlR82PtZ0leRDpvCD6nw0Qdb3PsYKMnosA=";
2021-08-05 07:29:28 +00:00
};
2019-12-28 18:16:18 +00:00
2022-12-01 21:44:59 +00:00
nativeBuildInputs = [
dpkg
makeWrapper
];
2019-12-28 18:16:18 +00:00
fhsEnv = buildFHSEnv {
2022-12-01 21:44:59 +00:00
name = "${pname}-fhs-env";
runScript = "";
2022-12-01 21:44:59 +00:00
targetPkgs = pkgs: with pkgs; [
# Unity Hub binary dependencies
2022-12-01 21:44:59 +00:00
xorg.libXrandr
xdg-utils
2022-12-01 21:44:59 +00:00
# GTK filepicker
gsettings-desktop-schemas
hicolor-icon-theme
# Bug Reporter dependencies
fontconfig
freetype
lsb-release
] ++ extraPkgs pkgs;
multiPkgs = pkgs: with pkgs; [
# Unity Hub ldd dependencies
cups
gtk3
expat
libxkbcommon
lttng-ust_2_12
krb5
alsa-lib
nss
2022-12-01 21:44:59 +00:00
libdrm
mesa
nspr
atk
dbus
at-spi2-core
pango
xorg.libXcomposite
xorg.libXext
xorg.libXdamage
xorg.libXfixes
xorg.libxcb
xorg.libxshmfence
xorg.libXScrnSaver
xorg.libXtst
# Unity Hub additional dependencies
libva
openssl
2022-12-01 21:44:59 +00:00
cairo
libnotify
libuuid
libsecret
udev
libappindicator
wayland
cpio
icu
libpulseaudio
# Unity Editor dependencies
2022-12-01 21:44:59 +00:00
libglvnd # provides ligbl
xorg.libX11
xorg.libXcursor
glib
gdk-pixbuf
libxml2
zlib
clang
git # for git-based packages in unity package manager
# Unity Editor 2019 specific dependencies
xorg.libXi
xorg.libXrender
gnome2.GConf
libcap
2022-12-01 21:44:59 +00:00
] ++ extraLibs pkgs;
};
unpackCmd = "dpkg -x $curSrc src";
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
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
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
runHook postInstall
'';
2021-08-05 07:29:28 +00:00
2023-04-19 23:56:52 +00:00
passthru.updateScript = ./update.sh;
meta = with lib; {
2022-12-01 21:44:59 +00:00
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";
2019-12-28 18:16:18 +00:00
license = licenses.unfree;
2022-12-01 21:44:59 +00:00
maintainers = with maintainers; [ tesq0 huantian ];
2019-12-28 18:16:18 +00:00
platforms = [ "x86_64-linux" ];
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2019-12-28 18:16:18 +00:00
};
}