Monday, December 9, 2013

Compiling Spyder2

Spyder (previously known as Pydee) is a powerful interactive development environment for the Python language with advanced editing, interactive testing, debugging and introspection feature.

Set the environment.

Update the environment in c:/msys/etc/profile:
export CFLAGS="-Ic:/programs/dev/python64/include -Ic:/programs/python27/include/python2.7"
export LDFLAGS="-Lc:/programs/dev/python64/lib -Lc:/programs/python27/lib"
export PATH="$PATH:/c/programs/python27/bin:/c/programs/dev/python64/bin:/c/programs/tools/bin"
export TERMINFO="c:/programs/python27/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Install Python.

Extract Python-2.7.*-*-mingw-x86_64.7z to your Python installation dir, for example; 'c:/programs/python27'.

Compile extra dependencies.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download

cd freetype-2.4.12
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install



tiff-4.0.3
http://download.osgeo.org/libtiff/tiff-4.0.3.tar.gz

cd tiff-4.0.3
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-cxx --disable-shared
cd port && make
cd ../libtiff
make -j2
make install



jpeg-9
http://www.ijg.org/files/jpegsrc.v9.tar.gz

cd jpeg-9
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install



giflib-5.0.5
http://sourceforge.net/projects/giflib/files/giflib-5.x/giflib-5.0.5.tar.bz2/download

cd giflib-5.0.5
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install



zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.xz
patch: zlib-1.2.8_disable_shared.diff

cd zlib-1.2.8
patch -p1 <../zlib-1.2.8_disable_shared.diff

make prefix=c:/programs/dev/python64 -f win32/Makefile.gcc install


lcms-1.19
http://sourceforge.net/projects/lcms/files/lcms/1.19/lcms-1.19.tar.gz/download
patch: lcms-1.19_mingw.diff

cd lcms-1.19

patch -p1 <../lcms-1.19_mingw.diff
 ./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install



libwebp-0.3.1
https://webp.googlecode.com/files/libwebp-0.3.1.tar.gz

cd libwebp-0.3.1
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --enable-libwebpmux --enable-libwebpdemux --disable-shared
make -j2
make install


Compile extra Python modules.

setuptools-1.3
https://pypi.python.org/packages/source/s/setuptools/setuptools-1.3.tar.gz

cd setuptools-1.3
python setup.py build install



pip-1.4.1
https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz

cd pip-1.4.1
python setup.py build install



scons-2.3.0
https://pypi.python.org/packages/source/S/SCons/SCons-2.3.0.tar.gz
patch: scons-2.3.0_mingw-python.diff

cd scons-2.3.0

patch -p1 <../scons-2.3.0_mingw-python.diff 
python setup.py build install --no-install-bat --no-version-script


pyflakes-0.7.2
https://pypi.python.org/packages/source/p/pyflakes/pyflakes-0.7.2.tar.gz

cd pyflakes-0.7.2
python setup.py build install



Pillow-2.2.1
https://pypi.python.org/packages/source/P/Pillow/Pillow-2.2.1.zip
patch: Pillow-2.2.1_mingw-python.diff

cd Pillow-2.2.1

patch -p1 <../Pillow-2.2.1_mingw-python.diff
python setup.py build install0


[ pylint & dependencies ]

colorama-0.2.5
https://pypi.python.org/packages/source/c/colorama/colorama-0.2.5.tar.gz

cd colorama-0.2.5
python setup.py build install



logilab-common-0.60.0
https://pypi.python.org/packages/source/l/logilab-common/logilab-common-0.60.0.tar.gz

cd logilab-common-0.60.0
python setup.py build install



logilab-astng-0.24.3
https://pypi.python.org/packages/source/l/logilab-astng/logilab-astng-0.24.3.tar.gz

cd logilab-astng-0.24.3
python setup.py build install



pylint-0.28.0
https://pypi.python.org/packages/source/p/pylint/pylint-0.28.0.tar.gz

cd pylint-0.28.0
python setup.py build install


[ end pylint ]


rope-0.9.4
https://pypi.python.org/packages/source/r/rope/rope-0.9.4.tar.gz

cd rope-0.9.4
python setup.py build install



zeromq-3.2.2
http://download.zeromq.org/zeromq-3.2.2.tar.gz
patch: zeromq-3.2.2_mingw_static.diff

cd zeromq-3.2.2

patch -p1 <../zeromq-3.2.2_mingw_static.diff
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --enable-static --disable-shared
make
make install



pyzmq-13.1.0
https://pypi.python.org/packages/source/p/pyzmq/pyzmq-13.1.0.tar.gz
patch: pyzmq-13.1.0_mingw-python.diff

cd pyzmq-13.1.0

patch -p1 <../pyzmq-13.1.0_mingw-python.diff 
python setup.py build --zmq=c:/programs/dev/python64 install


Pygments-1.6
https://pypi.python.org/packages/source/P/Pygments/Pygments-1.6.tar.gz

cd Pygments-1.6
python setup.py build install



pep8-1.4.6
https://pypi.python.org/packages/source/P/Pygments/Pygments-1.6.tar.gz

cd pep8-1.4.6
python setup.py build install



sympy-0.7.3
https://pypi.python.org/packages/source/s/sympy/sympy-0.7.3-py2.7.tar.gz

cd sympy-0.7.3
python setup.py build install



[ sphinx & dependencies ]

docutils-0.11
https://pypi.python.org/packages/source/d/docutils/docutils-0.11.tar.gz

cd docutils-0.11
python setup.py build install



Jinja2-2.6
https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.6.tar.gz

