1This file provides information on how to build and install Dune Legacy. 2 3Prerequirements 4--------------- 5 6- gcc or any other standard compliant C++ compiler 7- autotools 8- SDL 2 9- SDL2-mixer 10 11 12Building 13-------- 14 15Dune Legacy can read the needed data from different locations. If you want 16to keep everything in one directory you should use the first method. You also 17may decide to install Dune Legacy on your system. The use the second method. 18 19Method 1: Data read from local directory 20---------------------------------------- 21Extract the Dune Legacy source code and run at the top level directory 22the following command: 23 24autoreconf --install 25./buildlocal.sh 26 27This will configure and build Dune Legacy and you will find afterwards 28a "dunelegacy" binary in the top level directory. The data is read from 29the data subdirectory. There you shoud copy all the PAK-files from Dune 2 30 31Method 2: Install Dune Legacy on your system 32-------------------------------------------- 33Extract the Dune Legacy source code and run at the top level directory 34the following commands: 35 36autoreconf --install 37./configure 38make 39make install 40 41You may decide to change configure's default prefix to something else, e.g. 42./configure --prefix=/usr 43 44 45 46Updating localization 47--------------------- 48 49Dune 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 50 51./updatelocale.sh 52 53To create a new locale run the following command (replacing "de" with your locale) 54 55msginit --locale=de --input=dunelegacy.pot --output=German.de.po 56 57 58 59Packaging/Distributions 60------------ 61 62Source: 63To package the source code go to the build directory and type 64 65make dist-bzip2 66 67This creates dunelegacy-?.tar.bz2. You might want to add a "src" to the name to get dunelegacy-?-src.tar.bz2 68 69 70Debian/Ubuntu: 71Make sure you have the following packages installed: build-essential, debhelper, autoconf, libsdl2-dev and libsdl2-mixer-dev 72Extract the source code from the bz2 file and change inside the source root directory (which contains configure). From there you run the following command: 73 74dpkg-buildpackage -rfakeroot 75 76You will get a dunelegacy_0.96-1_*.deb file one directory above. 77 78 79Fedora: 80You 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: 81 82rpmbuild -tb dunelegacy-?-src.tar.bz2 83 84Under ~/rpmbuild/RPMS/<arch> you will find the created rpm file. 85 86 87Gentoo: 88There is an ebuild available. Go to your local portage tree and create the directory games-strategy/dunelegacy. Put the ebuild there and run 89 90ebuild dunelegacy-?.ebuild digest 91emerge dunelegacy 92 93 94Mac OS X: 95First 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/. 96Then 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. 97Now 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. 98Zip the dmg again to save a lot of download bandwidth. 99 100 101Windows: 102Use Code::Blocks to build the exe which will be placed in the data directory. The following DLLs are needed to run dunelegacy.exe: 103libogg-0.dll 104libvorbis-0.dll 105libvorbisfile-3.dll 106SDL2.dll 107SDL2_mixer.dll 108smpeg.dll 109 110Copy them in the data directory. To create a installer you need NSIS. Compile dunelegacy.nsi with the NSIS compiler to create the installer. 111 112 113Cross-compiling Windows Version on Linux: 114To 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. 115You need SDL2 and SDL2-mixer development files for Windows (These are not the same as the development files for Linux): 116https://libsdl.org/release/SDL2-devel-2.0.5-mingw.tar.gz 117https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-mingw.tar.gz 118 119Put a copy of the headers under /usr/i686-w64-mingw32/include and /usr/x86_64-w64-mingw32/include ; the lib files under /usr/i686-w64-mingw32/lib and /usr/x86_64-w64-mingw32/lib. 120 121To cross-compile and create a Windows installer for Dune Legacy run the following command: 122 123./buildcrosswin32.sh 124 125 126Running unit tests 127------------------ 128 129To run the unit tests from the tests directory simply run the following script 130 131./runUnitTests.sh 132 133 134Running cppcheck 135---------------- 136 137cppcheck is a static analysis. The following command will run it on the source and write all errors/warnings to cppcheck.log: 138 139cppcheck -j 5 --enable=all -D_REENTRANT -DHAS_SOCKLEN_T -I include . 2> cppcheck.log 140 141 142