2023-05-24 13:37:59 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, dpkg
|
|
|
|
, makeWrapper
|
|
|
|
, buildFHSEnv
|
2023-03-24 00:07:29 +00:00
|
|
|
, extraPkgs ? pkgs: [ ]
|
|
|
|
, extraLibs ? pkgs: [ ]
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2022-04-27 09:35:20 +00:00
|
|
|
pname = "unityhub";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "3.5.0";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
src = fetchurl {
|
2023-03-24 00:07:29 +00:00
|
|
|
url = "https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local/pool/main/u/unity/unityhub_amd64/unityhub-amd64-${version}.deb";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-d5TUUhGqchkrCRqJWHEewurjsHxbfZ+5hv9w9Yv2EQ4=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
dpkg
|
|
|
|
makeWrapper
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
fhsEnv = buildFHSEnv {
|
2023-03-24 00:07:29 +00:00
|
|
|
name = "${pname}-fhs-env";
|
|
|
|
runScript = "";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2023-03-24 00:07:29 +00:00
|
|
|
targetPkgs = pkgs: with pkgs; [
|
2023-07-15 17:15:38 +00:00
|
|
|
# Unity Hub binary dependencies
|
2023-03-24 00:07:29 +00:00
|
|
|
xorg.libXrandr
|
2023-07-15 17:15:38 +00:00
|
|
|
xdg-utils
|
2023-03-24 00:07:29 +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-15 17:15:38 +00:00
|
|
|
nss
|
2023-03-24 00:07:29 +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-24 13:37:59 +00:00
|
|
|
openssl
|
2023-03-24 00:07:29 +00:00
|
|
|
cairo
|
|
|
|
libnotify
|
|
|
|
libuuid
|
|
|
|
libsecret
|
|
|
|
udev
|
|
|
|
libappindicator
|
|
|
|
wayland
|
|
|
|
cpio
|
|
|
|
icu
|
|
|
|
libpulseaudio
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# Unity Editor dependencies
|
2023-03-24 00:07:29 +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-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
# Unity Editor 2019 specific dependencies
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrender
|
|
|
|
gnome2.GConf
|
|
|
|
libcap
|
2023-03-24 00:07:29 +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 21:33:18 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-24 00:07:29 +00:00
|
|
|
description = "Official Unity3D app to download and manage Unity Projects and installations";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://unity.com/";
|
|
|
|
downloadPage = "https://unity.com/unity-hub";
|
|
|
|
changelog = "https://unity.com/unity-hub/release-notes";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.unfree;
|
2023-03-24 00:07:29 +00:00
|
|
|
maintainers = with maintainers; [ tesq0 huantian ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|