Home | History | Annotate | Download | only in fonttools
      1 #! /usr/bin/env python
      2 
      3 from __future__ import print_function
      4 import os, sys
      5 from distutils.core import setup, Extension
      6 from distutils.command.build_ext import build_ext
      7 
      8 try:
      9 	# load py2exe distutils extension, if available
     10 	import py2exe
     11 except ImportError:
     12 	pass
     13 
     14 try:
     15 	import xml.parsers.expat
     16 except ImportError:
     17 	print("*** Warning: FontTools needs PyXML, see:")
     18 	print("        http://sourceforge.net/projects/pyxml/")
     19 
     20 
     21 class 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 
     34 if 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 	]}
     49 else:
     50 	classifiers = {}
     51 
     52 long_description = """\
     53 FontTools/TTX is a library to manipulate font files from Python.
     54 It supports reading and writing of TrueType/OpenType fonts, reading
     55 and writing of AFM files, reading (and partially writing) of PS Type 1
     56 fonts. The package also contains a tool called "TTX" which converts
     57 TrueType/OpenType fonts to and from an XML-based format.
     58 """
     59 
     60 setup(
     61 		name = "fonttools",
     62 		version = "2.4",
     63 		description = "Tools to manipulate font files",
     64 		author = "Just van Rossum",
     65 		author_email = "just (at] letterror.com",
     66 		maintainer = "Just van Rossum",
     67 		maintainer_email = "just (at] letterror.com",
     68 		url = "http://fonttools.sourceforge.net/",
     69 		license = "OpenSource, BSD-style",
     70 		platforms = ["Any"],
     71 		long_description = long_description,
     72 		
     73 		packages = [
     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 		scripts = ["Tools/ttx", "Tools/pyftsubset", "Tools/pyftinspect", "Tools/pyftmerge"],
     84 		cmdclass = {"build_ext": build_ext_optional},
     85 		data_files = [('share/man/man1', ["Doc/ttx.1"])],
     86 		**classifiers
     87 	)
     88