How to create the Linux package
Since creating an executable binary of any program that runs across several distributions is quite a problem, we use autopackage's apbuild to solve some of the problems. If the process gives no problem, it's pretty straightforward; but these are many steps, and are listed here as a reference.
This assumes you got the sources from SVN and that you can use a command-line interface. You will also need to have gcc version 3.2 or 3.3 *and* 3.4 or higher because of the c++ ABI compatibility problem.
Warning: these instructions were written for version 0.6, so it won't work with earlier versions and most likely will have to be modified a bit for next versions. Also please note that if you do find a problem and it's not your fault, most likely fixing it will take a great deal of time.
Contents |
Instructions
Install autopackage
- Get autopackage's apbuild at http://autopackage.org/download-tools.html to get apgcc and apg++. Extract it, go to the extraction directory, and run:
% make install
Build STK
- Go to STK's root directory, and run:
% sh autogen.sh
% CC=apgcc CXX=apg++ sh configure
% make clean all
% cd src/
% apg++ -O2 -Wall -Ibullet/src -o supertuxkart *.o -L. -lstatic_ssg /usr/lib/libplibjs.a /usr/lib/libplibsl.a
/usr/lib/libplibssg.a /usr/lib/libplibpu.a /usr/lib/libplibfnt.a /usr/lib/libplibsg.a /usr/lib/libplibul.a
/usr/lib/libplibssgaux.a -Lbullet/Demos/OpenGL -lbulletopenglsupport -Lbullet/src -lbulletdynamics
-lbulletcollision -lbulletmath -Lenet -lenet -lglut -lGL -lSDL -lSDLmain /usr/lib/libalut.a
/home/coz/Desktop/Descargados/openal-soft-1.6.372/libopenal.a /usr/lib/libvorbisfile.a /usr/lib/libvorbis.a
/usr/lib/libogg.a
% strip supertuxkart
Creating the compressed archive
- Get the last version of the Linux package and extract it. Using it as a base instead of starting from scratch saves time. Replace the binary inside the old Linux package with the newer binary. Do the same for the data. Rename the folder, and create a .tar.bz2 that follows the version naming scheme.
That's it. If there are any missing steps or problems with this, contact the mailing list.
A final note
Ideally you should build yourself each dependency to be static linked (for example, libvorbisfile.a, libopenal.a ), instead of using your system's provided libraries, and even more if you use a source-based distro like Gentoo; I have had problems with the dependencies even with systems running on the same processor type.
If the maker of the dependency provides a binary of some sort for development( like in the case of OpenAL ), you should use it instead of compiling the dependency yourself.
Remember to test your package among a wide variety of distros if you can.
Troubleshooting
- Apbuild problems
I have had cases where I had to fix permission problems with apbuild first; a dangerous/risky alternative to fixing this is to use the root user or sudo for steps where you have trouble.
- I built the package on Ubuntu (or Debian or another distro that makes plib available as a dynamic library), but it doesn't runs on other distros! (like OpenSuse)
By default, gcc will link to dynamic libraries instead of the static libraries. Also, plib by default only provides static libraries, so when you build STK with bindings to dynamic libraries, it won't work on installations only with the static libraries. The steps which links manually before 'strip supertuxkart' when building STK should take care of this, but you could have forgotten about doing it. Thanks to Christian Zigotzky (Xeno74) for the fix for this problem.
- I get missing library errors when linking to the static libraries, but I have the development version of that library installed!
Verify that your have the static libraries, they end with the .a suffix. Some distros provide packages which will only build the dynamic libraries, and some libraries build the dynamic version by default( for example, at the moment of this writting, openal ). That doesn't means they can't be built statically, it just means you'll have to get the static library somehow, the easiest way is to download the sources of the library and compile the static version yourself. Usually this is pretty straight forward.