~jibel/ubuntu/trusty/python-imaging/lp1248743_enable_autopkgtest

« back to all changes in this revision

Viewing changes to setup.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-03-20 16:44:01 UTC
  • mfrom: (2.1.13 experimental)
  • Revision ID: package-import@ubuntu.com-20130320164401-ptf6m0ttg4zw72az
Tags: 1.1.7+2.0.0-1
Pillow 2.0.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    "Geometry", "GetBBox", "GifDecode", "GifEncode", "HexDecode",
29
29
    "Histo", "JpegDecode", "JpegEncode", "LzwDecode", "Matrix",
30
30
    "ModeFilter", "MspDecode", "Negative", "Offset", "Pack",
31
 
    "PackDecode", "Palette", "Paste", "Quant", "QuantHash",
 
31
    "PackDecode", "Palette", "Paste", "Quant", "QuantOctree", "QuantHash",
32
32
    "QuantHeap", "PcdDecode", "PcxDecode", "PcxEncode", "Point",
33
33
    "RankFilter", "RawDecode", "RawEncode", "Storage", "SunRleDecode",
34
34
    "TgaRleDecode", "Unpack", "UnpackYCC", "UnsharpMask", "XbmDecode",
35
 
    "XbmEncode", "ZipDecode", "ZipEncode")
 
35
    "XbmEncode", "ZipDecode", "ZipEncode", "TiffDecode")
36
36
 
37
37
 
38
38
def _add_directory(path, dir, where=None):
78
78
 
79
79
 
80
80
NAME = 'Pillow'
81
 
VERSION = '1.7.8'
 
81
VERSION = '2.0.0'
82
82
PIL_VERSION = '1.1.7'
83
83
TCL_ROOT = None
84
84
JPEG_ROOT = None
134
134
        #
135
135
        # add configured kits
136
136
 
