forked from microsoft/DWriteShapePy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
63 lines (56 loc) · 2.04 KB
/
setup.py
File metadata and controls
63 lines (56 loc) · 2.04 KB
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
# -*- coding: utf-8 -*-
from io import open
import os
import sys
import platform
from setuptools import Extension, setup
from Cython.Build import cythonize
here = os.path.abspath(os.path.dirname(__file__))
# Get the long description from the pypi.md file
with open(os.path.join(here, 'pypi.md'), encoding='utf-8') as f:
long_description = f.read()
define_macros = [('UNICODE', 1), ('_UNICODE', 1)]
linetrace = False
if int(os.environ.get('CYTHON_LINETRACE', '0')):
linetrace = True
define_macros.append(('CYTHON_TRACE_NOGIL', '1'))
extra_compile_args = ['/Zc:wchar_t']
if platform.system() != 'Windows':
extra_compile_args.append('-std=c++11')
extension = Extension(
'dwriteshapepy.dwriteshape',
define_macros=define_macros,
include_dirs=["."],
sources=['src/dwriteshapepy/dwriteshape.pyx','src/cpp/hb-common.cc','src/cpp/hb-number.cc','src/cpp/dwriteshapeInternal.cpp','src/cpp/dwriteshapelib.cpp', 'src/cpp/locale.cpp','src/cpp/posttable.cpp','src/cpp/textanalysis.cpp', 'src/cpp/textrun.cpp' ],
language='c++',
libraries=['dwrite'],
extra_compile_args=extra_compile_args,
)
setup(
name="dwriteshapepy",
version= '1.0.7',
description="Python extension for Windows DirectWrite shaping, modeled after uharfbuzz ",
long_description=long_description,
long_description_content_type='text/markdown',
author="Paul Linnerud",
author_email="[email protected]",
url="https://github.com/microsoft/DWriteShapePy",
license="MIT",
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows :: Windows 10",
],
package_dir={"": "src"},
packages=["dwriteshapepy"],
zip_safe=False,
python_requires=">=3.7",
ext_modules = cythonize(
extension,
annotate=bool(int(os.environ.get('CYTHON_ANNOTATE', '0'))),
compiler_directives={"linetrace": linetrace},
),
entry_points={
'console_scripts': [ "dw-shape = dwriteshapepy.__main__:main" ]
}
)