Packaging on Linux

From VDrift
Revision as of 14:15, 3 July 2011 by Timo 6 (talk | contribs) (→‎Prerequisites: Change from SVN to Git)
Jump to: navigation, search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Make sure you have a working build to release - check Getting the development version and Compiling on Linux.

Binary packages with autopackage

Prerequisites

There are some things you need before you can build an autopackage.

First and most importantly, the autopackage development tools are needed. As of this writing, only the version in autopackage svn will correctly build the VDrift packages. The next release of the autopackage tools should have all the patches needed to build proper packages. BinReloc is used by VDrift but the code has been imported and you do not need to download this to build a package. You do however need apbuild.

Second, you must have two different compilers installed on your machine. This is to do the double-compiling so the vdrift binary will work on Linux no matter what version of glibc was used to build the distribution. Currently, the VDrift package setup uses g++-3.3 and g++-4.1, with gcc-4.1. Another known working setup is g++-3.3, g++-3.4, and gcc-3.4. The compiler versions are set in the tools/autopackage/vdrift.apspec file in VDrift Git.

Building

The autopackage project is a very promising and useful next-generation packaging tool for Linux. It aims to help developers create packages that will work on any Linux distribution.

VDrift's autopackage creation is integrated into the SCons build system used to build the Linux version of VDrift. To build an autopackage, simply run

scons autopackage

Two options are important when running this command, minimal and release. For instance,

scons autopackage minimal=1

will build a package with the minimal data set. This can be combined with the release option to make a release-optimized package with the minimal data set:

scons autopackage minimal=1 release=1

Turning these options to 0 turns them off. This affects the package built as one might expect. The package name reflects how it was built. For example:

VDrift yyyy-mm-dd-dev-minimal.package
VDrift yyyy-mm-dd-full.package

Usually the file is renamed to replace the space with a '-' character, so that the URL to the package does not have to contain a "%20".

Source packages

Source packages are made in a similar way as autopackages using SCons.

scons src-package

builds a package named similarly. This package is put into the build/ directory. Currently the build system does tar the source package after compiling it in the build/ directory, but it includes the build directory as a parent in the archive itself. Since this function is not used that much, it has been a low priority to fix, and it is also pretty simple to just run tar manually and create the package.

Before doing this however, it is useful to warn the user that there is no data in the source package and they must download one of the source packages in order to install the game. This can be done by replacing the file data/SConscript in the file with the file in the SVN repository data/SConscript.no_data. This is a minor change made to the build system when source packages are made.

So, to make all this make sense, here are the commands to build a source package correctly:

scons src-package
cd build
cp ../data/SConscript.no_data data/SConscript
tar -jcvf vdrift-yyyy-mm-dd-src.tar.bz2 vdrift-yyyy-mm-dd-src/

Thus you end up with the file vdrift-yyyy-mm-dd-src.tar.bz2 as a finished source package.