Ok, so I've got a little game I've been coding in my spare time. It uses SDL and Boost so that it's pretty cross-platform compatible. In fact, I've built, ran and tested the game in OpenSuse Linux. However, I'm not clear on an easy way of packaging the game up in a download for Linux users. The game has run-time dependencies on expat as well as many SDL libraries (specifically SDL_ttf, SDL_image, SDL_mixer, SDL_gfx, and of course, SDL itself). I'd like something simple, akin to what I do with Windows (which is a batch file that bundles up every file needed, including DLLs, into one ZIP file for download). Can anyone out there help me?
This is a can of worms depending on how you go about it. Not sure what licensing problems you run into if you re-dist certain parts of the dependancies.
Are you statically linking? I’m not sure about expat but sdl is LGPL and boost is pretty flexible.
Otherwise, you might look into writing an RPM .spec file and building an RPM. You will specific the dependencies in the .spec file, so you wouldn’t have re-distribute those (sdl, boost, etc.). But that only works for RPM distros (Suse, Fedora, Mandrake).
Or you could just have locally built libraries for all your dependencies and drop them in the same directory as your game binary. Then tarball it and include some shell script? Not sure how well that would work or even if I would recommend it.
Thanks Mauriat – yeah I’m realizing how screwed up this is now. No wonder Linux is the poster-boy for Open Source – that’s the only semi-reliable way of distributing your software without building for every major distro “family” out there… sounds like RPM is the most likely candidate for this – I wonder if anyone in Debian/Ubuntu are working on this.
“Or you could just have locally built libraries for all your dependencies and drop them in the same directory as your game binary. Then tarball it and include some shell script?”
First, some shell script to do what? Set the LD_LIBRARY_PATH or something?
Also, will this even work on systems other than 32-bit Intel/AMD-based SUSE? I definitely think it will not work for 64-bit systems, not sure about other processors outside of Intel/AMD but I have my doubts, and as for – say – Fedora on an equivalent piece of hardware – wouldn’t this require me to build ALL the libraries i.e. even libc, etc that SDL relies on?
And no – I’m not statically linking. As you say, SDL is LGPL so that’s not allowed.
I think my best bet is to plan to learn all about RPMs and go that route – that seems to cover a good amount of Linux users (maybe I’m being naive). Then I can figure out what’s required for Debian-based system to cover even more…
Man, what a mess!
I guess the Debian varieties have their own system (apt) that claims to work with RPMs. I guess when I get to the point of actually creating the RPM I can ask someone to test it out for me…
Actually LGPL can be statically linked without any problems – it *is* allowed. In fact, I am pretty sure all of your components can be done that way (boost, SDL, expat). This might be one possible solution where don’t need to worry if the target platform has those libraries or not.
As for Debian they package with “.DEB” files, I suspect they are generated similarly to how an RPM is created. I think ‘apt’ is just the manager, like YaST or YUM.
As for the local library, yes I think you’re right about LD_LIBRARY_PATH. There are some examples out there (RealPlayer and Acrobat come to mind).
As for the architecture issue, since I’m guessing you’re not providing the source, you’re best off just producing 32bit binaries. The 64bit distro’s should have their own mechanism to resolve 32bit application and library dependencies.
I have quite a few distro’s available to test, Fedora, Suse, Ubuntu in some combo’s of 32bit/64bit if you want to send me your binaries.
Oops, no you were right, I’m wrong about the LGPL. Sorry, my mistake. Looks like you’ll either have dynamically link to that.
i recommend http://autopackage.org/ , http://0install.net/ or klik http://klik.atekon.de/
there are a few other installer proyects that do a good job too. Try loki installer (specially for games) http://www.liflg.org/
There’s also Oblisk, http://oblisk.codu.org/ ; installjammer, http://installjammer.com/
Anyway if you want to make both an .rpm and .deb (i heard debs are easier to make). You can also convert rpm to deb or backwards with the “Alien” (actual name) program. Remember to test the convertions (sometimes they may not work)
Hi, I don’t know where you learnt that APT works with RPMs… I’m pretty confident that this isn’t the case.
There does exist a program to convert an RPM to a deb (the kind of binary package that Ubuntu and Debian use). It is called ‘alien’.
RPMs and debs work exactly the same way. You build your binary program into the package, along with some info about what other packages your program needs. You can also include some install scripts in the package to set things up. http://doc.ubuntu.com/ubuntu/packagingguide/C/ is a full guide on this.
Hope this helps 🙂