137
 
        for root in (TCL_ROOT, JPEG_ROOT, TCL_ROOT, TIFF_ROOT, ZLIB_ROOT,
 
137
        for root in (TCL_ROOT, JPEG_ROOT, TIFF_ROOT, ZLIB_ROOT,
138
138
                     FREETYPE_ROOT, LCMS_ROOT):
139
139
            if isinstance(root, type(())):
140
140
                lib_root, include_root = root
180
180
        #
181
181
        # locate tkinter libraries
182
182
 
 
183
 
183
184
        if _tkinter:
184
185
            TCL_VERSION = _tkinter.TCL_VERSION[:3]
185
186
 
208
209
            else:
209
210
                TCL_ROOT = None
210
211
 
 
212
 
211
213
        #
212
214
        # add standard directories
213
215
 
235
237
        # look for available libraries
236
238
 
237
239
        class feature:
238
 
            zlib = jpeg = tiff = freetype = tcl = tk = lcms = None
 
240
            zlib = jpeg = tiff = freetype = tcl = tk = lcms = webp = None
239
241
        feature = feature()
240
242
 
241
243
        if _find_include_file(self, "zlib.h"):
253
255
 
254
256
        if _find_library_file(self, "tiff"):
255
257
            feature.tiff = "tiff"
 
258
        if sys.platform == "win32" and _find_library_file(self, "libtiff"):
 
259
            feature.tiff = "libtiff"
 
260
        if sys.platform == "darwin" and _find_library_file(self, "libtiff"):
 
261
            feature.tiff = "libtiff"
256
262
 
257
263
        if _find_library_file(self, "freetype"):
258
264
            # look for freetype2 include files
291
297
            elif _find_library_file(self, "tk" + TCL_VERSION):
292
298
                feature.tk = "tk" + TCL_VERSION
293
299
 
 
300
        if _find_include_file(self, "webp/encode.h") and _find_include_file(self, "webp/decode.h"):
 
301
            if _find_library_file(self, "webp"):
 
302
                feature.webp = "webp"
 
303
 
294
304
        #
295
305
        # core library
296
306
 
308
318
        if feature.zlib:
309
319
            libs.append(feature.zlib)
310
320
            defs.append(("HAVE_LIBZ", None))
 
321
        if feature.tiff:
 
322
            libs.append(feature.tiff)
 
323
            defs.append(("HAVE_LIBTIFF", None))
311
324
        if host_platform == "win32":
312
325
            libs.extend(["kernel32", "user32", "gdi32"])
313
326
        if struct.unpack("h", "\0\1".encode('ascii'))[0] == 1:
338
351
            exts.append(Extension(
339
352
                "_imagingcms", ["_imagingcms.c"], libraries=["lcms"] + extra))
340
353
 
341
 
        if host_platform == "darwin":
 
354
        if os.path.isfile("_webp.c") and feature.webp:
 
355
            exts.append(Extension(
 
356
                "_webp", ["_webp.c"], libraries=["webp"]))
 
357
 
 
358
 
 
359
        if sys.platform == "darwin":
342
360
            # locate Tcl/Tk frameworks
343
361
            frameworks = []
344
362
            framework_roots = [
384
402
    def summary_report(self, feature, unsafe_zlib):
385
403
 
386
404
        print("-" * 68)
387
 
        print("SETUP SUMMARY (Pillow %s / PIL %s)" % (VERSION, PIL_VERSION))
 
405
        print("SETUP SUMMARY (Pillow %s fork, originally based on PIL %s)" % (VERSION, PIL_VERSION))
388
406
        print("-" * 68)
389
 
        print("version      %s" % VERSION)
 
407
        print("version      %s (Pillow)" % VERSION)
390
408
        v = sys.version.split("[")
391
409
        print("platform     %s %s" % (host_platform, v[0].strip()))
392
410
        for v in v[1:]:
397
415
            (feature.tcl and feature.tk, "TKINTER"),
398
416
            (feature.jpeg, "JPEG"),
399
417
            (feature.zlib, "ZLIB (PNG/ZIP)"),
400
 
            # (feature.tiff, "experimental TIFF G3/G4 read"),
 
418
            (feature.tiff, "TIFF G3/G4 (experimental)"),
401
419
            (feature.freetype, "FREETYPE2"),
402
420
            (feature.lcms, "LITTLECMS"),
 
421
            (feature.webp, "WEBP"),
403
422
            ]
404
423
 
405
424
        all = 1
411
430
                if option[1] == "TKINTER" and _tkinter:
412
431
                    version = _tkinter.TCL_VERSION
413
432
                    print("(Tcl/Tk %s libraries needed)" % version)
414
 
                print("")
415
433
                all = 0
416
434
 
417
435
        if feature.zlib and unsafe_zlib:
430
448
            print("To add a missing option, make sure you have the required")
431
449
            print("library, and set the corresponding ROOT variable in the")
432
450
            print("setup.py script.")
433
 
            print("\n")
 
451
            print("")
434
452
 
435
453
        print("To check the build, run the selftest.py script.")
 
454
        print("")
436
455
 
437
456
    def check_zlib_version(self, include_dirs):
438
457
        # look for unsafe versions of zlib
478
497
    version=VERSION,
479
498
    description='Python Imaging Library (fork)',
480
499
    long_description=(
481
 
        _read('README.rst') +
482
 
        _read('docs/INSTALL.txt') +
483
 
        _read('docs/HISTORY.txt')).decode('utf-8'),
 
500
        _read('README.rst') + b'\n' +
 
501
        _read('docs/HISTORY.txt') + b'\n' +
 
502
        _read('docs/CONTRIBUTORS.txt')).decode('utf-8'),
484
503
    author='Alex Clark (fork author)',
485
504
    author_email='aclark@aclark.net',
486
505
    url='http://github.com/python-imaging/Pillow',
503
522
    ext_modules=[Extension("_imaging", ["_imaging.c"])],
504
523
    packages=find_packages(),
505
524
    scripts=glob.glob("Scripts/pil*.py"),
 
525
    keywords=["Imaging",],
 
526
    license='Standard PIL License',
506
527
    )