blob: 31703d68a5d4280390122ef7a3af6b545d608ad2 [file] [log] [blame]
jvr3285b4b2001-08-09 18:47:22 +00001#! /usr/bin/env python
2
3import os, sys
4from distutils.core import setup, Extension
jvr059cbe32002-07-01 09:11:01 +00005from distutils.command.build_ext import build_ext
jvr3285b4b2001-08-09 18:47:22 +00006
jvr36682342002-07-11 18:19:46 +00007try:
8 # load py2exe distutils extension, if available
9 import py2exe
jvr7bd0d8c2002-07-13 08:15:21 +000010except ImportError:
jvr36682342002-07-11 18:19:46 +000011 pass
jvr3285b4b2001-08-09 18:47:22 +000012
jvr5808f3f2001-08-09 23:03:47 +000013try:
jvr1b7d54f2008-03-04 15:25:27 +000014 import numpy
jvr5808f3f2001-08-09 23:03:47 +000015except ImportError:
jvr1b7d54f2008-03-04 15:25:27 +000016 print "*** Warning: FontTools needs the numpy library, see:"
17 print " http://numpy.scipy.org/"
jvr5808f3f2001-08-09 23:03:47 +000018
19try:
jvr48e4b622002-05-03 08:59:22 +000020 import xml.parsers.expat
jvr5808f3f2001-08-09 23:03:47 +000021except ImportError:
22 print "*** Warning: FontTools needs PyXML, see:"
23 print " http://sourceforge.net/projects/pyxml/"
24
25
jvr059cbe32002-07-01 09:11:01 +000026class 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
jvr91bde172003-01-03 21:01:07 +000039if 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 ]}
54else:
55 classifiers = {}
56
57long_description = """\
58FontTools/TTX is a library to manipulate font files from Python.
59It supports reading and writing of TrueType/OpenType fonts, reading
60and writing of AFM files, reading (and partially writing) of PS Type 1
61fonts. The package also contains a tool called "TTX" which converts
62TrueType/OpenType fonts to and from an XML-based format.
63"""
64
jvrfdf2d772002-05-03 18:57:02 +000065setup(
pabs3fb8e53b2008-01-28 04:00:14 +000066 name = "fonttools",
pabs3ff850082008-05-18 06:28:37 +000067 version = "2.2",
jvr91bde172003-01-03 21:01:07 +000068 description = "Tools to manipulate font files",
jvr3285b4b2001-08-09 18:47:22 +000069 author = "Just van Rossum",
70 author_email = "just@letterror.com",
jvrfdf2d772002-05-03 18:57:02 +000071 maintainer = "Just van Rossum",
72 maintainer_email = "just@letterror.com",
jvr3285b4b2001-08-09 18:47:22 +000073 url = "http://fonttools.sourceforge.net/",
jvr91bde172003-01-03 21:01:07 +000074 license = "OpenSource, BSD-style",
75 platforms = ["Any"],
76 long_description = long_description,
jvr3285b4b2001-08-09 18:47:22 +000077
78 packages = [
79 "",
80 "fontTools",
81 "fontTools.encodings",
82 "fontTools.misc",
jvrceb34492003-08-28 17:59:52 +000083 "fontTools.pens",
jvr3285b4b2001-08-09 18:47:22 +000084 "fontTools.ttLib",
85 "fontTools.ttLib.tables",
86 "fontTools.ttLib.test",
87 ],
88 package_dir = {'': 'Lib'},
89 extra_path = 'FontTools',
90 ext_modules = [
91 Extension(
jvr09f337b2001-08-09 19:18:30 +000092 "fontTools.misc.eexecOp",
jvr3285b4b2001-08-09 18:47:22 +000093 ["Src/eexecOp/eexecOpmodule.c"],
94 include_dirs=[],
95 define_macros=[],
96 library_dirs=[],
97 libraries=[],
98 )
jvrfdf2d772002-05-03 18:57:02 +000099 ],
jvrb46acaa2002-09-10 09:22:28 +0000100 scripts = ["Tools/ttx"],
jvr91bde172003-01-03 21:01:07 +0000101 cmdclass = {"build_ext": build_ext_optional},
pabs3406cb2f2009-11-08 15:54:25 +0000102 data_files = [('share/man/man1', ["Doc/ttx.1"])],
jvr91bde172003-01-03 21:01:07 +0000103 **classifiers
jvr3285b4b2001-08-09 18:47:22 +0000104 )