|
1
|
|
|
#!/usr/bin/env python |
|
2
|
|
|
# coding: utf8 |
|
3
|
|
|
|
|
4
|
|
|
# Copyright 2013-2015 Vincent Jacques <[email protected]> |
|
5
|
|
|
|
|
6
|
|
|
from __future__ import division, absolute_import, print_function |
|
7
|
|
|
|
|
8
|
|
|
import setuptools |
|
9
|
|
|
import subprocess |
|
10
|
|
|
|
|
11
|
|
|
version = "0.3.4" |
|
12
|
|
|
|
|
13
|
|
|
|
|
14
|
|
|
def parse_pkg_config(*args): |
|
15
|
|
|
return [ |
|
16
|
|
|
s[2:] |
|
17
|
|
|
for s |
|
18
|
|
|
in subprocess.check_output(["pkg-config"] + list(args)).strip().split(" ") |
|
19
|
|
|
] |
|
20
|
|
|
|
|
21
|
|
|
# @todo Support Python 3 (on Travis as well) |
|
22
|
|
|
|
|
23
|
|
|
setuptools.setup( |
|
24
|
|
|
name="DrawTurksHead", |
|
25
|
|
|
version=version, |
|
26
|
|
|
description="Draw... Turk's head knots!", |
|
27
|
|
|
long_description=open("README.rst").read(), |
|
28
|
|
|
author="Vincent Jacques", |
|
29
|
|
|
author_email="[email protected]", |
|
30
|
|
|
url="http://jacquev6.github.io/DrawTurksHead/", |
|
31
|
|
|
packages=setuptools.find_packages(), |
|
32
|
|
|
license="MIT", |
|
33
|
|
|
classifiers=[ |
|
34
|
|
|
"Development Status :: 4 - Beta", |
|
35
|
|
|
"License :: OSI Approved", |
|
36
|
|
|
"License :: OSI Approved :: MIT License", |
|
37
|
|
|
"Programming Language :: Python", |
|
38
|
|
|
"Programming Language :: Python :: 2", |
|
39
|
|
|
"Programming Language :: Python :: 2.7", |
|
40
|
|
|
], |
|
41
|
|
|
ext_modules=[ |
|
42
|
|
|
setuptools.Extension( |
|
43
|
|
|
"DrawTurksHead._turkshead", |
|
44
|
|
|
["DrawTurksHead/_turkshead.cpp"], |
|
45
|
|
|
include_dirs=parse_pkg_config("pycairo", "cairomm-1.0", "--cflags-only-I"), |
|
46
|
|
|
libraries=["boost_python"] + parse_pkg_config("cairomm-1.0", "--libs-only-l"), |
|
47
|
|
|
), |
|
48
|
|
|
], |
|
49
|
|
|
test_suite="DrawTurksHead.tests", |
|
50
|
|
|
command_options={ |
|
51
|
|
|
"build_sphinx": { |
|
52
|
|
|
"version": ("setup.py", version), |
|
53
|
|
|
"release": ("setup.py", version), |
|
54
|
|
|
"source_dir": ("setup.py", "doc"), |
|
55
|
|
|
}, |
|
56
|
|
|
}, |
|
57
|
|
|
) |
|
58
|
|
|
|