Moved purple core ui ops to Cython code.
[python-purple] / setup.py
1 #!/usr/bin/env python
2 import sys
3 import os
4
5 from setuptools import setup, find_packages, Extension
6 from distutils.sysconfig import get_python_inc
7 from Cython.Distutils import build_ext
8
9 from subprocess import Popen, PIPE
10
11 cflags = Popen(['pkg-config', '--cflags', 'purple'], stdout=PIPE).communicate()[0].split()
12 ldflags = Popen(['pkg-config', '--libs', 'purple'], stdout=PIPE).communicate()[0].split()
13 print ldflags
14
15 class pypurple_build_ext(build_ext):
16     def finalize_options(self):
17         build_ext.finalize_options(self)
18         self.include_dirs.insert(0, 'include')
19         self.pyrex_include_dirs.extend(self.include_dirs)
20
21 setup(
22   name = 'python-pypurple',
23   version = '0.1',
24   author ='Bruno Abinader',
25   author_email='bruno.abinader@openbossa.org',
26   cmdclass = {'build_ext': pypurple_build_ext},
27   ext_modules=[Extension('purple',
28               sources=['c_purple.c','purple.pyx'],
29               extra_compile_args=cflags,
30               extra_link_args=ldflags)])