diff options
author | aszlig <aszlig@nix.build> | 2018-06-25 22:11:47 +0200 |
---|---|---|
committer | aszlig <aszlig@nix.build> | 2018-06-28 03:42:01 +0200 |
commit | e04e151f0802d5d04b3370c6783b540cdaaf5044 (patch) | |
tree | 2736ab69eda503108d9fe3caedc5feb9c57df30b /pkgs/games/build-support/build-unity.nix | |
parent | 0ffe48d746323c411361eb9124d957771ed8e545 (diff) |
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 <aszlig@nix.build>
Diffstat (limited to 'pkgs/games/build-support/build-unity.nix')
-rw-r--r-- | pkgs/games/build-support/build-unity.nix | 7 |
1 files changed, 6 insertions, 1 deletions
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 |