Packaging

From VDrift Documentation Wiki

Jump to: navigation, search

One goal is to automate packaging as much as possible so that doing releases is simple. There are different methods for every platform. This document attempts to summarize them.

Contents

[edit] Linux

[edit] Binary packages with autopackage

[edit] 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 SVN.

[edit] 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 2007-03-31-dev-minimal.package
VDrift 2007-03-23-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".

[edit] 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-2007-03-23-src.tar.bz2 vdrift-2007-03-23-src/

Thus you end up with the file vdrift-2007-03-23-src.tar.bz2 as a finished source package.

[edit] Windows

[edit] Prerequisites

* Nullsoft installer system: http://nsis.sourceforge.net/
* A compiled source of VDrift (Compiling#Windows)

[edit] Doing the work

In the directory tools/win you can find 2 .nsi files. One for the minimal release and one for the full release. If you installed nsis you can right click on the vdrift.nsi or vdrift-minimal.nsi file and select "compile script". The installer will be created now. Please do not forget to change the version in the .nsi files (at the top of the files)

[edit] FreeBSD

Coming Soon

[edit] OS X

  • Obtain the VDrift source code from the latest source release or directly via svn
  (Sometimes the source release is broken on Mac OS X, so you have to use svn in this case)
  • The VDrift Mac OS X project requires at least XCode version 2.2 with the 10.4 Universal SDK installed
  • Finally open tools/osx/vdrift.xcodeproj, switch to the "Release-Deployment" Build style using the popup-menu in the toolbar and hit "Build" from XCode's "Build" menu
  • Deployable Disk-images (full and minimal) will be put into the "Release-Deployment" build folder
Personal tools