~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to docs/INSTALL.txt

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (1.1.4)
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130131204920-7tnuhqhlsqdza4c2
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
--------------------------------------------------------------------
 
3
Build instructions (all platforms)
 
4
--------------------------------------------------------------------
 
5
 
 
6
For a list of changes in this release, see the CHANGES document.
 
7
 
 
8
0. If you're in a hurry, try this::
 
9
 
 
10
        $ tar xvfz Imaging-1.1.7.tar.gz
 
11
        $ cd Imaging-1.1.7
 
12
        $ python setup.py install
 
13
 
 
14
   If you prefer to know what you're doing, read on.
 
15
 
 
16
 
 
17
1. Prerequisites.
 
18
 
 
19
   If you need any of the features described below, make sure you
 
20
   have the necessary libraries before building PIL.
 
21
 
 
22
   +----------------------+---------------------------------------------+
 
23
   |  feature             |library                                      |
 
24
   +----------------------+---------------------------------------------+
 
25
   |  JPEG support        |libjpeg (6a or 6b)                           |
 
26
   |                      |                                             |           
 
27
   |                      |http://www.ijg.org                           |
 
28
   |                      |http://www.ijg.org/files/jpegsrc.v6b.tar.gz  |
 
29
   |                      |ftp://ftp.uu.net/graphics/jpeg/              |
 
30
   +----------------------+---------------------------------------------+
 
31
   |                      |                                             |           
 
32
   |  PNG support         |zlib (1.2.3 or later is recommended)         |
 
33
   |                      |                                             |           
 
34
   |                      |http://www.gzip.org/zlib/                    |
 
35
   +----------------------+---------------------------------------------+
 
36
   |                      |                                             |           
 
37
   |  OpenType/TrueType   |freetype2 (2.3.9 or later is recommended)    |
 
38
   |  support             |                                             |
 
39
   |                      |http://www.freetype.org                      |
 
40
   |                      |http://freetype.sourceforge.net              |
 
41
   +----------------------+---------------------------------------------+
 
42
   |                      |                                             |           
 
43
   |  CMS support         |littleCMS (1.1.5 or later is recommended)    |
 
44
   |                      |http://www.littlecms.com/                    |
 
45
   +----------------------+---------------------------------------------+
 
46
 
 
47
   If you have a recent Linux version, the libraries provided with the
 
48
   operating system usually work just fine.  If some library is
 
49
   missing, installing a prebuilt version (jpeg-devel, zlib-devel,
 
50
   etc) is usually easier than building from source.  For example, for
 
51
   Ubuntu 9.10 (karmic), you can install the following libraries::
 
52
 
 
53
       sudo apt-get install libjpeg62-dev
 
54
       sudo apt-get install zlib1g-dev
 
55
       sudo apt-get install libfreetype6-dev
 
56
       sudo apt-get install liblcms1-dev
 
57
 
 
58
   If you're using Mac OS X, you can use the 'fink' tool to install
 
59
   missing libraries (also see the Mac OS X section below).
 
60
 
 
61
   Similar tools are available for many other platforms.
 
62
 
 
63
 
 
64
2. To build under Python 1.5.2, you need to install the stand-alone
 
65
   version of the distutils library:
 
66
 
 
67
       http://www.python.org/sigs/distutils-sig/download.html
 
68
 
 
69
   You can fetch distutils 1.0.2 from the Python source repository:
 
70
   
 
71
       svn export http://svn.python.org/projects/python/tags/Distutils-1_0_2/Lib/distutils/
 
72
 
 
73
   For newer releases, the distutils library is included in the
 
74
   Python standard library.
 
75
 
 
76
   NOTE: Version 1.1.7 is not fully compatible with 1.5.2.  Some
 
77
   more recent additions to the library may not work, but the core
 
78
   functionality is available.
 
79
   
 
80
 
 
81
3. If you didn't build Python from sources, make sure you have
 
82
   Python's build support files on your machine.  If you've down-
 
83
   loaded a prebuilt package (e.g. a Linux RPM), you probably
 
84
   need additional developer packages.  Look for packages named
 
85
   "python-dev", "python-devel", or similar.  For example, for
 
