Porting games from other linux Distris


KrazyKain

Still Fresh
Joined
Apr 28, 2011
Messages
55
Hey guys, I've got a fair amount of programming experience for windows applications, but when it comes to linux I'm a complete noob. I could be totally wrong here (in fact I probably am) but I am under the impression that when you get a linux version of a game, its sort of in a raw state and needs to be compiled to run in a particular distribution of linux. If this is the case, how easy is it to actually compile just about any linux game/program to run on the pandora?


If i'm completely wrong, then let's just assume it's open source and we have the source code for a linux game... how would we get THAT running on pandora?


Is there some sort of step by step tutorial on how to do this? I have no idea where to begin but beleive I'm technical enough to understand instructions given so long as they don't make too many assumptions on knowledge of linux. I simply would like to be able to port games myself rather then wait for someone else to do it.
 

vadsamoht

Well-Known Member
Joined
Jun 11, 2010
Messages
1,022
Age
31
Location
South Australia
See if there's anything useful here before you start.


Also, it depends quite a bit on the language you are using as well (speaking for linux in general, not the Pandora), e.g. a python program will run any any machine with python installed, regardless of OS, whereas compiled binaries are often OS-specific.
 
Last edited by a moderator:

CFWhitman

Member
Joined
Mar 2, 2011
Messages
176
Hey guys, I've got a fair amount of programming experience for windows applications, but when it comes to linux I'm a complete noob. I could be totally wrong here (in fact I probably am) but I am under the impression that when you get a linux version of a game, its sort of in a raw state and needs to be compiled to run in a particular distribution of linux. If this is the case, how easy is it to actually compile just about any linux game/program to run on the pandora?

Most non-commercial Linux games are available in the repositories of various distributions. These are in binary form (unless it is a source based distro like Gentoo) basically like programs for any operating system. In fact, unless you are jumping from one type of processor to another, the actual programs are capable of running on whatever distribution you choose. The only obstacles to this are the availability of the proper package manager for the installation step, whether all the proper dependencies are available, and occasionally, whether a distribution expects some file to be in a different directory, but that's not usually an issue. The reason these files won't run on the Pandora is of course that it is based on an ARM CPU rather than an x86 one.


In fact, Mozilla makes Firefox for Linux available in binary format in a simple compressed directory, which when expanded will run on whatever x86 distribution you care to run it on (if the dependencies are available, which will be the case on most desktop systems).


So, really, the only raw form that the games are available in is source code, if they are open source.

If i'm completely wrong, then let's just assume it's open source and we have the source code for a linux game... how would we get THAT running on pandora?

If source code is in C or C++, then it theoretically is just a matter of compiling it for an ARM processor. This can be done by compiling the code on an ARM system, like the Pandora itself, or by cross-compiling the program from an x86 (or other) processor. To do that, you need to either set up a developer environment on the Pandora, or a cross-compiling environment on your desktop.


There are of course some obstacles possible (perhaps probable) in trying to do this. The code may not be ARM "clean" (there may be code that depends on x86 architecture somehow). There may be some requirement that is simply not available for the Pandora, like full-fledged OpenGL (rather than OpenGL ES). If you are cross-compiling there may be parts of the configuration script that don't work on your host machine, etc. You may be able to rewrite part of the program to deal with the first two issues, and you may be able to either edit the Makefile manually or compile the program on the Pandora to avoid the third issue, etc. These solutions may mean a lot of extra work to make a Pandora executable, but it can be fun to overcome these issues as well (if you like that sort of thing :) ).

Is there some sort of step by step tutorial on how to do this? I have no idea where to begin but beleive I'm technical enough to understand instructions given so long as they don't make too many assumptions on knowledge of linux. I simply would like to be able to port games myself rather then wait for someone else to do it.

There are some more resources available in the development forum on gp32x.de:


http://www.gp32x.de/board/index.php?/forum/64-developers-corner-pandora/


The first two pinned posts are useful.
 
Last edited by a moderator:

ibisum

Well-Known Member
Joined
May 6, 2009
Messages
1,135
If this is the case, how easy is it to actually compile just about any linux game/program to run on the pandora?

Its quite easy - in fact the Pandora itself has everything it needs to compile Linux apps onboard .. this is a fully-capable Linux workstation, after all, and that includes all the developer tools.
 

quartercast

Well-Known Member
Joined
Feb 13, 2007
Messages
1,551
If this is the case, how easy is it to actually compile just about any linux game/program to run on the pandora?

Its quite easy - in fact the Pandora itself has everything it needs to compile Linux apps onboard .. this is a fully-capable Linux workstation, after all, and that includes all the developer tools.

