Wikia

Freeciv

MSYS2

703pages on
this wiki
Talk0

This stub was initialized with …/doc/README.msys2, please fix it as you see fit, e.g., explain what it actually does for the purposes of Freeciv for folks who have git and MinGW-w64 without Gtk.

 MSYS2 Windows Installer build notes
====================================

This document is about building Freeciv Windows Installer packages
using MSYS2 from http://msys2.github.io


 Status
====================================

- Msys1, not msys2, is still the official freeciv Windows Installer
  build method
- With very specific configure options (see Problems) and msys2 package
  selection freeciv can be built
- Buildable clients are gtk3, gtk2, and Qt
  - Official pre-made msys2 environment supports only gtk3-client build
- Both server, gtk3-client, and gtk2-client launch ok, Qt client does not
- Most Installers cannot be built
- Buildable Installers:
  - Ruledit
- Both win32 and win64 builds work, but only when also the installer
  package for whole msys2 system matches (despite installation always
  having mingw32 and mingw64 portions, in addition to build-system
  specific common part)
  So if you have installed 32bit package, do not use mingw64_shell
  at all. More surprisingly, if you have installed 64bit package,
  do not use mingw32_shell in it at all.


 Setup
====================================

 This chapter is about creating new msys2 build environment.

 If you want to reproduce more official freeciv builds, the environment
 used to make those builds is documented in the next chapter ("Premade environment"),
 with listing of versions current at the time of this freeciv version.

1) Install MSYS2 following the documentation on their homepage

1.1) Download
 https://sourceforge.net/projects/msys2/files/Base/i686/msys2-i686-20160205.exe
 for win32 or
 https://sourceforge.net/projects/msys2/files/Base/x86_64/msys2-x86_64-20160205.exe
 for win64

1.2) Run it to install MSYS2 on build system

1.3) Launch msys2_shell to update packages
> update-core
> pacman -Su

2) Install following packages with 'pacman -Su'

2.1) Packages needed for building freeciv
 These packages are needed even if you don't plan to make installer,
 but only build freeciv for local use.

2.1.1) Arch independent packages needed for building freeciv

2.1.1.1) Arch independent packages always needed for building freeciv
 With these packages it's possible to build freeciv source tree that
 has already such generated files present that are created for the
 release tarball.

 - make
 - gettext
 - pkg-config

2.1.1.2) Arch independent packages needed for getting and extracting freeciv
 source tarball

 - tar

2.1.1.3) Arch independent packages needed for building freeciv from svn checkout
 These are needed in addition to the ones always needed for building freeciv.

 - subversion
 - automake
 - libtool
 - autoconf
 - python

2.1.2) Arch-specific packages needed for building freeciv

2.1.2.1) Arch-specific packages for building common parts
 - mingw-w64-i686-gcc / mingw-w64-x86_64-gcc
 - mingw-w64-i686-icu / mingw-w64-x86_64-icu
 - mingw-w64-i686-curl / mingw-w64-x86_64-curl
 - mingw-w64-i686-bzip2 / mingw-w64-x64_64-bzip2
 - mingw-w64-i686-readline / mingw-w64-x86_64-readline
 - mingw-w64-i686-SDL2_mixer / mingw-w64-x86_64-SDL2_mixer

2.1.2.2) Arch-specific packages for building gtk3-client
 - mingw-w64-i686-gtk3 / mingw-w64-x86_64-gtk3

2.1.2.3) Arch-specific packages for buildind Qt-client and/or Ruledit
 - mingw-w64-i686-qt5 / mingw-w64-x86_64-qt5

2.1.2.4) Arch-specific packages for building gtk2-client
 - mingw-w64-i686-gtk2 / mingw-w64-x86_64-gtk2

2.2) Packaged needed for building installer package
 These are needed in addition to above ones used in the
 building step already.

2.2.1) Arch-specific packages needed for building installer
 package

 - mingw-w64-i686-nsis / mingw-w64-x86_64-nsis

2.3) Packages TODO:
 - Mixer support
 - Clients other than gtk3 and gtk2
 - MagickWand support


 Premade environment
====================================

Premade msys2 environment is available for download from
http://download.gna.org/freeciv/packages/windows/testing/cazfi/installer_msys2/envs/

Current versions are

win32:
------
msys2-freeciv-win32-160821.7z, based on
https://sourceforge.net/projects/msys2/files/Base/i686/msys2-i686-20160205.exe
Replace <arch> with 'i686' in package names below

win64:
------
msys2-freeciv-win64-160821.7z, based on
https://sourceforge.net/projects/msys2/files/Base/x86-64/msys2-x86_64-20160205.exe
Replace <arch> with 'x86_64' in package names below


Following packages have been installed:
- make
- pkg-config
- tar
- subversion
- patch
- nano
- automake
- libtool
- autoconf
- python
- mingw-w64-<arch>-gcc
- mingw-w64-<arch>-icu
- mingw-w64-<arch>-curl
- mingw-w64-<arch>-sqlite3
- mingw-w64-<arch>-gtk3
- mingw-w64-<arch>-nsis
- mingw-w64-<arch>-bzip2
- mingw-w64-<arch>-readline
- mingw-w64-<arch>-SDL2_mixer


 Build
====================================

Launch msys2 shell. Get the freeciv sources there
somehow. Some options are:
1) Download freeciv tarball within msys2 shell with wget
2) Use svn within msys2 shell to get them from version control
3) Copy them from Windows folder where they are to a directory that
   is within msys2

> cd win32/installer_msys2
> make <targets>

  Target can be:
  - "<gui>-installer", where <gui> is
     - gtk3
     - gtk2
     - qt
  - "ruledit-installer"
  - "snapshot", if your freeciv sources are in svn checkout directory

 You can also set minimum Windows version targeted. While setting this
 to an older version allows those Windows versions to run the created
 executables, it may come with the cost of disabling functionality that
 newer Windows versions could otherwise have.
 The version is set via MIN_WIN_VER variable. For values to use, see
 list in: https://msdn.microsoft.com/en-us/library/6sehtctf.aspx
 Current default is 0x0600 (Windows Vista).


 Problems
====================================

- Freeciv linked against readline in msys2 does not work.
  Configure freeciv with --without-readline

- Checking if files are bzip2 compressed crashes freeciv.
  Disable bzip2 support with --without-libbz2


 TODO
====================================

- Bzip2 based compression support was disabled without
  removing any dll's from the installer packages.
  Please review what related dlls are packaged and could be
  removed.

- Qt program installers; qt-client and ruledit

- sdl2-client installer

- Both win32 and win64 packages built from a single build environment

- Readline support

Around Wikia's network

Random Wiki