import subprocess, re from distutils.core import setup, Extension freetype_config = subprocess.Popen('freetype-config --cflags --libs', shell = True, stdout = subprocess.PIPE).stdout.read() setup( name = 'pykfx', version = '0.1', description = 'pykfx is a collection of classes for parsing ASS-scripts.', author = 'Jon Bergli Heier', author_email = 'jonheier@start.no', packages = ['pykfx'], ext_modules = [Extension('pykfx.fscalc', ['fscalc.cpp', 'wrapper.cpp'], include_dirs = re.findall('-I[^\/\w]*([\w\/]+)', freetype_config), libraries = ['boost_python', 'fontconfig'] + re.findall('-l\W*(\w+)', freetype_config), )], )