Skip to content

Commit e4959cf

Browse files
committed
unityhub: 2.3.2 -> 3.4.1
1 parent 878cb61 commit e4959cf

1 file changed

Lines changed: 113 additions & 29 deletions

File tree

Lines changed: 113 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,129 @@
1-
{ lib, fetchurl, appimageTools }:
1+
{ lib, stdenv, fetchurl, dpkg, makeWrapper, buildFHSUserEnv
2+
, extraPkgs ? pkgs: [ ]
3+
, extraLibs ? pkgs: [ ]
4+
}:
25

3-
appimageTools.wrapType2 rec {
6+
stdenv.mkDerivation rec {
47
pname = "unityhub";
5-
version = "2.3.2";
8+
version = "3.4.1";
69

710
src = fetchurl {
8-
# mirror of https://public-cdn.cloud.unity3d.com/hub/prod/UnityHub.AppImage
9-
url = "https://archive.org/download/unity-hub-${version}/UnityHub.AppImage";
10-
sha256 = "07nfyfp9apshqarc6pgshsczila6x4943hiyyizc55kp85aw0imn";
11+
url = "https://hub-dist.unity3d.com/artifactory/hub-debian-prod-local/pool/main/u/unity/unityhub_amd64/unityhub-amd64-${version}.deb";
12+
sha256 = "sha256-/P6gPLSRGfwEN801cyNrZTpHyZKO+4tU6cFvLz8ERuo=";
1113
};
1214

13-
extraPkgs = (pkgs: with pkgs; with xorg; [ gtk2 gdk-pixbuf glib libGL libGLU nss nspr
14-
alsa-lib cups libcap fontconfig freetype pango
15-
cairo dbus dbus-glib libdbusmenu libdbusmenu-gtk2 expat zlib libpng12 udev tbb
16-
libpqxx gtk3 libsecret lsb-release openssl nodejs ncurses5
15+
nativeBuildInputs = [
16+
dpkg
17+
makeWrapper
18+
];
1719

18-
libX11 libXcursor libXdamage libXfixes libXrender libXi
19-
libXcomposite libXext libXrandr libXtst libSM libICE libxcb
20+
fhsEnv = buildFHSUserEnv {
21+
name = "${pname}-fhs-env";
22+
runScript = "";
2023

21-
libselinux pciutils libpulseaudio libxml2 icu clang cacert
22-
]);
24+
# Seems to be needed for GTK filepickers to work in FHSUserEnv
25+
profile = "XDG_DATA_DIRS=\"\$XDG_DATA_DIRS:/usr/share/\"";
2326

24-
extraInstallCommands =
25-
let appimageContents = appimageTools.extractType2 { inherit pname version src; }; in
26-
''
27-
install -Dm444 ${appimageContents}/unityhub.desktop -t $out/share/applications
28-
substituteInPlace $out/share/applications/unityhub.desktop \
29-
--replace 'Exec=AppRun' 'Exec=${pname}'
30-
install -m 444 -D ${appimageContents}/unityhub.png \
31-
$out/share/icons/hicolor/64x64/apps/unityhub.png
32-
'';
27+
targetPkgs = pkgs: with pkgs; [
28+
xorg.libXrandr
29+
30+
# GTK filepicker
31+
gsettings-desktop-schemas
32+
hicolor-icon-theme
33+
34+
# Bug Reporter dependencies
35+
fontconfig
36+
freetype
37+
lsb-release
38+
] ++ extraPkgs pkgs;
39+
40+
multiPkgs = pkgs: with pkgs; [
41+
# Unity Hub ldd dependencies
42+
cups
43+
gtk3
44+
expat
45+
libxkbcommon
46+
lttng-ust_2_12
47+
krb5
48+
alsa-lib
49+
nss_latest
50+
libdrm
51+
mesa
52+
nspr
53+
atk
54+
dbus
55+
at-spi2-core
56+
pango
57+
xorg.libXcomposite
58+
xorg.libXext
59+
xorg.libXdamage
60+
xorg.libXfixes
61+
xorg.libxcb
62+
xorg.libxshmfence
63+
xorg.libXScrnSaver
64+
xorg.libXtst
65+
66+
# Unity Hub additional dependencies
67+
libva
68+
openssl_1_1
69+
cairo
70+
xdg-utils
71+
libnotify
72+
libuuid
73+
libsecret
74+
udev
75+
libappindicator
76+
wayland
77+
cpio
78+
icu
79+
libpulseaudio
80+
81+
# Editor dependencies
82+
libglvnd # provides ligbl
83+
xorg.libX11
84+
xorg.libXcursor
85+
glib
86+
gdk-pixbuf
87+
libxml2
88+
zlib
89+
clang
90+
git # for git-based packages in unity package manager
91+
] ++ extraLibs pkgs;
92+
};
93+
94+
unpackCmd = "dpkg -x $curSrc src";
95+
96+
dontConfigure = true;
97+
dontBuild = true;
98+
99+
installPhase = ''
100+
runHook preInstall
101+
102+
mkdir -p $out
103+
mv opt/ usr/share/ $out
104+
105+
# `/opt/unityhub/unityhub` is a shell wrapper that runs `/opt/unityhub/unityhub-bin`
106+
# Which we don't need and overwrite with our own custom wrapper
107+
makeWrapper ${fhsEnv}/bin/${pname}-fhs-env $out/opt/unityhub/unityhub \
108+
--add-flags $out/opt/unityhub/unityhub-bin \
109+
--argv0 unityhub
110+
111+
# Link binary
112+
mkdir -p $out/bin
113+
ln -s $out/opt/unityhub/unityhub $out/bin/unityhub
114+
115+
# Replace absolute path in desktop file to correctly point to nix store
116+
substituteInPlace $out/share/applications/unityhub.desktop \
117+
--replace /opt/unityhub/unityhub $out/opt/unityhub/unityhub
118+
119+
runHook postInstall
120+
'';
33121

34122
meta = with lib; {
123+
description = "Official Unity3D app to download and manage Unity Projects and installations";
35124
homepage = "https://unity3d.com/";
36-
description = "Game development tool";
37-
longDescription = ''
38-
Popular development platform for creating 2D and 3D multiplatform games
39-
and interactive experiences.
40-
'';
41125
license = licenses.unfree;
126+
maintainers = with maintainers; [ tesq0 huantian ];
42127
platforms = [ "x86_64-linux" ];
43-
maintainers = with maintainers; [ tesq0 ];
44128
};
45129
}

0 commit comments

Comments
 (0)