diff --git a/pkgs/games/openra_2019/common.nix b/pkgs/games/openra_2019/common.nix index d9cc93e82348..338215616196 100644 --- a/pkgs/games/openra_2019/common.nix +++ b/pkgs/games/openra_2019/common.nix @@ -27,7 +27,7 @@ in { sed -i 's|locations=.*|locations=${lua}/lib|' ${dir}/thirdparty/configure-native-deps.sh ''; - wrapLaunchGame = openraSuffix: '' + wrapLaunchGame = openraSuffix: binaryName: '' # Setting TERM=xterm fixes an issue with terminfo in mono: System.Exception: Magic number is wrong: 542 # https://github.com/mono/mono/issues/6752#issuecomment-365212655 wrapProgram $out/lib/openra${openraSuffix}/launch-game.sh \ @@ -35,7 +35,7 @@ in { --prefix LD_LIBRARY_PATH : "${rpath}" \ --set TERM xterm - makeWrapper $out/lib/openra${openraSuffix}/launch-game.sh $(mkdirp $out/bin)/openra${openraSuffix} \ + makeWrapper $out/lib/openra${openraSuffix}/launch-game.sh $(mkdirp $out/bin)/${binaryName} \ --chdir "$out/lib/openra${openraSuffix}" ''; diff --git a/pkgs/games/openra_2019/engine.nix b/pkgs/games/openra_2019/engine.nix index d6acf10cfc69..f3f3b9c073c5 100644 --- a/pkgs/games/openra_2019/engine.nix +++ b/pkgs/games/openra_2019/engine.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation (recursiveUpdate packageAttrs rec { ]; postInstall = '' - ${wrapLaunchGame ""} + ${wrapLaunchGame "" "openra"} ${concatStrings (map (mod: '' makeWrapper $out/bin/openra $out/bin/openra-${mod} --add-flags Game.Mod=${mod} diff --git a/pkgs/games/openra_2019/mod-launch-game.sh b/pkgs/games/openra_2019/mod-launch-game.sh index 88b53e71e1bc..16fb14c24d65 100644 --- a/pkgs/games/openra_2019/mod-launch-game.sh +++ b/pkgs/games/openra_2019/mod-launch-game.sh @@ -8,7 +8,7 @@ show_error() { exit 1 } -cd "@out@/lib/openra-@name@" +pushd "@out@/lib/openra_2019-@name@" > /dev/null # Check for missing assets assetsError='@assetsError@' @@ -17,7 +17,7 @@ if [[ -n "$assetsError" && ! -d "$HOME/.openra/Content/@name@" ]]; then fi # Run the game -mono --debug OpenRA.Game.exe Game.Mod=@name@ Engine.LaunchPath="@out@/bin/openra-@name@" Engine.ModSearchPaths="@out@/lib/openra-@name@/mods" "$@" +mono --debug OpenRA.Game.exe Game.Mod=@name@ Engine.LaunchPath="@out@/bin/openra-@name@" Engine.ModSearchPaths="@out@/lib/openra_2019-@name@/mods" "$@" # Show a crash dialog if something went wrong if (( $? != 0 && $? != 1 )); then diff --git a/pkgs/games/openra_2019/mod.nix b/pkgs/games/openra_2019/mod.nix index 9d69b79bdeb4..c57726580741 100644 --- a/pkgs/games/openra_2019/mod.nix +++ b/pkgs/games/openra_2019/mod.nix @@ -70,14 +70,14 @@ in stdenv.mkDerivation (recursiveUpdate packageAttrs rec { cp -r ${engineSourceName}/mods/{${concatStringsSep "," ([ "common" "modcontent" ] ++ engine.mods)}} mods/* \ $out/lib/${pname}/mods/ - substitute ${./mod-launch-game.sh} $out/lib/${pname}/launch-game.sh \ + substitute ${./mod-launch-game.sh} $out/lib/openra_2019-${mod.name}/launch-game.sh \ --subst-var out \ --subst-var-by name ${escapeShellArg mod.name} \ --subst-var-by title ${escapeShellArg mod.title} \ --subst-var-by assetsError ${escapeShellArg mod.assetsError} - chmod +x $out/lib/${pname}/launch-game.sh + chmod +x $out/lib/openra_2019-${mod.name}/launch-game.sh - ${wrapLaunchGame "-${mod.name}"} + ${wrapLaunchGame "_2019-${mod.name}" "openra-${mod.name}"} substitute ${./openra-mod.desktop} $(mkdirp $out/share/applications)/${pname}.desktop \ --subst-var-by name ${escapeShellArg mod.name} \