86
   Ubuntu 9.10 (karmic), use the following command:
 
87
 
 
88
       sudo apt-get install python-dev
 
89
 
 
90
 
 
91
4. When you have everything you need, unpack the PIL distribution
 
92
   (the file Imaging-1.1.7.tar.gz) in a suitable work directory::
 
93
 
 
94
        $ cd MyExtensions # example
 
95
        $ gunzip Imaging-1.1.7.tar.gz
 
96
        $ tar xvf Imaging-1.1.7.tar
 
97
 
 
98
 
 
99
5. Build the library.  We recommend that you do an in-place build,
 
100
   and run the self test before installing::
 
101
 
 
102
        $ cd Imaging-1.1.7
 
103
        $ python setup.py build_ext -i
 
104
        $ python selftest.py
 
105
 
 
106
   During the build process, the setup.py will display a summary
 
107
   report that lists what external components it found.  The self-
 
108
   test will display a similar report, with what external components
 
109
   the tests found in the actual build files::
 
110
 
 
111
        --------------------------------------------------------------------
 
112
        Pillow 1.5 ( PIL fork based on PIL 1.1.7 ) SETUP SUMMARY
 
113
        --------------------------------------------------------------------
 
114
        platform  darwin 2.6.6 (r266:84292, Nov 26 2010, 16:24:16)
 
115
          [GCC 4.2.1 (Apple Inc. build 5664)]
 
116
        --------------------------------------------------------------------
 
117
        --- TKINTER support available
 
118
        --- JPEG support available
 
119
        --- ZLIB (PNG/ZIP) support available
 
120
        *** FREETYPE2 support not available
 
121
        *** LITTLECMS support not available
 
122
        --------------------------------------------------------------------
 
123
 
 
124
   Make sure that the optional components you need are included.
 
125
 
 
126
   If the build script won't find a given component, you can edit the
 
127
   setup.py file and set the appropriate ROOT variable.  For details,
 
128
   see instructions in the file.
 
129
 
 
130
   If the build script finds the component, but the tests cannot
 
131
   identify it, try rebuilding *all* modules::
 
132
 
 
133
        $ python setup.py clean
 
134
        $ python setup.py build_ext -i
 
135
 
 
136
 
 
137
6. If the setup.py and selftest.py commands finish without any
 
138
   errors, you're ready to install the library::
 
139
 
 
140
        $ python setup.py install
 
141
 
 
142
   (depending on how Python has been installed on your machine,
 
143
   you might have to log in as a superuser to run the 'install'
 
144
   command, or use the 'sudo' command to run 'install'.)
 
145
 
 
146
 
 
147
Additional notes for Mac OS X
 
148
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
149
 
 
150
On Mac OS X you will usually install additional software such as
 
151
libjpeg or freetype with the "fink" tool, and then it ends up in
 
152
"/sw".  If you have installed the libraries elsewhere, you may have
 
153
to tweak the "setup.py" file before building.
 
154
 
 
155
 
 
156
Additional notes for Windows
 
157
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
158
 
 
159
On Windows, you need to tweak the ROOT settings in the "setup.py"
 
160
file, to make it find the external libraries.  See comments in the
 
161
file for details.
 
162
 
 
163
Make sure to build PIL and the external libraries with the same
 
164
runtime linking options as was used for the Python interpreter
 
165
(usually /MD, under Visual Studio).
 
166
 
 
167
 
 
168
Note that most Python distributions for Windows include libraries
 
169
compiled for Microsoft Visual Studio.  You can get the free Express
 
170
edition of Visual Studio from:
 
171
 
 
172
    http://www.microsoft.com/Express/
 
173
 
 
174
To build extensions using other tool chains, see the "Using
 
175
non-Microsoft compilers on Windows" section in the distutils handbook:
 
176
 
 
177
    http://www.python.org/doc/current/inst/non-ms-compilers.html
 
178
 
 
179
For additional information on how to build extensions using the
 
180
popular MinGW compiler, see:
 
181
 
 
182
    http://mingw.org (compiler)
 
183
    http://sebsauvage.net/python/mingw.html (build instructions)
 
184
    http://sourceforge.net/projects/gnuwin32 (prebuilt libraries)
 
185