1 { stdenv, clonehero-unwrapped, writeScript }:
3 # Clone Hero doesn't have an installer, so it just stores configuration & data relative to the binary.
4 # This wrapper works around that limitation, storing game configuration & data in XDG_CONFIG_HOME.
7 desktopName = "Clone Hero";
9 writeScript "${name}-xdg-wrapper-${clonehero-unwrapped.version}" ''
11 configDir="''${XDG_CONFIG_HOME:-$HOME/.config}/unity3d/srylain Inc_/${desktopName}"
14 # Force link shipped clonehero_Data, unless directory already exists (to allow modding)
15 if [ ! -d "$configDir/clonehero_Data" ] || [ -L "$configDir/clonehero_Data" ]; then
16 ln -snf ${clonehero-unwrapped}/share/clonehero_Data "$configDir"
19 # Fake argv[0] to emulate running in the config directory
20 exec -a "$configDir/${name}" ${clonehero-unwrapped}/bin/${name} "$@"