pygame / doc / BuildMinGW.txt

Building Pygame2 using MinGW
Using MinGW on Win32 platforms is probably the most comfortable way to
build and install Pygame2 on Windows, thanks to a handy script, that
will do most of the work for you.

.. note::

    At you can find more information and
    details about the build and installation process.

Setting up MSYS and MinGW
First of all, you have to make sure, you have an up to date and working MinGW
and MSYS installation running. If you have not, install both of them first.
Visit and follow their instructions to install and configure
The following setup has been tested to work well on several Win32

* MinGW 5.1.4 installer (or newer)

  On installing, make sure you install the C compiler, C++ compiler and
  win32api packages. This is usually done by checking the options "MinGW base"
  and "g++ Compiler".

* Msys 1.0.10 installer (or newer)

  Simply follow the installation instructions. In the post install step, make
  sure you set up your MinGW/MSYS environment properly.

* Msys DTK 1.0.1 installer (or newer)

  Simply follow the installation instructions.

If anything went right, MSYS and MinGW should be set up correctly now. Now
it's time to get the dependencies.

Building the dependencies
.. note::

    The following list of dependencies might not be the most actual one.
    Please check the README.txt file in the top source directory for the
    most actual dependency list!

.. note::

    You can find a set of prebuilt dependencies at Simply download the matching
    Win32 prebuilt package and unpack it within the source directory of
    pgreloaded (and rename it correctly).

Make sure, you have at least one of the following Python versions installed:

* Python 2.4, 2.5, 2.6, 3.1 (

To build anything, you will have to download the following additional source

* SDL >= 1.2.10              (
* SDL_mixer >= 1.2.11        (
* SDL_ttf >= 2.0.9           (
* SDL_image >= 1.2.10        (
* SDL_gfx >= 2.0.18          (
* libpng >= 1.2.24           (
* libjpeg >= 6b              (
* freetype >= 2.3.5          (
* portmidi >= 199            (
* OpenAL                     use one of:
  * OpenAL11CoreSDK (Aug 2009) 
  * openal-soft >= 1.11.753

And you will need the dependency packages for the packages above:

* zlib >= 1.2.3              (
* tiff >= 3.8.2              (
* libvorbis >= 1.2.0  	     (
* libogg >= 1.1.3            (
* FLAC >= 1.2.1              (
* smpeg >= rev. 370          (

Once you downloaded all source packages, unpack them and put them all into a
common directory, where the script can find them.
The script will search the directory where it resides, the parent directory of
it and a directory named 'deps' for the unpacked sources.

.. note::

    At this point, we strongly recommend a directory named 'deps' that
    is created under the Pygame2 source directory.

Once anything's unpacked, move the Pygame2 source directory to your MSYS home
directory (in a default installation this would be C:\\msys\\1.0\\home\\%USERNAME%).
Start the Msys shell and change to the Pygame2 source directory: ::

    cd pgreloaded

Now start the script: ::

    python --all

This will start to build all necessary dependencies and takes some time to
finish. Now is a good time to get yourself another cup of coffee and read
the newspaper.

Building Pygame2
Now that all dependencies are built and installed, you can proceed to build
and install Pygame2 itself. Simply type: ::

    python build --compiler=mingw32 install

This will build and install Pygame2 in one step.