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