Added majority of libpurple functions used by pidgin-carman.
[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
14 class pypurple_build_ext(build_ext):
15     def finalize_options(self):
16         build_ext.finalize_options(self)
17         self.include_dirs.insert(0, 'include')
18         self.pyrex_include_dirs.extend(self.include_dirs)
19
20 setup(
21   name = 'python-pypurple',
22   version = '0.1',
23   author ='Bruno Abinader',
24   author_email='bruno.abinader@openbossa.org',
25   cmdclass = {'build_ext': pypurple_build_ext},
26   ext_modules=[Extension('purple',
27               sources=['c_purple.c','purple.pyx'],
28               extra_compile_args=cflags,
29               extra_link_args=ldflags)])