-
Notifications
You must be signed in to change notification settings - Fork 67
/
INSTALL
190 lines (117 loc) · 5.2 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
Build & install instructions
============================
These are build & install instructions for Dust Racing 2D.
Source code
===========
The source tree includes source code for the track editor and the game itself.
The code is "documented" with Doxygen tags.
The source tree layout:
src/game/ : Source files for the game.
src/game/MiniCore/ : Graphics and physics engine.
src/game/MTFH/ : Menu Toolkit From Hell.
src/game/STFH/ : Sound Toolkit From Hell.
src/editor/ : Source files for the track editor.
src/common/ : Shared files between the editor and the game.
src/images/ : Some SVG-images used as the source for final images.
Data directory structure:
data/ : Data mapping and configuration files.
data/fonts/ : Font used by the game.
data/icons/ : Icon files for game and editor.
data/images/ : Image files and textures loaded by the game.
data/levels/ : Level data.
data/models/ : 3D models.
data/sounds/ : Sound files.
data/translations/ : Released Qt translation files.
Other:
packaging/windows/ : NSIS packaging for Windows.
Build systems
=============
The "official" build system for Linux is CMake.
Toolchains
==========
GCC/MinGW and Clang are the only "officially" supported toolchains on Linux.
Windows builds are done in a Docker container with MXE (http://mxe.cc). The build script
also generates automatically an NSIS Windows installer and a ZIP-archive.
See scripts/build-windows-nsis and scripts/build-windows-nsis-packaging-helper.
Building the project with Microsoft Visual C++ 2013 also works, but no automatic
packaging/deployment currently exist. The runtime files (data/, Qt, OpenAL..) must be
manually copied in place. See more detailed instructions below.
Build dependencies
==================
Currently the build depends on Qt, libopenal and libvorbisfile.
On Linux pkg-config is required.
Dustrac also exploits some features of the C++14 standard,
so a somewhat compliant compiler is required (GCC >= 5.0).
Building in the command line on Linux (tested on Ubuntu 18.04)
==============================================================
Development build (the game can be run without installing anything):
-------------------------------------------------------------------
1) Install Qt5 development files
- `qt5-default` package on Ubuntu/Debian/Mint should install everything needed
- You might need to install also these manually depending on your system
- `qttools5-dev`
- `libqt5opengl5-dev`
(Qt packaging might differ a bit in newer Ubuntu releases)
2) Install OpenAL development files (libopenal-dev on Debian/Ubuntu).
3) Install Vorbis development files (libvorbis-dev on Debian/Ubuntu).
4) Install CMake (cmake on Debian/Ubuntu).
5) Go to the source directory and run:
`$ mkdir build && cd build`
`$ cmake ..`
`$ make`
This will build the editor and the game binaries.
Run the game:
`$ ./dustrac-game`
Optionally run the track editor:
`$ ./dustrac-editor`
Run unit tests:
`$ ctest`
Release build (in this example game installs under /usr):
--------------------------------------------------------
`$ mkdir build && cd build`
`$ cmake .. -DReleaseBuild=ON -DCMAKE_INSTALL_PREFIX=/usr`
`$ make`
This will build the editor and the game binaries.
Install the binaries and data files:
`$ sudo make install`
This installs also the desktop files so Dust Racing 2D
should appear in your application menu.
Cross-compiling for Windows in Docker with MXE on Linux
=======================================================
1) Install Docker
2) `$ ./scripts/build-windows-installer`
CPack
=====
Dust Racing 2D has a support for CPack. It's not complete, but can be used to generate
e.g. Debian packages.
After a successful build with ReleaseBuild=ON run CPack:
`$ cpack -G DEB`
This will generate a Debian package.
Building with Microsoft Visual C++
==================================
The project has been successfully compiled and executed with MSVC with the following setup:
* Windows 8.1 Pro
* Windows SDK for Windows 8.1
* CMake 3.0
* Qt 5.3 32-bit SDK for MSVC
* MS Visual Studio 2013 for Desktop Windows
1) Download and build Vorbis libraries and OpenAL Soft with the same toolchain
2) Open the top-level CMakeLists.txt in Qt Creator, configure and build
3) Copy the runtime files, like OpenAL DLL, to the same directory with the game binary
Jenkins CI
==========
Jenkinsfile includes pipelines configuration for Jenkins CI.
For packagers
=============
The binaries only need to find the data dir that includes
all the runtime data. This can be set in the main CMakeLists.txt
and is given to the game via -DDATA_PATH.
The release build should be used when packaging (give
-DReleaseBuild=ON to cmake).
Currently the data files install to CMAKE_INSTALL_PREFIX/share/DustRacing
and the binaries install to CMAKE_INSTALL_PREFIX/bin.
Among the data files there are also fonts that are installed by default;
in case they are available in the system, it is possible to not ship
any font by giving -DSystemFonts=ON to cmake.
CMAKE_INSTALL_PREFIX usually defaults to /usr/local and
can be changed by giving, for example, -DCMAKE_INSTALL_PREFIX=/usr to cmake.