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