jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | |
Denis Jacquerye | db08ee2 | 2013-11-29 14:11:19 +0100 | [diff] [blame] | 3 | from __future__ import print_function |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 4 | import os, sys |
| 5 | from distutils.core import setup, Extension |
jvr | 059cbe3 | 2002-07-01 09:11:01 +0000 | [diff] [blame] | 6 | from distutils.command.build_ext import build_ext |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 7 | |
jvr | 3668234 | 2002-07-11 18:19:46 +0000 | [diff] [blame] | 8 | try: |
| 9 | # load py2exe distutils extension, if available |
| 10 | import py2exe |
jvr | 7bd0d8c | 2002-07-13 08:15:21 +0000 | [diff] [blame] | 11 | except ImportError: |
jvr | 3668234 | 2002-07-11 18:19:46 +0000 | [diff] [blame] | 12 | pass |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 13 | |
jvr | 5808f3f | 2001-08-09 23:03:47 +0000 | [diff] [blame] | 14 | try: |
jvr | 48e4b62 | 2002-05-03 08:59:22 +0000 | [diff] [blame] | 15 | import xml.parsers.expat |
jvr | 5808f3f | 2001-08-09 23:03:47 +0000 | [diff] [blame] | 16 | except ImportError: |
Denis Jacquerye | db08ee2 | 2013-11-29 14:11:19 +0100 | [diff] [blame] | 17 | print("*** Warning: FontTools needs PyXML, see:") |
| 18 | print(" http://sourceforge.net/projects/pyxml/") |
jvr | 5808f3f | 2001-08-09 23:03:47 +0000 | [diff] [blame] | 19 | |
| 20 | |
jvr | 059cbe3 | 2002-07-01 09:11:01 +0000 | [diff] [blame] | 21 | class build_ext_optional(build_ext): |
| 22 | """build_ext command which doesn't abort when it fails.""" |
| 23 | def build_extension(self, ext): |
| 24 | # Skip extensions which cannot be built |
| 25 | try: |
| 26 | build_ext.build_extension(self, ext) |
| 27 | except: |
| 28 | self.announce( |
| 29 | '*** WARNING: Building of extension "%s" ' |
| 30 | 'failed: %s' % |
| 31 | (ext.name, sys.exc_info()[1])) |
| 32 | |
| 33 | |
jvr | 91bde17 | 2003-01-03 21:01:07 +0000 | [diff] [blame] | 34 | if sys.version_info > (2, 3, 0, 'alpha', 1): |
| 35 | # Trove classifiers for PyPI |
| 36 | classifiers = {"classifiers": [ |
| 37 | "Development Status :: 4 - Beta", |
| 38 | "Environment :: Console", |
| 39 | "Environment :: Other Environment", |
| 40 | "Intended Audience :: Developers", |
| 41 | "Intended Audience :: End Users/Desktop", |
| 42 | "License :: OSI Approved :: BSD License", |
| 43 | "Natural Language :: English", |
| 44 | "Operating System :: OS Independent", |
| 45 | "Programming Language :: Python", |
| 46 | "Topic :: Multimedia :: Graphics", |
| 47 | "Topic :: Multimedia :: Graphics :: Graphics Conversion", |
| 48 | ]} |
| 49 | else: |
| 50 | classifiers = {} |
| 51 | |
| 52 | long_description = """\ |
| 53 | FontTools/TTX is a library to manipulate font files from Python. |
| 54 | It supports reading and writing of TrueType/OpenType fonts, reading |
| 55 | and writing of AFM files, reading (and partially writing) of PS Type 1 |
| 56 | fonts. The package also contains a tool called "TTX" which converts |
| 57 | TrueType/OpenType fonts to and from an XML-based format. |
| 58 | """ |
| 59 | |
jvr | fdf2d77 | 2002-05-03 18:57:02 +0000 | [diff] [blame] | 60 | setup( |
pabs3 | fb8e53b | 2008-01-28 04:00:14 +0000 | [diff] [blame] | 61 | name = "fonttools", |
pabs3 | ec62dbe | 2013-06-22 14:25:03 +0000 | [diff] [blame] | 62 | version = "2.4", |
jvr | 91bde17 | 2003-01-03 21:01:07 +0000 | [diff] [blame] | 63 | description = "Tools to manipulate font files", |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 64 | author = "Just van Rossum", |
| 65 | author_email = "just@letterror.com", |
jvr | fdf2d77 | 2002-05-03 18:57:02 +0000 | [diff] [blame] | 66 | maintainer = "Just van Rossum", |
| 67 | maintainer_email = "just@letterror.com", |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 68 | url = "http://fonttools.sourceforge.net/", |
jvr | 91bde17 | 2003-01-03 21:01:07 +0000 | [diff] [blame] | 69 | license = "OpenSource, BSD-style", |
| 70 | platforms = ["Any"], |
| 71 | long_description = long_description, |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 72 | |
| 73 | packages = [ |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 74 | "fontTools", |
| 75 | "fontTools.encodings", |
| 76 | "fontTools.misc", |
jvr | ceb3449 | 2003-08-28 17:59:52 +0000 | [diff] [blame] | 77 | "fontTools.pens", |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 78 | "fontTools.ttLib", |
| 79 | "fontTools.ttLib.tables", |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 80 | ], |
| 81 | package_dir = {'': 'Lib'}, |
| 82 | extra_path = 'FontTools', |
Khaled Hosny | 0e37f89 | 2013-09-12 11:13:39 +0200 | [diff] [blame] | 83 | scripts = ["Tools/ttx", "Tools/pyftsubset", "Tools/pyftinspect"], |
jvr | 91bde17 | 2003-01-03 21:01:07 +0000 | [diff] [blame] | 84 | cmdclass = {"build_ext": build_ext_optional}, |
pabs3 | 406cb2f | 2009-11-08 15:54:25 +0000 | [diff] [blame] | 85 | data_files = [('share/man/man1', ["Doc/ttx.1"])], |
jvr | 91bde17 | 2003-01-03 21:01:07 +0000 | [diff] [blame] | 86 | **classifiers |
jvr | 3285b4b | 2001-08-09 18:47:22 +0000 | [diff] [blame] | 87 | ) |