Compiling Tux Paint using MinGW/MSYS2

This document provides how to compile Tux Paint with MinGW/MSYS2 on Microsoft Windows.


MinGW/MSYS2 toolchains and required libraries

So many tools and libraries are required to build Tux Paint. The package management system "pacman" helps you install them automatically solving complicated dependencies.


MSYS2

First of all, you have to install latest MSYS2 as follows.

Open the msys2 shell from the "Start Menu" -> "MSYS2 64bit" -> "MSYS2 MSYS" and execute following command.

$ pacman -Syu
# (press <ENTER> for all inquiry)

This will update core system and the window will close automatically.

Open the msys2 shell again and execute following command to finish remaining updating process.

$ pacman -Syu
# (press <ENTER> for all inquiry)

Install basic development tools as follows.

$ pacman -S base-devel msys2-devel git
# (press <ENTER> for all inquiry)

Proceed to the next "MinGW 64bit (x86_64) toolchains" section or skip to the "MinGW 32bit (i686) toolchains" section if you need only a 32bit build environment.


MinGW 64bit (x86_64) toolchains

Open the msys2 shell from the "Start Menu" -> "MSYS2 64bit" -> "MSYS2 MSYS" and install basic 64bit development tools as follows.

$ pacman -S mingw-w64-x86_64-toolchain
# (press <ENTER> for all inquiry)

64bit (x86_64) dependency libraries for Tux Paint

You can install tools and libraries required for compiling Tux Paint on MSYS2/MINGW using "pacman" except for SDL_Pango.

"ntldd" is a small tool which examine windows executable files to list dynamic link library (.dll) files they depends on. Tux Paint's packaging process for binary distribution uses it to find required .dll files.

$ pacman -S mingw-w64-x86_64-SDL_{image,mixer,ttf}
$ pacman -S mingw-w64-x86_64-librsvg
$ pacman -S mingw-w64-x86_64-fribidi
$ pacman -S mingw-w64-x86_64-libimagequant
$ pacman -S mingw-w64-x86_64-fltk
$ pacman -S mingw64/mingw-w64-x86_64-ntldd-git

Close the shell before proceeding to the remaining process.

Install SDL_Pango and re-install SDL on the 64bit environment.

SDL_Pango should be installed manually. In addition, you have to re-install SDL from the source code or you will see unnecessary blank window opens when starting Tux Paint.

This time, use the MinGW "64bit" shell. Open the shell from the "Start Menu" -> "MSYS2 64bit -> "MSYS2 MinGW 64-bit"

SDL_Pango

At first, you have to prepare source tar-ball and a patch required in the same directory.

Build and install SDL_Pango as follows.

$ tar zxvf SDL_Pango-0.1.2.tar.gz
$ cd SDL_Pango-0.1.2/
$ patch -p0 < ../SDL_Pango-configure-extra-api.patch
$ ./configure --prefix=/mingw64 && make && make install

SDL

Download source tar-ball from "libsdl.org" and re-install SDL as follows.

$ tar zxvf SDL-1.2.15.tar.gz
$ cd SDL-1.2.15
$ ./configure --prefix=/mingw64 && make && make install

Proceed to the next "MinGW 32bit (i686) toolchains" section or skip to the "ImageMagick" section if you need only a 64bit build environment.


MinGW 32bit (i686) toolchains

Open the msys2 shell from the "Start Menu" -> "MSYS2 64bit" -> "MSYS2 MSYS" and install basic 32bit development tools as follows.

$ pacman -S mingw-w64-i686-toolchain
# (press <ENTER> for all inquiry)

32bit (i686) dependency libraries for Tux Paint

You can install tools and libraries required for compiling Tux Paint on MSYS2/MINGW using "pacman" except for SDL_Pango.

"ntldd" is a small tool which examin windows executable files to list dynamic link library (.dll) files they depends on. Tux Paint's packaging process for binary distribution uses it to find required .dll files.

$ pacman -S mingw-w64-i686-SDL_{image,mixer,ttf}
$ pacman -S mingw-w64-i686-librsvg
$ pacman -S mingw-w64-i686-fribidi
$ pacman -S mingw-w64-i686-libimagequant
$ pacman -S mingw-w64-i686-fltk
$ pacman -S mingw-w64-i686-ntldd-git

