From ece7f0effed4f33eec1894ae9a4dbb6c97958c3a Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 10 Sep 2017 08:18:09 +0200 Subject: 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 --- pkgs/games/build-support/build-unity.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'pkgs/games/build-support') 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" -- cgit 1.4.1