Version 36 (modified by leper, 12 years ago) ( diff )

--

Summary

Parts of our build and deployment environment are currently beeing changed. The main goal behind this is being able to easily create deployable packages/bundles for OSX. This Page should be a work in progress and its purpose is to document the overall design and the different tasks required to implement it. The idea is that people involved in these tasks discuss all topics related to that and document the decisions here. Once we all have the same idea about the solution we aim for, we can assign the different tasks to different people and complete them more efficiently.

A good place for discussions is this thread in the forums.


Overview current design

update-workspaces.sh / update-workspaces.bat:

The sh-script on Linux/*nix/OSX runs the compilation of some external dependencies and also premake. On Windows the batchfile only executes premake because most of the dependencies are precompiled.

Premake

Premake creates our workspaces (also called solutions or projects) for the different platforms. Currently we support Makefiles, VisualStudio (2005, 2008, 2010), Xcode3, Codeblocks.

Workspaces

The workspaces are used for building the code on different platform and also for development with different programs (IDE's).

Deployment

For (alpha-)releases we make a special deployment for various reasons. The main reason is that we want to make it easier and more convenient for the user. Everything is precompiled and distributed in appropriate containers for the different operating systems and platforms (e.g. .deb files for debian based linux systems and .exe files for windows etc.).


Future design

Overview

Some basic design decisions

  • In the first place we stick to Premake. If someone offers a working solution with other tools like CMake, we are open to change that decision.
  • Sticking to Premake means we can't manually create workspaces
  • We separate the external libraries from the game's code and data in the repository
  • The libraries are split into separate directories per operating system and architecture
  • Developers will have to make a separate checkout to get the right libraries for their system
  • Updateworkspaces checks if the libraries are present and up to date to avoid problems with outdated libraries
  • Supported platforms are Linux-source (no precompiled libraries in the repository), Macosx-x64 and Windows-x86.
  • We don't use special "subversion tricks" like externals definitions and instead keep separate identical copies of libraries if necessary. Storage isn't a problem and we don't update the libraries often. Other arguments brought up by Philip: "... it'll probably confuse Trac and it'll probably make mirroring/migrating to Git harder".

Graphical overview of interaction between different components (future-version)

http://trac.wildfiregames.com/attachment/wiki/BuildAndDeploymentEnvironment/future-build-environment-overview.png

The repository structure

.
|-- art
|-- audio
|-- libraries
|   `-- trunk
|       |-- linux-source
|       |   |-- libA
|       |   |   |-- include
|       |   |   `-- lib
|       |   `-- libB
|       |       |-- build.sh
|       |       |-- include
|       |       |-- lib
|       |       `-- src
|       |-- macosx-x64
|       |   |-- libA
|       |   |   |-- include
|       |   |   `-- lib
|       |   `-- libB
|       |       |-- build.sh
|       |       |-- include
|       |       |-- lib
|       |       `-- src
|       `-- windows-x86
|           |-- libA
|           |   |-- include
|           |   `-- lib
|           `-- libB
|               |-- include
|               `-- lib
`-- ps
    `-- trunk
        |-- build
        |   |-- premake
        |   `-- workspaces
        |       `-- update-workspaces.sh
        `-- source

Checking out the code

Developers will have to do an additional checkout to compile 0ad.

This is still the same command to get the source and data:
svn co http://svn.wildfiregames.com/public/ps/trunk/ 0ad

In addition to that, it will be required to get the right libraries for your system (of course replacing "windows-x86" with your platform):
svn co http://svn.wildfiregames.com/public/libraries/trunk/windows-x86 0ad/libraries

Updateworkspaces

Updateworkspaces must check if the library is present and up to date. If not, it should stop and display an error. This check could work with a manually updated file in the source-tree containing the current revisions for library-directories.


Realease, packaging and deployment

The current release process is documented in ReleaseProcess. Philip does that, except not the PPA packages or the Gentoo ebuilds. Ricotz creates the Ubuntu packages in an unknown way and other(unknown) people do it for Gentoo and the other distros.

Some information about OS-specific aspects of the packages...

Windows

Where to place which files

NOTE: This is just a draft.

A discussion can be found in this thread.

NameReadonlyDescriptionPath WindowsDetermined by/Set where?
Game data rootYData-Directory for static game datarelative to EXEm_rdata in Paths.cpp
User data rootNRoot-Directory for data the user creates in-game (savegames, screenshots etc...)My Documents\0adm_Data in Paths.cpp
Savegame directoryNDirectory where savegames are saved to and loaded fromMy Documents\0ad\savesAs [User data root]\saves in GameSetup.cpp InitVFS
screenshot directoryNDirectory where screnshots are saved by the gameMy Documents\0ad\screenshotsAs [User data root]\screenshots in GameSetup.cpp InitVFS
Default configYDefault config-file which is readonlyrelative to EXEAs [Game data root]\config in GameSetup.cpp IniVFS
UserconfigNContains user specific configuration settingsMy Documents\0ad\configm_config = %appdata%\config in Paths.cpp
LogsNContains logs created by the gameMy Documents\0ad\logsm_logs = %appdata%\logs in Paths.cpp
CacheNCache directory%appdata%\0ad\cachem_cache
User modNUser mod directory, where e.g. Atlas should save mapsMy Documents\0ad\mods\userNot implemented yet
ModsNOther mods added by the userMy Documents\0ad\modsNot implemented yet

Linux

Where to place which files

NOTE: This is just a draft.

VariableDefault
XDG_CACHE_HOME~/.cache
XDG_CONFIG_HOME~/.config
XDG_DATA_HOME~/.local/share
INSTALLED_DATADIRe.g. /usr/share/0ad or /usr/local/share/0ad or /opt/0ad/data (if compiled with this flag)

The default Atlas config dir (or file) is specified in source/tools/atlas/AtlasUI/Misc/DLLInterface.cpp and does not adhere to the values in Paths.cpp or the basedir-spec (Note #868)

NameReadonlyDescriptionPath LinuxDetermined by/Set where?
Game data rootYData-Directory for static game data[INSTALLED_DATADIR or relative to binary]/m_rdata in Paths.cpp
User data rootNRoot-Directory for data the user creates in-game (savegames, screenshots etc...)$XDG_DATA_HOME/0adm_Data in Paths.cpp
Savegame directoryNDirectory where savegames are saved to and loaded from$XDG_DATA_HOME/0ad/savesAs [User data root]/saves in GameSetup.cpp InitVFS
screenshot directoryNDirectory where screnshots are saved by the game$XDG_DATA_HOME/0ad/screenshotsAs [User data root]/screenshots in GameSetup.cpp InitVFS
Default configYDefaullt config-file which is readonly[INSTALLED_DATADIR or relative to binary]/configAs [Game data root]/config in GameSetup.cpp IniVFS
Userconfig rootNCurrently unclear... why is [Logs] here and not in [User data root]?$XDG_CONFIG_HOME/0adAs xdgConfig in Paths.cpp
UserconfigNContains user specific configuration settings$XDG_CONFIG_HOME/0ad/configm_config = [Userconfig root]/config in Paths.cpp
LogsNContains logs created by the game$XDG_CONFIG_HOME/0ad/logsm_logs = [Userconfig root]/logs in Paths.cpp
CacheNCache directory$XDG_CACHE_HOME/0adm_cache
User modNUser mod directory, where e.g. Atlas should save maps$XDG_DATA_HOME/0ad/mods/userNot implemented yet
ModsNOther mods added by the user$XDG_DATA_HOME/0ad/modsNot implemented yet

MacOSX

Where to place which files?

NOTE: This is just a draft.

NameReadonlyDescriptionPath MACDetermined by/Set where?
Game data rootYData-Directory for static game data[Bundle]/Contents/Resources/data or relative to binarym_rdata in Paths.cpp
User data rootNRoot-Directory for data the user creates in-game (savegames, screenshots etc...)~/Documents/0adm_Data in Paths.cpp
Savegame directoryNDirectory where savegames are saved to and loaded from~/Documents/0ad/savesAs [User data root]/saves in GameSetup.cpp InitVFS
screenshot directoryNDirectory where screnshots are saved by the game~/Documents/0ad/screenshotsAs [User data root]/screenshots in GameSetup.cpp InitVFS
Default configYDefaullt config-file which is readonly[Bundle]/Contents/Resources/data/config or relative to binaryAs [Game data root]/config in GameSetup.cpp IniVFS
Userconfig rootNCurrently unclear... why is [Logs] here and not in [User data root]?~/Documents/0adAs xdgConfig in Paths.cpp
UserconfigNContains user specific configuration settings~/Documents/0ad/configm_config = [Userconfig root]/config in Paths.cpp
LogsNContains logs created by the game~/Documents/0ad/logsm_logs = [Userconfig root]/logs in Paths.cpp
CacheNCache directory~/Library/Application Support/0ad/cachem_cache
User modNUser mod directory, where e.g. Atlas should save maps~/Documents/0ad/mods/userNot implemented yet
ModsNOther mods added by the user~/Documents/0ad/modsNot implemented yet

Open tasks

1. Change how the game handles default search paths

Each OS should have its default behaviour that should make sense for that OS. For Windows and Linux that's already quite good, but OSX requires improvements.

It should by default work for two different situations.

  1. The current situation where the pyrogenesis binary is in 0ad/binaries/system, data is in 0ad/binaries/data etc...
  2. The situation when everything is in a bundle and the directories are organized as described in "Where to place which files?" in this article.

In addition to that, all the paths should be customizable with parameters or environment variables (what's better?).

2. Adjust the build-system and documentation for a separate library directory

3. Prepare the libraries for each platform

Either include precompiled libraries or integrate the source-code into our build-scripts (called from update-workspaces.sh). It depends on the platform and probably on the library if the source or a precompiled version should be included.

4. Write a script to create the bundle from the prebuilt libraries, the game-executables and the data

5. Check CMake as an alternative in the future or work on improved XCode support for Premake


Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.