cd Jinja2-2.6
python setup.py build install



Sphinx-1.1.3
https://pypi.python.org/packages/source/S/Sphinx/Sphinx-1.1.3.tar.gz

cd Sphinx-1.1.3
python setup.py build install


[ end sphinx ]

psutil-1.1.2
https://pypi.python.org/packages/source/p/psutil/psutil-1.1.2.tar.gz
patch: psutil-1.1.2_mingw-python.diff

cd psutil-1.1.2

patch -p1 <../psutil-1.1.2_mingw-python.diff
python setup.py build install


tornado-3.1.1
https://pypi.python.org/packages/source/t/tornado/tornado-3.1.1.tar.gz

cd tornado-3.1.1
 
python setup.py build install


ipython-1.1.0
https://pypi.python.org/packages/source/i/ipython/ipython-1.1.0.tar.gz
patch: ipython-1.1.0_mingw-python.diff

cd ipython-1.1.0

patch -p1 <../ipython-1.1.0_mingw-python.diff
python setup.py build install




For NumPy, SciPy and Matplotlib refer to this previous article.

numpy-1.8.0
scipy-0.13.0
qt-4.8.4
sip-4.15.2
PyQt-win-gpl-4.10.3
matplotlib-1.3.1



numexpr-2.1
https://pypi.python.org/packages/source/n/numexpr/numexpr-2.1.tar.gz

cd numexpr-2.1
python setup.py build install



Compile Spyder2.

spyder-2.2.5
https://spyderlib.googlecode.com/files/spyder-2.2.5.zip
patch: spyder-2.2.5_mingw-python.diff

cd spyder-2.2.5

patch -p1 <../spyder-2.2.5_mingw-python.diff 
python setup.py build install







Sunday, September 15, 2013

Compiling GIMP


GIMP is an acronym for GNU Image Manipulation Program. It is a freely distributed program for such tasks as photo retouching, image composition and image authoring. It has many capabilities. It can be used as a simple paint program, an expert quality photo retouching program, an online batch processing system, a mass production image renderer, an image format converter, etc.

GIMP is expandable and extensible. It is designed to be augmented with plug-ins and extensions to do just about anything. The advanced scripting interface allows everything from the simplest task to the most complex image manipulation procedures to be easily scripted.  (taken from the official website)


Set the environment.

Update the environment in c:/msys/etc/profile:
export CPPFLAGS="-I/c/programs/gimp/include"
export LDFLAGS="-L/c/programs/gimp/lib"
export PATH="$PATH:/c/programs/gimp/bin"
export PKG_CONFIG_PATH="c:\\programs\\gimp\\lib\\pkgconfig"
export TERMINFO="/c/programs/gimp/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Install Python.

Copy all folders (including files) from Python-2.7.6-1-mingw-x86_64.7z (bin, include, lib, share) to the GIMP installation dir, for example; c:/programs/gimp.


Compile GTK+ and dependencies.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download

cd freetype-2.4.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



expat-2.1.0
http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download

cd expat-2.1.0
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



fontconfig-2.11.0
http://freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.bz2
patch: fontconfig-2.11.0_mingw64_gimp.diff

cd fontconfig-2.11.0
patch -p1 <../fontconfig-2.11.0_mingw64_gimp.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-docs --disable-static
make -j2
make install



tiff-4.0.2
http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz

cd tiff-4.0.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-cxx --disable-static
cd port && make
cd ../libtiff
make -j2
make install



jasper-1.900.1
http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
patch: jasper-1.900.1_enable_shared.diff

cd jasper-1.900.1
patch -p1 <../jasper-1.900.1_enable_shared.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



jpeg-9
http://www.ijg.org/files/jpegsrc.v9.tar.gz

cd jpeg-9
./configure --prefix=cd --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.xz
patch: zlib-1.2.8_disable_static.diff

cd zlib-1.2.8

patch -p1 <../zlib-1.2.8_disable_static.diff
make prefix=/c/programs/gimp -f win32/Makefile.gcc install


libpng-1.5.12
http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/libpng-1.5.12.tar.bz2/download

cd libpng-1.5.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gettext-0.18.2
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.2.tar.gz
patch: gettext-0.18.2_mingw64.diff

cd gettext-0.18.2
patch -p1 <../gettext-0.18.2_mingw64.diff

cd gettext-runtime
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install


cd ../gettext-tools
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install



libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
make distclean
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



libffi-3.0.12
ftp://sourceware.org/pub/libffi/libffi-3.0.12.tar.gz
patch: libffi-3.0.12_mingw.diff

cd libffi-3.0.12
patch -p1 <../libffi-3.0.12_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-builddir --disable-static
make -j2
make install



glib-2.35.9
http://ftp.gnome.org/pub/gnome/sources/glib/2.35/glib-2.35.9.tar.xz
patch: glib-2.35.9_mingw-python.diff

cd glib-2.35.9
patch -p1 <../glib-2.35.9_mingw-python.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-threads=win32
make -j2

make install


pixman-0.30.2
http://cairographics.org/releases/pixman-0.28.2.tar.gz

cd pixman-0.30.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



cairo-1.10.2
http://cairographics.org/releases/cairo-1.10.2.tar.gz
patch: cairo-1.10.2_mingw.diff

cd cairo-1.10.2
patch -p1 <../cairo-1.10.2_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gobject-introspection-1.35.4
http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.35/gobject-introspection-1.35.4.tar.xz
patch: gobject-introspection-1.35.4_mingw-python.diff

