openraPackages_2019: fix build

All mods and engines were failing to build due to path issues
after package name changes.
This commit is contained in:
mdarocha 2023-06-15 17:01:52 +02:00
parent 12904347a7
commit d5a64ffb1e
4 changed files with 8 additions and 8 deletions

View File

@ -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}"
'';

View File

@ -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}

View File

@ -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

View File

@ -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} \