Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unityhub: init at 2.2.2 #65391

Merged
merged 4 commits into from Dec 28, 2019
Merged

unityhub: init at 2.2.2 #65391

merged 4 commits into from Dec 28, 2019

Conversation

tesq0
Copy link
Contributor

@tesq0 tesq0 commented Jul 25, 2019

Motivation for this change

#65229

Let's switch to unity hub so people can manage different versions of unity.
Seems like we don't need the old package anymore.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested execution of all binary files (usually in ./result/bin/)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

pkgs/development/libraries/libtinfo/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/libtinfo/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/libtinfo/default.nix Outdated Show resolved Hide resolved
pkgs/development/libraries/libtinfo/default.nix Outdated Show resolved Hide resolved
pkgs/development/tools/unity3d/base.nix Outdated Show resolved Hide resolved
pkgs/development/tools/unity3d/base.nix Outdated Show resolved Hide resolved
pkgs/development/tools/unity3d/base.nix Outdated Show resolved Hide resolved
@leo60228
Copy link
Member

Unity Hub works on NixOS with appimage-run. It's what I've been using.

@tesq0
Copy link
Contributor Author

tesq0 commented Jul 31, 2019

Unity Hub works on NixOS with appimage-run. It's what I've been using.

@leo60228
That sounds interesting. Maybe we could make a wrapper package instead or in addition to this.

@veprbl
Copy link
Member

veprbl commented Jul 31, 2019

cc @jb55

@infinisil
Copy link
Member

Can you change the title of the PR to something more meaningful?

@tesq0 tesq0 changed the title Unity merge request unity3d: Switch to unity hub Jul 31, 2019
@leo60228
Copy link
Member

Unity Hub on Linux is the recommended way to launch Unity itself, which is compiled for Ubuntu (not an appimage). I have an FHS env for this at https://github.com/leo60228/dotfiles/blob/master/unityenv.nix (ignore the hack in runScript).

@leo60228
Copy link
Member

leo60228 commented Aug 1, 2019

appimage-run also caches data in the user's HOME directory. It'd probably make more sense to do it in the build.

@jb55
Copy link
Contributor

jb55 commented Aug 1, 2019 via email

@tesq0
Copy link
Contributor Author

tesq0 commented Aug 2, 2019

I don't really use this package anymore, sorry. Feel free to remove my maintainership as an additional commit. @jb55

Seems like you already removed yourself in commit 94c3b33

@tesq0
Copy link
Contributor Author

tesq0 commented Aug 2, 2019

appimage-run also caches data in the user's HOME directory. It'd probably make more sense to do it in the build. @leo60228

I don't quite follow what you mean by this. It would be helpful if you could elaborate a bit more.

@leo60228
Copy link
Member

leo60228 commented Aug 2, 2019

There's a folder in ~/.cache/appimage-run/ for every appimage you run, and it's relatively large (~50MB).

@PlumpMath
Copy link

#59830

I want to compile a WebGL project. There is currently a problem with Emscripten embedded in Unity. Do you happen to know how to fix it?
Thanks. g,.g

@PlumpMath
Copy link

(mkDerivation rec{
pname = "unity-hub";
version = "master";
src = fetchurl {
url = "https://public-cdn.cloud.unity3d.com/hub/prod/UnityHub.AppImage";
sha256 = "1ckgva0bywi4wg480qfqgm69nic0v99hsgdk47mfzc26sqzzwkaz";
};
dontUnpack = true;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share
cp $src $out/share/UnityHub.AppImage
cat << EOF > "$out/bin/unityhub"
#!${runtimeShell}
${appimage-run}/bin/appimage-run $out/share/UnityHub.AppImage
EOF
chmod +x $out/bin/unityhub $out/share/UnityHub.AppImage
'';
})


can't execute (AppImage) and stop.

@PlumpMath
Copy link

PlumpMath commented Dec 2, 2019

unity3d = buildFHSUserEnv rec {
name = "unity3d";
targetPkgs = pkgs: with pkgs; [ appstream-glib gtk2 gdk_pixbuf glib libGL libGLU nss nspr alsaLib cups libcap fontconfig freetype pango cairo dbus expat zlib libpng12 udev tbb libpqxx gtk3 coreutils git python37Full nix-index gsettings-desktop-schemas breeze-gtk breeze-icons gnome3.adwaita-icon-theme fontconfig.lib xlibs.libXext.out xlibs.libXfixes.out fontconfig_210.lib xlibs.libX11.out xlibs.libXi.out libcap_progs.lib xlibs.libXcomposite.out atk.out xlibs.libSM.out cups.lib gnome2.gtk.out glib.out alsaLib.out xlibs.libXcursor.out xlibs.libXrender.out freetype.out libglvnd.out libGLU_combined.out zlib.out gnome2.GConf.out xlibs.libXtst.out cairo.out gcc-unwrapped.lib libGLU.out xlibs.libxcb.out xlibs.libXdamage.out dbus_libs.lib gnome2.pango.out nspr.out nssTools.out xorg_sys_opengl.out expat.out gdk_pixbuf.out xlibs.libICE.out gtk3.out xlibs.libXrandr.out ];
profile = ''
export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/gsettings-desktop-schemas-3.32.0/:${pkgs.gtk3}/share/gsettings-schemas/gtk+3-3.24.10"
'';
runScript = let
UNITY_EDITORS="~/Unity/Editor";
in pkgs.writeScript "unity3d" ''
GTK_THEME=Adwaita:dark exec ${UNITY_EDITORS}/Unity
'';
};