cd gobject-introspection-1.35.4
patch -p1 <../gobject-introspection-1.35.4_mingw-python.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



harfbuzz-0.9.12
http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.12.tar.bz2

cd harfbuzz-0.9.12
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



pango-1.32.6
http://ftp.gnome.org/pub/gnome/sources/pango/1.32/pango-1.32.6.tar.xz


cd pango-1.32.6
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-included-modules --disable-static
make -j2
make install



atk-2.8.0
http://ftp.gnome.org/pub/gnome/sources/atk/2.8/atk-2.8.0.tar.xz
patch: atk-2.8.0_mingw.diff

cd atk-2.8.0
patch -p1 <../atk-2.8.0_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install



gdk-pixbuf-2.28.2
http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.28/gdk-pixbuf-2.28.2.tar.xz

export HEX=`echo gdk-pixbuf_2.28.2 | md5sum | cut -d' ' -f1`
cd gdk-pixbuf-2.28.2
./configure --prefix=/c/programs/$HEX --build=x86_64-w64-mingw32 --with-included-loaders --with-libjasper --without-gdiplus
make -j2
make install


./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-included-loaders --with-libjasper --without-gdiplus
make -j2
make install



gtk+-2.24.20
http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.20.tar.xz


cd gtk+-2.24.20
rm -f gtk/gtk.def

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --with-gdktarget=win32 --with-included-immodules
make -j2
make install



Compile the extra dependencies.

babl-0.1.10
ftp://ftp.gtk.org/pub/babl/0.1/babl-0.1.10.tar.bz2
patch: babl-0.1.10_mingw.diff

cd babl-0.1.10
patch -p1 <../babl-0.1.10_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


intltool-0.50.2
https://launchpad.net/intltool/trunk/0.50.2/+download/intltool-0.50.2.tar.gz

cd intltool-0.50.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


gegl-0.2.0
ftp://ftp.gtk.org/pub/gegl/0.2/gegl-0.2.0.tar.bz2


cd gegl-0.2.0

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32
make -j2
make install


libexif-0.6.21
http://sourceforge.net/projects/libexif/files/libexif/0.6.21/libexif-0.6.21.tar.bz2/download

cd libexif-0.6.21
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libwmf-0.2.8.4
http://sourceforge.net/projects/wvware/files/libwmf/0.2.8.4/libwmf-0.2.8.4.tar.gz/download

cd libwmf-0.2.8.4
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libmng-1.0.10
http://sourceforge.net/projects/libmng/files/libmng-devel/1.0.10/libmng-1.0.10.tar.bz2/download
patch: libmng-1.0.10_mingw_shared.diff

cd libmng-1.0.10
patch -p1 <../libmng-1.0.10_mingw_shared.diff
make -f makefiles/makefile.mingwdll INSTALL_PREFIX=/c/programs/gimp/ install


openjpeg-1.5.1
http://openjpeg.googlecode.com/files/openjpeg-1.5.1.tar.gz

cd openjpeg-1.5.1
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-png --disable-tiff --disable-static
make -j2
make install


poppler-0.24.2
http://poppler.freedesktop.org/poppler-0.24.2.tar.gz

cd poppler-0.24.2
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-poppler-cpp --disable-utils --disable-static
make -j2
make install


libxml2-2.9.0
http://xmlsoft.org/sources/libxml2-2.9.0.tar.gz
patch: libxml2-2.9.0_mingw-python.diff

cd libxml2-2.9.0
patch -p1 <../libxml2-2.9.0_mingw-python.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libcroco-0.6.8
http://ftp.gnome.org/pub/gnome/sources/libcroco/0.6/libcroco-0.6.8.tar.xz

cd libcroco-0.6.8
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


librsvg-2.36.4
http://ftp.gnome.org/pub/gnome/sources/librsvg/2.36/librsvg-2.36.4.tar.xz

cd librsvg-2.36.4
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-introspection --disable-static
make -j2
make install


lcms-1.19
http://sourceforge.net/projects/lcms/files/lcms/1.19/lcms-1.19.tar.gz/download
patch: lcms-1.19_mingw.diff

cd lcms-1.19
patch -p1 <../lcms-1.19_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


bzip2-1.0.6
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
patch: bzip2-1.0.6_mingw_shared.diff

cd bzip2-1.0.6
patch -p1 <../bzip2-1.0.6_mingw_shared.diff
make -f Makefile-libbz2_so
install -m 755 libbz2-2.dll /c/programs/gimp/bin
install -m 644 libbz2.dll.a /c/programs/gimp/lib
install -m 644 bzlib.h /c/programs/gimp/include




Compile PyGTK.


py2cairo-1.10.0
http://cairographics.org/releases/py2cairo-1.10.0.tar.bz2
patch: py2cairo-1.10.0_mingw.diff

cd py2cairo-1.10.0
patch -p1 <../py2cairo-1.10.0_mingw.diff
rm -f config.lt config.status libtool *.pc
touch ChangeLog
autoreconf -fiv

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install


pygobject-2.28.6
http://ftp.gnome.org/pub/gnome/sources/pygobject/2.28/pygobject-2.28.6.tar.xz
patch: pygobject-2.28.6_mingw.diff

cd pygobject-2.28.6
patch -p1 <../pygobject-2.28.6_mingw.diff
./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



pygtk-2.24.0
http://ftp.gnome.org/pub/gnome/sources/pygtk/2.24/pygtk-2.24.0.tar.bz2
patch: pygtk-2.24.0_mingw.diff

cd pygtk-2.24.0
patch -p1 <../pygtk-2.24.0_mingw.diff

