setup.py revision 57fbb3dcb32b049cae4f73178ba043f8b6049109
1#! /usr/bin/env python
2
3import os, sys
4from distutils.core import setup, Extension
5from distutils.command.build_ext import build_ext
6
7try:
8	# load py2exe distutils extension, if available
9	import py2exe
10except ImportError:
11	pass
12
13try:
14	import xml.parsers.expat
15except ImportError:
16	print "*** Warning: FontTools needs PyXML, see:"
17	print "        http://sourceforge.net/projects/pyxml/"
18
19
20class 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
33if 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	]}
48else:
49	classifiers = {}
50
51long_description = """\
52FontTools/TTX is a library to manipulate font files from Python.
53It supports reading and writing of TrueType/OpenType fonts, reading
54and writing of AFM files, reading (and partially writing) of PS Type 1
55fonts. The package also contains a tool called "TTX" which converts
56TrueType/OpenType fonts to and from an XML-based format.
57"""
58
59setup(
60		name = "fonttools",
61		version = "2.4",
62		description = "Tools to manipulate font files",
63		author = "Just van Rossum",
64		author_email = "just@letterror.com",
65		maintainer = "Just van Rossum",
66		maintainer_email = "just@letterror.com",
67		url = "http://fonttools.sourceforge.net/",
68		license = "OpenSource, BSD-style",
69		platforms = ["Any"],
70		long_description = long_description,
71
72		packages = [
73			"",
74			"fontTools",
75			"fontTools.encodings",
76			"fontTools.misc",
77			"fontTools.pens",
78			"fontTools.ttLib",
79			"fontTools.ttLib.tables",
80		],
81		package_dir = {'': 'Lib'},
82		extra_path = 'FontTools',
83		ext_modules = [
84			Extension(
85				"fontTools.misc.eexecOp",
86				["Src/eexecOp/eexecOpmodule.c"],
87				include_dirs=[],
88				define_macros=[],
89				library_dirs=[],
90				libraries=[],
91			)
92		],
93		scripts = ["Tools/ttx", "Tools/pyftsubset", "Tools/pyftinspect"],
94		console = ["Tools/ttx", "Tools/pyftsubset"],
95		cmdclass = {"build_ext": build_ext_optional},
96		data_files = [('share/man/man1', ["Doc/ttx.1"])],
97		**classifiers
98	)
99