Thanks @leo60228

but webgl files.. problem

EM="$EDITOR/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten"
FAST="$EDITOR/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten_FastComp_Linux"
<--- (clang++ or python) libtinfo.so.5 ERROR


ERROR 1:

Failed running python "/Unity/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/emcc" @"/Downloads/u_car/ff/Assets/../Temp/emcc_arguments.resp"

stdout:
stderr:~/Unity/Editor/Data/PlaybackEngines/WebGLSupport/BuildTools/Emscripten_FastComp_Linux/opt: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directoryERROR:root:Failed to run llvm optimizations:
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


ERROR 2:

Exception: Failed building WebGL Player.
UnityEditor.WebGL.ProgramUtils.StartProgramChecked (System.Diagnostics.ProcessStartInfo p) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/ProgramUtils.cs:48)
UnityEditor.WebGL.WebGlBuildPostprocessor.EmscriptenLink (UnityEditor.Modules.BuildPostProcessArgs args, System.Boolean wasmBuild, System.String sourceFiles, System.String sourceFilesHash) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:432)
UnityEditor.WebGL.WebGlBuildPostprocessor.LinkBuild (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:482)
UnityEditor.WebGL.WebGlBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args) (at /Users/builduser/buildslave/unity/build/PlatformDependent/WebGL/Extensions/Unity.WebGL.extensions/BuildPostprocessor.cs:954)
UnityEditor.Modules.DefaultBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at /home/builduser/buildslave/unity/build/Editor/Mono/Modules/DefaultBuildPostprocessor.cs:27)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at /home/builduser/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:286)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Some of my currently unity-hub (appimage-run) doesn't work at all on my NixonOS.
So I think we need to solve the problem in the HOME folder by decompressing it and copying
Modify the installation default.nix script on the /nix/store, try... try...But failed.
I've lost all day.
I gave it up.

Now it's just, @leo60228 his way. Thanks help me~* ,.

@ar1a
Copy link
Contributor

ar1a commented Dec 8, 2019

is this pr blocked on only webgl?

@PlumpMath
Copy link

PlumpMath commented Dec 8, 2019

@ar1a
sorry, I don't know how to do github PR since I've never done it before.
g,.g;;
I have seen the manual of github's PR.
Do you know where the nixpkgs PR tutorials or good documents are located?

I'm Open the file directly and use unity3d.tar.xz.

@jb55
Copy link
Contributor

jb55 commented Dec 9, 2019

I couldn't get this to work. First I updated the AppImage link to the newest one on their site, but then when I tried to run it with appimage-run, it doesn't seem to do anything.

@leo60228
Copy link
Member

leo60228 commented Dec 9, 2019

I had to use Unity for a class, I haven't touched it in a while.

@veprbl
Copy link
Member

veprbl commented Dec 27, 2019

What is the status of this?

@tesq0
Copy link
Contributor Author

tesq0 commented Dec 28, 2019

I decided to put unityhub in a separate package in case someone still wants to use the other one.
It works great. @PlumpMath Compiling a WebGL project seems to work as well, but i had to copy the template files to the build folder manually. Other than that, it seems like it's ready to merge @veprbl.

@veprbl veprbl changed the title unity3d: Switch to unity hub unityhub: init at 2.2.2 Dec 28, 2019
@veprbl veprbl merged commit 650a635 into NixOS:master Dec 28, 2019
@tesq0 tesq0 deleted the unityMergeRequest branch December 28, 2019 19:15
@PlumpMath
Copy link

I have a problem with unity-hub.
What is your version of nixos? I'm 19.09-stable.
I have a problem with my nixos, so I am working in the window.
@tesq0
I'll try again later.

thanks.

@jb55
Copy link
Contributor

jb55 commented Dec 29, 2019

looks like the binary needs to be renamed from unityhub-2.2.2 to unityhub.

'';

src = fetchurl {
url = "https://public-cdn.cloud.unity3d.com/hub/prod/UnityHub.AppImage";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized, there will be broken hashes:
https://aur.archlinux.org/packages/unityhub/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for posterity

Unity doesn't provide version-specific urls for Unity Hub so on every update there will be some period where the sum is incorrect until I find time to update the package.

Then even after I update the package, the CDN will keep serving the old version for a while to some people...

There isn't much that I can do to make this better, so please be patient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative would be to upload UnityHub.AppImage to archive.org.
The hash is broken by the way in master.

veprbl added a commit that referenced this pull request Dec 29, 2019
@veprbl
Copy link
Member

veprbl commented Dec 29, 2019

I rolled back my change to the name. It works for me either way (I don't have licenses to test much, though).

Still, the issue with the absence of a stable download is a major one. We might have to remove unityhub from nixpkgs because of that.

@ar1a
Copy link
Contributor

ar1a commented Dec 30, 2019

surely there's an alternative to removing it. packaging is more help than just "here is a download url", it saves every single person who wants to use unityhub (there will be a lot, its what unity is transitioning to) to figuring out quirks, dependencies, etc

@ar1a ar1a mentioned this pull request Mar 17, 2020
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

9 participants