./configure --prefix=/c/programs/gimp --build=x86_64-w64-mingw32 --disable-static
make
make install



Compile GIMP.

gimp-2.8.10
ftp://ftp.gimp.org/pub/gimp/v2.8/gimp-2.8.10.tar.bz2
patch: gimp-2.8.10_mingw-python.diff

cd gimp-2.8.10
patch -p1 <../gimp-2.8.10_mingw-python.diff
./configure --prefix=c:/programs/gimp --build=x86_64-w64-mingw32
make -j3
make install-strip


* move pyconsole.py: 
mv c:/programs/gimp/lib/gimp/2.0/plug-ins/pyconsole.py c:/programs/gimp/lib/gimp/2.0/python


Downloads:

gimp-2.8.10-x86-64.7z




Saturday, September 14, 2013

Compiling GTK+ 2

GTK+, or the GIMP Toolkit, is a multi-platform toolkit for creating graphical user interfaces. Offering a complete set of widgets, GTK+ is suitable for projects ranging from small one-off tools to complete application suites.

Update the environment.

Edit 'c:/msys/etc/profile':
export CPPFLAGS="-I/c/programs/gtk2/include -I/c/programs/python27/include/python2.7"
export LDFLAGS="-L/c/programs/gtk2/lib"
export PATH="$PATH:/c/programs/gtk2/bin:/c/programs/python27/bin"
export PKG_CONFIG_PATH="c:\\programs\\gtk2\\lib\\pkgconfig"
export TERMINFO="/c/programs/python27/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Install Python-2.7.x (refer to our previous Python installation).


Compile the dependencies.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download

cd freetype-2.4.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


expat-2.1.0
http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download

cd expat-2.1.0
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


fontconfig-2.11.0
http://freedesktop.org/software/fontconfig/release/fontconfig-2.11.0.tar.bz2
patch: fontconfig-2.11.0_mingw64.diff

cd fontconfig-2.5.0
patch -p1 <../fontconfig-2.11.0_mingw64.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-docs --disable-static
make -j2
make install


tiff-4.0.2
http://download.osgeo.org/libtiff/tiff-4.0.2.tar.gz

cd tiff-4.0.2
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-cxx --disable-static
cd port && make
cd ../libtiff
make -j2
make install


jasper-1.900.1
http://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.1.zip
patch: jasper-1.900.1_enable_shared.diff

cd jasper-1.900.1
patch -p1 <../jasper-1.900.1_enable_shared.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


jpeg-9
http://www.ijg.org/files/jpegsrc.v9.tar.gz

cd jpeg-9
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.bz2
patch: zlib-1.2.8_disable_static.diff

cd zlib-1.2.8
patch -p1 <../zlib-1.2.8_disable_static.diff
make prefix=/c/programs/gtk2 -f win32/Makefile.gcc install


libpng-1.5.12
http://sourceforge.net/projects/libpng/files/libpng15/1.5.12/libpng-1.5.12.tar.bz2/download

cd libpng-1.5.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gettext-0.18.2
http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.2.tar.gz
patch: gettext-0.18.2_mingw64.diff

cd gettext-0.18.2
patch -p1 <../gettext-0.18.2_mingw64.diff

cd gettext-0.18.2/gettext-runtime
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install

cd ../gettext-tools
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --enable-threads=win32 --disable-static
make -j2
make install


libiconv-1.14
http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz

cd libiconv-1.14
make distclean
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


libffi-3.0.12
ftp://sourceware.org/pub/libffi/libffi-3.0.12.tar.gz
patch: libffi-3.0.12_mingw.diff

cd libffi-3.0.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-builddir --disable-static
make -j2
make install


glib-2.35.9
http://ftp.gnome.org/pub/gnome/sources/glib/2.35/glib-2.35.9.tar.xz
patch: glib-2.35.9_mingw-python.diff

cd glib-2.35.9
patch -p1 <../glib-2.35.9_mingw-python.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-threads=win32
make -j2
make install


pixman-0.30.2
http://cairographics.org/releases/pixman-0.30.2.tar.gz

cd pixman-0.30.2
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


cairo-1.10.2
http://cairographics.org/releases/cairo-1.10.2.tar.gz
patch: cairo-1.10.2_mingw.diff

cd cairo-1.10.2
patch -p1 <../cairo-1.10.2_mingw.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gobject-introspection-1.35.4
http://ftp.gnome.org/pub/gnome/sources/gobject-introspection/1.35/gobject-introspection-1.35.4.tar.xz
patch: gobject-introspection-1.35.4_mingw-python.diff

cd gobject-introspection-1.35.4
patch -p1 <../gobject-introspection-1.35.4_mingw-python.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make
make install


harfbuzz-0.9.12
http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.12.tar.bz2

cd harfbuzz-0.9.12
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


pango-1.32.6
http://ftp.gnome.org/pub/gnome/sources/pango/1.32/pango-1.32.6.tar.xz

cd pango-1.32.6
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-dynamic-modules=basic-win32 --disable-static
make -j2
make install


atk-2.8.0
http://ftp.gnome.org/pub/gnome/sources/atk/2.7/atk-2.8.0.tar.xz
patch: atk-2.8.0_mingw.diff

cd atk-2.8.0
patch -p1 <../atk-2.8.0_mingw.diff
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --disable-static
make -j2
make install


gdk-pixbuf-2.28.2
http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/2.28/gdk-pixbuf-2.28.2.tar.xz

export HEX=`echo gdk-pixbuf_2.28.2 | md5sum | cut -d' ' -f1`
cd gdk-pixbuf-2.28.2

