=============================================== PIL(Pillow) build on Windows (32bit & 64bit) =============================================== If you want to build PIL on Windows, you need to prepare few external libraries. Although some libraries did not provide static library for windows 32/64 bits then you need to build these libraries by your hand too. Also, PIL will load by python at last then you are recommended to use same compiler with python to build libraries. Target PIL and versions ================================= :Pillow: 1.7.8 for Python 2.7: `src `_ Required compilers ==================== :Python-2.7: VisualC++ 2008 Express SP1 + Windows SDK 7.0 Required libraries and versions ==================================== :freetype2: 2.4.11 `src `_ :jpeg6b: 6b 27-Mar-1998 `src `_ :LittleCMS: 1.19 `src `_ :tcl: 8.5.13 `src `_ :tk: 8.5.13 `src `_ :zlib: 1.2.7 `src `_ Required patches ==================================== :for jpeg: `src `_ :for freetype, lcms, zlib and Pillow: `src `_ Build process for Python-2.7 ============================ win32-only ----------------- 1. make sure ``C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin`` is in your PATH. win64-only ----------------- 1. make sure ``C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64`` is in your PATH. 2. Copy this file: ``C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars64.bat`` to this follow folder and rename the file (vcvars64.bat to vcvarsamd64.bat): ``C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\amd64\vcvarsamd64.bat`` build freetype ------------------ 1. extract ``freetype-2.4.11.tar.bz2`` into ``C:\opt\freetype-2.4.11`` 2. apply the ``ft2411_windows.patch`` patch 3. ``cd builds\win32\vc2008`` 4. (Win32): ``vcvars32.bat`` (Win64): ``vcvarsamd64.bat`` 5. (Win32): ``VCExpress.exe freetype.sln /rebuild "LIB Release|Win32"`` (Win64): ``vcbuild.exe freetype.sln /rebuild "LIB Release|x64"`` 6. done! You got ``objs\win32\vc2008\freetype2411.lib``. 7. rename ``freetype2411.lib`` to ``freetype.lib`` build jpeg6b ------------------- 1. extract ``jpegsr6b.zip`` into ``C:\opt\jpeg-6b`` 2. rename ``jconfig.vc`` to ``jconfig.h`` 3. extract the ``jpeg-6b.sln`` and ``jpeg-6b.vcproj`` from the jpeg6bvcconf-patch to ``C:\opt\jpeg-6b`` 4. (Win32): ``vcvars32.bat`` (Win64): ``vcvarsamd64.bat`` 5. (Win32): ``VCExpress.exe jpeg-6b.sln /rebuild "Release|Win32"`` (Win64): ``vcbuild.exe jpeg-6b.sln /rebuild "Release|x64"`` 6. done! You got ``Release\jpeg-6b.lib``. 7. rename ``jpeg-6b.lib`` to ``libjpeg.lib`` build LittleCMS ------------------- 1. extract ``lcms-1.19.zip`` into ``C:\opt\lcms-1.19`` 2. apply the ``lcms119_windows.patch`` patch 3. ``cd Projects\VC2008`` 4. (Win32): ``vcvars32.bat`` (Win64): ``vcvarsamd64.bat`` 5. (Win32): ``VCExpress.exe lcms.sln /rebuild "Release|Win32"`` (Win64): ``vcbuild.exe lcms.sln /rebuild "Release|x64"`` 6. done! You got ``Lib\MS\lcms.lib``. .. note:: You need to choose 1.x series of Little CMS for PIL. build tcl/tk ---------------- 1. extract ``tcl8.5.13-src.zip`` and ``tk8.5.13-src.zip`` 2. (Win32): ``vcvars32.bat`` (Win64): ``vcvarsamd64.bat`` 3. ``cd C:\opt\tcl8.5.13\win`` 4. ``nmake -f makefile.vc INSTALLDIR=C:\opt\tcl release`` 5. ``nmake -f makefile.vc INSTALLDIR=C:\opt\tcl install`` 6. ``cd C:\lib\tk8.5.13\win`` 7. ``nmake -f makefile.vc TCLDIR=..\\..\\tcl8.5.13 INSTALLDIR=C:\opt\tcl release`` 8. ``nmake -f makefile.vc TCLDIR=..\\..\\tcl8.5.13 INSTALLDIR=C:\opt\tcl install`` 9. done! you got ``C:\opt\tcl\lib\tcl85.lib`` and ``C:\opt\tcl\lib\tk85.lib`` build zlib -------------- 1. extract ``zlib127.zip`` into ``C:\opt\zlib-1.2.7`` 2. apply the ``zlib127_windows.patch`` patch 3. ``cd contrib\vstudio\vc9`` 4. (Win32): ``vcvars32.bat`` (Win64): ``vcvarsamd64.bat`` 5. (Win32): ``VCExpress.exe zlibstat.vcproj /rebuild "ReleaseWithoutAsm|Win32"`` (Win64): ``vcbuild.exe zlibstat.vcproj /rebuild "ReleaseWithoutAsm|x64"`` 6. done! You got ``contrib\vstudio\vc9\(x86|x64)\ZlibStatReleaseWithoutAsm\zlibstat.lib``. 7. rename ``zlibstat.lib`` to ``zlib.lib`` build PIL ------------- 1. extract PIL source into ``C:\opt\pillow`` 2. apply the ``pillow178_win(32|64).patch`` patch 3. build (with inplace option for selftest):: ``python-2.7 -S setup.py build_ext -i build`` 4. self test:: ``python-2.7 -S selftest`` 5. make windows installer:: ``python-2.7 -S setup.py bdist_wininst``