Close the shell before proceeding to the remaining process.

Install SDL_Pango and re-install SDL on the 32bit environment.

SDL_Pango should be installed manually. In addition, you have to re-install SDL from the source code or you will see unnecessary blank window opens when starting Tux Paint.

This time, use the MinGW "32bit" shell. Open the shell from the "Start Menu" -> "MSYS2 64bit -> "MSYS2 MinGW 32-bit"

SDL_Pango

At first, you have to prepare source tar-ball and a patch required in the same directory.

Build and install SDL_Pango as follows.

$ tar zxvf SDL_Pango-0.1.2.tar.gz
$ cd SDL_Pango-0.1.2/
$ patch -p0 < ../SDL_Pango-configure-extra-api.patch
$ ./configure --prefix=/mingw32 && make && make install

SDL

Download source tar-ball from "libsdl.org" and re-install SDL as follows.

$ tar zxvf SDL-1.2.15.tar.gz
$ cd SDL-1.2.15
$ ./configure --prefix=/mingw32 && make && make install

Proceed to the next ImageMagick section.


ImageMagick

ImageMagick is a compilation of command line tools to create, edit, compose, or convert bitmap images supporting quite a large number of image formats. Tux Paint uses two functions ("convert" and "composite") in it to generate thumbnails for startar images and templates in the build process.

Using official binary release available from "Windows Binary Release" is recommended because its commands installed using "pacman" on MinGW/MSYS do not work as expected.

Do not forget to enable "Install legacy utilities (e.g. convert)" while installing it because Tux Paint's build process uses them.

Add the path to the directory in which ImageMagick is installed at the top of the "PATH" environment variable. For example;

$ export PATH=/c/Program\ Files/ImageMagick-7.0.10-Q16-HDRI:$PATH

You make it default by describing above in the bash configuration file "~/.bash_profile".


Tux Paint

You are able to compile 64bit binaries using MSYS2 64bit shell and 32bit binaries using 32bit shell respectively.


Tux Paint Config

"Tux Paint Config" is a useful graphical tool for tweaking Tux Paint's behavior. You have to build this component before compiling Tux Paint if you want to have it included in your package.

You can use any of [a] stable tar-ball release or [b] developing source tree.

[a] Using stable tar-ball release.

Expand the tar-ball and change the directory name so that the final packaging process can find related files.

$ tar zxvf tuxpaint-config-0.0.16.tar.gz
$ mv tuxpaint-config-0.0.16 tuxpaint-config

[b] Using developing source tree

Fetch the developing source tree from git repository.

$ git clone https://git.code.sf.net/p/tuxpaint/tuxpaint-config tuxpaint-config

Now you can build tuxpaint-config as follows.

$ cd tuxpaint-config
$ make win32

Tux Paint

You can use any of [a] stable tar-ball release or [b] developing source tree.

[a] Using stable tar-ball release.

Expand the tar-ball and enter to the top of the source tree.

$ tar zxvf tuxpaint-0.9.25.tar.gz
$ cd tuxpaint-0.9.25

[b] Using developing source tree

Fetch the developing source tree from git repository and enter to the top of the source tree.

$ git clone https://git.code.sf.net/p/tuxpaint/tuxpaint tuxpaint
$ cd tuxpaint

Now you can build Tux Paint as follows.

$ make bdist-win32

All the files needed for starting Tux Paint and Tux Paint Config are collected in the directory for binary distribution "bdist" directory under "win32". You can start them by double-clicking .exe files in the "bdist" directory.


Tux Paint installer

Inno Setup is used to build executable installer for Tux Paint. Therefore you have to install it in the first place.

Inno Setup officially supports translations for only about 20 languages. However, one of the great points of Tux Paint is it supports so many languages. Therefore, the set up script "tuxpaint.iss" to build the installer is written to use much more translations including unofficial one which are available on "Inno Setup Translations". You have to download translation files (.isl) required and put them in "Languages" directory under the directory in which Inno Setup is installed.

Then, you can easily build an executable installer just as follows.

It takes for a while and you will find tuxpaint-x.x.xx-win32-installer.exe in the same directory.