./configure --prefix=/c/programs/$HEX --build=x86_64-w64-mingw32 --with-libjasper --without-gdiplus
make -j2
make install

./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-libjasper --without-gdiplus
make -j2
make install


Compile GTK+

gtk+-2.24.20
http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-2.24.20.tar.xz


cd gtk+-2.24.20

rm -f gtk/gtk.def
./configure --prefix=/c/programs/gtk2 --build=x86_64-w64-mingw32 --with-gdktarget=win32 --with-included-immodules
make -j2
make install


If all went well, you should be able to test your compilation by executing 'gtk-demo.exe'


Friday, April 19, 2013

Compiling Matplotlib

Compile Qt4 and PyQt4.

We will only be using MinGW and Windows cmd.exe to compile Qt4 and PyQt4. No need to install Qt4.

qt-everywhere-opensource-src-4.8.4
http://download.qt-project.org/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.zip
patch: qt-4.8.4_mingw_static.diff

Update the environment;
set QTDIR=C:\Programs\Dev\qt-4.8.4
set QMAKESPEC=%QTDIR%\mkspecs\win32-g++
set PATH=%PATH%;C:\MinGW64\bin;%QTDIR%\bin
Patch the source;
cd %QTDIR%
patch -p1 <../qt-4.8.4_mingw_static.diff
Run configure;
configure.exe -confirm-license -release -static -opensource -qt-style-windowsxp -qt-style-windowsvista -opengl desktop -audio-backend -webkit -no-exceptions -no-s60 -no-phonon -no-qt3support -nomake tests -nomake examples -nomake demos -nomake translations -nomake docs
Compile;
mingw32-make

sip-4.15.2
http://sourceforge.net/projects/pyqt/files/sip/sip-4.15.2/sip-4.15.2.tar.gz/download
patch: sip-4.15.2_mingw-python.diff

Set the environment;
set QTDIR=C:\Programs\Dev\qt-4.8.4
set PATH=C:\MinGW64\bin;C:\Programs\Python27\bin;%QTDIR%\bin
Patch the source;
cd C:\Programs\Dev\sip-4.15.2
patch -p1 <../sip-4.15.2_mingw-python.diff
Run configure;
cd C:\Programs\Dev\sip-4.15.2
python configure.py -p win32-g++
Compile & install;
mingw32-make
mingw32-make install

PyQt-win-gpl-4.10.3
http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.10/PyQt-win-gpl-4.10.3.zip/download
patch: PyQt-win-gpl-4.10.3_mingw-python.diff

Set the environment;
set QTDIR=C:\Programs\Qt4
set PATH=%PATH%;C:\MinGW64\bin;C:\Programs\Python27\bin;%QTDIR%\bin
Patch the source;
cd C:\Programs\Dev\PyQt-win-gpl-4.10.3
patch -p1 <../PyQt-win-gpl-4.10.3_mingw-python.diff
 Run configure;
python configure.py --confirm-license -t qsvgicon -t qico -t qsvg -t qtga -g -w
Compile & install;
mingw32-make -j3
mingw32-make install
Test the compilation;
python
from PyQt4.Qt import *
from sip import *
print SIP_VERSION_STR, QT_VERSION_STR, PYQT_VERSION_STR

It should return something like;
4.15.2 4.8.4 4.10.3
Compile extra dependencies.

From this point forward, we will be using MSYS.

freetype-2.4.12
http://sourceforge.net/projects/freetype/files/freetype2/2.4.12/freetype-2.4.12.tar.bz2/download
cd freetype-2.4.12
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install

libpng-1.5.17
http://sourceforge.net/projects/libpng/files/libpng15/1.5.17/libpng-1.5.17.tar.bz2/download
cd libpng-1.5.17
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make -j2
make install

Compile python modules dependencies.

setuptools-1.3
https://pypi.python.org/packages/source/s/setuptools/setuptools-1.3.tar.gz
cd setuptools-1.3
python setup.py build install
pip-1.4.1
https://pypi.python.org/packages/source/p/pip/pip-1.4.1.tar.gz
cd pip-1.4.1
python setup.py build install
six-1.4.1
https://pypi.python.org/packages/source/s/six/six-1.4.1.tar.gz
cd six-1.4.1
python setup.py build install
python-dateutil-2.1
https://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-2.1.tar.gz
cd python-dateutil-2.1
python setup.py build install
pyparsing-2.0.1
https://pypi.python.org/packages/source/p/pyparsing/pyparsing-2.0.1.tar.gz
cd pyparsing-2.0.1
python setup.py build install
pytz-2013.7
https://pypi.python.org/packages/source/p/pytz/pytz-2013.7.tar.gz
cd pytz-2013.7
python setup.py build install
unittest2-0.5.1
https://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.tar.gz
cd unittest2-0.5.1
python setup.py build install
futures-2.1.4
https://pypi.python.org/packages/source/f/futures/futures-2.1.4.tar.gz
cd futures-2.1.4
python setup.py build install
pycares-0.5.0
https://pypi.python.org/packages/source/p/pycares/pycares-0.5.0.tar.gz
patch: add '#undef socklen_t' in 'src/pycares.h'
cd pycares-0.5.0
python setup.py build install
tornado-3.1.1
https://pypi.python.org/packages/source/t/tornado/tornado-3.1.1.tar.gz
cd tornado-3.1.1
python setup.py build install
numpy-1.8.0
scipy-0.13.0


** For NumPy and SciPy, refer to previous article. **


Compile Matplotlib.

