[Image-SIG] patch for 1.1.7 to support automated builds and msys
Bill Janssen
janssen at parc.com
Sat Apr 3 19:52:53 CEST 2010
I've been building an automated build framework for my UpLib system,
which requires PIL. I've made a couple of changes to the PIL setup.py
which might go into the standard release, and attach a patch.
Basically two changes:
1. It's useful to be able to set TIFF_ROOT, JPEG_ROOT, etc. without
editing the setup.py file. This patch modifies the default values for
those setup variables to be read from the environment, as PIL_TIFF_ROOT,
PIL_JPEG_ROOT, etc. This allows a build script to just set the
environment variables to pass them in to setup.py.
2. When linking _imagingft on msys, the auxiliary libraries (-ljpeg,
-lz, etc.) need to be passed as arguments to the link command. So I've
modified the link code
if feature.freetype:
defs = []
if feature.freetype_version == 20:
defs.append(("USE_FREETYPE_2_0", None))
exts.append(Extension(
"_imagingft", ["_imagingft.c"], libraries=["freetype"],
define_macros=defs
))
to read instead
if feature.freetype:
defs = []
if feature.freetype_version == 20:
defs.append(("USE_FREETYPE_2_0", None))
exts.append(Extension(
"_imagingft", ["_imagingft.c"], libraries=["freetype"] + libs,
define_macros=defs
))
adding back in the necessary libraries. Similarly for _imagingtiff and
_imagingcms.
Should this perhaps be done only for msys, via an "extra" parameter,
such as that used with _imagingcms? Be happy to change it, but it seems
to work fine on OS X and Ubuntu, too, as is.
Bill
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PIL-1.1.7-msys-PATCH
Type: text/x-python
Size: 3191 bytes
Desc: patch for PIL configuration and msys build
URL: <http://mail.python.org/pipermail/image-sig/attachments/20100403/727866e9/attachment.py>
More information about the Image-SIG
mailing list