-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
92 lines (78 loc) · 2.41 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env python
#
# $Id: setup.py 2550 2005-10-10 12:54:55Z fredrik $
# Setup script for aggdraw
#
# Usage:
#
# To build in current directory:
# $ python setup.py build_ext -i
#
# To build and install:
# $ python setup.py install
#
from distutils.core import setup, Extension
import os
VERSION = "1.1-64bits"
# tweak as necessary
FREETYPE_ROOT = "../../kits/freetype-2.1.10"
if not os.path.isdir(FREETYPE_ROOT):
print "===", "freetype support disabled"
FREETYPE_ROOT = None
sources = [
# source code currently used by aggdraw
# FIXME: link against AGG library instead?
"agg2/src/agg_arc.cpp",
"agg2/src/agg_bezier_arc.cpp",
"agg2/src/agg_curves.cpp",
"agg2/src/agg_path_storage.cpp",
"agg2/src/agg_rasterizer_scanline_aa.cpp",
"agg2/src/agg_trans_affine.cpp",
"agg2/src/agg_vcgen_contour.cpp",
# "agg2/src/agg_vcgen_dash.cpp",
"agg2/src/agg_vcgen_stroke.cpp",
]
defines = []
include_dirs = ["agg2/include"]
library_dirs = []
libraries = []
if FREETYPE_ROOT:
defines.append(("HAVE_FREETYPE2", None))
sources.extend([
"agg2/font_freetype/agg_font_freetype.cpp",
])
include_dirs.append("agg2/font_freetype")
include_dirs.append(os.path.join(FREETYPE_ROOT, "include"))
include_dirs.append(os.path.join(FREETYPE_ROOT, "include/freetype2"))
library_dirs.append(os.path.join(FREETYPE_ROOT, "lib"))
libraries.append("freetype")
try:
# add necessary to distutils (for backwards compatibility)
from distutils.dist import DistributionMetadata
DistributionMetadata.classifiers = None
DistributionMetadata.download_url = None
DistributionMetadata.platforms = None
except:
pass
setup(
name="aggdraw",
version=VERSION,
author="Fredrik Lundh",
author_email="fredrik@pythonware.com",
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Multimedia :: Graphics",
],
description="aggdraw -- high quality drawing interface for PIL",
download_url="http://www.effbot.org/downloads#aggdraw",
license="Python (MIT style)",
platforms="Python 2.1 and later.",
url="http://www.effbot.org/zone/aggdraw.htm",
ext_modules = [
Extension("aggdraw", ["aggdraw.cxx"] + sources,
define_macros=defines,
include_dirs=include_dirs,
library_dirs=library_dirs, libraries=libraries
)
]
)