matplotlib-1.3.1
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.3.1/matplotlib-1.3.1.tar.gz/download
patch: matplotlib-1.3.1_mingw-python.diff
cd matplotlib-1.3.1
patch -p1 <../matplotlib-1.3.1_mingw-python.diff
cp setup.cfg.template setup.cfg
Edit setup.cfg;
change from '#basedirlist = /usr' to 'basedirlist = c:/programs/dev/python64'

Add extra CFLAGS to environment;
export CFLAGS="$CFLAGS -Ic:/programs/dev/python64/include/freetype2"
Compile & install;
python setup.py config build install
Test the compilation;
cd $HOME
python qt_mpl_bars.py


Tuesday, April 2, 2013

Compiling NumPy & SciPy

 ** Updated 11 August 2016 **

Continued from here.


* compiled using:
gcc-4.9.2 (dongsheng build) :
gcc-4.9-win32_4.9.2-20141029.7z
gcc-4.9-win64_4.9.2-20141029.7z

gcc-5.3.1 (dongsheng build) :
gcc-5.3-win32_5.3.1-20160601.7z
gcc-5.3-win64_5.3.1-20160601.7z

ATLAS-3.10.3
http://sourceforge.net/projects/math-atlas/files/Stable/3.10.3/atlas3.10.3.tar.bz2/download
http://www.netlib.org/lapack/lapack-3.6.1.tgz
patch: ATLAS-3.10.3_mingw.diff

** patch is based on vtjnash work.


Patch the source;
cd ATLAS
patch -p1 <../ATLAS-3.10.3_mingw.diff
Configure;

[ for i686]
cd ATLAS
mkdir -p _build32 && cd _build32
../configure --with-netlib-lapack-tarfile=../lapack-3.6.1.tgz -v 1 -A 30 -O 8 -V 960 -s 1 -b 32

make

[for x86_64]
cd ATLAS
mkdir -p _build64 && cd _build64
../configure --with-netlib-lapack-tarfile=../lapack-3.6.1.tgz -v 1 -A 30 -O 9 -V 960 -s 2 -b 64
make

Install;

