blob: e37bf267167863f9c16f621a9ae7234c854f10a9 [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:
jvr48e4b622002-05-03 08:59:22 +000014 import xml.parsers.expat
jvr5808f3f2001-08-09 23:03:47 +000015except ImportError:
16 print "*** Warning: FontTools needs PyXML, see:"
17 print " http://sourceforge.net/projects/pyxml/"
18
19
jvr059cbe32002-07-01 09:11:01 +000020class 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
jvr91bde172003-01-03 21:01:07 +000033if 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
jvrfdf2d772002-05-03 18:57:02 +000059setup(
pabs3fb8e53b2008-01-28 04:00:14 +000060 name = "fonttools",
pabs3ec62dbe2013-06-22 14:25:03 +000061 version = "2.4",
jvr91bde172003-01-03 21:01:07 +000062 description = "Tools to manipulate font files",
jvr3285b4b2001-08-09 18:47:22 +000063 author = "Just van Rossum",
64 author_email = "just@letterror.com",
jvrfdf2d772002-05-03 18:57:02 +000065 maintainer = "Just van Rossum",
66 maintainer_email = "just@letterror.com",
jvr3285b4b2001-08-09 18:47:22 +000067 url = "http://fonttools.sourceforge.net/",
jvr91bde172003-01-03 21:01:07 +000068 license = "OpenSource, BSD-style",
69 platforms = ["Any"],
70 long_description = long_description,
jvr3285b4b2001-08-09 18:47:22 +000071
72 packages = [
73 "",
74 "fontTools",
75 "fontTools.encodings",
76 "fontTools.misc",
jvrceb34492003-08-28 17:59:52 +000077 "fontTools.pens",
jvr3285b4b2001-08-09 18:47:22 +000078 "fontTools.ttLib",
79 "fontTools.ttLib.tables",
80 "fontTools.ttLib.test",
81 ],
82 package_dir = {'': 'Lib'},
83 extra_path = 'FontTools',
84 ext_modules = [
85 Extension(
jvr09f337b2001-08-09 19:18:30 +000086 "fontTools.misc.eexecOp",
jvr3285b4b2001-08-09 18:47:22 +000087 ["Src/eexecOp/eexecOpmodule.c"],
88 include_dirs=[],
89 define_macros=[],
90 library_dirs=[],
91 libraries=[],
92 )
jvrfdf2d772002-05-03 18:57:02 +000093 ],
Khaled Hosny0e37f892013-09-12 11:13:39 +020094 scripts = ["Tools/ttx", "Tools/pyftsubset", "Tools/pyftinspect"],
Behdad Esfahbodee5e1632013-08-29 18:53:30 -040095 console = ["Tools/ttx", "Tools/pyftsubset"],
jvr91bde172003-01-03 21:01:07 +000096 cmdclass = {"build_ext": build_ext_optional},
pabs3406cb2f2009-11-08 15:54:25 +000097 data_files = [('share/man/man1', ["Doc/ttx.1"])],
jvr91bde172003-01-03 21:01:07 +000098 **classifiers
jvr3285b4b2001-08-09 18:47:22 +000099 )