-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL
142 lines (87 loc) · 4.86 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
This file provides information on how to build and install Dune Legacy.
Prerequirements
---------------
- gcc or any other standard compliant C++ compiler
- autotools
- SDL 2
- SDL2-mixer
Building
--------
Dune Legacy can read the needed data from different locations. If you want
to keep everything in one directory you should use the first method. You also
may decide to install Dune Legacy on your system. The use the second method.
Method 1: Data read from local directory
----------------------------------------
Extract the Dune Legacy source code and run at the top level directory
the following command:
autoreconf --install
./buildlocal.sh
This will configure and build Dune Legacy and you will find afterwards
a "dunelegacy" binary in the top level directory. The data is read from
the data subdirectory. There you shoud copy all the PAK-files from Dune 2
Method 2: Install Dune Legacy on your system
--------------------------------------------
Extract the Dune Legacy source code and run at the top level directory
the following commands:
autoreconf --install
./configure
make
make install
You may decide to change configure's default prefix to something else, e.g.
./configure --prefix=/usr
Updating localization
---------------------
Dune Legacy uses po files as generated by gettext. To update the template file data/locale/dunelegacy.pot and update the localizations in the *.po files run
./updatelocale.sh
To create a new locale run the following command (replacing "de" with your locale)
msginit --locale=de --input=dunelegacy.pot --output=German.de.po
Packaging/Distributions
------------
Source:
To package the source code go to the build directory and type
make dist-bzip2
This creates dunelegacy-?.tar.bz2. You might want to add a "src" to the name to get dunelegacy-?-src.tar.bz2
Debian/Ubuntu:
Make sure you have the following packages installed: build-essential, debhelper, autoconf, libsdl2-dev, libsdl2-mixer-dev and libsdl2-ttf-dev
Extract the source code from the bz2 file and change inside the source root directory (which contains configure). From there you run the following command:
dpkg-buildpackage -rfakeroot
You will get a dunelegacy_0.96-1_*.deb file one directory above.
Fedora:
You need the source tarball (see Packaging/Source in this file) and the following packages: rpm-build, gcc, gcc-c++, libstdc++-devel, SDL2-devel, SDL2_mixer-devel. Then run the following command:
rpmbuild -tb dunelegacy-?-src.tar.bz2
Under ~/rpmbuild/RPMS/<arch> you will find the created rpm file.
Gentoo:
There is an ebuild available. Go to your local portage tree and create the directory games-strategy/dunelegacy. Put the ebuild there and run
ebuild dunelegacy-?.ebuild digest
emerge dunelegacy
Mac OS X:
First you need the SDL2 and SDL2-mixer framework. Download them as dmgs from the official website, open the dmgs and copy SDL2.framework and SDL2_mixer.framework to /Library/Frameworks/.
Then open the XCode-Project from IDE/xCode/Dune Legacy.xcodeproj and build Dune Legacy. The resulting bundle will be put under IDE/xCode/build/Release.
Now go to the folder MacOSX and extract Dune Legacy.dmg.zip and then mount Dune Legacy.dmg. Put the compiled Dune Legacy bundle into the mounted dmg and unmount it afterwards.
Zip the dmg again to save a lot of download bandwidth.
Windows:
Use Code::Blocks to build the exe which will be placed in the data directory. The following DLLs are needed to run dunelegacy.exe:
libogg-0.dll
libvorbis-0.dll
libvorbisfile-3.dll
SDL2.dll
SDL2_mixer.dll
libmpg123-0.dll
Copy them in the data directory. To create a installer you need NSIS. Compile dunelegacy.nsi with the NSIS compiler to create the installer.
Cross-compiling Windows Version on Linux:
To compile the Windows version on Linux you need to setup the mingw cross-compiler. On Debian/Ubuntu install the packages g++-mingw-w64 and nsis.
You need SDL2, SDL2-ttf and SDL2-mixer development files for Windows (These are not the same as the development files for Linux):
https://libsdl.org/release/SDL2-devel-2.0.14-mingw.tar.gz
https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-2.0.15-mingw.tar.gz
https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.4-mingw.tar.gz
Put a copy of the headers under /usr/local/sdl/i686-w64-mingw32/include and /usr/local/sdl/x86_64-w64-mingw32/include ; the lib files under /usr/local/sdl/i686-w64-mingw32/lib and /usr/local/sdl/x86_64-w64-mingw32/lib.
To cross-compile and create a Windows installer for Dune Legacy run the following command:
./buildcrosswin32.sh
Running unit tests
------------------
To run the unit tests from the tests directory simply run the following script
./runUnitTests.sh
Running cppcheck
----------------
cppcheck is a static analysis. The following command will run it on the source and write all errors/warnings to cppcheck.log:
cppcheck -j 5 --enable=all -D_REENTRANT -DHAS_SOCKLEN_T -I include . 2> cppcheck.log