[ for i686]
mkdir -p /dev/atlas-w32/{include/atlas,lib}
install -c -m 644 ../include/{cblas,clapack}.h /dev/atlas-w32/include
install -c -m 644 include/*.h /dev/atlas-w32/include/atlas
install -c -m 644 lib/lib*.a /dev/atlas-w32/lib

[for x86_64]
mkdir -p /dev/atlas-w64/{include/atlas,lib}
install -c -m 644 ../include/{cblas,clapack}.h /dev/atlas-w64/include
install -c -m 644 include/*.h /dev/atlas-w64/include/atlas
install -c -m 644 lib/lib*.a /dev/atlas-w64/lib


Run the testsuite;
make check
DONE BUILDING TESTERS, RUNNING:
SCOPING FOR FAILURES IN BIN TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
        bin/sanity.out
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
8 cases: 8 passed, 0 skipped, 0 failed
4 cases: 4 passed, 0 skipped, 0 failed
DONE
SCOPING FOR FAILURES IN CBLAS TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
        interfaces/blas/C/testing/sanity.out | \
                fgrep -v PASSED
make[1]: [sanity_test] Error 1 (ignored)
DONE
SCOPING FOR FAILURES IN F77BLAS TESTS:
fgrep -e fault -e FAULT -e error -e ERROR -e fail -e FAIL \
        interfaces/blas/F77/testing/sanity.out | \
                fgrep -v PASSED
make[1]: [sanity_test] Error 1 (ignored)
DONE

swig

swig : copy swig.exe from pywin32 to /dev/atlas-w{32,64}/bin

setuptools-5.8

cd setuptools-5.8
python setup.py build
python setup.py install

nose-1.3.7
cd nose-1.3.7
python setup.py config build
python setup.py install


* compiled using:
gcc-4.9.3 (mingw-builds) :
i686-4.9.3-release-win32-sjlj-rt_v4-rev1.7z
x86_64-4.9.3-release-win32-seh-rt_v4-rev1.7z
gcc-5.3.0 (mingw-builds) :
i686-5.3.0-release-win32-sjlj-rt_v4-rev0.7z
x86_64-5.3.0-release-win32-seh-rt_v4-rev0.7z

numpy-1.11.1
https://sourceforge.net/projects/numpy/files/NumPy/1.11.1/numpy-1.11.1.tar.gz/download
patch: numpy-1.11.1_mingw-python.diff

Patch the source;
cd numpy-1.11.1
patch -p1 <../numpy-1.11.1_mingw-python.diff
Add site.cfg;

cat > site.cfg << "EOF"
[DEFAULT]
library_dirs = c:\programs\dev\atlas-w64\lib
include_dirs = c:\programs\dev\atlas-w64\include
EOF
Build & install;
python setup.py config build --fcompiler=gnu95 install
Test the installed numpy;
cd $HOME
python -c "import numpy; numpy.test(verbose=3)"
======================================================================
FAIL: test_collections_hashable (test_multiarray.TestHashing)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python35\lib\python3.5\site-packages\numpy-1.11.1-py3.5-win-x86_64.egg\numpy\core\tests\test_multiarray.py",
line 6265, in test_collections_hashable
    self.assertFalse(isinstance(x, collections.Hashable))
AssertionError: True is not false

----------------------------------------------------------------------
Ran 6044 tests in 141.898s

FAILED (KNOWNFAIL=8, SKIP=10, failures=1)


scipy-0.18.0
http://sourceforge.net/projects/scipy/files/scipy/0.18.0/scipy-0.18.0.tar.gz/download
patch: scipy-0.18.0_mingw-python.diff

Patch the source;
cd scipy-0.18.0
patch -p1 <../scipy-0.18.0_mingw-python.diff
Add site.cfg;
cat > site.cfg << "EOF"
[DEFAULT]
library_dirs = c:\programs\dev\atlas-w64\lib
include_dirs = c:\programs\dev\atlas-w64\include
EOF
Build & install;
python setup.py config build --fcompiler=gnu95 install
Test the installed scipy;
cd $HOME
python -c "import scipy; scipy.test(verbose=3)"
======================================================================
ERROR: test_base.TestLIL.test_fancy_assignment_dtypes(dtype('float64'),)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python35\lib\python3.5\site-packages\nose-1.3.7-py3.5.egg\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\tests\test_base.py", line 2739, in
check
    A[[0,1],[0,1]] = dtype.type(1)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\lil.py", line 377, in __setitem__
    i, j, x)
  File "scipy/sparse/_csparsetools.pyx", line 231, in scipy.sparse._csparsetools.lil_fancy_set (scipy\sparse\_csparsetools.c:4671)
  File "scipy/sparse/_csparsetools.pyx", line 368, in scipy.sparse._csparsetools._lil_fancy_set_int32_float64
(scipy\sparse\_csparsetools.c:6608)
ValueError: Buffer dtype mismatch, expected 'npy_float64' but got 'long double'

======================================================================
ERROR: test_base.TestLIL.test_fancy_assignment_dtypes(dtype('complex128'),)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python35\lib\python3.5\site-packages\nose-1.3.7-py3.5.egg\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\tests\test_base.py", line 2739, in
check
    A[[0,1],[0,1]] = dtype.type(1)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\lil.py", line 377, in __setitem__
    i, j, x)
  File "scipy/sparse/_csparsetools.pyx", line 231, in scipy.sparse._csparsetools.lil_fancy_set (scipy\sparse\_csparsetools.c:4671)
  File "scipy/sparse/_csparsetools.pyx", line 432, in scipy.sparse._csparsetools._lil_fancy_set_int32_clongdouble
(scipy\sparse\_csparsetools.c:7510)
ValueError: Buffer dtype mismatch, expected 'long double complex' but got 'complex double'

======================================================================
ERROR: test_base.TestLIL.test_fancy_assignment_dtypes(dtype('complex128'),)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "c:\programs\python35\lib\python3.5\site-packages\nose-1.3.7-py3.5.egg\nose\case.py", line 198, in runTest
    self.test(*self.arg)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\tests\test_base.py", line 2739, in
check
    A[[0,1],[0,1]] = dtype.type(1)
  File "c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy\sparse\lil.py", line 377, in __setitem__
    i, j, x)
  File "scipy/sparse/_csparsetools.pyx", line 231, in scipy.sparse._csparsetools.lil_fancy_set (scipy\sparse\_csparsetools.c:4671)
  File "scipy/sparse/_csparsetools.pyx", line 432, in scipy.sparse._csparsetools._lil_fancy_set_int32_clongdouble
(scipy\sparse\_csparsetools.c:7510)
ValueError: Item size of buffer (16 bytes) does not match size of 'long double complex' (32 bytes)

----------------------------------------------------------------------
Ran 23047 tests in 630.914s

FAILED (KNOWNFAIL=61, SKIP=1817, errors=3)
Running unit tests for scipy
NumPy version 1.11.1
NumPy relaxed strides checking option: False
NumPy is installed in c:\programs\python35\lib\python3.5\site-packages\numpy-1.11.1-py3.5-win-x86_64.egg\numpy
SciPy version 0.18.0
SciPy is installed in c:\programs\python35\lib\python3.5\site-packages\scipy-0.18.0-py3.5-win-x86_64.egg\scipy
Python version 3.5.2 (default, Jul 28 2016, 21:19:51) [GCC 5.3.0 (64-bit)]
nose version 1.3.7
0-th dimension must be fixed to 3 but got 15
0-th dimension must be fixed to 3 but got 5
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2
0-th dimension must be fixed to 4 but got 2


Downloads:

i686 packages

x86_64 packages



Saturday, March 16, 2013

Compiling Python In Native MinGW

The official Python package lacks some modules and were built using MSVC. It's nice if we could have build Python in native MinGW environment and build all external modules in native MinGW without mixing them both (MSVC built Python with GCC built extensions). We need to patch the source in order to compile Python with MinGW because it's not officially supported (yet.. or will never be?). I'm using patches from mingwandroid & alexpux and make some minor adjustment to compile successfully with MinGW-w64 toolchains.

For this build, we need a new MinGW-w64 toolchains (previously we are using toolchains by NevCairiel) because nevcairiel's build lacks gfortran because it is needed afterwards to compile NumPy and SciPy for example. So, lets start with the basic part..




Preparing the toolchains.

The MSYS routine is the same as before.

Download ray_linn's toolchain here: mingw-w64-gcc-4.7.2-runtime-2.0.7-static-ada-gc-20121112.7z and extract it to 'c:\'

Optional: Remove the pthreads dll, lib and headers.


Updating the environment.

Add in 'c:/msys/etc/fstab':
c:/mingw64 /mingw


Add in 'c:/msys/etc/profile':
export CPPFLAGS="-Ic:/programs/dev/python64/include"
export LDFLAGS="-Lc:/programs/dev/python64/lib"
export PATH="$PATH:/c/programs/python27/bin:/c/programs/python64/bin"
export TERMINFO="c:/programs/python27/share/terminfo"
export lt_cv_deplibs_check_method="pass_all"


Compile extra libs for modules.

expat-2.1.0

http://sourceforge.net/projects/expat/files/expat/2.1.0/expat-2.1.0.tar.gz/download
cd expat-2.1.0
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make
make install

zlib-1.2.8
http://zlib.net/zlib-1.2.8.tar.bz2
patch: zlib-1.2.8_disable_shared.diff
cd zlib-1.2.8
patch -p1 <../zlib-1.2.8_disable_shared.diff

make prefix=c:/programs/dev/python64 libz.a -f win32/Makefile.gcc install

bzip2-1.0.6
http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz
patch: bzip2-1.0.6_static_mingw.diff
cd bzip2-1.0.6
patch -p1 <../bzip2-1.0.6_static
_mingw.diff
make
install -m 644 bzlib.h c:/programs/dev/python64/include
install -m 644 libbz2.a c:/programs/dev/python64/lib

sqlite-3.7.15.2 
http://sqlite.org/sqlite-autoconf-3071502.tar.gz
export CFLAGS="-g -O2 -DSQLITE_ENABLE_FTS3=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 \
-DSQLITE_ENABLE_UNLOCK_NOTIFY=1 -DSQLITE_SECURE_DELETE=1"
cd sqlite-autoconf-3071502
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make
make install

ncurses-5.9
http://invisible-island.net/datafiles/release/ncurses.tar.gz
cd ncurses-5.9-20131102
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --with-progs --without-tests \
--without-cxx-binding --without-ada --without-debug --without-manpages --enable-overwrite --enable-widec \
--enable-term-driver --enable-assertions --enable-database --enable-sp-funcs --enable-hard-tabs \
--enable-ext-colors --enable-ext-mouse --enable-interop --disable-assumed-color --disable-termcap
make
make install

readline-5.0
http://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz
patch: readline-5.0_ncursesw_mingw.diff
cd readline-5.0
patch -p1 <../readline-5.0_ncursesw
_mingw.diff
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --with-curses --disable-shared
make
make install

openssl-1.0.1h
http://www.openssl.org/source/openssl-1.0.1h.tar.gz
patch: openssl-1.0.1h_static_mingw.diff
cd openssl-1.0.1h
patch -p1<../openssl-1.0.1h_static_mingw.diff
./configure --prefix=c:/programs/dev/python64 mingw64 no-zlib no-asm no-dso no-shared
make
make install

gdbm-1.10
http://ftp.gnu.org/pub/gnu/gdbm/gdbm-1.10.tar.gz
patch: gdbm-1.10_mingw.diff
cd gdbm-1.10
patch -p1 <../gdbm-1.10_mingw.diff
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-nls --disable-shared
make
make install

libffi-3.0.12
ftp://sourceware.org/pub/libffi/libffi-3.0.12.tar.gz
patch: libffi-3.0.12_mingw.diff
cd libffi-3.0.12
patch -p1 <../libffi-3.0.12_mingw.diff
./configure --prefix=c:/programs/dev/python64 --build=x86_64-w64-mingw32 --disable-shared
make
make install


tcl-8.6.1
http://sourceforge.net/projects/tcl/files/Tcl/8.6.1/tcl-core8.6.1-src.tar.gz/download
patch: tcl8.6.1_system_zlib_mingw.diff

cd tcl8.6.1/win
patch -p1 <../../tcl8.6.1_system_zlib_mingw.diff
./configure --prefix=c:/programs/python27 --build=x86_64-w64-mingw32 --enable-64bit
make
make install

tk-8.6.1
http://sourceforge.net/projects/tcl/files/Tcl/8.6.1/tk8.6.1-src.tar.gz/download
patch: tk8.6.1_mingw.diff
cd tk8.6.1/win
patch -p1 <../../tk8.6.1_mingw.diff
./configure --prefix=c:/programs/python27 --build=x86_64-w64-mingw32 --enable-64bit
make

make install

Compile Python.

Python-2.7.8

http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz
patch: Python-2.7.8-1_mingw.diff
cd Python-2.7.8
patch -p1 <../Python-2.7.8-1_mingw.diff
mkdir _build64 && cd _build64
../configure --prefix=c:/programs/python27 --build=x86_64-w64-mingw32 --with-system-expat --with-system-ffi
make
Some modules were not built;
Python build finished, but the necessary bits to build these modules were not found:

_bsddb             bsddb185           dl
linuxaudiodev      nis                ossaudiodev
resource           sunaudiodev        termios


To test the compilation;
make test
Then install it;
make install

Downloads:

Python-2.7.8-1-mingw-x86_64.7z
Python-2.7.8-1-mingw-i686.7z

Python-3.4.1-1-mingw-x86_64.7z
Python-3.4.1-1-mingw-i686.7z

+ Now using '\\' as primary path separator instead of '/', and resulting
  in more test suites passed the test.
+ Fixed some failing test.
+ Cosmetic cleanups.


Old Versions:

Python-2.7.6-1-mingw-x86_64.7z

+ Added architecture bitness in 'COMPILER' string.
+ Added posix installation path for bdist_wininst & bdist_msi module.
+ Fixed some regrtest routines.
+ Removed some old unused codes for mingw port.

Python-2.7.3-2-mingw-x86_64.7z

+ Added 'pythonw.exe' to the build.
+ Now using shared Tcl/Tk.
+ Fixed some test routines.
+ Some minor fix.


Python-2.7.3-1-mingw-x86_64.7z 

+ Initial release.


Python running under mintty, with simple curses example: