Page 1 of 1

Portable OpenRA for Linux

Posted: Sun Jan 20, 2013 12:28 pm
by RazZziel
Hi there,

I'm trying to pack up a portable version of OpenRA, with Mono embedded, for http://www.portablelinuxgames.org/

I'm facing a problem: when I run the application, I get this error

Code: Select all

[raziel@Bebop openra]$ ./AppRun 
Usage:
If the game doesn't run, try using the Cg renderer ~/.openra/settings.yaml
like so:
Graphics:
        Renderer: Cg
Be careful to only use one indenting tab with 8 shift width.
Platform is Linux
Using Gl renderer
Desktop resolution: 1920x1080
No custom resolution provided, using desktop resolution
Using resolution: 1920x1080
Available mods:
        cnc: C&C (release-20121019)
        d2k: Dune 2000 (beta) ({DEV_VERSION})
        ra: Red Alert (release-20121019)
Exception of type `System.TypeInitializationException`: An exception was thrown by the type initializer for OpenRA.Support.PerfHistory
Inner Exception of type `System.TypeInitializationException`: An exception was thrown by the type initializer for System.Drawing.KnownColors
  Inner Exception of type `System.TypeInitializationException`: An exception was thrown by the type initializer for System.Drawing.GDIPlus
    Inner Exception of type `System.DllNotFoundException`: libc
      TypeName=``
        at (wrapper managed-to-native) System.Drawing.GDIPlus:uname (intptr)
  at System.Drawing.GDIPlus..cctor &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
      at System.Drawing.KnownColors..cctor &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
    at System.Drawing.Color.get_Red &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.Support.PerfHistory..cctor &#40;&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.Game.Initialize &#40;OpenRA.Arguments args&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.Program.Run &#40;System.String&#91;&#93; args&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
  at OpenRA.Program.Main &#40;System.String&#91;&#93; args&#41; &#91;0x00000&#93; in <filename unknown>&#58;0 
I have very little experience with .NET/Mono, so I don't really know what can be going on. Does any of you guys have an idea?

Run script (AppRun): http://pastebin.com/fuHsWywj
Contents of the package: http://pastebin.com/L0kv5pWg

Posted: Sun Jan 20, 2013 3:12 pm
by Matt

Posted: Sun Jan 20, 2013 10:45 pm
by Sleipnir
The OSX builds of OpenRA used to ship with a stripped down version of Mono.

At the time (Mono 2.4 - 2.6), this required patching hardcoded library paths in the mono executable and support files, and also setting $LD_LIBRARY_PATH and $MONO_PATH before running the patched build.

Things are probably different with newer versions and Linux vs OSX, but these may be useful references:

builddeps.sh
OSX Launcher script
osx-deps-v4.zip

Posted: Tue Feb 19, 2013 12:17 am
by RazZziel
Oops, sorry about the late reply, looks like the message notifier didn't work

Thanks a lot for the info and the scripts. I added the missing dependencies and tweaked some environment variables and mono parameters, but the error still persists.

What bugs me is that the error seems to be that mono is not able to find libc for some reason. It must be something about the binary patching needed to make mono run in a portable way. Ugly stuff.

I'll keep trying!

Posted: Sun Mar 10, 2013 6:05 pm
by RazZziel
I almost managed to get it working with the tool mkbundle, but libgdiplus.so somehow still resists to be found...

Posted: Fri Mar 29, 2013 7:21 pm
by RazZziel
I had to do some pretty nasty hacks, but in the end I think I got it working. I tested it on my Archlinux and on a Ubuntu 10.04 LiveUSB, so it should be pretty portable.

I uploaded the package to http://www.portablelinuxgames.org/. Feel free to test it out and report back any error, I'd appreciate that :)

Posted: Sun Sep 08, 2013 9:45 am
by Matt
We now allow a portable support directory since playtest-20130818 https://github.com/OpenRA/OpenRA/commit ... e01b4cc4cf