Freeciv
(Workaround for MSYS2 FREECIV_DATA_PATH brokenness)
(Data path variables bug fixed)
Line 68: Line 68:
 
<pre>> make</pre>
 
<pre>> make</pre>
   
- Run produced freeciv. This is currently a bit broken. It should happen like:
+
- Run produced freeciv.
 
<pre>> ./fcgui</pre>
 
<pre>> ./fcgui</pre>
...but for the time being use this:
 
<pre>> FREECIV_DATA_PATH=../../src/data ./fcgui</pre>
 
   
 
== Updating sources to latest ones ==
 
== Updating sources to latest ones ==

Revision as of 18:35, 29 October 2017

MSYS2 can be used as freeciv build/development environment on Windows.

First time setup

- Download latest msys2 environment from http://files.freeciv.org/packages/windows/msys2/

- Extract the environment from the package to a suitable location. 7-zip from http://www.7-zip.org can be used for extracting.

- Start the msys2 shell from mingw32.exe (to produce win32 builds) or mingw64.exe (to produce win64 builds) at environment root. If you selected mingw32.exe, ${ARCH} in following examples is mingw32. If you selected mingw64.exe, ${ARCH} is mingw64.

- Setup git directories. In the shell:

> mkdir freeciv
> cd freeciv
> git clone https://github.com/freeciv/freeciv.git git
# Create root dirs for branch-specific directory hierarchies
> mkdir master
> mkdir S3_0
> mkdir S2_6
> cd git
# Only one worktree can have checkout of a given branch. Checkout
# unused branch here so we can later checkout other branches to
# their real hierarchies
> git checkout S2_4
# Create worktrees for all the branches
> git worktree add ../master/src origin/master
> git worktree add ../S3_0/src origin/S3_0
> git worktree add ../S2_6/src origin/S2_6
# Checkout correct branches for each worktree
> cd ../master/src
> git checkout master
> cd ../../S3_0/src
> git checkout S3_0
> cd ../../S2_6/src
> git checkout S2_6

- Create build directories.

# Do following for each of the branches (master, S3_0, S2_6)
# This example if for S2_6
> cd ~/freeciv/S2_6/src
> ./autogen.sh --no-configure-run
> cd ..
> mkdir builds
> cd builds
# Create configurations you want. This example creates
# simple gtk3.22-, Qt-, and sdl2-client configurations
> mkdir gtk3.22
> cd gtk3.22
> ../../src/configure --enable-debug --without-readline --enable-client=gtk3.22
> cd ..
> mkdir qt
> cd qt
> ../../src/configure --enable-debug --without-readline --enable-client=qt --with-qt5-includes=/${ARCH}/include --with-qt5-libs=/${ARCH}/lib
> cd ..
> mkdir sdl2
> cd sdl2
> ../../src/configure --enable-debug --without-readline --enable-client=sdl2

Building and running freeciv

- Go to directory of the configuration you want to build. For example S2_6 gtk3.22-client configuration

> cd ~/freeciv/S2_6/builds/gtk3.22

- Run make to build freeciv

> make

- Run produced freeciv.

> ./fcgui

Updating sources to latest ones

- Go to source directory of the branch you want to update. For example S2_6:

> cd ~/freeciv/S2_6/src

- Pull the changes since your last update

> git pull

You are now ready to rebuild configurations of that branch from the updated sources.

Updating msys2 environment

If you want to keep your msys2 environment updated against upstream changes, you can do that with

> pacman -Syu

Notice however that such updates should not be made for environments used to build official freeciv installers, as the installers should be created in well-specified environments, not necessarily up-to-date (what ever that means at a given moment) environments.