blob: d5b643631a7d74fe2a4ebbd38894d8c71d6ff5ac [file] [log] [blame]
jvr3285b4b2001-08-09 18:47:22 +00001#! /usr/bin/env python
2
Denis Jacqueryedb08ee22013-11-29 14:11:19 +01003from __future__ import print_function
jvr3285b4b2001-08-09 18:47:22 +00004import os, sys
5from distutils.core import setup, Extension
jvr059cbe32002-07-01 09:11:01 +00006from distutils.command.build_ext import build_ext
jvr3285b4b2001-08-09 18:47:22 +00007
jvr36682342002-07-11 18:19:46 +00008try:
9 # load py2exe distutils extension, if available
10 import py2exe
jvr7bd0d8c2002-07-13 08:15:21 +000011except ImportError:
jvr36682342002-07-11 18:19:46 +000012 pass
jvr3285b4b2001-08-09 18:47:22 +000013
jvr5808f3f2001-08-09 23:03:47 +000014try:
jvr48e4b622002-05-03 08:59:22 +000015 import xml.parsers.expat
jvr5808f3f2001-08-09 23:03:47 +000016except ImportError:
Denis Jacqueryedb08ee22013-11-29 14:11:19 +010017 print("*** Warning: FontTools needs PyXML, see:")
18 print(" http://sourceforge.net/projects/pyxml/")
jvr5808f3f2001-08-09 23:03:47 +000019
20
jvr059cbe32002-07-01 09:11:01 +000021class build_ext_optional(build_ext):
22 """build_ext command which doesn't abort when it fails."""
23 def build_extension(self, ext):
24 # Skip extensions which cannot be built
25 try:
26 build_ext.build_extension(self, ext)
27 except:
28 self.announce(
29 '*** WARNING: Building of extension "%s" '
30 'failed: %s' %
31 (ext.name, sys.exc_info()[1]))
32
33
jvr91bde172003-01-03 21:01:07 +000034if sys.version_info > (2, 3, 0, 'alpha', 1):
35 # Trove classifiers for PyPI
36 classifiers = {"classifiers": [
37 "Development Status :: 4 - Beta",
38 "Environment :: Console",
39 "Environment :: Other Environment",
40 "Intended Audience :: Developers",
41 "Intended Audience :: End Users/Desktop",
42 "License :: OSI Approved :: BSD License",
43 "Natural Language :: English",
44 "Operating System :: OS Independent",
45 "Programming Language :: Python",
46 "Topic :: Multimedia :: Graphics",
47 "Topic :: Multimedia :: Graphics :: Graphics Conversion",
48 ]}
49else:
50 classifiers = {}
51
52long_description = """\
53FontTools/TTX is a library to manipulate font files from Python.
54It supports reading and writing of TrueType/OpenType fonts, reading
55and writing of AFM files, reading (and partially writing) of PS Type 1
56fonts. The package also contains a tool called "TTX" which converts
57TrueType/OpenType fonts to and from an XML-based format.
58"""
59
jvrfdf2d772002-05-03 18:57:02 +000060setup(
pabs3fb8e53b2008-01-28 04:00:14 +000061 name = "fonttools",
pabs3ec62dbe2013-06-22 14:25:03 +000062 version = "2.4",
jvr91bde172003-01-03 21:01:07 +000063 description = "Tools to manipulate font files",
jvr3285b4b2001-08-09 18:47:22 +000064 author = "Just van Rossum",
65 author_email = "just@letterror.com",
jvrfdf2d772002-05-03 18:57:02 +000066 maintainer = "Just van Rossum",
67 maintainer_email = "just@letterror.com",
jvr3285b4b2001-08-09 18:47:22 +000068 url = "http://fonttools.sourceforge.net/",
jvr91bde172003-01-03 21:01:07 +000069 license = "OpenSource, BSD-style",
70 platforms = ["Any"],
71 long_description = long_description,
jvr3285b4b2001-08-09 18:47:22 +000072
73 packages = [
jvr3285b4b2001-08-09 18:47:22 +000074 "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",
jvr3285b4b2001-08-09 18:47:22 +000080 ],
81 package_dir = {'': 'Lib'},
82 extra_path = 'FontTools',
Roozbeh Pournader642eaf12013-12-21 01:04:18 -080083 scripts = ["Tools/ttx", "Tools/pyftsubset", "Tools/pyftinspect", "Tools/pyftmerge"],
jvr91bde172003-01-03 21:01:07 +000084 cmdclass = {"build_ext": build_ext_optional},
pabs3406cb2f2009-11-08 15:54:25 +000085 data_files = [('share/man/man1', ["Doc/ttx.1"])],
jvr91bde172003-01-03 21:01:07 +000086 **classifiers
jvr3285b4b2001-08-09 18:47:22 +000087 )