FANDOM


(Data path variables bug fixed)
(Simplify setup as allowed by current git versions)
Line 11: Line 11:
   
 
- Setup git directories. In the shell:
 
- Setup git directories. In the shell:
  +
 
<pre>
 
<pre>
 
> mkdir freeciv
 
> mkdir freeciv
Line 25: Line 26:
 
> git checkout S2_4
 
> git checkout S2_4
 
# Create worktrees for all the branches
 
# Create worktrees for all the branches
> git worktree add ../master/src origin/master
+
> git worktree add ../master/src master
> git worktree add ../S3_0/src origin/S3_0
+
> git worktree add ../S3_0/src S3_0
> git worktree add ../S2_6/src origin/S2_6
+
> git worktree add ../S2_6/src S2_6</pre>
# 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</pre>
 
   
 
- Create build directories.
 
- Create build directories.
  +
 
<pre>
 
<pre>
 
# Do following for each of the branches (master, S3_0, S2_6)
 
# Do following for each of the branches (master, S3_0, S2_6)
Line 56: Line 58:
   
 
- Go to directory of the configuration you want to build. For example S2_6 gtk3.22-client configuration
 
- Go to directory of the configuration you want to build. For example S2_6 gtk3.22-client configuration
  +
 
<pre>> cd ~/freeciv/S2_6/builds/gtk3.22</pre>
 
<pre>> cd ~/freeciv/S2_6/builds/gtk3.22</pre>
   
 
- Run make to build freeciv
 
- Run make to build freeciv
  +
 
<pre>> make</pre>
 
<pre>> make</pre>
   
 
- Run produced freeciv.
 
- Run produced freeciv.
  +
 
<pre>> ./fcgui</pre>
 
<pre>> ./fcgui</pre>
   
Line 68: Line 73:
 
- Go to source directory of the branch you want to update.
 
- Go to source directory of the branch you want to update.
 
For example S2_6:
 
For example S2_6:
  +
 
<pre>> cd ~/freeciv/S2_6/src</pre>
 
<pre>> cd ~/freeciv/S2_6/src</pre>
   
 
- Pull the changes since your last update
 
- Pull the changes since your last update
  +
 
<pre>> git pull</pre>
 
<pre>> git pull</pre>
   
Line 80: Line 87:
 
If you want to keep your msys2 environment updated against upstream
 
If you want to keep your msys2 environment updated against upstream
 
changes, you can do that with
 
changes, you can do that with
  +
 
<pre>> pacman -Syu</pre>
 
<pre>> pacman -Syu</pre>
 
Notice however that such updates should not be made for environments
 
Notice however that such updates should not be made for environments

Revision as of 23:30, June 22, 2019

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 master
> git worktree add ../S3_0/src S3_0
> git worktree add ../S2_6/src 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.

Community content is available under CC-BY-SA unless otherwise noted.