Actually its not that easy anymore, setting up a new dev environment on your Pandora via opkg will just bork it. At least it borked mine last time I tried :)
 

ibisum

Well-Known Member
Joined
May 6, 2009
Messages
1,135
Are you talking about the problems with Hotfix #5? I thought that had all been resolved already .. ?
 

KrazyKain

Still Fresh
Joined
Apr 28, 2011
Messages
55
Hey guys, I've got a fair amount of programming experience for windows applications, but when it comes to linux I'm a complete noob. I could be totally wrong here (in fact I probably am) but I am under the impression that when you get a linux version of a game, its sort of in a raw state and needs to be compiled to run in a particular distribution of linux. If this is the case, how easy is it to actually compile just about any linux game/program to run on the pandora?

Most non-commercial Linux games are available in the repositories of various distributions. These are in binary form (unless it is a source based distro like Gentoo) basically like programs for any operating system. In fact, unless you are jumping from one type of processor to another, the actual programs are capable of running on whatever distribution you choose. The only obstacles to this are the availability of the proper package manager for the installation step, whether all the proper dependencies are available, and occasionally, whether a distribution expects some file to be in a different directory, but that's not usually an issue. The reason these files won't run on the Pandora is of course that it is based on an ARM CPU rather than an x86 one.


In fact, Mozilla makes Firefox for Linux available in binary format in a simple compressed directory, which when expanded will run on whatever x86 distribution you care to run it on (if the dependencies are available, which will be the case on most desktop systems).


So, really, the only raw form that the games are available in is source code, if they are open source.

If i'm completely wrong, then let's just assume it's open source and we have the source code for a linux game... how would we get THAT running on pandora?

If source code is in C or C++, then it theoretically is just a matter of compiling it for an ARM processor. This can be done by compiling the code on an ARM system, like the Pandora itself, or by cross-compiling the program from an x86 (or other) processor. To do that, you need to either set up a developer environment on the Pandora, or a cross-compiling environment on your desktop.


There are of course some obstacles possible (perhaps probable) in trying to do this. The code may not be ARM "clean" (there may be code that depends on x86 architecture somehow). There may be some requirement that is simply not available for the Pandora, like full-fledged OpenGL (rather than OpenGL ES). If you are cross-compiling there may be parts of the configuration script that don't work on your host machine, etc. You may be able to rewrite part of the program to deal with the first two issues, and you may be able to either edit the Makefile manually or compile the program on the Pandora to avoid the third issue, etc. These solutions may mean a lot of extra work to make a Pandora executable, but it can be fun to overcome these issues as well (if you like that sort of thing :) ).

Is there some sort of step by step tutorial on how to do this? I have no idea where to begin but beleive I'm technical enough to understand instructions given so long as they don't make too many assumptions on knowledge of linux. I simply would like to be able to port games myself rather then wait for someone else to do it.

There are some more resources available in the development forum on gp32x.de:


http://www.gp32x.de/board/index.php?/forum/64-developers-corner-pandora/


The first two pinned posts are useful.

wow.... you couldn't possibly have answered my question more perfectly. Thanks a lot man, I'll have to try my hand at porting some C / C++ stuff I think I can manage that :)
 
Last edited by a moderator:

WizardStan

Mega GP Mania
Joined
May 24, 2008
Messages
16,733
Are you talking about the problems with Hotfix #5? I thought that had all been resolved already .. ?
It's not a problem with hotfix 5, it's a problem with updates in the Angstrom repository, last I heard. Something about the ncurses library gets updated when it shouldn't or something. There's a workaround, but it's not exactly a resolution.
 

CFWhitman

Member
Joined
Mar 2, 2011
Messages
176
One more thing I should mention that I didn't because it seems almost self-evident to me is that to cross-compile, you need to be working from a Linux install on the other machine (or virtual machine). (Well, it may be theoretically possible to do it from Cygwin or something, but if you could get that to work, I can't see the extra hassle being worth it.)
 

Granitehead

Advanced Member
Joined
Oct 16, 2009
Messages
3,011
Is there some sort of step by step tutorial on how to do this? I have no idea where to begin but beleive I'm technical enough to understand instructions given so long as they don't make too many assumptions on knowledge of linux. I simply would like to be able to port games myself rather then wait for someone else to do it.

There are some more resources available in the development forum on gp32x.de:


http://www.gp32x.de/board/index.php?/forum/64-developers-corner-pandora/


The first two pinned posts are useful.
In my opinion this one is also great.
 
Last edited by a moderator:

vadsamoht

Well-Known Member
Joined
Jun 11, 2010
Messages
1,022
Age
31
Location
South Australia
I think this thread should be pinned in the Development/General Talk section. Also posting to add it to the current stucky there.
 
Top