Pillow/winbuild/build.rst

94 lines
2.7 KiB
ReStructuredText
Raw Normal View History

2014-03-22 03:52:05 +04:00
Building Pillow on Windows
==========================
2018-02-09 12:56:10 +03:00
.. note:: For most people, the `installation instructions
<../docs/installation.rst#windows-installation>`_ should
be sufficient.
2014-03-22 03:52:05 +04:00
This page will describe a build setup to build Pillow against the
2015-10-11 13:27:18 +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
2015-12-02 07:40:16 +03:00
-------------
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
2016-11-07 15:35:23 +03:00
routines are using 3 features, and installing 3.4 gives us pip and
2014-04-05 04:05:42 +04:00
virtualenv as well, reducing the number of packages that we need to
2015-10-11 13:24:35 +03:00
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
2015-10-11 13:24:35 +03:00
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
2015-12-07 23:03:36 +03:00
4 <https://www.microsoft.com/en-us/download/details.aspx?id=8279>`_
2014-03-22 03:52:05 +04:00
2018-06-09 03:27:03 +03:00
* `CMake-2.8.10.2-win32-x86.exe
<https://cmake.org/files/v2.8/cmake-2.8.10.2-win32-x86.exe>`_
2014-03-22 03:52:05 +04:00
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
2015-10-11 13:24:35 +03:00
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
2015-10-11 13:24:35 +03:00
the compilers.
2014-03-22 03:52:05 +04:00
2015-10-11 13:24:35 +03:00
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
build. `build.py --wheel` will build wheels instead of
2015-10-11 13:24:35 +03:00
installing into virtualenvs.
2015-12-07 23:03:36 +03:00
2014-04-05 04:05:42 +04:00
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