about summary refs log tree commit diff
path: root/pkgs/games/build-support/build-unity.nix
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-09-10 08:18:09 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-09-10 08:18:09 +0200
commitece7f0effed4f33eec1894ae9a4dbb6c97958c3a (patch)
treeadb7aa3a9b6ad4ef7c12acf31ce0ff595e96c26d /pkgs/games/build-support/build-unity.nix
parent7a7cffce514f8967cb610399890f252cab75eb6a (diff)
pkgs/build-unity: Wrap binary instead of linking
The executable of Unity games at the moment is unable to find its own
path if it can't do a stat() on argv[0]. So wrapping the program helps
here for now.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/games/build-support/build-unity.nix')
-rw-r--r--pkgs/games/build-support/build-unity.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/games/build-support/build-unity.nix b/pkgs/games/build-support/build-unity.nix
index 701ace91..e6c0162d 100644
--- a/pkgs/games/build-support/build-unity.nix
+++ b/pkgs/games/build-support/build-unity.nix
@@ -1,4 +1,4 @@
-{ stdenv, mesa, xorg, libpulseaudio, libudev }:
+{ stdenv, makeWrapper, mesa, xorg, libpulseaudio, libudev }:
 
 { name, version, fullName, buildPhase ? "", rpath ? [], ... }@attrs:
 
@@ -12,6 +12,8 @@ in stdenv.mkDerivation ({
   inherit version arch executable dataDir;
   slugName = name;
 
+  nativeBuildInputs = [ makeWrapper ];
+
   buildPhase = let
     mainRpath = stdenv.lib.makeLibraryPath ([
       stdenv.cc.cc mesa xorg.libX11 xorg.libXcursor xorg.libXrandr
@@ -36,7 +38,7 @@ in stdenv.mkDerivation ({
     ln -s "$out/share/$slugName" "$out/libexec/$slugName/Data"
 
     mkdir -p "$out/bin"
-    ln -s "$out/libexec/$slugName/$slugName" "$out/bin/$slugName"
+    makeWrapper "$out/libexec/$slugName/$slugName" "$out/bin/$slugName"
 
     mkdir -p "$out/share"
     cp -vRd "$dataDir" "$out/share/$slugName"