Building Moondust Project from sources

This is a special manual where will be written about building process for each operating system.

Common Preparing

 * Download sources (clone dev repo)
 * Download any config pack

First of all, you will need to download all sources:

Try to clone the repository by this command:

But if you was failed to clone repo, you can download sources as ZIP:

https://github.com/Wohlhabend-Networks/PGE-Project

(use the link "Download Zip" for getting the sources from GitHub)



And after download any configuration package (which contains graphics, music and sounds) which need to be able work with PGE:

http://wohlsoft.ru/config_packs.php

Note: Don't forget place configs, languages (after built *.qm files) directories with compiled executable file!

Dependences

 * Qt >= 5.4 (You can download it here: http://qt-project.org/downloads (You need the community version)
 * gcc >=4.7
 * g++ >=4.7
 * freeglut:
 * freeglut3-dev (Debian/Ubuntu/Mint)
 * freeglut-devel (RedHat / CentOS / Fedora)
 * SDL2 >= 2.0
 * SDL2_mixer >= 2.0

GCC
Install gcc on Debian/Ubuntu/Mint

on Redhat / CentOS

on openSUSE

SDL
At first, download the SDL library:

On Linux Mint you just can execute to install all dependencies:

Install official SDL2_mixer build: (But instead of you can build a modified SDL2_mixer library which includes with PGE Sources in the _Libs/SDL2_mixer_modified )

Differences: between official and modded builds:
 * Added resample source from 'madplay' player to implement better audio resampling
 * Ability to build via qmake from Qt
 * Enabled true loops for ModPlug and MikMod libraries
 * Attempt to add .SPC playback

But, if your distro hasn't SDL2 builds, you will need to get a source package: http://www.libsdl.org/download-2.0.php

And download the SDL2_mixer's source too: http://www.libsdl.org/projects/SDL_mixer/

Here you will need for these libs: libogg, libvorbis and libflac http://xiph.org/downloads/

Here you need to download the mikmod library: http://mikmod.sourceforge.net/#files

And here you need to download the LibMAD library to allow MP3 playback via SDL2_mixer: http://sourceforge.net/projects/mad/files/

You also can get all libraries from our folder: http://wohlsoft.ru/docs/Software/LibSDL/

Don't forget to download fix for configure script of the libmad: http://wohlsoft.ru/docs/Software/LibSDL/libmad-0.15.1b-mingw-w64.patch

Note You can found sources of SDL in the _Libs/_sources/ folder. You can try to build them with running of "build_linux_usr.sh" as root which will build SDL with /usr/ prefix or build_linux.sh which will build dependencies into _Libs/_builds/linux folder

Qt 5
To get Qt installation you have two ways: you can install Qt5 packages from your repositories but also you can download it here:

http://www.qt.io/download-open-source/

Note: You can see more download links if you will open "View all downloads" page.

If you download necessary package from official site, you should open Terminal and set "executable" permission to get able start installation.

and follow install instructions.
 * download package to your PC
 * Set executable:
 * Run install:

and, after install don't forgot check installed Qt (If you set install folder is "/opt/Qt/"):

If you get message like this:

All is okay ;-)

for convenience, you can add symlink to qmake in /usr/bin and use qmake simply:

Warning! :warning: If you have installed other versions of Qt, you can create symlink, for example, as "qmake-qt5"

After the install, unpack all sources from ZIP to any folder (for example, /home/vasya/projects/pge/)

Preparing for build

 * Extract the source code to a folder where you can find it easily
 * Extract the downloaded config pack into /path/to/your/source/Content/configs

You must have this tree:



Building code
You simply use the special build script in the "build.sh" file for build project

And you can build sources simply:

qmake cd Editor lrelease pge_editor.pro cd .. make make install

Links

 * Original building manual on PGE Forums