From 788ee3bcc1a1b648645a52a54b1b4b08685e054f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 18 Oct 2015 02:48:19 -0700 Subject: [PATCH] unity3d: wip at 5.1.0f3 --- pkgs/development/tools/unity3d/default.nix | 135 +++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 137 insertions(+) create mode 100644 pkgs/development/tools/unity3d/default.nix diff --git a/pkgs/development/tools/unity3d/default.nix b/pkgs/development/tools/unity3d/default.nix new file mode 100644 index 000000000000..5c805ac667d9 --- /dev/null +++ b/pkgs/development/tools/unity3d/default.nix @@ -0,0 +1,135 @@ +{ GConf +, alsaLib +, fetchurl +, stdenv +, makeWrapper +, cairo +, libcap +, cups +, dbus +, expat +, postgresql +, fontconfig +, freetype +, gdk_pixbuf +, getopt +, fakeroot +, glib +, gtk +, mesa_glu +, nspr +, nss +, pango +, xorg +, monodevelop +, xdg_utils +}: + +let + deps = [ + GConf + alsaLib + cairo + cups + libcap + dbus + expat + fontconfig + freetype + glib + gtk + gdk_pixbuf + mesa_glu + nspr + postgresql + nss + pango + xorg.libXcomposite + xorg.libX11 + xorg.libXcursor + xorg.libXdamage + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXtst + ]; + libPath = stdenv.lib.makeLibraryPath deps; + ver = "5.1.0"; + build = "f3"; + date = "2015091501"; + pkgVer = "${ver}${build}"; + fullVer = "${pkgVer}+${date}"; +in stdenv.mkDerivation rec { + name = "unity-editor-${version}"; + version = pkgVer; + buildInputs = [ makeWrapper monodevelop xdg_utils getopt fakeroot ]; + + src = fetchurl { + url = "http://download.unity3d.com/download_unity/unity-editor-installer-${fullVer}.sh"; + sha256 = "77b351d80fc4b63284f118093df486e16c13d7b136debae6534245878029a5ca"; + }; + + outputs = ["out" "sandbox"]; + + unpackPhase = '' + # 'yes | fakeroot' + echo -e 'q\ny' | fakeroot sh $src + sourceRoot="unity-editor-${pkgVer}" + ''; + + installPhase = '' + unitydir=$out/opt/Unity + + mkdir -p $out/{bin,opt} + mkdir -p $sandbox/bin + mkdir -p $unitydir + mkdir -p $out/share/applications + mkdir -p $out/share/icons/hicolor/{256x256,48x48}/apps + + mv Editor $unitydir + mv MonoDevelop $unitydir + + echo "exec $unitydir/Editor/Unity \"\$@\"" > $out/bin/unity-editor + chmod +x $out/bin/unity-editor + + sed "/^Exec=/c\Exec=$out/bin/unity-editor" < unity-editor.desktop \ + > $out/share/applications/unity-editor.desktop + + #sed -i "/^Exec=/c\Exec=$out/bin/monodevelop-unity" unity-monodevelop.desktop + + cp unity-editor-icon.png $out/share/icons/hicolor/256x256/apps + # cp $unitydir/unity-monodevelop.png $out/share/icons/hicolor/48x48/apps + + rpath="$unitydir/Editor/Data/Tools:$unitydir/Editor:${stdenv.cc.cc}/lib" + + patchelf \ + --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + $unitydir/Editor/chrome-sandbox + + cp $unitydir/Editor/chrome-sandbox $sandbox/bin + rm $unitydir/Editor/chrome-sandbox + + patchelf \ + --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ + --set-rpath "$rpath" \ + $unitydir/Editor/Unity + + wrapProgram $out/bin/unity-editor \ + --prefix LD_LIBRARY_PATH : "${libPath}" + + ''; + + dontStrip = true; + + meta = { + homepage = https://unity3d.com/; + description = "Game development tool"; + longDescription = '' + Popular development platform for creating 2D and 3D multiplatform games + and interactive experiences. + ''; + license = stdenv.lib.licenses.unfree; + maintainers = with stdenv.lib.maintainers; [ jb55 ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index b4c4d163390e..888cce92e673 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16749,6 +16749,8 @@ in ums = callPackage ../servers/ums { }; + unity3d = callPackage ../development/tools/unity3d { inherit (gnome) GConf; }; + urbit = callPackage ../misc/urbit { }; utf8proc = callPackage ../development/libraries/utf8proc { };