mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-24 13:05:08 +00:00
Merge pull request #238099 from mdarocha/openra-fix
openra_2019: fix build
This commit is contained in:
commit
16bca20148
@ -27,7 +27,7 @@ in {
|
|||||||
sed -i 's|locations=.*|locations=${lua}/lib|' ${dir}/thirdparty/configure-native-deps.sh
|
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
|
# 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
|
# https://github.com/mono/mono/issues/6752#issuecomment-365212655
|
||||||
wrapProgram $out/lib/openra${openraSuffix}/launch-game.sh \
|
wrapProgram $out/lib/openra${openraSuffix}/launch-game.sh \
|
||||||
@ -35,7 +35,7 @@ in {
|
|||||||
--prefix LD_LIBRARY_PATH : "${rpath}" \
|
--prefix LD_LIBRARY_PATH : "${rpath}" \
|
||||||
--set TERM xterm
|
--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}"
|
--chdir "$out/lib/openra${openraSuffix}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ stdenv.mkDerivation (recursiveUpdate packageAttrs rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
${wrapLaunchGame ""}
|
${wrapLaunchGame "" "openra"}
|
||||||
|
|
||||||
${concatStrings (map (mod: ''
|
${concatStrings (map (mod: ''
|
||||||
makeWrapper $out/bin/openra $out/bin/openra-${mod} --add-flags Game.Mod=${mod}
|
makeWrapper $out/bin/openra $out/bin/openra-${mod} --add-flags Game.Mod=${mod}
|
||||||
|
@ -8,7 +8,7 @@ show_error() {
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
cd "@out@/lib/openra-@name@"
|
pushd "@out@/lib/openra_2019-@name@" > /dev/null
|
||||||
|
|
||||||
# Check for missing assets
|
# Check for missing assets
|
||||||
assetsError='@assetsError@'
|
assetsError='@assetsError@'
|
||||||
@ -17,7 +17,7 @@ if [[ -n "$assetsError" && ! -d "$HOME/.openra/Content/@name@" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Run the game
|
# 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
|
# Show a crash dialog if something went wrong
|
||||||
if (( $? != 0 && $? != 1 )); then
|
if (( $? != 0 && $? != 1 )); then
|
||||||
|
@ -70,14 +70,14 @@ in stdenv.mkDerivation (recursiveUpdate packageAttrs rec {
|
|||||||
cp -r ${engineSourceName}/mods/{${concatStringsSep "," ([ "common" "modcontent" ] ++ engine.mods)}} mods/* \
|
cp -r ${engineSourceName}/mods/{${concatStringsSep "," ([ "common" "modcontent" ] ++ engine.mods)}} mods/* \
|
||||||
$out/lib/${pname}/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 out \
|
||||||
--subst-var-by name ${escapeShellArg mod.name} \
|
--subst-var-by name ${escapeShellArg mod.name} \
|
||||||
--subst-var-by title ${escapeShellArg mod.title} \
|
--subst-var-by title ${escapeShellArg mod.title} \
|
||||||
--subst-var-by assetsError ${escapeShellArg mod.assetsError}
|
--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 \
|
substitute ${./openra-mod.desktop} $(mkdirp $out/share/applications)/${pname}.desktop \
|
||||||
--subst-var-by name ${escapeShellArg mod.name} \
|
--subst-var-by name ${escapeShellArg mod.name} \
|
||||||
|
Loading…
Reference in New Issue
Block a user