From e04e151f0802d5d04b3370c6783b540cdaaf5044 Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 25 Jun 2018 22:11:47 +0200 Subject: games/build-unity: Add support for .app dirs Some games (well, currently just one, Dungeons 3) come with a .app directory that contains additional game data which includes package .unity3d files. Such directories will be searched relative from the current working directory, so let's actually set the working directory to $out/share/something and copy the .app directory to that if it exists. Tested with Dungeons 3 and also with a few other Unity3d games to see whether they still work. Signed-off-by: aszlig --- pkgs/games/build-support/build-unity.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'pkgs/games') diff --git a/pkgs/games/build-support/build-unity.nix b/pkgs/games/build-support/build-unity.nix index 0bcfa246..4169870c 100644 --- a/pkgs/games/build-support/build-unity.nix +++ b/pkgs/games/build-support/build-unity.nix @@ -45,7 +45,8 @@ in buildGame ({ ln -s "$out/share/$slugName" "$out/libexec/$slugName/Data" mkdir -p "$out/bin" - makeWrapper "$out/libexec/$slugName/$slugName" "$out/bin/$slugName" + makeWrapper "$out/libexec/$slugName/$slugName" "$out/bin/$slugName" \ + --run "cd '$out/share/$slugName'" iconpath="$out/share/$slugName/Resources/UnityPlayer.png" mkdir -p "$out/share/applications" @@ -62,6 +63,10 @@ in buildGame ({ cp -vRd "$dataDir" "$out/share/$slugName" + if [ -d "$fullName.app" ]; then + cp -vRd -t "$out/share/$slugName" "$fullName.app" + fi + if [ ! -e "$iconpath" ]; then echo "Desktop icon not found at $iconpath." >&2 exit 1 -- cgit 1.4.1