Pillow/docs/build.rst

95 lines
2.8 KiB
ReStructuredText
Raw Normal View History

2014-03-22 03:52:05 +04:00
Building Pillow on Windows
==========================
.. note:: For most people, the :doc:`installation instructions
<installation>` should be sufficient
This page will describe a build setup to build Pillow against the
2015-06-16 23:45:45 +03:00
supported python versions in 32 and 64-bit modes, using freely
2015-06-17 02:02:32 +03:00
available Microsoft compilers. This has been developed and tested
2015-06-16 23:29:30 +03:00
against 64-bit Windows 7 Professional and Windows Server 2012
64-bit version on Amazon EC2.
2014-03-22 03:52:05 +04:00
2015-06-17 02:02:32 +03:00
Prerequisites
2014-03-22 03:52:05 +04:00
------------
Extra Build Helpers
^^^^^^^^^^^^^^^^^^^
* Powershell (available by default on Windows Server)
2015-06-16 23:29:30 +03:00
* GitHub client (provides git+bash shell)
2014-03-22 03:52:05 +04:00
2014-04-05 04:05:42 +04:00
Optional:
2015-06-16 23:29:30 +03:00
* GPG (for checking signatures) (UNDONE -- Python signature checking)
2014-04-05 04:05:42 +04:00
2014-03-22 03:52:05 +04:00
Pythons
^^^^^^^
2015-06-16 23:29:30 +03:00
The build routines expect Python to be installed at C:\PythonXX for
32-bit versions or C:\PythonXXx64 for the 64-bit versions.
2014-03-22 03:52:05 +04:00
2015-06-16 23:29:30 +03:00
Download Python 3.4, install it, and add it to the path. This is the
2014-04-05 04:05:42 +04:00
Python that we will use to bootstrap the build process. (The download
routines are using 3.2+ features, and installing 3.4 gives us pip and
virtualenv as well, reducing the number of packages that we need to
install.)
2014-03-22 03:52:05 +04:00
2015-06-16 23:29:30 +03:00
Download the rest of the Pythons by opening a command window, changing
2014-04-05 04:05:42 +04:00
to the `winbuild` directory, and running `python
get_pythons.py`.
2014-03-22 03:52:05 +04:00
2014-04-05 04:05:42 +04:00
UNDONE -- gpg verify the signatures (note that we can download from
https)
2014-03-22 03:52:05 +04:00
2014-04-05 04:05:42 +04:00
Run each installer and set the proper path to the installation. Don't
2015-06-16 23:29:30 +03:00
set any of them as the default Python, or add them to the path.
2014-03-22 03:52:05 +04:00
2014-03-25 20:00:41 +04:00
2014-03-22 03:52:05 +04:00
Compilers
^^^^^^^^^
Download and install:
* `Microsoft Windows SDK for Windows 7 and .NET Framework 3.5
SP1 <http://www.microsoft.com/en-us/download/details.aspx?id=3138>`_
* `Microsoft Windows SDK for Windows 7 and .NET Framework
4 <http://www.microsoft.com/en-us/download/details.aspx?id=8279>`_
* `CMake-2.8.10.2-win32-x86.exe <http://www.cmake.org/cmake/resources/software.html>`_
The samples and the .NET SDK portions aren't required, just the
compilers and other tools. UNDONE -- check exact wording.
Dependencies
------------
2014-04-05 04:05:42 +04:00
The script 'build_dep.py' downloads and builds the dependencies. Open
a command window, change directory into `winbuild` and run `python
build_dep.py`.
2014-03-22 03:52:05 +04:00
This will download libjpeg, libtiff, libz, and freetype. It will then
2015-06-16 23:29:30 +03:00
compile 32 and 64-bit versions of the libraries, with both versions of
2014-03-22 03:52:05 +04:00
the compilers.
UNDONE -- lcms fails.
2014-04-05 04:05:42 +04:00
UNDONE -- webp, jpeg2k not recognized
2014-03-22 03:52:05 +04:00
2014-04-05 04:05:42 +04:00
Building Pillow
---------------
Once the dependencies are built, run `python build.py --clean` to
build and install Pillow in virtualenvs for each python
2015-06-16 23:29:30 +03:00
build. `build.py --dist` will build Windows installers instead of
2014-04-05 04:05:42 +04:00
installing into virtualenvs.
UNDONE -- suppressed output, what about failures.
Testing Pillow
2014-03-22 03:52:05 +04:00
--------------
2014-04-05 04:05:42 +04:00
Build and install Pillow, then run `python test.py` from the
`winbuild` directory.
2014-03-22 03:52:05 +04:00