2023-05-12 22:38:54 +00:00
|
|
|
{ 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
|
|
|
|
2023-04-11 10:52:27 +00:00
|
|
|
fhsEnv = buildFHSEnv {
|
2022-12-01 21:44:59 +00:00
|
|
|
name = "${pname}-fhs-env";
|
|
|
|
runScript = "";
|
2020-06-24 21:06:58 +00:00
|
|
|
|
2022-12-01 21:44:59 +00:00
|
|
|
targetPkgs = pkgs: with pkgs; [
|
2023-07-01 22:29:22 +00:00
|
|
|
# Unity Hub binary dependencies
|
2022-12-01 21:44:59 +00:00
|
|
|
xorg.libXrandr
|
2023-07-01 22:29:22 +00:00
|
|
|
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
|
2023-07-01 22:29:22 +00:00
|
|
|
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
|
2023-05-12 22:38:54 +00:00
|
|
|
openssl
|
2022-12-01 21:44:59 +00:00
|
|
|
cairo
|
|
|
|
libnotify
|
|
|
|
libuuid
|
|
|
|
libsecret
|
|
|
|
udev
|
|
|
|
libappindicator
|
|
|
|
wayland
|
|
|
|
cpio
|
|
|
|
icu
|
|
|
|
libpulseaudio
|
|
|
|
|
2023-06-26 01:40:29 +00:00
|
|
|
# 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
|
2023-06-26 01:40:29 +00:00
|
|
|
|
|
|
|
# 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;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2022-12-01 21:44:59 +00:00
|
|
|
description = "Official Unity3D app to download and manage Unity Projects and installations";
|
2023-07-01 22:29:22 +00:00
|
|
|
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" ];
|
2023-07-01 22:29:22 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2019-12-28 18:16:18 +00:00
|
|
|
};
|
|
|
|
}
|