Distribution: Unvanquished portable for Linux

Release and discuss things you've made, including mods.
RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Distribution: Unvanquished portable for Linux

Post by RazZziel »

Hi there,

I'm packing a portable version of Unvanquished for http://www.portablelinuxgames.org/

I downloaded the binaries from your site and tested them on my Archlinux. If I run the game normally, I get a nasty "X Error of failed request: BadAlloc (insufficient resources for operation)" error. However, if I install Unvanquished from AUR, the game runs perfectly on my Intel, so the we know the problem must be some libs under lib32.

I started playing around with the lib32/ libs, and I got the game to work removing the following libs:

Code: Select all

libGL.so.1  libICE.so.6  libstdc++.so.6  libX11.so.6  libXau.so.6  libXdamage.so.1  libXdmcp.so.6  libXext.so.6  libXfixes.so.3  libXrender.so.1  libXxf86vm.so.1

I don't know if it's the minimal set to make the game work, must most importantly, I don't know the implications portability-wise of removing these libraries. Do you think it's a good idea to remove them? When I get some broadband I can upload a portable version of the latest binaries so people can test it on their systems.

User avatar
Viech
Project Head
Posts: 2139
Joined: Fri Aug 03, 2012 11:50 pm UTC
Location: Berlin

Re: Distribution: Unvanquished portable for Linux

Post by Viech »

RazZziel wrote:

if I install Unvanquished from AUR, the game runs perfectly

You're welcome! :D

Regarding the libraries in the PKGBUILD: I copied them over from the previous maintainer, so unfortunately I can't tell wether all of them are really needed. Apart from that I don't understand why removing libraries makes your game work. If I can do any tests to help you, let me know!

Responsible for: Arch Linux package & torrent distribution, Parpax (map), Chameleon (map texture editor), Sloth (material file generator), gameplay design & programming, artistic direction

RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by RazZziel »

Thanks for the build!

The ArchLinux version worked fine without PKGBUILD modification. It's the official version the one in which I had to remove some libs, so that my system libs get used instead.

I uploaded some packages to https://sourceforge.net/projects/pg4l/f ... nquished/:

Unvanquished (Official) 0.9.4-r1: Package created from the one downloaded from Unvanquished site, with all the libs, doesn't work on my system
Unvanquished (Official noX11) 0.9.4-r1: Same, but with the libs I mentioned above removed, so it works on my system
Unvanquished (ArchLinux) 0.9.0-r1: Package created from AUR's Unvanquished

All the packages were created without main/*.pk3 data files, so I can upload them in a finite amount of time, you'll need to have the data files in ~/.Unvanquished/main, or execute the package with the -download flag to run the downloader. I'll upload packages with the data files embedded when I have better broadband (550MB each package).

I need to setup some Linuxes (at least Ubuntus and Fedoras, or what people use nowadays) to properly test the packages, and decide which one is the most portable. If you can help I'd be really grateful :D

User avatar
velociostrich
Dragoon
Posts: 318
Joined: Thu Mar 08, 2012 6:24 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by velociostrich »

Do you think you can perform a backtrace with all of the libraries present to determine which is causing the trouble?

Also, I don't know enough to know why we cannot (provided that we cannot) dynamically link to all the libraries on the system.

RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by RazZziel »

Oops! I'm sorry for the year long delay (I guess this would be even considered a thread resurrection), didn't receive reply notification.

I'll try to debug the flawed libraries when I pack the latest version of the game.

Regarding linking all the dynamic libraries, it's tricky, but it's what I do in most of my packages and what usually provides best results. The thing is, as you start including base libs like libgcc or libm, you start needing to include the dynamic linker itself (ld-linux.so.2) and explicitly use it to run your binary. If you don't pack all the libs, you may run into dependency problems like this one that makes the game crash.

User avatar
Ishq
Project Head
Posts: 1145
Joined: Tue Mar 06, 2012 8:32 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by Ishq »

I think I already managed to do this. Try out the 64bit Linux binaries on sf.

RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by RazZziel »

Eeck, I don't have a 64bit OS, but I'll try to run it on a LiveUSB; I'm curious on how it works and how portable it is, integrating so many libraries seemingly without embedded dynamic loader.

RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by RazZziel »

Just tested it on a Ubuntu 12.04.2 64bit LiveUSB, and there's just one teeny weeny library missing: libXss.so.1
Complete ldd output: http://pastebin.com/raw.php?i=YfyFtV4S
Also some X11 libraries (libXcursor.so.1, libXinerama.so.1, libXrandr.so.2, libXrender.so.1) are not included and found in /usr/lib, while other X11 libs are included. Is this on purpose? Isn't it a library mismatch risk?

User avatar
Ishq
Project Head
Posts: 1145
Joined: Tue Mar 06, 2012 8:32 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by Ishq »

Yes, kind of. I found that including some X11 libraries caused crashes while including others didn't. So, I tried to remove all libraries that were likely to cause crashes. I still haven't perfected it though.

RazZziel
Posts: 6
Joined: Mon Nov 26, 2012 10:50 pm UTC

Re: Distribution: Unvanquished portable for Linux

Post by RazZziel »

Aha, that's more or less my experience; I've found that usually the best way is to include all the libraries except libGL.so.1, and then include /lib/ld-linux.so.2 and run the game as

Code: Select all

./ld-linux.so.2 ./game_binary

I use this little script to automate finding dependencies. It uses ldd, so only libraries loaded at startup are detected; libraries loaded with dlopen() are not detected, and must be detected either using extremely nasty strings+grep hacks (included in the script), or in runtime using strace+grep.

Post Reply